415. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 12/5/2017 12:06:51 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.

415.1 Files compared

# Location File Last Modified
1 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\VixCommon\main\src\java\gov\va\med\imaging ImageAnnotationURN.java Mon Dec 4 21:34:16 2017 UTC
2 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\VixCommon\main\src\java\gov\va\med\imaging ImageAnnotationURN.java Mon Dec 4 22:07:21 2017 UTC

415.2 Comparison summary

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

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

415.4 Active regular expressions

No regular expressions were active.

415.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  17, 2011
  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;
  27  
  28   import gov .va.med.Gl obalArtifa ctIdentifi er;
  29   import gov .va.med.Gl obalArtifa ctIdentifi erImpl;
  30   import gov .va.med.Na mespaceIde ntifier;
  31   import gov .va.med.Pa tientArtif actIdentif ier;
  32   import gov .va.med.Ro utingToken ;
  33   import gov .va.med.Ro utingToken Impl;
  34   import gov .va.med.SE RIALIZATIO N_FORMAT;
  35   import gov .va.med.UR N;
  36   import gov .va.med.UR NComponent s;
  37   import gov .va.med.UR NType;
  38   import gov .va.med.We llKnownOID ;
  39   import gov .va.med.im aging.exce ptions.Ima geURNForma tException ;
  40   import gov .va.med.im aging.exce ptions.URN FormatExce ption;
  41  
  42   import jav a.io.Seria lizable;
  43   import org .apache.lo gging.log4 j.LogManag er;
  44   import org .apache.lo gging.log4 j.Logger;
  45   import jav a.util.reg ex.Matcher ;
  46   import jav a.util.reg ex.Pattern ;
  47  
  48   /**
  49    * Annotat ion layer  identifier . This ide ntifier is  globally  unique.  I t contains  the site,  patient,  image 
  50    * and ann otation la yer ID.  T he image I D specifie d is not a  fully ima ge URN and  insuffici ent inform ation
  51    * to crea te a full  image URN  but it is  sufficient  to identi fy the ima ge at a si te.
  52    * 
  53    * @author         
WERFEJ
  54    *
  55    */
  56   @URNType(n amespace=" vaannotati on")
  57   public cla ss ImageAn notationUR N
  58   extends UR N
  59   implements  Serializa ble, Patie ntArtifact Identifier
  60   {
  61           pr ivate stat ic final l ong serial VersionUID  = 1L;
  62           
  63           pr otected St ring patie ntId;
  64           pr otected St ring annot ationId;
  65           pr otected St ring image Id;
  66           pr otected St ring origi natingSite Id;
  67           
  68           pr ivate stat ic final S tring name space = "v aannotatio n";
  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 annotat ion ID 
  75                    URN. namespaceS pecificStr ingDelimit er +
  76                    "([^ -]+)" +                                                                            // t he image I D
  77                    URN. namespaceS pecificStr ingDelimit er + 
  78                    "([^ -]+)";                                                                             // t he patient  ID 
  79           pr ivate stat ic final P attern nam espaceSpec ificString Pattern =  Pattern.co mpile(name spaceSpeci ficStringR egex);
  80           pr ivate stat ic final i nt SITE_ID _GROUP = 1 ;
  81           pr ivate stat ic final i nt ANNOTAT ION_ID_GRO UP = 2;
  82           pr ivate stat ic final i nt IMAGE_I D_GROUP =  3;
  83           pr ivate stat ic final i nt PATIENT _ID_GROUP  = 4;
  84           
  85           pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(Imag eAnnotatio nURN.class );
  86  
  87           
  88           pr ivate stat ic Namespa ceIdentifi er namespa ceIdentifi er = new N amespaceId entifier(n amespace);
  89           pu blic stati c synchron ized Names paceIdenti fier getMa nagedNames pace()
  90           {
  91                    retu rn namespa ceIdentifi er;
  92           }
  93           
  94           pu blic stati c ImageAnn otationURN  create(St ring origi natingSite Id, 
  95                             String  annotatio nId, Strin g imageId,  String pa tientId)
  96           th rows URNFo rmatExcept ion
  97           {        
  98                    retu rn new Ima geAnnotati onURN(Imag eAnnotatio nURN.getMa nagedNames pace(),
  99                                      originat ingSiteId,  annotatio nId, image Id, patien tId);
  100           }
  101           
  102           pu blic stati c ImageAnn otationURN  create(UR NComponent s urnCompo nents, 
  103                             SERIAL IZATION_FO RMAT seria lizationFo rmat) 
  104           th rows URNFo rmatExcept ion
  105           {
  106                    retu rn new Ima geAnnotati onURN(urnC omponents,  serializa tionFormat );
  107           }
  108           
  109           /* *
  110            *  Used dire ctly and a  pass thro ugh for de rived clas ses.
  111            *  The const ructor cal led by the  URN class  when a UR N derived  class
  112            *  is being  created fr om a Strin g represen tation.
  113            *  
  114            *  @param co mponents
  115            *  @throws U RNFormatEx ception
  116            * /
  117           pr otected Im ageAnnotat ionURN(URN Components  urnCompon ents, SERI ALIZATION_ FORMAT ser ialization Format) 
  118           th rows URNFo rmatExcept ion
  119           {
  120                    supe r(urnCompo nents, ser ialization Format);
  121           }
  122           
  123           pr otected Im ageAnnotat ionURN(Nam espaceIden tifier nam espaceIden tifier,
  124                             String  originati ngSiteId, 
  125                             String  annotatio nId, 
  126                             String  imageId,
  127                             String  patientId )
  128           th rows URNFo rmatExcept ion
  129           {
  130                    supe r(namespac eIdentifie r);
  131                    setO riginating SiteId(ori ginatingSi teId);
  132                    setA nnotationI d(annotati onId);
  133                    setI mageId(ima geId);
  134                    setP atientId(p atientId);
  135           }
  136  
  137           @O verride
  138           pu blic Strin g getHomeC ommunityId ()
  139           {
  140                    // I mages are  always in  the VA com munity
  141                    retu rn WellKno wnOID.VA_R ADIOLOGY_I MAGE.getCa nonicalVal ue().toStr ing();
  142           }
  143  
  144           @O verride
  145           pu blic Strin g getRepos itoryUniqu eId()
  146           {
  147                    retu rn origina tingSiteId ;
  148           }
  149  
  150           @O verride
  151           pu blic boole an isEquiv alent(Rout ingToken t hat)
  152           {
  153                    retu rn Routing TokenImpl. isEquivale nt(this, t hat);
  154           }
  155  
  156           @O verride
  157           pu blic boole an isInclu ding(Routi ngToken th at)
  158           {
  159                    retu rn Routing TokenImpl. isIncludin g(this, th at);
  160           }
  161  
  162           @O verride
  163           pu blic Strin g toRoutin gTokenStri ng()
  164           {
  165                    retu rn getHome CommunityI d() + ","  + getRepos itoryUniqu eId();
  166           }
  167  
  168           @O verride
  169           pu blic int c ompareTo(G lobalArtif actIdentif ier o)
  170           {
  171                    retu rn GlobalA rtifactIde ntifierImp l.compareT o(this, o) ;
  172           }
  173  
  174           @O verride
  175           pu blic Strin g getDocum entUniqueI d()
  176           {
  177                    retu rn formatD ocumentUni queId( get Annotation Id(), getI mageId(),  getPatient Id() );
  178           }
  179  
  180           @O verride
  181           pu blic boole an equalsG lobalArtif actIdentif ier(Global ArtifactId entifier t hat)
  182           {
  183                    retu rn GlobalA rtifactIde ntifierImp l.equalsGl obalArtifa ctIdentifi er(this, t hat);
  184           }
  185  
  186           @O verride
  187           pu blic Strin g getPatie ntIdentifi er()
  188           {
  189                    retu rn getPati entId();
  190           }
  191  
  192           @O verride
  193           pu blic Image Annotation URN clone(
  194           th rows Clone NotSupport edExceptio n
  195           {
  196                    try
  197                    {
  198                             return  create(ge tOriginati ngSiteId() , getAnnot ationId(),  
  199                                               getImageId (), getPat ientId());
  200                    } 
  201                    catc h (URNForm atExceptio n e)
  202                    {
  203                             throw  new CloneN otSupporte dException (e.getMess age());
  204                    }
  205           }
  206  
  207           pu blic Strin g getPatie ntId()
  208           {
  209                    retu rn patient Id;
  210           }
  211  
  212           pu blic void  setPatient Id(String  patientId)
  213           {
  214                    this .patientId  = patient Id;
  215           }
  216  
  217           pu blic Strin g getAnnot ationId()
  218           {
  219                    retu rn annotat ionId;
  220           }
  221  
  222           pu blic void  setAnnotat ionId(Stri ng annotat ionId)
  223           {
  224                    this .annotatio nId = anno tationId;
  225           }
  226  
  227           pu blic Strin g getOrigi natingSite Id()
  228           {
  229                    retu rn origina tingSiteId ;
  230           }
  231  
  232           pu blic void  setOrigina tingSiteId (String or iginatingS iteId)
  233           {
  234                    this .originati ngSiteId =  originati ngSiteId;
  235           }
  236  
  237           pu blic Strin g getImage Id()
  238           {
  239                    retu rn imageId ;
  240           }
  241  
  242           pu blic void  setImageId (String im ageId)
  243           {
  244                    this .imageId =  imageId;
  245           }
  246  
  247           pr otected st atic Strin g formatDo cumentUniq ueId(Strin g annotati onId, Stri ng imageId , String p atientId)
  248           {
  249                    Stri ngBuilder  sb = new S tringBuild er();
  250                    
  251                    sb.a ppend(anno tationId);
  252                    sb.a ppend(URN. namespaceS pecificStr ingDelimit er);
  253                    sb.a ppend(imag eId);
  254                    sb.a ppend(URN. namespaceS pecificStr ingDelimit er);
  255                    sb.a ppend(pati entId);
  256                    
  257                    retu rn sb.toSt ring();
  258           }
  259           
  260           /*  (non-Java doc)
  261            *  @see gov. va.med.URN #toString( )
  262            * /
  263           @O verride
  264           pu blic Strin g toString ()
  265           {
  266                    Stri ngBuilder  ahnold = n ew StringB uilder();
  267                    
  268                    // b uild the s cheme iden tifier
  269                    ahno ld.append( urnSchemaI dentifier) ;
  270                    ahno ld.append( urnCompone ntDelimite r);
  271  
  272                    // b uild the n amespace i dentifier
  273                    ahno ld.append( this.getNa mespaceIde ntifier()) ;
  274                    ahno ld.append( urnCompone ntDelimite r);
  275                    
  276                    ahno ld.append( this.getNa mespaceSpe cificStrin g());
  277                    
  278                    retu rn ahnold. toString() ;
  279           }
  280  
  281           /*  (non-Java doc)
  282            *  @see gov. va.med.URN #toStringA sNative()
  283            * /
  284           @O verride
  285           pr otected St ring toStr ingNative( )
  286           {
  287                    Stri ngBuilder  ahnold = n ew StringB uilder();
  288                    
  289                    // b uild the s cheme iden tifier
  290                    ahno ld.append( urnSchemaI dentifier) ;
  291                    ahno ld.append( urnCompone ntDelimite r);
  292  
  293                    // b uild the n amespace i dentifier
  294                    ahno ld.append( this.getNa mespaceIde ntifier()) ;
  295                    ahno ld.append( urnCompone ntDelimite r);
  296                    
  297                    // r estore any  RFC2141 i llegal cha racters
  298                    ahno ld.append(  RFC2141_E SCAPING.un escapeIlle galCharact ers(this.g etNamespac eSpecificS tring()) ) ;
  299                    
  300                    retu rn ahnold. toString() ;
  301           }
  302  
  303           /*  (non-Java doc)
  304            *  @see gov. va.med.URN #toStringA sVAInterna l()
  305            * /
  306           @O verride
  307           pu blic Strin g toString CDTP()
  308           {
  309                    Stri ngBuilder  ahnold = n ew StringB uilder();
  310                    
  311                    // b uild the s cheme iden tifier
  312                    ahno ld.append( urnSchemaI dentifier) ;
  313                    ahno ld.append( urnCompone ntDelimite r);
  314  
  315                    // b uild the n amespace i dentifier
  316                    ahno ld.append( this.getNa mespaceIde ntifier()) ;
  317                    ahno ld.append( urnCompone ntDelimite r);
  318                    
  319                    Stri ng nss = t his.getNam espaceSpec ificString ();
  320                    // e scape any  filename i llegal cha racters
  321                    nss  = FILENAME _ESCAPING. escapeIlle galCharact ers(nss);
  322                    ahno ld.append( nss);
  323                    
  324                    Stri ng additio nalIdentif iers = thi s.getAddit ionalIdent ifiersStri ng();
  325                    // e scape any  filename i llegal cha racters
  326                    addi tionalIden tifiers =  FILENAME_E SCAPING.es capeIllega lCharacter s(addition alIdentifi ers);
  327                    ahno ld.append( additional Identifier s);
  328                    
  329                    retu rn ahnold. toString() ;       
  330           }
  331  
  332           /* *
  333            *  
  334            * /
  335           @O verride
  336           pu blic Strin g getNames paceSpecif icString(S ERIALIZATI ON_FORMAT  serializat ionFormat)
  337           {
  338                    Stri ngBuilder  ahnold = n ew StringB uilder();
  339                    
  340                    // b uild the n amespace s pecific st ring
  341                    ahno ld.append( this.origi natingSite Id);
  342                    ahno ld.append( URN.namesp aceSpecifi cStringDel imiter);
  343                    ahno ld.append( this.annot ationId);
  344                    ahno ld.append( URN.namesp aceSpecifi cStringDel imiter);
  345                    ahno ld.append( this.image Id);
  346                    ahno ld.append( URN.namesp aceSpecifi cStringDel imiter);
  347                    ahno ld.append( this.patie ntId);
  348                    
  349                    retu rn ahnold. toString() ;
  350           }
  351  
  352           @O verride
  353           pu blic void  parseNames paceSpecif icString(N amespaceId entifier n amespace,
  354                             String  namespace SpecificSt ring,
  355                             SERIAL IZATION_FO RMAT seria lizationFo rmat) 
  356           th rows URNFo rmatExcept ion                         
  357           {
  358                    if(n amespaceSp ecificStri ng == null )
  359                             throw  new URNFor matExcepti on("The na mespace sp ecific str ing for a( n) " + thi s.getClass ().getSimp leName() +  " cannot  be null.") ;
  360                    
  361                    Matc her nssMat cher = nam espaceSpec ificString Pattern.ma tcher(name spaceSpeci ficString) ;
  362                    
  363                    if(!  nssMatche r.matches( ))
  364                    {
  365                             String  msg = "Na mespace sp ecific str ing '" + n amespaceSp ecificStri ng + "' is  not valid .";
  366                             logger .warn(msg) ;
  367                             throw  new ImageU RNFormatEx ception(ms g);
  368                    }
  369           
  370                    setO riginating SiteId( ns sMatcher.g roup(SITE_ ID_GROUP). trim() );
  371                    setP atientId(  nssMatcher .group(Ima geAnnotati onURN.PATI ENT_ID_GRO UP).trim()  );
  372                    Stri ng tmpAnno tationId =  nssMatche r.group(Im ageAnnotat ionURN.ANN OTATION_ID _GROUP).tr im();
  373                    Stri ng tmpImag eId = nssM atcher.gro up(ImageAn notationUR N.IMAGE_ID _GROUP).tr im();
  374                    swit ch(seriali zationForm at)
  375                    {
  376                    case  PATCH83_V FTP:
  377                    case  RFC2141:
  378                    case  VFTP:
  379                    case  NATIVE:
  380                    case  RAW:
  381                             setAnn otationId( tmpAnnotat ionId);
  382                             setIma geId(tmpIm ageId);
  383                             break;
  384                    case  CDTP:
  385                             this.a nnotationI d = URN.FI LENAME_TO_ RFC2141_ES CAPING.esc apeIllegal Characters (tmpAnnota tionId);
  386                             this.i mageId = U RN.FILENAM E_TO_RFC21 41_ESCAPIN G.escapeIl legalChara cters(tmpI mageId);
  387                             break;
  388                    }
  389           }
  390  
  391   }