130. EPMO Open Source Coordination Office Redaction File Detail Report

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

130.1 Files compared

# Location File Last Modified
1 C:\AraxisMergeCompare\Pri_un\IV-ehmp_cif\MIXDataSource\main\src\java\gov\va\med\imaging\mix\proxy\v1 StudyResult.java Thu Jun 29 17:23:08 2017 UTC
2 C:\AraxisMergeCompare\Pri_re\IV-ehmp_cif\MIXDataSource\main\src\java\gov\va\med\imaging\mix\proxy\v1 StudyResult.java Thu Jul 6 15:04:29 2017 UTC

130.2 Comparison summary

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

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

130.4 Active regular expressions

No regular expressions were active.

130.5 Comparison detail

  1   package go v.va.med.i maging.mix .proxy.v1;
  2  
  3   import gov .va.med.im aging.Dico mDateForma t;
  4   import gov .va.med.im aging.mix. webservice s.rest.typ es.v1.*;
  5   import gov .va.med.im aging.prox y.Abstract Result;
  6  
  7   import jav a.io.File;
  8   import jav a.io.FileW riter;
  9   import jav a.io.IOExc eption;
  10   import jav a.io.Seria lizable;
  11   import jav a.text.Dat eFormat;
  12   import jav a.text.Par seExceptio n;
  13   import jav a.text.Sim pleDateFor mat;
  14   import jav a.util.Dat e;
  15  
  16   /**
  17    * A simpl e wrapper  class that  allows th e proxy to  return th e transact ion identi fier along  with
  18    * the stu dies.
  19    * As a de rivation o f Abstract Result,  t his class  always has  a Transac tion ID on ce it has  been creat ed.
  20    * If one  is not sup plied in t he constru ctor then  one is cre ated in th e construc tor.  
  21    * Once cr eated the  transactio n ID is im mutable. 
  22    * 
  23    * @author         
BECKEC
  24    *
  25    */
  26   public cla ss StudyRe sult
  27   extends Ab stractResu lt
  28   implements  Serializa ble
  29   {
  30           pr ivate stat ic final l ong serial VersionUID  = -497435 2581115168 471L;
  31           pr ivate Repo rtStudyLis tResponseT ype studie s;
  32           
  33           pu blic Study Result(Str ing transa ctionId, R eportStudy ListRespon seType stu dies2)
  34           {
  35                    supe r(transact ionId);
  36                    this .studies =  studies2;
  37           }
  38  
  39           pu blic Repor tStudyList ResponseTy pe getStud ies()
  40           {
  41                    retu rn this.st udies;
  42           }
  43           
  44           /* *
  45            *  @see gov. va.med.ima ging.Equiv alent
  46            * /
  47           pu blic boole an equival ent(Object  obj)
  48           {
  49                    if ( this == ob j)
  50                             return  true;
  51                    if ( obj == nul l)
  52                             return  false;
  53                    if ( getClass()  != obj.ge tClass())
  54                             return  false;
  55                    fina l StudyRes ult that =  (StudyRes ult)obj;
  56                    
  57                    // i f the stud ies list i s null in  both insta nces then  the result s are equi valent
  58                    if(t his.studie s == null  && that.st udies == n ull)
  59                             return  true;
  60  
  61                    // i f the stud ies list i s null in  one instan ces but no t the othe r then the  results a re not equ ivalent
  62                    if(t his.studie s == null  && that.st udies != n ull ||
  63                                      this.stu dies != nu ll && that .studies = = null)
  64                             return  false;
  65  
  66                    // i f the numb er of stud ies differ  then the  results ar e not equi valent
  67                    if(t his.studie s.getStudi es().lengt h != that. studies.ge tStudies() .length)
  68                             return  false;
  69                    
  70                    // a t this poi nt we know  that both  instances  have stud ies and bo th instanc es have th e
  71                    // s ame number  of studie s
  72                    // e quivalence  is determ ined on th e same stu dies, the  same study  IDs and t he studies
  73                    // w ith the sa me IDs are  .equals()
  74                    for( StudyType  study : th is.studies .getStudie s())
  75                    {
  76                             boolea n studyMat chFound =  false;
  77                             for(St udyType th atStudy :  that.studi es.getStud ies())
  78                             {
  79                                      // if th e study ID s match th en the res t of the s tudyType m ust match
  80                                      if( stud y.getStudy Id().equal s(thatStud y.getStudy Id()) )
  81                                      {
  82                                               studyMatch Found = tr ue;
  83                                               if(! study .equals(th atStudy))
  84                                                       re turn false ;
  85                                               break;
  86                                      }
  87                             }
  88                             // no  study with  the same  study ID w as found i n the 'tha t' results
  89                             if(!st udyMatchFo und)
  90                                      return f alse;
  91                    }
  92                    
  93                    retu rn true;
  94           }
  95  
  96           /* *
  97            *  @param fi lespec - t he tab del imited fil e to appen d to. File spec will  be created
  98            *  if it doe s not alre ady exist.  This is a  helper fu nction use d to build  the test  data
  99            *  spreadhsh eet for CP S.
  100            * /
  101           pu blic void  appendStud iesToTabDe limitedFil e(String f ilespec)
  102           {
  103                    Stri ngBuilder  sb = new S tringBuild er();
  104                    
  105                    if ( studies ==  null)
  106                    {
  107                             return ;
  108                    }
  109  
  110                    File  file = ne w File(fil espec);
  111                    if ( file.exist s() == fal se)
  112                    {
  113                             sb.app end("Patie nt/Proc Da te\tStudy\ tSeries\tI nstance\tC ount\tDICO M UID\tDIC OM #\n");  // column  headers
  114                    }
  115                    
  116                    for  (int i = 0  ; i < thi s.studies. getStudies ().length  ; i++)
  117                    {
  118                             StudyT ype study  = this.stu dies.getSt udies(i);
  119                             if (i  == 0)
  120                             {
  121                                      sb.appen d(study.ge tPatientNa me().trim( ) + " (" +  study.get PatientId( ) + ")\n") ; // patie nt line
  122                             }
  123                             sb.app end(transl ateProcedu reDateFrom Dicom(stud y.getProce dureDate() ) + 
  124                                               "\t" + " S tudy:" + s tudy.getSt udyId() + 
  125                                               "(" + stud y.getProce dureDescri ption() +  " - " + st udy.getDes cription()  +
  126                                               ")\t\t\t"  + study.ge tSeriesCou nt() +   
  127                                               "\t" + stu dy.getDico mUid() + " \n"); // s tudy line
  128                             
  129                             StudyT ypeCompone ntSeries c omponentSe ries = stu dy.getComp onentSerie s();
  130                             for (i nt j = 0 ;  j < study .getSeries Count() ;  j++)
  131                             {
  132                                      SeriesTy pe series  = componen tSeries.ge tSeries(j) ;
  133                                      sb.appen d("\t\tSer ies:" + se ries.getSe riesId() +   
  134                                                       "\ t\t" + ser ies.getIma geCount()  + "\t" + s eries.getD icomUid() 
  135                                                       "\ t" + serie s.getDicom SeriesNumb er()+ "\n" ); // seri es line
  136           
  137                                      SeriesTy peComponen tInstances  component Instances  = series.g etComponen tInstances ();
  138                                      for (int  k = 0 ; k  < series. getImageCo unt() ; k+ +)
  139                                      {
  140                                               InstanceTy pe image =  component Instances. getInstanc e(k);
  141                                               // sb.appe nd("\t\t\t Image:" +  image.getI mageId() +       
  142                                               sb.append( "\t\t\tIma ge:" + ima ge.getImag eUrn() +         
  143                                                                "\t\ t" + image .getDicomU id() + 
  144                                                                "\t"  + image.g etDicomIns tanceNumbe r() + "\n" ); // inst ance line
  145                                      }
  146                             }
  147                    }
  148                    
  149                    File Writer wri ter = null ;
  150                    Stri ng results  = sb.toSt ring();
  151                    
  152                    try  {
  153                             writer  = new Fil eWriter(fi le, true);
  154                             writer .write(res ults);
  155                             writer .close();
  156                    } ca tch (IOExc eption e)  {
  157                             e.prin tStackTrac e();
  158                    }
  159                    
  160           }
  161           
  162           pr ivate Stri ng transla teProcedur eDateFromD icom(Strin g dateStri ng)
  163           {
  164                    Stri ng procedu reDateStri ng = "";
  165                    if ( dateString  != null)
  166                    {
  167                             String  trimmedDa teString =  dateStrin g.trim();
  168                             if (tr immedDateS tring.leng th() > 0)
  169                             {
  170                                      DateForm at procedu reDateForm at = null;
  171                                      DateForm at dicomDa teFormat =  new Dicom DateFormat ();
  172                                      if (date String.tri m().length () > 8)
  173                                      {
  174                                               procedureD ateFormat  = new Simp leDateForm at("MM/dd/ yyyy HH:mm ");
  175                                      }
  176                                      else
  177                                      {
  178                                               procedureD ateFormat  = new Simp leDateForm at("MM/dd/ yyyy");
  179                                      }
  180                                      
  181                                      Date pro cedureDate  = null;
  182                                      try 
  183                                      {
  184                                               procedureD ate = dico mDateForma t.parse(tr immedDateS tring);
  185                                      } 
  186                                      catch (P arseExcept ion e) 
  187                                      {
  188                                               e.printSta ckTrace();
  189                                      }
  190                                      procedur eDateStrin g = proced ureDateFor mat.format (procedure Date);
  191                             }
  192                    }
  193                    retu rn procedu reDateStri ng;
  194           }
  195   }
  196