334. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 12/5/2017 12:06:47 PM Central Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

334.1 Files compared

# Location File Last Modified
1 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\PathologyCommon\main\src\java\gov\va\med\imaging\pathology PathologyCaseConsultationURN.java Mon Dec 4 21:34:30 2017 UTC
2 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\PathologyCommon\main\src\java\gov\va\med\imaging\pathology PathologyCaseConsultationURN.java Mon Dec 4 22:04:54 2017 UTC

334.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 3 878
Changed 2 4
Inserted 0 0
Removed 0 0

334.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

334.4 Active regular expressions

No regular expressions were active.

334.5 Comparison detail

  1   /**
  2    * 
  3     Package:  MAG - Vis tA Imaging
  4     WARNING:  Per VHA D irective 2 004-038, t his routin e should n ot be modi fied.
  5     Date Cre ated: Jun  15, 2012
  6     Site Nam e:  Washin gton OI Fi eld Office , Silver S pring, MD
  7       Developer:          
WERFEJ
  8     Descript ion: 
  9  
  10           ;;  +-------- ---------- ---------- ---------- ---------- ---------- ---------- +
  11           ;;  Property  of the US  Government .
  12           ;;  No permis sion to co py or redi stribute t his softwa re is give n.
  13           ;;  Use of un released v ersions of  this soft ware requi res the us er
  14           ;;   to execu te a writt en test ag reement wi th the Vis tA Imaging
  15           ;;   Developm ent Office  of the De partment o f Veterans  Affairs,
  16           ;;   telephon e (301) 73 4-0100.
  17           ;;
  18           ;;  The Food  and Drug A dministrat ion classi fies this  software a s
  19           ;;  a Class I I medical  device.  A s such, it  may not b e changed
  20           ;;  in any wa y.  Modifi cations to  this soft ware may r esult in a n
  21           ;;  adulterat ed medical  device un der 21CFR8 20, the us e of which
  22           ;;  is consid ered to be  a violati on of US F ederal Sta tutes.
  23           ;;  +-------- ---------- ---------- ---------- ---------- ---------- ---------- +
  24  
  25    */
  26   package go v.va.med.i maging.pat hology;
  27  
  28   import jav a.io.Seria lizable;
  29   import jav a.util.reg ex.Matcher ;
  30   import jav a.util.reg ex.Pattern ;
  31  
  32   import org .apache.lo gging.log4 j.LogManag er;
  33   import org .apache.lo gging.log4 j.Logger;
  34  
  35   import gov .va.med.Gl obalArtifa ctIdentifi er;
  36   import gov .va.med.Gl obalArtifa ctIdentifi erImpl;
  37   import gov .va.med.Na mespaceIde ntifier;
  38   import gov .va.med.Pa tientArtif actIdentif ier;
  39   import gov .va.med.Pa tientIdent ifier;
  40   import gov .va.med.Ro utingToken ;
  41   import gov .va.med.Ro utingToken Impl;
  42   import gov .va.med.SE RIALIZATIO N_FORMAT;
  43   import gov .va.med.UR N;
  44   import gov .va.med.UR NComponent s;
  45   import gov .va.med.UR NType;
  46   import gov .va.med.We llKnownOID ;
  47   import gov .va.med.im aging.exce ptions.URN FormatExce ption;
  48  
  49   /**
  50    * @author         
WERFEJ
  51    *
  52    */
  53   @URNType(n amespace=" vapatholog ycaseconsu ltation")
  54   public cla ss Patholo gyCaseCons ultationUR N
  55   extends UR N
  56   implements  Serializa ble, Patie ntArtifact Identifier
  57   {
  58           pr ivate stat ic final l ong serial VersionUID  = 1L;
  59           
  60           pr otected St ring origi natingSite Id;
  61           pr otected St ring consu ltationId;
  62           pr otected St ring patho logyType;
  63           pr otected St ring year;
  64           pr otected St ring numbe r;
  65           pr otected Pa tientIdent ifier pati entId;
  66           
  67           pr ivate stat ic final S tring name space = "v apathology caseconsul tation";
  68           pu blic stati c final We llKnownOID  DEFAULT_H OME_COMMUN ITY_ID = W ellKnownOI D.VA_RADIO LOGY_IMAGE ;
  69           
  70           pr ivate stat ic final S tring name spaceSpeci ficStringR egex = 
  71                    "([^ -]+)" +                                                                   //  the site  ID
  72                    URN. namespaceS pecificStr ingDelimit er +
  73                    "([^ -]+)" +                                                                            // t he consult ation ID
  74                    URN. namespaceS pecificStr ingDelimit er +
  75                    "([^ -]+)" +                                                                            // t he patholo gy type 
  76                    URN. namespaceS pecificStr ingDelimit er +
  77                    "([^ -]+)" +                                                                            // t he year
  78                    URN. namespaceS pecificStr ingDelimit er + 
  79                    "([^ -]+)" +                                                                            // t he number
  80                    URN. namespaceS pecificStr ingDelimit er + 
  81                    "([^ -]+)";                                                                             // t he patient  ID
  82           pr ivate stat ic final P attern nam espaceSpec ificString Pattern =  Pattern.co mpile(name spaceSpeci ficStringR egex);
  83           pr ivate stat ic final i nt SITE_ID _GROUP = 1 ;
  84           pr ivate stat ic final i nt CONSULT ATION_ID_G ROUP = 2;
  85           pr ivate stat ic final i nt PATHOLO GY_TYPE_GR OUP = 3;
  86           pr ivate stat ic final i nt YEAR_GR OUP = 4;
  87           pr ivate stat ic final i nt NUMBER_ GROUP = 5;
  88           pr ivate stat ic final i nt PATIENT _ID_GROUP  = 6;
  89           
  90           pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(Path ologyCaseC onsultatio nURN.class );
  91  
  92           pr ivate stat ic Namespa ceIdentifi er namespa ceIdentifi er = new N amespaceId entifier(n amespace);
  93           pu blic stati c synchron ized Names paceIdenti fier getMa nagedNames pace()
  94           {
  95                    retu rn namespa ceIdentifi er;
  96           }
  97           
  98           pu blic stati c Patholog yCaseConsu ltationURN  create(St ring origi natingSite Id, 
  99                             String  consultat ionId, Str ing pathol ogyType, S tring year
  100                             String  number, P atientIden tifier pat ientId)
  101           th rows URNFo rmatExcept ion
  102           {        
  103                    retu rn new Pat hologyCase Consultati onURN(Path ologyCaseC onsultatio nURN.getMa nagedNames pace(),
  104                                      originat ingSiteId,  consultat ionId, pat hologyType , year, nu mber, pati entId);
  105           }
  106           
  107           pu blic stati c Patholog yCaseConsu ltationURN  create(St ring consu ltationId,  Pathology CaseURN pa thologyCas eUrn)
  108           th rows URNFo rmatExcept ion
  109           {
  110                    retu rn new Pat hologyCase Consultati onURN(Path ologyCaseC onsultatio nURN.getMa nagedNames pace(),
  111                                      patholog yCaseUrn.g etOriginat ingSiteId( ), consult ationId, 
  112                                      patholog yCaseUrn.g etPatholog yType(),pa thologyCas eUrn.getYe ar(), 
  113                                      patholog yCaseUrn.g etNumber() , patholog yCaseUrn.g etPatientI d());
  114           }
  115           
  116           pu blic stati c Patholog yCaseConsu ltationURN  create(UR NComponent s urnCompo nents, 
  117                             SERIAL IZATION_FO RMAT seria lizationFo rmat) 
  118           th rows URNFo rmatExcept ion
  119           {
  120                    retu rn new Pat hologyCase Consultati onURN(urnC omponents,  serializa tionFormat );
  121           }
  122           
  123           /* *
  124            *  Used dire ctly and a  pass thro ugh for de rived clas ses.
  125            *  The const ructor cal led by the  URN class  when a UR N derived  class
  126            *  is being  created fr om a Strin g represen tation.
  127            *  
  128            *  @param co mponents
  129            *  @throws U RNFormatEx ception
  130            * /
  131           pr otected Pa thologyCas eConsultat ionURN(URN Components  urnCompon ents, SERI ALIZATION_ FORMAT ser ialization Format) 
  132           th rows URNFo rmatExcept ion
  133           {
  134                    supe r(urnCompo nents, ser ialization Format);
  135           }
  136           
  137           pr otected Pa thologyCas eConsultat ionURN(Nam espaceIden tifier nam espaceIden tifier,
  138                             String  originati ngSiteId, 
  139                             String  consultat ionId,
  140                             String  pathology Type, 
  141                             String  year, 
  142                             String  number, 
  143                             Patien tIdentifie r patientI d)
  144           th rows URNFo rmatExcept ion
  145           {
  146                    supe r(namespac eIdentifie r);
  147                    setO riginating SiteId(ori ginatingSi teId);
  148                    setC onsultatio nId(consul tationId);
  149                    setP athologyTy pe(patholo gyType);
  150                    setY ear(year);
  151                    setN umber(numb er);                        
  152                    setP atientId(p atientId);
  153           }
  154  
  155           @O verride
  156           pu blic Strin g getHomeC ommunityId ()
  157           {
  158                    // I mages are  always in  the VA com munity
  159                    retu rn WellKno wnOID.VA_R ADIOLOGY_I MAGE.getCa nonicalVal ue().toStr ing();
  160           }
  161  
  162           @O verride
  163           pu blic Strin g getRepos itoryUniqu eId()
  164           {
  165                    retu rn origina tingSiteId ;
  166           }
  167  
  168           @O verride
  169           pu blic boole an isEquiv alent(Rout ingToken t hat)
  170           {
  171                    retu rn Routing TokenImpl. isEquivale nt(this, t hat);
  172           }
  173  
  174           @O verride
  175           pu blic boole an isInclu ding(Routi ngToken th at)
  176           {
  177                    retu rn Routing TokenImpl. isIncludin g(this, th at);
  178           }
  179  
  180           @O verride
  181           pu blic Strin g toRoutin gTokenStri ng()
  182           {
  183                    retu rn getHome CommunityI d() + ","  + getRepos itoryUniqu eId();
  184           }
  185  
  186           @O verride
  187           pu blic int c ompareTo(G lobalArtif actIdentif ier o)
  188           {
  189                    retu rn GlobalA rtifactIde ntifierImp l.compareT o(this, o) ;
  190           }
  191  
  192           @O verride
  193           pu blic Strin g getDocum entUniqueI d()
  194           {
  195                    retu rn formatD ocumentUni queId(getP athologyTy pe(), getY ear(), get Number() ) ;
  196           }
  197  
  198           @O verride
  199           pu blic boole an equalsG lobalArtif actIdentif ier(Global ArtifactId entifier t hat)
  200           {
  201                    retu rn GlobalA rtifactIde ntifierImp l.equalsGl obalArtifa ctIdentifi er(this, t hat);
  202           }
  203  
  204           @O verride
  205           pu blic Strin g getPatie ntIdentifi er()
  206           {
  207                    retu rn getPati entId().ge tValue();
  208           }
  209  
  210           @O verride
  211           pu blic Patho logyCaseCo nsultation URN clone(
  212           th rows Clone NotSupport edExceptio n
  213           {
  214                    try
  215                    {
  216                             return  create(ge tOriginati ngSiteId() , getConsu ltationId( ), getPath ologyType( ), 
  217                                               getYear(),  getNumber (), getPat ientId());
  218                    } 
  219                    catc h (URNForm atExceptio n e)
  220                    {
  221                             throw  new CloneN otSupporte dException (e.getMess age());
  222                    }
  223           }
  224  
  225           pu blic Patie ntIdentifi er getPati entId()
  226           {
  227                    retu rn patient Id;
  228           }
  229  
  230           pu blic void  setPatient Id(Patient Identifier  patientId )
  231           {
  232                    this .patientId  = patient Id;
  233           }
  234  
  235           pu blic Strin g getPatho logyType()
  236           {
  237                    retu rn patholo gyType;
  238           }
  239  
  240           pu blic void  setPatholo gyType(Str ing pathol ogyType)
  241           {
  242                    this .pathology Type = pat hologyType ;
  243           }
  244  
  245           pu blic Strin g getYear( )
  246           {
  247                    retu rn year;
  248           }
  249  
  250           pu blic void  setYear(St ring year)
  251           {
  252                    this .year = ye ar;
  253           }
  254  
  255           pu blic Strin g getNumbe r()
  256           {
  257                    retu rn number;
  258           }
  259  
  260           pu blic void  setNumber( String num ber)
  261           {
  262                    this .number =  number;
  263           }
  264  
  265           pu blic Strin g getOrigi natingSite Id()
  266           {
  267                    retu rn origina tingSiteId ;
  268           }
  269  
  270           pu blic void  setOrigina tingSiteId (String or iginatingS iteId)
  271           {
  272                    this .originati ngSiteId =  originati ngSiteId;
  273           }
  274  
  275           pu blic Strin g getConsu ltationId( )
  276           {
  277                    retu rn consult ationId;
  278           }
  279  
  280           pu blic void  setConsult ationId(St ring consu ltationId)
  281           {
  282                    this .consultat ionId = co nsultation Id;
  283           }
  284  
  285           pr otected st atic Strin g formatDo cumentUniq ueId(Strin g annotati onId, Stri ng imageId , String p atientId)
  286           {
  287                    Stri ngBuilder  sb = new S tringBuild er();
  288                    
  289                    sb.a ppend(anno tationId);
  290                    sb.a ppend(URN. namespaceS pecificStr ingDelimit er);
  291                    sb.a ppend(imag eId);
  292                    sb.a ppend(URN. namespaceS pecificStr ingDelimit er);
  293                    sb.a ppend(pati entId);
  294                    
  295                    retu rn sb.toSt ring();
  296           }
  297           
  298           /*  (non-Java doc)
  299            *  @see gov. va.med.URN #toString( )
  300            * /
  301           @O verride
  302           pu blic Strin g toString ()
  303           {
  304                    Stri ngBuilder  ahnold = n ew StringB uilder();
  305                    
  306                    // b uild the s cheme iden tifier
  307                    ahno ld.append( urnSchemaI dentifier) ;
  308                    ahno ld.append( urnCompone ntDelimite r);
  309  
  310                    // b uild the n amespace i dentifier
  311                    ahno ld.append( this.getNa mespaceIde ntifier()) ;
  312                    ahno ld.append( urnCompone ntDelimite r);
  313                    
  314                    ahno ld.append( this.getNa mespaceSpe cificStrin g());
  315                    
  316                    retu rn ahnold. toString() ;
  317           }
  318  
  319           /*  (non-Java doc)
  320            *  @see gov. va.med.URN #toStringA sNative()
  321            * /
  322           @O verride
  323           pr otected St ring toStr ingNative( )
  324           {
  325                    Stri ngBuilder  ahnold = n ew StringB uilder();
  326                    
  327                    // b uild the s cheme iden tifier
  328                    ahno ld.append( urnSchemaI dentifier) ;
  329                    ahno ld.append( urnCompone ntDelimite r);
  330  
  331                    // b uild the n amespace i dentifier
  332                    ahno ld.append( this.getNa mespaceIde ntifier()) ;
  333                    ahno ld.append( urnCompone ntDelimite r);
  334                    
  335                    // r estore any  RFC2141 i llegal cha racters
  336                    ahno ld.append(  RFC2141_E SCAPING.un escapeIlle galCharact ers(this.g etNamespac eSpecificS tring()) ) ;
  337                    
  338                    retu rn ahnold. toString() ;
  339           }
  340  
  341           /*  (non-Java doc)
  342            *  @see gov. va.med.URN #toStringA sVAInterna l()
  343            * /
  344           @O verride
  345           pu blic Strin g toString CDTP()
  346           {
  347                    Stri ngBuilder  ahnold = n ew StringB uilder();
  348                    
  349                    // b uild the s cheme iden tifier
  350                    ahno ld.append( urnSchemaI dentifier) ;
  351                    ahno ld.append( urnCompone ntDelimite r);
  352  
  353                    // b uild the n amespace i dentifier
  354                    ahno ld.append( this.getNa mespaceIde ntifier()) ;
  355                    ahno ld.append( urnCompone ntDelimite r);
  356                    
  357                    Stri ng nss = t his.getNam espaceSpec ificString ();
  358                    // e scape any  filename i llegal cha racters
  359                    nss  = FILENAME _ESCAPING. escapeIlle galCharact ers(nss);
  360                    ahno ld.append( nss);
  361                    
  362                    Stri ng additio nalIdentif iers = thi s.getAddit ionalIdent ifiersStri ng();
  363                    // e scape any  filename i llegal cha racters
  364                    addi tionalIden tifiers =  FILENAME_E SCAPING.es capeIllega lCharacter s(addition alIdentifi ers);
  365                    ahno ld.append( additional Identifier s);
  366                    
  367                    retu rn ahnold. toString() ;       
  368           }
  369  
  370           /* *
  371            *  
  372            * /
  373           @O verride
  374           pu blic Strin g getNames paceSpecif icString(S ERIALIZATI ON_FORMAT  serializat ionFormat)
  375           {
  376                    Stri ngBuilder  ahnold = n ew StringB uilder();
  377                    
  378                    // b uild the n amespace s pecific st ring
  379                    ahno ld.append( this.origi natingSite Id);
  380                    ahno ld.append( URN.namesp aceSpecifi cStringDel imiter);
  381                    ahno ld.append( this.consu ltationId) ;
  382                    ahno ld.append( URN.namesp aceSpecifi cStringDel imiter);
  383                    ahno ld.append( this.patho logyType);
  384                    ahno ld.append( URN.namesp aceSpecifi cStringDel imiter);
  385                    ahno ld.append( this.year) ;
  386                    ahno ld.append( URN.namesp aceSpecifi cStringDel imiter);
  387                    ahno ld.append( this.numbe r);
  388                    ahno ld.append( URN.namesp aceSpecifi cStringDel imiter);
  389                    ahno ld.append( this.patie ntId);
  390                    
  391                    retu rn ahnold. toString() ;
  392           }
  393  
  394           @O verride
  395           pu blic void  parseNames paceSpecif icString(N amespaceId entifier n amespace,
  396                             String  namespace SpecificSt ring,
  397                             SERIAL IZATION_FO RMAT seria lizationFo rmat) 
  398           th rows URNFo rmatExcept ion                         
  399           {
  400                    if(n amespaceSp ecificStri ng == null )
  401                             throw  new URNFor matExcepti on("The na mespace sp ecific str ing for a( n) " + thi s.getClass ().getSimp leName() +  " cannot  be null.") ;
  402                    
  403                    Matc her nssMat cher = nam espaceSpec ificString Pattern.ma tcher(name spaceSpeci ficString) ;
  404                    
  405                    if(!  nssMatche r.matches( ))
  406                    {
  407                             String  msg = "Na mespace sp ecific str ing '" + n amespaceSp ecificStri ng + "' is  not valid .";
  408                             logger .warn(msg) ;
  409                             throw  new URNFor matExcepti on(msg);
  410                    }
  411           
  412                    setO riginating SiteId( ns sMatcher.g roup(Patho logyCaseCo nsultation URN.SITE_I D_GROUP).t rim() );
  413                    Stri ng tmpCons ultationId  = nssMatc her.group( PathologyC aseConsult ationURN.C ONSULTATIO N_ID_GROUP ).trim();
  414                    Stri ng tmpPati entId = ns sMatcher.g roup(Patho logyCaseCo nsultation URN.PATIEN T_ID_GROUP ).trim();
  415                    setP atientId(P atientIden tifier.fro mString(tm pPatientId ));
  416                    Stri ng tmpPath ologyType  = nssMatch er.group(P athologyCa seConsulta tionURN.PA THOLOGY_TY PE_GROUP). trim();
  417                    Stri ng tmpYear  = nssMatc her.group( PathologyC aseConsult ationURN.Y EAR_GROUP) .trim();
  418                    Stri ng tmpNumb er= nssMat cher.group (Pathology CaseConsul tationURN. NUMBER_GRO UP).trim() ;
  419                    swit ch(seriali zationForm at)
  420                    {
  421                    case  PATCH83_V FTP:
  422                    case  RFC2141:
  423                    case  VFTP:
  424                    case  NATIVE:
  425                    case  RAW:
  426                             setYea r(tmpYear) ;
  427                             setNum ber(tmpNum ber);
  428                             setPat hologyType (tmpPathol ogyType);
  429                             setCon sultationI d(tmpConsu ltationId) ;
  430                             break;
  431                    case  CDTP:
  432                             this.y ear = URN. FILENAME_T O_RFC2141_ ESCAPING.e scapeIlleg alCharacte rs(tmpYear );
  433                             this.n umber = UR N.FILENAME _TO_RFC214 1_ESCAPING .escapeIll egalCharac ters(tmpNu mber);
  434                             this.p athologyTy pe = URN.F ILENAME_TO _RFC2141_E SCAPING.es capeIllega lCharacter s(tmpPatho logyType);
  435                             this.c onsultatio nId = URN. FILENAME_T O_RFC2141_ ESCAPING.e scapeIlleg alCharacte rs(tmpCons ultationId );
  436                             break;
  437                    }
  438           }
  439           
  440  
  441   }