335. 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.

335.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 PathologyCaseURN.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 PathologyCaseURN.java Mon Dec 4 22:04:55 2017 UTC

335.2 Comparison summary

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

335.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

335.4 Active regular expressions

No regular expressions were active.

335.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  12, 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 ycase")
  54   public cla ss Patholo gyCaseURN
  55   extends UR N
  56   implements  Serializa ble, Patie ntArtifact Identifier
  57   {
  58  
  59           pr ivate stat ic final l ong serial VersionUID  = 1L;
  60           
  61           pr otected St ring origi natingSite Id;
  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           
  68           pr ivate stat ic final S tring name space = "v apathology case";
  69           pu blic stati c final We llKnownOID  DEFAULT_H OME_COMMUN ITY_ID = W ellKnownOI D.VA_RADIO LOGY_IMAGE ;
  70           
  71           pr ivate stat ic final S tring name spaceSpeci ficStringR egex = 
  72                    "([^ -]+)" +                                                                   //  the site  ID
  73                    URN. namespaceS pecificStr ingDelimit er +
  74                    "([^ -]+)" +                                                                            // t he patholo gy type 
  75                    URN. namespaceS pecificStr ingDelimit er +
  76                    "([^ -]+)" +                                                                            // t he year
  77                    URN. namespaceS pecificStr ingDelimit er + 
  78                    "([^ -]+)" +                                                                            // t he accessi on number
  79                    URN. namespaceS pecificStr ingDelimit er + 
  80                    "([^ -]+)";                                                                             // t he patient  ID
  81           pr ivate stat ic final P attern nam espaceSpec ificString Pattern =  Pattern.co mpile(name spaceSpeci ficStringR egex);
  82           pr ivate stat ic final i nt SITE_ID _GROUP = 1 ;
  83           pr ivate stat ic final i nt PATHOLO GY_TYPE_GR OUP = 2;
  84           pr ivate stat ic final i nt YEAR_GR OUP = 3;
  85           pr ivate stat ic final i nt NUMBER_ GROUP = 4;
  86           pr ivate stat ic final i nt PATIENT _ID_GROUP  = 5;
  87           
  88           pr ivate stat ic Namespa ceIdentifi er namespa ceIdentifi er = new N amespaceId entifier(n amespace);
  89           
  90           pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(Path ologyCaseU RN.class);
  91  
  92           pu blic stati c synchron ized Names paceIdenti fier getMa nagedNames pace()
  93           {
  94                    retu rn namespa ceIdentifi er;
  95           }
  96           
  97           pu blic stati c Patholog yCaseURN c reate(Stri ng origina tingSiteId
  98                             String  pathology Type, Stri ng year, S tring numb er, Patien tIdentifie r patientI d)
  99           th rows URNFo rmatExcept ion
  100           {        
  101                    retu rn new Pat hologyCase URN(Pathol ogyCaseURN .getManage dNamespace (),
  102                                      originat ingSiteId,  pathology Type, year , number,  patientId) ;
  103           }
  104           
  105           pu blic stati c Patholog yCaseURN c reate(URNC omponents  urnCompone nts, 
  106                             SERIAL IZATION_FO RMAT seria lizationFo rmat) 
  107           th rows URNFo rmatExcept ion
  108           {
  109                    retu rn new Pat hologyCase URN(urnCom ponents, s erializati onFormat);
  110           }
  111           
  112           /* *
  113            *  Used dire ctly and a  pass thro ugh for de rived clas ses.
  114            *  The const ructor cal led by the  URN class  when a UR N derived  class
  115            *  is being  created fr om a Strin g represen tation.
  116            *  
  117            *  @param co mponents
  118            *  @throws U RNFormatEx ception
  119            * /
  120           pr otected Pa thologyCas eURN(URNCo mponents u rnComponen ts, SERIAL IZATION_FO RMAT seria lizationFo rmat) 
  121           th rows URNFo rmatExcept ion
  122           {
  123                    supe r(urnCompo nents, ser ialization Format);
  124           }
  125           
  126           pr otected Pa thologyCas eURN(Names paceIdenti fier names paceIdenti fier,
  127                             String  originati ngSiteId, 
  128                             String  pathology Type, 
  129                             String  year, 
  130                             String  number, 
  131                             Patien tIdentifie r patientI dentifier)
  132           th rows URNFo rmatExcept ion
  133           {
  134                    supe r(namespac eIdentifie r);
  135                    setO riginating SiteId(ori ginatingSi teId);
  136                    setP athologyTy pe(patholo gyType);
  137                    setY ear(year);
  138                    setN umber(numb er);                        
  139                    setP atientId(p atientIden tifier);
  140           }
  141  
  142           @O verride
  143           pu blic Strin g getHomeC ommunityId ()
  144           {
  145                    // I mages are  always in  the VA com munity
  146                    retu rn WellKno wnOID.VA_R ADIOLOGY_I MAGE.getCa nonicalVal ue().toStr ing();
  147           }
  148  
  149           @O verride
  150           pu blic Strin g getRepos itoryUniqu eId()
  151           {
  152                    retu rn origina tingSiteId ;
  153           }
  154  
  155           @O verride
  156           pu blic boole an isEquiv alent(Rout ingToken t hat)
  157           {
  158                    retu rn Routing TokenImpl. isEquivale nt(this, t hat);
  159           }
  160  
  161           @O verride
  162           pu blic boole an isInclu ding(Routi ngToken th at)
  163           {
  164                    retu rn Routing TokenImpl. isIncludin g(this, th at);
  165           }
  166  
  167           @O verride
  168           pu blic Strin g toRoutin gTokenStri ng()
  169           {
  170                    retu rn getHome CommunityI d() + ","  + getRepos itoryUniqu eId();
  171           }
  172  
  173           @O verride
  174           pu blic int c ompareTo(G lobalArtif actIdentif ier o)
  175           {
  176                    retu rn GlobalA rtifactIde ntifierImp l.compareT o(this, o) ;
  177           }
  178  
  179           @O verride
  180           pu blic Strin g getDocum entUniqueI d()
  181           {
  182                    retu rn formatD ocumentUni queId(getP athologyTy pe(), getY ear(), get Number() ) ;
  183           }
  184  
  185           @O verride
  186           pu blic boole an equalsG lobalArtif actIdentif ier(Global ArtifactId entifier t hat)
  187           {
  188                    retu rn GlobalA rtifactIde ntifierImp l.equalsGl obalArtifa ctIdentifi er(this, t hat);
  189           }
  190  
  191           @O verride
  192           pu blic Strin g getPatie ntIdentifi er()
  193           {
  194                    retu rn getPati entId().to String();
  195           }
  196  
  197           @O verride
  198           pu blic Patho logyCaseUR N clone() 
  199           th rows Clone NotSupport edExceptio n
  200           {
  201                    try
  202                    {
  203                             return  create(ge tOriginati ngSiteId() , getPatho logyType() , getYear( ), 
  204                                               getNumber( ), getPati entId());
  205                    } 
  206                    catc h (URNForm atExceptio n e)
  207                    {
  208                             throw  new CloneN otSupporte dException (e.getMess age());
  209                    }
  210           }
  211  
  212           pu blic Patie ntIdentifi er getPati entId()
  213           {
  214                    retu rn patient Id;
  215           }
  216  
  217           pu blic void  setPatient Id(Patient Identifier  patientId )
  218           {
  219                    this .patientId  = patient Id;
  220           }
  221  
  222           pu blic Strin g getPatho logyType()
  223           {
  224                    retu rn patholo gyType;
  225           }
  226  
  227           pu blic void  setPatholo gyType(Str ing pathol ogyType)
  228           {
  229                    this .pathology Type = pat hologyType ;
  230           }
  231  
  232           pu blic Strin g getYear( )
  233           {
  234                    retu rn year;
  235           }
  236  
  237           pu blic void  setYear(St ring year)
  238           {
  239                    this .year = ye ar;
  240           }
  241  
  242           pu blic Strin g getNumbe r()
  243           {
  244                    retu rn number;
  245           }
  246  
  247           pu blic void  setNumber( String num ber)
  248           {
  249                    this .number =  number;
  250           }
  251  
  252           pu blic Strin g getOrigi natingSite Id()
  253           {
  254                    retu rn origina tingSiteId ;
  255           }
  256  
  257           pu blic void  setOrigina tingSiteId (String or iginatingS iteId)
  258           {
  259                    this .originati ngSiteId =  originati ngSiteId;
  260           }
  261  
  262           pr otected st atic Strin g formatDo cumentUniq ueId(Strin g annotati onId, Stri ng imageId , String p atientId)
  263           {
  264                    Stri ngBuilder  sb = new S tringBuild er();
  265                    
  266                    sb.a ppend(anno tationId);
  267                    sb.a ppend(URN. namespaceS pecificStr ingDelimit er);
  268                    sb.a ppend(imag eId);
  269                    sb.a ppend(URN. namespaceS pecificStr ingDelimit er);
  270                    sb.a ppend(pati entId);
  271                    
  272                    retu rn sb.toSt ring();
  273           }
  274           
  275           /*  (non-Java doc)
  276            *  @see gov. va.med.URN #toString( )
  277            * /
  278           @O verride
  279           pu blic Strin g toString ()
  280           {
  281                    Stri ngBuilder  ahnold = n ew StringB uilder();
  282                    
  283                    // b uild the s cheme iden tifier
  284                    ahno ld.append( urnSchemaI dentifier) ;
  285                    ahno ld.append( urnCompone ntDelimite r);
  286  
  287                    // b uild the n amespace i dentifier
  288                    ahno ld.append( this.getNa mespaceIde ntifier()) ;
  289                    ahno ld.append( urnCompone ntDelimite r);
  290                    
  291                    ahno ld.append( this.getNa mespaceSpe cificStrin g());
  292                    
  293                    retu rn ahnold. toString() ;
  294           }
  295  
  296           /*  (non-Java doc)
  297            *  @see gov. va.med.URN #toStringA sNative()
  298            * /
  299           @O verride
  300           pr otected St ring toStr ingNative( )
  301           {
  302                    Stri ngBuilder  ahnold = n ew StringB uilder();
  303                    
  304                    // b uild the s cheme iden tifier
  305                    ahno ld.append( urnSchemaI dentifier) ;
  306                    ahno ld.append( urnCompone ntDelimite r);
  307  
  308                    // b uild the n amespace i dentifier
  309                    ahno ld.append( this.getNa mespaceIde ntifier()) ;
  310                    ahno ld.append( urnCompone ntDelimite r);
  311                    
  312                    // r estore any  RFC2141 i llegal cha racters
  313                    ahno ld.append(  RFC2141_E SCAPING.un escapeIlle galCharact ers(this.g etNamespac eSpecificS tring()) ) ;
  314                    
  315                    retu rn ahnold. toString() ;
  316           }
  317  
  318           /*  (non-Java doc)
  319            *  @see gov. va.med.URN #toStringA sVAInterna l()
  320            * /
  321           @O verride
  322           pu blic Strin g toString CDTP()
  323           {
  324                    Stri ngBuilder  ahnold = n ew StringB uilder();
  325                    
  326                    // b uild the s cheme iden tifier
  327                    ahno ld.append( urnSchemaI dentifier) ;
  328                    ahno ld.append( urnCompone ntDelimite r);
  329  
  330                    // b uild the n amespace i dentifier
  331                    ahno ld.append( this.getNa mespaceIde ntifier()) ;
  332                    ahno ld.append( urnCompone ntDelimite r);
  333                    
  334                    Stri ng nss = t his.getNam espaceSpec ificString ();
  335                    // e scape any  filename i llegal cha racters
  336                    nss  = FILENAME _ESCAPING. escapeIlle galCharact ers(nss);
  337                    ahno ld.append( nss);
  338                    
  339                    Stri ng additio nalIdentif iers = thi s.getAddit ionalIdent ifiersStri ng();
  340                    // e scape any  filename i llegal cha racters
  341                    addi tionalIden tifiers =  FILENAME_E SCAPING.es capeIllega lCharacter s(addition alIdentifi ers);
  342                    ahno ld.append( additional Identifier s);
  343                    
  344                    retu rn ahnold. toString() ;       
  345           }
  346  
  347           /* *
  348            *  
  349            * /
  350           @O verride
  351           pu blic Strin g getNames paceSpecif icString(S ERIALIZATI ON_FORMAT  serializat ionFormat)
  352           {
  353                    Stri ngBuilder  ahnold = n ew StringB uilder();
  354                    
  355                    // b uild the n amespace s pecific st ring
  356                    ahno ld.append( this.origi natingSite Id);
  357                    ahno ld.append( URN.namesp aceSpecifi cStringDel imiter);
  358                    ahno ld.append( this.patho logyType);
  359                    ahno ld.append( URN.namesp aceSpecifi cStringDel imiter);
  360                    ahno ld.append( this.year) ;
  361                    ahno ld.append( URN.namesp aceSpecifi cStringDel imiter);
  362                    ahno ld.append( this.numbe r);
  363                    ahno ld.append( URN.namesp aceSpecifi cStringDel imiter);
  364                    ahno ld.append( this.patie ntId);
  365                    retu rn ahnold. toString() ;
  366           }
  367  
  368           @O verride
  369           pu blic void  parseNames paceSpecif icString(N amespaceId entifier n amespace,
  370                             String  namespace SpecificSt ring,
  371                             SERIAL IZATION_FO RMAT seria lizationFo rmat) 
  372           th rows URNFo rmatExcept ion                         
  373           {
  374                    if(n amespaceSp ecificStri ng == null )
  375                             throw  new URNFor matExcepti on("The na mespace sp ecific str ing for a( n) " + thi s.getClass ().getSimp leName() +  " cannot  be null.") ;
  376                    
  377                    Matc her nssMat cher = nam espaceSpec ificString Pattern.ma tcher(name spaceSpeci ficString) ;
  378                    
  379                    if(!  nssMatche r.matches( ))
  380                    {
  381                             String  msg = "Na mespace sp ecific str ing '" + n amespaceSp ecificStri ng + "' is  not valid .";
  382                             logger .warn(msg) ;
  383                             throw  new URNFor matExcepti on(msg);
  384                    }
  385           
  386                    setO riginating SiteId( ns sMatcher.g roup(Patho logyCaseUR N.SITE_ID_ GROUP).tri m() );
  387                    Stri ng tmpPati entId = ns sMatcher.g roup(Patho logyCaseUR N.PATIENT_ ID_GROUP). trim();
  388                    setP atientId(P atientIden tifier.fro mString(tm pPatientId ));
  389                    Stri ng tmpPath ologyType  = nssMatch er.group(P athologyCa seURN.PATH OLOGY_TYPE _GROUP).tr im();
  390                    Stri ng tmpYear  = nssMatc her.group( PathologyC aseURN.YEA R_GROUP).t rim();
  391                    Stri ng tmpNumb er= nssMat cher.group (Pathology CaseURN.NU MBER_GROUP ).trim();
  392                    swit ch(seriali zationForm at)
  393                    {
  394                    case  PATCH83_V FTP:
  395                    case  RFC2141:
  396                    case  VFTP:
  397                    case  NATIVE:
  398                    case  RAW:
  399                             setYea r(tmpYear) ;
  400                             setNum ber(tmpNum ber);
  401                             setPat hologyType (tmpPathol ogyType);
  402                             break;
  403                    case  CDTP:
  404                             this.y ear = URN. FILENAME_T O_RFC2141_ ESCAPING.e scapeIlleg alCharacte rs(tmpYear );
  405                             this.n umber = UR N.FILENAME _TO_RFC214 1_ESCAPING .escapeIll egalCharac ters(tmpNu mber);
  406                             this.p athologyTy pe = URN.F ILENAME_TO _RFC2141_E SCAPING.es capeIllega lCharacter s(tmpPatho logyType);
  407                             break;
  408                    }
  409           }
  410           
  411           /* *
  412            *  Returns t he Patholo gyType Yea r Number w hich repre sents the  accession  number in  VistA
  413            *  @return
  414            * /
  415           pu blic Strin g toString AccessionN umber()
  416           {
  417                    retu rn getPath ologyType( ) + " " +  getYear()  + " " + ge tNumber();
  418           }
  419   }