20. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 7/10/2017 1:01:42 PM Central Daylight 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.

20.1 Files compared

# Location File Last Modified
1 C:\AraxisMergeCompare\Pri_un\IV-ehmp_cif\CoreValueObjects\main\src\java\gov\va\med\imaging\mix\business\fhir Instance.java Thu Jun 29 17:22:22 2017 UTC
2 C:\AraxisMergeCompare\Pri_re\IV-ehmp_cif\CoreValueObjects\main\src\java\gov\va\med\imaging\mix\business\fhir Instance.java Thu Jul 6 15:00:11 2017 UTC

20.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 676
Changed 1 2
Inserted 0 0
Removed 0 0

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

20.4 Active regular expressions

No regular expressions were active.

20.5 Comparison detail

  1   /**
  2    * 
  3    */
  4   package go v.va.med.i maging.mix .business. fhir;
  5  
  6   import gov .va.med.Gl obalArtifa ctIdentifi er;
  7   import gov .va.med.Im ageURNFact ory;
  8   import gov .va.med.Pa tientIdent ifier;
  9   import gov .va.med.Pa tientIdent ifierType;
  10   import gov .va.med.Ro utingToken ;
  11   import gov .va.med.im aging.Imag eURN;
  12   import gov .va.med.im aging.exce ptions.URN FormatExce ption;
  13   import gov .va.med.im aging.exch ange.busin ess.Compar ableUtil;
  14   import gov .va.med.im aging.exch ange.enums .ObjectOri gin;
  15   // import  gov.va.med .imaging.e xchange.en ums.Object Status;
  16  
  17   import jav a.io.Seria lizable;
  18   import jav a.util.Dat e;
  19  
  20   import org .apache.lo g4j.Logger ;
  21  
  22   /**
  23    * @author   DNS  TITTOC
  24    *
  25    * This In stance cla ss is for  FHIR Imagi ngStudy mo del suppor t (referri ng to the  equivalent  DICOM Ins tance term )
  26    * Cardina lity: Pati ent 1..* D iagnosticR eport 0..*  ImagingSt udy 0..* S eries 0..*  Instance
  27    */
  28   public cla ss Instanc
  29   implements  Serializa ble, Compa rable<Inst ance> 
  30   {
  31           pr ivate stat ic final l ong serial VersionUID  = -402941 6178345334 605L;
  32           pr ivate fina l static L ogger logg er = Logge r.getLogge r(Instance .class);
  33           
  34           pr ivate Glob alArtifact Identifier  globalArt ifactIdent ifier; //  eventually  imageURN
  35           //  fields th at make up  the image  identifie r(s)
  36       //prot ected Stri ng patient ICN;
  37       
  38       protec ted String  number; / / DICOM In stance seq uence numb er in Seri es
  39           pr otected St ring uid;  // R! DICO M SOP Inst ance UID ( for VA a ' .' separat ed imageUR N carrying  site (Sta tion) Numb er segment !)
  40       protec ted String  sopClassU id; // R!  DICOM SOP  class UID  -- how to  get it fro m VA legac y? - null?
  41       protec ted String  type; //  type of in stance (im age, ...)  - unused?
  42       protec ted String  title; //  Descripti on of inst ance - unu sed?
  43   //    prot ected Stri ng content ; // attac hment - co ntente of  instance -  unused!
  44       privat e ObjectOr igin objec tOrigin; / / might be  used for  VA/DOD dif ferentiati on...
  45       
  46       /**
  47        * 
  48        */
  49       public  static In stance cre ate(String  originati ngSiteId,  String ima geId, Stri ng studyId
  50                    Pati entIdentif ier patien tIdentifie r,
  51                    Stri ng imageMo dality) 
  52       throws  URNFormat Exception
  53       {
  54           Im ageURN ima geUrn = Im ageURNFact ory.create (originati ngSiteId,  imageId, s tudyId, 
  55                             patien tIdentifie r.getValue (), imageM odality, I mageURN.cl ass);
  56           im ageUrn.set PatientIde ntifierTyp eIfNecessa ry(patient Identifier .getPatien tIdentifie rType());
  57           
  58           re turn creat e( imageUr n );
  59       }
  60  
  61       /**
  62        * 
  63        * @pa ram global ArtifactId entifier
  64        * @re turn
  65        */
  66       public  static In stance cre ate(Global ArtifactId entifier g lobalArtif actIdentif ier)
  67       {
  68           re turn new I nstance(gl obalArtifa ctIdentifi er);
  69       }
  70       
  71       /**
  72        * 
  73        * @pa ram global ArtifactId entifier
  74        * @re turn
  75        */
  76       public  static In stance cre ate(ImageU RN imageUr n)
  77       {
  78           re turn new I nstance(im ageUrn);
  79       }
  80       
  81       /**
  82        * 
  83        * @pa ram global ArtifactId entifier
  84        */
  85       privat e Instance (GlobalArt ifactIdent ifier glob alArtifact Identifier )
  86       {
  87           th is.globalA rtifactIde ntifier =  globalArti factIdenti fier;
  88           nu mber = tit le = "";
  89           ty pe = "imag e";
  90       }
  91       
  92           /* *
  93            *  @return
  94            * /
  95           pu blic final  GlobalArt ifactIdent ifier getG lobalArtif actIdentif ier()
  96           {
  97                    retu rn globalA rtifactIde ntifier; 
  98           }
  99  
  100       public  String ge tNumber()  {
  101                    retu rn number;
  102           }
  103  
  104           pu blic void  setNumber( String num ber) {
  105                    this .number =  number;
  106           }
  107  
  108       /**
  109        * @re turn the t itle
  110        */
  111       public  String ge tTitle() {
  112           re turn title ;
  113       }
  114  
  115       /**
  116        * @pa ram title  the title  (descripti on) to set
  117        */
  118       public  void setT itle(Strin g title) {
  119           th is.title =  title;
  120       }
  121  
  122  
  123       /**
  124        * @re turn the i mage IEN i f this is  a VistA Im aging imag e, else re turn null
  125        */
  126       public  String ge tIen() 
  127       {
  128           re turn this. globalArti factIdenti fier insta nceof Imag eURN ? 
  129                    ((Im ageURN)(th is.globalA rtifactIde ntifier)). getImageId () :
  130                    null ;
  131       }
  132  
  133       /**
  134        * @re turn the s opClassUid
  135        */
  136       public  String ge tSopClassU id() {
  137           re turn sopCl assUid;
  138       }
  139  
  140       /**
  141        * @pa ram sopCla ssUid the  sopClassUi d to set
  142        */
  143       public  void setS opClassUid (String so pClassUid)  {
  144           th is.sopClas sUid = sop ClassUid;
  145       }
  146  
  147       /**
  148        * @re turn the t ype
  149        */
  150       public  String ge tType() {
  151           re turn type;
  152       }
  153  
  154       /**
  155        * @pa ram type t he type of  inst to s et
  156        */
  157       public  void setT ype(String  type) {
  158           th is.type =  type;
  159       }
  160  
  161       /**
  162        * @re turn the p atientICN
  163        */
  164       public  String ge tPatientId () 
  165       {
  166           re turn this. globalArti factIdenti fier insta nceof Imag eURN ? 
  167                    ((Im ageURN)(th is.globalA rtifactIde ntifier)). getPatient Id() :
  168                    null ;
  169       }
  170       
  171       public  PatientId entifier g etPatientI dentifier( )
  172           {
  173                    Stri ng patient Id = getPa tientId();
  174                    Pati entIdentif ierType pa tientIdent ifierType  = getPatie ntIdentifi erType();
  175                    if(p atientId = = null ||  patientIde ntifierTyp e == null)
  176                             return  null;
  177                    
  178                    retu rn new Pat ientIdenti fier(patie ntId, pati entIdentif ierType);
  179           }
  180           
  181           pu blic Patie ntIdentifi erType get PatientIde ntifierTyp e()
  182           {
  183                    retu rn this.gl obalArtifa ctIdentifi er instanc eof ImageU RN ? 
  184                    ((Im ageURN)(th is.globalA rtifactIde ntifier)). getPatient Identifier TypeOrDefa ult() :
  185                    null ;
  186           }
  187  
  188       /**
  189        * @re turn the s iteNumber
  190        */
  191       public  String ge tSiteNumbe r() 
  192       {
  193           re turn globa lArtifactI dentifier. getReposit oryUniqueI d();
  194       }
  195  
  196       /**
  197        * @pa ram siteNu mber the s iteNumber  to set
  198        */
  199       //publ ic void se tSiteNumbe r(String s iteNumber)  
  200       //{
  201       //  tr y
  202           //       {
  203           //                if(thi s.globalAr tifactIden tifier !=  null)
  204           //                         this.glo balArtifac tIdentifie r = 
  205           //                                  GlobalArti factIdenti fierFactor y.create(t his.global ArtifactId entifier.g etHomeComm unityId(),  siteNumbe r, this.gl obalArtifa ctIdentifi er.getDocu mentUnique Id());
  206           //                else
  207           //                         this.glo balArtifac tIdentifie r = 
  208           //                                  GlobalArti factIdenti fierFactor y.create(n ull, siteN umber, nul l);
  209           //       }
  210           //       catc h (Throwab le x)
  211           //       {
  212           //                x.prin tStackTrac e();
  213           //       }
  214       //}
  215  
  216           /* *
  217            *  @return t he studyIe n
  218            * /
  219           pu blic Strin g getStudy Ien() 
  220           {
  221                    retu rn this.gl obalArtifa ctIdentifi er instanc eof ImageU RN ? 
  222                             ((Imag eURN)(this .globalArt ifactIdent ifier)).ge tStudyId()  :
  223                             null;
  224           }
  225  
  226           /* *
  227            *  @return t he uid
  228            * /
  229           pu blic Strin g getUid()  {
  230                    retu rn uid;
  231           }
  232  
  233           /* *
  234            *  @param ui d the uid  of the Ins tance to s et
  235            * /
  236           pu blic void  setUid(Str ing uid) {
  237                    this .uid = uid ;
  238           }
  239  
  240           /* *
  241            *  @return t he objectO rigin
  242            * /
  243           pu blic Objec tOrigin ge tObjectOri gin() {
  244                    retu rn objectO rigin;
  245           }
  246  
  247           /* *
  248            *  @param ob jectOrigin  the objec tOrigin to  set
  249            * /
  250           pu blic void  setObjectO rigin(Obje ctOrigin o bjectOrigi n) {
  251                    this .objectOri gin = obje ctOrigin;
  252           }
  253           
  254           pu blic Image URN getIma geUrn() 
  255           {
  256                    retu rn this.gl obalArtifa ctIdentifi er instanc eof ImageU RN ?
  257                             (Image URN)(this. globalArti factIdenti fier) : nu ll;
  258           }
  259  
  260           pu blic Strin g getImage Modality()  
  261           {
  262                    retu rn this.gl obalArtifa ctIdentifi er instanc eof ImageU RN ? 
  263                    ((Im ageURN)(th is.globalA rtifactIde ntifier)). getImageMo dality() :
  264                    null ;
  265           }
  266  
  267           @O verride
  268           pu blic Strin g toString () 
  269           {
  270                    Stri ng output  = "";
  271                    outp ut += "Glo balArtifac tIdentifie r[" + this .getGlobal ArtifactId entifier() .toString( ) + "]\n";  
  272                    outp ut += "Ins tance Prop erties:\n" ;
  273                    outp ut += "uid : " + uid  + "\n";
  274                    outp ut += "sop ClassUid:  " + sopCla ssUid + "\ n";
  275                    outp ut += "typ e: " + typ e + "\n";
  276                    outp ut += "tit le: " + ti tle + "\n" ;
  277                    outp ut += "obj ectOrigin:  " + objec tOrigin +  "\n";
  278                    
  279                    retu rn output;
  280           }
  281  
  282           /* *
  283            *  @see java .lang.Obje ct#equals( java.lang. Object)
  284            * /
  285           @O verride
  286           pu blic boole an equals( Object arg 0) 
  287           {
  288                    if(a rg0 instan ceof Insta nce) 
  289                    {
  290                             Instan ce that =  (Instance) arg0;
  291                             
  292                             // if  the study,  group and  image IEN s are equa l then the  procedure  date had  better
  293                             // be  equal, non etheless i t is compa red here t o assure t hat .equal s and .com pareTo
  294                             // are  strictly  compatible
  295                             if(      this.glo balArtifac tIdentifie r.equalsGl obalArtifa ctIdentifi er(that.ge tGlobalArt ifactIdent ifier()) & &
  296                                      this.uid  != null & & this.uid .equals(th at.uid) &&
  297                                      this.get SiteNumber () != null  && this.g etSiteNumb er().equal sIgnoreCas e(that.get SiteNumber ())) 
  298                             {
  299                                      return t rue;
  300                             }
  301                    }
  302                    retu rn false;
  303           }
  304           
  305           /* *
  306            *  The natur al sort or der of Ima ge instanc es is:
  307            *  1.) decre asing by p rocedure d ate
  308            *  2.) incre asing by s ite number
  309            *  3.) incre asing by s tudy IEN
  310            *  4.) incre asing by g roup IEN ( series)
  311            *  5.) incre asing by i mage IEN
  312            *  
  313            *  @see java .lang.Comp arable#com pareTo(jav a.lang.Obj ect)
  314            * /
  315           @O verride
  316           pu blic int c ompareTo(I nstance th at) 
  317           {
  318                    int  cumulative Compare =  0;
  319                    
  320                    cumu lativeComp are = Comp arableUtil .compare(t his.uid, t hat.uid, f alse);
  321                    if(c umulativeC ompare !=  0)
  322                             return  cumulativ eCompare;
  323                    
  324                    cumu lativeComp are = Comp arableUtil .compare(t his.getSit eNumber(),  that.getS iteNumber( ), true);
  325                    if(c umulativeC ompare !=  0)
  326                             return  cumulativ eCompare;
  327                             
  328                    cumu lativeComp are = Comp arableUtil .compare(t his.getStu dyIen(), t hat.getStu dyIen(), t rue);
  329                    if(c umulativeC ompare !=  0)
  330                             return  cumulativ eCompare;
  331                    
  332                    retu rn Compara bleUtil.co mpare(
  333                             this.g etGlobalAr tifactIden tifier().g etDocument UniqueId()
  334                             that.g etGlobalAr tifactIden tifier().g etDocument UniqueId()
  335                             true
  336                    );
  337           }
  338           
  339   }