88. EPMO Open Source Coordination Office Redaction File Detail Report

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

88.1 Files compared

# Location File Last Modified
1 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ClinicalDisplayWebApp\main\src\java\gov\va\med\imaging\clinicaldisplay\webservices\translator ClinicalDisplayTranslator.java Mon Dec 4 21:35:20 2017 UTC
2 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ClinicalDisplayWebApp\main\src\java\gov\va\med\imaging\clinicaldisplay\webservices\translator ClinicalDisplayTranslator.java Mon Dec 4 21:58:17 2017 UTC

88.2 Comparison summary

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

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

88.4 Active regular expressions

No regular expressions were active.

88.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: Feb  4, 2008
  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.cli nicaldispl ay.webserv ices.trans lator;
  27  
  28   import gov .va.med.Gl obalArtifa ctIdentifi er;
  29   import gov .va.med.SE RIALIZATIO N_FORMAT;
  30   import gov .va.med.UR NFactory;
  31   import gov .va.med.im aging.Bhie StudyURN;
  32   import gov .va.med.im aging.Imag eURN;
  33   import gov .va.med.im aging.exce ptions.URN FormatExce ption;
  34   import gov .va.med.im aging.exch ange.Image AccessLogE vent.Image AccessLogE ventType;
  35   import gov .va.med.im aging.exch ange.busin ess.Image;
  36   import gov .va.med.im aging.exch ange.busin ess.Series ;
  37   import gov .va.med.im aging.exch ange.busin ess.Study;
  38   import gov .va.med.im aging.exch ange.busin ess.StudyF ilter;
  39   import gov .va.med.im aging.exch ange.busin ess.util.E xchangeUti l;
  40   import gov .va.med.im aging.exch ange.Image AccessLogE vent;
  41  
  42   import jav a.math.Big Integer;
  43   import jav a.text.Dat eFormat;
  44   import jav a.text.Par seExceptio n;
  45   import jav a.text.Sim pleDateFor mat;
  46   import jav a.util.Dat e;
  47   import jav a.util.Ite rator;
  48   import jav a.util.Lis t;
  49  
  50   import org .apache.lo gging.log4 j.LogManag er;
  51   import org .apache.lo gging.log4 j.Logger;
  52  
  53   /**
  54    * @author         
WERFEJ
  55    *
  56    */
  57   public cla ss Clinica lDisplayTr anslator 
  58   {
  59           pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(Clin icalDispla yTranslato r.class);
  60           
  61           pr ivate fina l static S tring clin icalDispla yWebservic eDateForma t = "MM/dd /yyyy";
  62           
  63           pu blic Clini calDisplay Translator ()
  64           {
  65                    supe r();
  66           }
  67           
  68           //  be carefu l about re -using Sim pleDateFor mat instan ces becaus e they are  not threa d-safe 
  69           pr ivate Date Format get ClinicalDi splayWebse rviceDateF ormat()
  70           {
  71                    retu rn new Sim pleDateFor mat(clinic alDisplayW ebserviceD ateFormat) ;
  72           }
  73           
  74           /* *
  75            *  Transform  a clinica l display  webservice  FilterTyp e to an in ternal Fil ter instan ce.
  76            *  
  77            * /
  78           pu blic Study Filter tra nsformFilt er(gov.va. med.imagin g.clinical display.we bservices. soap.Filte rType filt erType) 
  79           {
  80                    Stud yFilter fi lter = new  StudyFilt er();
  81                    
  82                    if(f ilterType  != null) 
  83                    {
  84                             DateFo rmat df =  getClinica lDisplayWe bserviceDa teFormat() ;
  85                             
  86                             Date f romDate =  null;
  87                             try
  88                             {
  89                                      fromDate  = filterT ype.getFro mDate() ==  null  ||  filterType .getFromDa te().lengt h() == 0 ?  null : df .parse(fil terType.ge tFromDate( ));
  90                             } 
  91                             catch  (ParseExce ption x)
  92                             {
  93                                      logger.e rror("Pars eException  convertin g webservi ce format  string fro m-date '"  +  filterT ype.getFro mDate() +  "' to inte rnal Date" , x);
  94                                      fromDate  = null;
  95                             }
  96                             
  97                             Date t oDate = nu ll;
  98                             try
  99                             {
  100                                      toDate =  filterTyp e.getToDat e() == nul l || filte rType.getT oDate().le ngth() ==  0 ? null :  df.parse( filterType .getToDate ());
  101                             } 
  102                             catch  (ParseExce ption x)
  103                             {
  104                                      logger.e rror("Pars eException  convertin g webservi ce format  string to- date '" +   filterTyp e.getToDat e() + "' t o internal  Date", x) ;
  105                                      fromDate  = null;
  106                             }
  107                             
  108                             // som e business  rules for  the filte r dates
  109                             if (fr omDate !=  null && to Date == nu ll)
  110                             {
  111                                      // defau lt toDate  to today
  112                                      toDate =  new Date( );
  113                             }
  114                             else i f (fromDat e == null  && toDate  != null)
  115                             {
  116                                      // defau lt to unfi ltered
  117                                      toDate =  null;
  118                             }
  119                             
  120                             filter .setFromDa te(fromDat e);
  121                             filter .setToDate (toDate);
  122                             
  123                             filter .setStudy_ class(filt erType.get _class() = = null ? " " : filter Type.get_c lass());
  124                             filter .setStudy_ event(filt erType.get Event() ==  null ? ""  : filterT ype.getEve nt());
  125                             filter .setStudy_ package(fi lterType.g et_package () == null  ? "" : fi lterType.g et_package ());
  126                             filter .setStudy_ specialty( filterType .getSpecia lty() == n ull ? "" :  filterTyp e.getSpeci alty());
  127                             filter .setStudy_ type(filte rType.getT ypes() ==  null ? ""  : filterTy pe.getType s());
  128                             
  129                             if(fil terType.ge tOrigin()  == null) {
  130                                      filter.s etOrigin(" ");
  131                             }
  132                             else {
  133                                      if("UNSP ECIFIED".e quals(filt erType.get Origin().g etValue()) ) {
  134                                               filter.set Origin("") ;
  135                                      }
  136                                      else {
  137                                               filter.set Origin(fil terType.ge tOrigin(). getValue() );
  138                                      }
  139                             }
  140                             // don 't have a  study id u sed here
  141                    }
  142                    retu rn filter;
  143           }
  144           
  145           pu blic gov.v a.med.imag ing.clinic aldisplay. webservice s.soap.Sha llowStudyT ype[] tran sformStudi esToShallo wStudies(L ist<Study>  studyList
  146           th rows URNFo rmatExcept ion 
  147           {
  148                    if(s tudyList = = null ||  studyList. size() ==  0)
  149                             return  null;
  150                    
  151                    gov. va.med.ima ging.clini caldisplay .webservic es.soap.Sh allowStudy Type [] re s = 
  152                             new go v.va.med.i maging.cli nicaldispl ay.webserv ices.soap. ShallowStu dyType[stu dyList.siz e()];
  153                    
  154                    int  index=0;
  155                    for( Iterator<S tudy> stud iesIter =  studyList. iterator() ; studiesI ter.hasNex t(); ++ind ex)
  156                             res[in dex] = tra nsformStud yToShallow Study(stud iesIter.ne xt());
  157                    
  158                    retu rn res;
  159           }
  160           
  161           pu blic gov.v a.med.imag ing.clinic aldisplay. webservice s.soap.Sha llowStudyT ype transf ormStudyTo ShallowStu dy(Study s tudy) 
  162           th rows URNFo rmatExcept ion 
  163           {
  164                    if(s tudy == nu ll)
  165                             return  null;
  166                    
  167                    gov. va.med.ima ging.clini caldisplay .webservic es.soap.Sh allowStudy Type resul t = 
  168                             new go v.va.med.i maging.cli nicaldispl ay.webserv ices.soap. ShallowStu dyType();
  169                    
  170                    resu lt.setDesc ription(st udy.getDes cription() );
  171                    //re sult.setDi comImageNu mber(study .get);
  172                    //re sult.setDi comSequenc eNumber(st udy.getst)
  173                    resu lt.setEven t(study.ge tEvent());
  174                    resu lt.setImag eCount(Big Integer.va lueOf(stud y.getImage Count()));
  175                    resu lt.setImag ePackage(s tudy.getIm agePackage ());
  176                    resu lt.setImag eType(stud y.getImage Type());
  177                    resu lt.setNote Title(stud y.getNoteT itle());
  178                    resu lt.setOrig in(study.g etOrigin() );
  179                    resu lt.setPati entIcn(stu dy.getPati entId());
  180                    resu lt.setPati entName(st udy.getPat ientName() );
  181                    resu lt.setProc edure(stud y.getProce dure());
  182                    resu lt.setRadi ologyRepor t(study.ge tRadiology Report());
  183                    resu lt.setSite Number(stu dy.getSite Number());
  184                    resu lt.setSpec ialty(stud y.getSpeci alty());
  185                    
  186                    // 2 /19/08 - n ow include  the site  name so th e Display  client sho ws what sp ecific DOD  facility  the study  is from
  187                    if(E xchangeUti l.isSiteDO D(study.ge tSiteNumbe r()))
  188                    {
  189                             result .setSiteAb breviation (study.get SiteAbbr() + (study.g etSiteName () != null  ? "-" + s tudy.getSi teName() :  ""));                          
  190                    }
  191                    else
  192                    {
  193                             result .setSiteAb breviation (study.get SiteAbbr() );
  194                    }                                  
  195                    resu lt.setStud yPackage(s tudy.getIm agePackage ());
  196                    resu lt.setStud yClass(stu dy.getStud yClass() = = null ? " " : study. getStudyCl ass()); //  get this  from study
  197                    resu lt.setStud yType(stud y.getImage Type());
  198                    resu lt.setCapt ureDate(st udy.getCap tureDate() );
  199                    resu lt.setCapt uredBy(stu dy.getCapt ureBy());               
  200                    if(s tudy.getPr ocedureDat e() == nul l)
  201                    {
  202                             logger .warn("Set ting null  procedure  date for s tudy");
  203                             result .setProced ureDate("" );
  204                    }
  205                    else
  206                    {
  207                             result .setProced ureDate(ge tClinicalD isplayWebs erviceDate Format().f ormat(stud y.getProce dureDate() ));
  208                    }
  209                    resu lt.setRpcR esponseMsg (study.get RpcRespons eMsg());
  210                    
  211                    // J MW - need  to find se ries for f irst image , ugly but  necessary
  212                    Seri es firstSe ries = nul l;
  213                    for( Series ser ies : stud y.getSerie s())
  214                    {
  215                             for(Im age image  : series)
  216                             {
  217                                      if(image .equals(st udy.getFir stImage()) )
  218                                      {
  219                                               firstSerie s = series ;
  220                                               break;
  221                                      }                                                   
  222                             }
  223                             if(fir stSeries ! = null)
  224                             {
  225                                      break;
  226                             }                          
  227                    }
  228                    /*
  229                    bool ean found  = false;
  230                    for( Image imag e : firstS eries.getI mages())
  231                    {
  232                             if(ima ge.getIen( ).equals(s tudy.getFi rstImage() .getIen()) )
  233                             {
  234                                      System.o ut.println ("Found fi rst image  in first s eries");
  235                                      found=tr ue;
  236                                      break;
  237                             }
  238                    }
  239                    if(! found)
  240                    {
  241                             System .out.print ln("Did no t find fir st image i n first se ries");
  242                    }
  243                    */
  244                    
  245                    gov. va.med.ima ging.clini caldisplay .webservic es.soap.Fa tImageType  firstImag e = 
  246                             transf ormImageTo FatImage(s tudy.getFi rstImage() , firstSer ies);
  247                    
  248                    resu lt.setFirs tImage(fir stImage);
  249                    
  250                    // n eed to add  site numb er field
  251                    
  252                    Glob alArtifact Identifier  studyIden tifier;
  253                    if(" 200".equal s(study.ge tSiteNumbe r()))
  254                             studyI dentifier  = BhieStud yURN.creat e(study.ge tStudyIen( ), study.g etPatientI d());
  255                    else
  256                             studyI dentifier  = study.ge tStudyUrn( );// Study URN.create (study.get SiteNumber (), study. getStudyIe n(), study .getPatien tIcn());
  257                    
  258                    resu lt.setStud yId(studyI dentifier. toString() );
  259                    
  260                    retu rn result;
  261           }
  262           
  263           pu blic gov.v a.med.imag ing.clinic aldisplay. webservice s.soap.Fat ImageType[ ] transfor mStudyToFa tImages(St udy study)  
  264           th rows URNFo rmatExcept ion 
  265           {
  266                    if(s tudy == nu ll)
  267                             return  null;
  268                    if(s tudy.getSe ries() ==  null)
  269                             return  null;
  270                    
  271                    gov. va.med.ima ging.clini caldisplay .webservic es.soap.Fa tImageType [] result 
  272                             new go v.va.med.i maging.cli nicaldispl ay.webserv ices.soap. FatImageTy pe[study.g etImageCou nt()];
  273                    
  274                    int  index=0;
  275                    //fo r(Iterator <Image> im agesIter =  images.it erator();  imagesIter .hasNext() ; ++index)
  276                    //       result [index] =  transformI mageToFatI mage(image sIter.next ());
  277                    
  278                    for( Series ser ies : stud y.getSerie s())
  279                    {
  280                             if(ser ies != nul l)
  281                             {
  282                                      for(Imag e image :  series)
  283                                      {
  284                                               result[ind ex] = tran sformImage ToFatImage (image, se ries);
  285                                               index++;
  286                                      }
  287                             }
  288                                       
  289                    }
  290                    retu rn result;
  291           }
  292           
  293           /*
  294           pu blic gov.v a.med.imag ing.clinic aldisplay. webservice s.soap.Fat ImageType[ ] transfor mImagesToF atImages(L ist<Image>  images) 
  295           th rows Imagi ngURNForma tException  
  296           {
  297                    if(i mages == n ull)
  298                             return  null;
  299                    
  300                    gov. va.med.ima ging.clini caldisplay .webservic es.soap.Fa tImageType [] result 
  301                             new go v.va.med.i maging.cli nicaldispl ay.webserv ices.soap. FatImageTy pe[images. size()];
  302                    
  303                    int  index=0;
  304                    for( Iterator<I mage> imag esIter = i mages.iter ator(); im agesIter.h asNext();  ++index)
  305                             result [index] =  transformI mageToFatI mage(image sIter.next ());
  306                    
  307                    retu rn result;
  308           }
  309           */
  310  
  311           pu blic gov.v a.med.imag ing.clinic aldisplay. webservice s.soap.Fat ImageType  transformI mageToFatI mage(
  312                    Imag e image, 
  313                    Seri es series)  
  314           th rows URNFo rmatExcept ion 
  315           {
  316                    if(i mage == nu ll)
  317                             return  null;
  318                    
  319                    gov. va.med.ima ging.clini caldisplay .webservic es.soap.Fa tImageType  result = 
  320                             new go v.va.med.i maging.cli nicaldispl ay.webserv ices.soap. FatImageTy pe();
  321                    
  322                    resu lt.setDesc ription(im age.getDes cription() );
  323                    resu lt.setDico mImageNumb er(image.g etDicomIma geNumberFo rDisplay() );
  324                    //re sult.setDi comSequenc eNumber(im age.getDic omSequence NumberForD isplay());
  325                    resu lt.setDico mSequenceN umber((ser ies != nul l) && (ser ies.getSer iesNumber( ) != null)  && (serie s.getSerie sNumber(). length() >  0) ? seri es.getSeri esNumber()  : image.g etDicomSeq uenceNumbe rForDispla y());
  326                    resu lt.setPati entIcn(ima ge.getPati entId());
  327                    resu lt.setPati entName(im age.getPat ientName() );
  328                    resu lt.setProc edure(imag e.getProce dure());
  329                    if(i mage.getPr ocedureDat e() == nul l)
  330                    {
  331                             logger .warn("Set ting null  procedure  date for i mage");
  332                             result .setProced ureDate("" );
  333                    }
  334                    else  
  335                    {
  336                             result .setProced ureDate(ge tClinicalD isplayWebs erviceDate Format().f ormat(imag e.getProce dureDate() ));
  337                    }
  338                    resu lt.setSite Number(ima ge.getSite Number());
  339                    resu lt.setSite Abbr(image .getSiteAb br());
  340                    resu lt.setImag eClass(ima ge.getImag eClass());
  341                    resu lt.setAbsL ocation(im age.getAbs Location() );
  342                    resu lt.setFull Location(i mage.getFu llLocation ());
  343                    
  344                    resu lt.setQaMe ssage(imag e.getQaMes sage());
  345                    resu lt.setImag eType(BigI nteger.val ueOf(image .getImgTyp e()));
  346  
  347                    // T he URN cla sses are r esponsible  for seria lizing the mselves us ing a file name safe  character  set
  348                    resu lt.setImag eId( image .getGlobal ArtifactId entifier() .toString( SERIALIZAT ION_FORMAT .CDTP) );
  349                             
  350                    //re sult.setIm ageUrn(ima geUrn.toSt ring());
  351                    resu lt.setAbsI mageURI("i mageURN="  + result.g etImageId( ) + "&imag eQuality=2 0&contentT ype=image/ jpeg");
  352                    resu lt.setFull ImageURI(" imageURN="  + result. getImageId () + "&ima geQuality= 70&content Type=appli cation/dic om");
  353                    resu lt.setBigI mageURI("i mageURN="  + result.g etImageId( ) + "&imag eQuality=9 0&contentT ype=applic ation/dico m");
  354                    /*
  355                    if(i mage.getOb jectOrigin () == Obje ctOrigin.D OD) {
  356                             result .setAbsIma geURI("ima geURN=" +  imageUrn.t oString()  + "&imageQ uality=20& contentTyp e=image/jp eg");
  357                             result .setFullIm ageURI("im ageURN=" +  imageUrn. toString()  + "&image Quality=70 &contentTy pe=applica tion/dicom ");
  358                             result .setBigIma geURI("ima geURN=" +  imageUrn.t oString()  + "&imageQ uality=90& contentTyp e=applicat ion/dicom" );
  359                    }
  360                    else  {
  361                             if(("" .equals(im age.getFul lFilename( ))) || (im age.getFul lFilename( ).startsWi th("-1")))  {
  362                                      result.s etFullImag eURI(image .getFullFi lename());  // put in  error sta te
  363                             }
  364                             else {
  365                                      result.s etFullImag eURI("imag eURN=" + i mageUrn.to String() +  "&imageQu ality=70&c ontentType =applicati on/dicom") ;
  366                             }
  367                             if(("" .equals(im age.getAbs Filename() )) || (ima ge.getAbsF ilename(). startsWith ("-1"))) {
  368                                      result.s etAbsImage URI(image. getAbsFile name());
  369                             }
  370                             else {
  371                                      result.s etAbsImage URI("image URN=" + im ageUrn.toS tring() +  "&imageQua lity=20&co ntentType= image/jpeg ");
  372                             }
  373                             if(("" .equals(im age.getBig Filename() )) || (ima ge.getBigF ilename(). startsWith ("-1"))) {
  374                                      result.s etBigImage URI(image. getBigFile name());
  375                             }
  376                             else {
  377                                      result.s etBigImage URI("image URN=" + im ageUrn.toS tring() +  "&imageQua lity=90&co ntentType= applicatio n/dicom");
  378                             }
  379                    }
  380                    */
  381                    retu rn result;
  382           }
  383           
  384           pu blic Image AccessLogE vent trans formLogEve nt(gov.va. med.imagin g.clinical display.we bservices. soap.Image AccessLogE ventType l ogEventTyp e) 
  385           th rows URNFo rmatExcept ion 
  386           {
  387                    if(l ogEventTyp e == null)
  388                             return  null;
  389                    Imag eURN image Urn = null ;
  390                    //im ageUrn = I mageURN.pa rse(logEve ntType.get ImageId()) ;
  391                    imag eUrn = URN Factory.cr eate(logEv entType.ge tImageId() , SERIALIZ ATION_FORM AT.CDTP, I mageURN.cl ass);
  392                    // m oved to Cl inicalDisp layWebserv ices
  393                    //se tTransacti onContext( logEventTy pe.getCred entials()) ;
  394                    Imag eAccessLog EventType  imageAcces sLogEventT ype = tran sformLogEv entType(lo gEventType .getEventT ype());
  395                    Imag eAccessLog Event resu lt = 
  396                             new Im ageAccessL ogEvent(im ageUrn.get ImageId(),  "", logEv entType.ge tPatientIc n(), 
  397                                               imageUrn.g etOriginat ingSiteId( ), System. currentTim eMillis(),  
  398                                               logEventTy pe.getReas on(), "",  imageAcces sLogEventT ype, 
  399                                               logEventTy pe.getCred entials(). getSiteNum ber());
  400                    
  401                    retu rn result;
  402           }
  403  
  404           pu blic Image AccessLogE ventType t ransformLo gEventType (gov.va.me d.imaging. clinicaldi splay.webs ervices.so ap.ImageAc cessLogEve ntTypeEven tType even tType) {
  405                    Imag eAccessLog EventType  result;//  = new gov. va.med.ima ging.excha nge.enums. ImageAcces sLogEventT ype();
  406                    if(e ventType = = gov.va.m ed.imaging .clinicald isplay.web services.s oap.ImageA ccessLogEv entTypeEve ntType.IMA GE_COPY) {
  407                             result  = ImageAc cessLogEve ntType.IMA GE_COPY;
  408                    }
  409                    else  {
  410                             result  = ImageAc cessLogEve ntType.IMA GE_PRINT;
  411                    }
  412                    retu rn result;
  413           }
  414   }