394. EPMO Open Source Coordination Office Redaction File Detail Report

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

394.1 Files compared

# Location File Last Modified
1 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\VistaImagingDataSourceProvider\main\src\java\gov\va\med\imaging\vistaimagingdatasource VistaImageDataSourceService.java Mon Dec 4 21:34:52 2017 UTC
2 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\VistaImagingDataSourceProvider\main\src\java\gov\va\med\imaging\vistaimagingdatasource VistaImageDataSourceService.java Mon Dec 4 22:06:47 2017 UTC

394.2 Comparison summary

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

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

394.4 Active regular expressions

No regular expressions were active.

394.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  5, 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.vis taimagingd atasource;
  27  
  28   import gov .va.med.im aging.arti factsource .ResolvedA rtifactSou rce;
  29   import gov .va.med.im aging.conv ersion.Ima geConversi onUtility;
  30   import gov .va.med.im aging.conv ersion.enu ms.ImageCo nversionSa tisfaction ;
  31   import gov .va.med.im aging.core .interface s.exceptio ns.Connect ionExcepti on;
  32   import gov .va.med.im aging.core .interface s.exceptio ns.MethodE xception;
  33   import gov .va.med.im aging.data source.exc eptions.In validCrede ntialsExce ption;
  34   import gov .va.med.im aging.exch ange.busin ess.Image;
  35   import gov .va.med.im aging.prot ocol.vista .VistaImag ingTransla tor;
  36   import gov .va.med.im aging.tran sactioncon text.Trans actionCont extFactory ;
  37   import gov .va.med.im aging.url. vista.Stri ngUtils;
  38   import gov .va.med.im aging.url. vista.Vist aQuery;
  39   import gov .va.med.im aging.url. vista.exce ptions.Inv alidVistaC redentials Exception;
  40   import gov .va.med.im aging.url. vista.exce ptions.Vis taMethodEx ception;
  41   import gov .va.med.im aging.vist a.storage. SmbStorage Utility;
  42   import gov .va.med.im aging.vist adatasourc e.session. VistaSessi on;
  43   import gov .va.med.im aging.vist aimagingda tasource.c ommon.Vist aImagingCo mmonUtilit ies;
  44  
  45   import jav a.io.IOExc eption;
  46   import jav a.util.Has hMap;
  47  
  48   import org .apache.lo gging.log4 j.LogManag er;
  49   import org .apache.lo gging.log4 j.Logger;
  50  
  51   /**
  52    * Impleme ntation of  the Image DataSource Spi for re trieving i mages from  a VistA s ystem
  53    * 
  54    * @author         
WERFEJ
  55    *
  56    */
  57   public cla ss VistaIm ageDataSou rceService  
  58   extends Ab stractBase VistaImage Service 
  59   {
  60           
  61           pu blic final  static bo olean USE_ ASYNCHRONO US_DISCONN ECT = fals e;         // set to  true to us e asynchro nous Vista Connection
  62  
  63           pu blic final  static St ring SUPPO RTED_PROTO COL = "vis taimaging" ;
  64           
  65           pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(Vist aImageData SourceServ ice.class) ;
  66           
  67   //      pr ivate fina l static N etworkLoca tionCacheM anager net workLocati onCache =  new Networ kLocationC acheManage r();
  68           
  69           //  The requi red versio n of VistA  Imaging n eeded to e xecute the  RPC calls  for this  operation
  70           //  patch 66  has the HI S update R PC call bu t its not  registered  to MAG WI NDOWS - th is doesn't  happen un til
  71           //  Patch 83,  so P83 is  required  for image  retrieval.
  72           pu blic final  static St ring MAG_R EQUIRED_VE RSION = "3 .0P83"; 
  73           
  74           pr ivate fina l static S tring DICO M_SOP_INST ANCE_UID_F IELD = "00 08,0018"; 
  75           
  76            / **
  77            *  @param re solvedArti factSource
  78            *  @param pr otocol
  79            * /
  80           pu blic Vista ImageDataS ourceServi ce(Resolve dArtifactS ource reso lvedArtifa ctSource,  String pro tocol)
  81           {
  82                    supe r(resolved ArtifactSo urce, prot ocol);
  83           th is.imageCo nversionUt ility = ne w ImageCon versionUti lity(new S mbStorageU tility(), 
  84                             ImageC onversionS atisfactio n.SATISFY_ ALLOWED_CO MPRESSION,  true);
  85           }
  86  
  87           
  88           /*  (non-Java doc)
  89            *  @see gov. va.med.ima ging.vista datasource .AbstractB aseVistaIm ageService #getRequir edVistaIma gingVersio n()
  90            * /
  91           @O verride
  92           pr otected St ring getRe quiredVist aImagingVe rsion() 
  93           {
  94                    retu rn VistaIm agingCommo nUtilities .getVistaD ataSourceI magingVers ion(
  95                                      VistaIma gingDataSo urceProvid er.getVist aConfigura tion(), th is.getClas s(), 
  96                                      MAG_REQU IRED_VERSI ON);
  97           }                 
  98           
  99           /*  (non-Java doc)
  100            *  @see gov. va.med.ima ging.vista datasource .AbstractB aseVistaIm ageService #getImageH ISUpdates( gov.va.med .imaging.v istadataso urce.sessi on.VistaSe ssion, gov .va.med.im aging.exch ange.busin ess.Image)
  101            * /
  102           @O verride
  103           pr otected Ha shMap<Stri ng, String > getImage HISUpdates (
  104                    Vist aSession v istaSessio n, Image i mage) 
  105           th rows Metho dException , Connecti onExceptio n, IOExcep tion 
  106           {
  107                    // C TB 29Nov20 09
  108                    //St ring decod edImageIen  = Base32C onversionU tility.bas e32Decode( image.getI en());
  109                    Stri ng decoded ImageIen =  image.get Ien();
  110                    logg er.info("g etImageHIS Updates("  + decodedI mageIen +  ") Transac tionContex t (" + Tra nsactionCo ntextFacto ry.get().g etDisplayI dentity()  + ").");
  111                    Hash Map<String , String>  hisUpdate  = null;
  112                    Vist aQuery his UpdateQuer y = VistaI magingQuer yFactory.c reateGetHi sUpdateQue ry(decoded ImageIen);
  113                    
  114                    Stri ng rtn = n ull;
  115                    try
  116                    {
  117                             rtn =  vistaSessi on.call(hi sUpdateQue ry);                 
  118                             logger .debug("Re sult from  HisUpdate  RPC [" + r tn + "]");
  119                             hisUpd ate = Vist aImagingTr anslator.c onvertVist aHisUpdate ToHashmap( rtn);                   
  120                             String  value = h isUpdate.g et(DICOM_S OP_INSTANC E_UID_FIEL D);
  121                             if(val ue != null )
  122                             {
  123                                      logger.d ebug("His  Update con tains DICO M SOP INST ANCE UID f ield");
  124                                      // check  for error  in tag va lue
  125                                      String e Message =  StringUtil s.MagPiece (value, St ringUtils. COMMA, 1);
  126                                      if("-1". equals(eMe ssage)) {                                         
  127                                               value = ge tNewSopIns tanceUID(v istaSessio n, decoded ImageIen);
  128                                               logger.inf o("DICOM S OP INSTANC E UID fiel d is missi ng, puttin g in new v alue[ " +  value + "] ");
  129                                               hisUpdate. put(DICOM_ SOP_INSTAN CE_UID_FIE LD, value) ;
  130                                      }
  131                             }
  132                    }
  133                    catc h(VistaMet hodExcepti on vmX)
  134                    {
  135                             logger .error("Er ror retrie ving HIS u pdate for  image [" +  decodedIm ageIen + " ]", vmX);
  136                             // thi s error oc curs if th ere was so mething wr ong callin g the RPC  - this sho uld not pr event
  137                             // the  image fro m being di splayed.
  138                             // not  really su re if shou ld return  empty map  or null, t rying null  for now w hich will  make
  139                             // ima ge convers ion not wo rk but sho uld not st op image f rom being  retrieved  and conver ted to non -DICOM
  140                             //thro w new Meth odExceptio n(vmX);
  141                             return  null;
  142                    }
  143                    catc h(InvalidV istaCreden tialsExcep tion ivcX)
  144                    {
  145                             logger .error("Er ror retrie ving HIS u pdate for  image [" +  decodedIm ageIen + " ]", ivcX);
  146                             throw  new Invali dCredentia lsExceptio n(ivcX);
  147                    }
  148                    retu rn hisUpda te;
  149           }
  150  
  151           pr ivate Stri ng getNewS opInstance UID(VistaS ession vis taSession,  String de codedImage Ien) 
  152           th rows Metho dException , Connecti onExceptio n, IOExcep tion
  153           {
  154                    logg er.info("g etNewSopIn stanceUID( " + decode dImageIen  + ") Trans actionCont ext (" + T ransaction ContextFac tory.get() .getDispla yIdentity( ) + ").");
  155                    
  156                    Vist aQuery new SopInstanc eUidQuery  = VistaIma gingQueryF actory.cre ateNewSOPI nstanceUid Query(getS ite().getS iteNumber( ), decoded ImageIen);
  157                    Stri ng rtn = n ull;
  158                    try
  159                    {
  160                             rtn =  vistaSessi on.call(ne wSopInstan ceUidQuery );
  161                             return  rtn.trim( );
  162                    }
  163                    catc h(VistaMet hodExcepti on vmX)
  164                    {
  165                             logger .error("Er ror create  new SOP I nstance UI D for imag e [" + dec odedImageI en + "]",  vmX);
  166                             throw  new Method Exception( vmX);
  167                    }
  168                    catc h(InvalidV istaCreden tialsExcep tion ivcX)
  169                    {
  170                             logger .error("Er ror create  new SOP I nstance UI D for imag e [" + dec odedImageI en + "]",  ivcX);
  171                             throw  new Invali dCredentia lsExceptio n(ivcX);
  172                    }
  173           }
  174  
  175           @O verride
  176           pr otected Vi staQuery g etImageInf ormationQu ery(String  identifie r,
  177                             boolea n includeD eletedImag es)
  178           {
  179                    retu rn VistaIm agingQuery Factory.cr eateGetIma geInformat ionQuery(i dentifier) ;
  180           }
  181  
  182           @O verride
  183           pr otected St ring getDa taSourceVe rsion()
  184           {
  185                    retu rn "1";
  186           }
  187   }