385. EPMO Open Source Coordination Office Redaction File Detail Report

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

385.1 Files compared

# Location File Last Modified
1 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\VistaDataSource\main\src\java\gov\va\med\imaging\vistadatasource VistaPatientDataSourceService.java Mon Dec 4 21:34:34 2017 UTC
2 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\VistaDataSource\main\src\java\gov\va\med\imaging\vistadatasource VistaPatientDataSourceService.java Mon Dec 4 22:06:29 2017 UTC

385.2 Comparison summary

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

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

385.4 Active regular expressions

No regular expressions were active.

385.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: Apr  10, 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 tadatasour ce;
  27  
  28   import gov .va.med.He althSummar yURN;
  29   import gov .va.med.Pa tientIdent ifier;
  30   import gov .va.med.Ro utingToken ;
  31   import gov .va.med.im aging.arti factsource .ResolvedA rtifactSou rce;
  32   import gov .va.med.im aging.core .interface s.exceptio ns.Connect ionExcepti on;
  33   import gov .va.med.im aging.core .interface s.exceptio ns.MethodE xception;
  34   import gov .va.med.im aging.core .interface s.exceptio ns.Securit yCredentia lsExpiredE xception;
  35   import gov .va.med.im aging.data source.Abs tractVersi onableData Source;
  36   import gov .va.med.im aging.data source.Pat ientDataSo urceSpi;
  37   import gov .va.med.im aging.data source.exc eptions.Un supportedS erviceMeth odExceptio n;
  38   import gov .va.med.im aging.exch ange.busin ess.Health SummaryTyp e;
  39   import gov .va.med.im aging.exch ange.busin ess.Patien t;
  40   import gov .va.med.im aging.exch ange.busin ess.Patien tMeansTest Result;
  41   import gov .va.med.im aging.exch ange.busin ess.Patien tPhotoID;
  42   import gov .va.med.im aging.exch ange.busin ess.Patien tPhotoIDIn formation;
  43   import gov .va.med.im aging.exch ange.busin ess.Patien tSensitive Value;
  44   import gov .va.med.im aging.exch ange.busin ess.Resolv edSite;
  45   import gov .va.med.im aging.exch ange.busin ess.Site;
  46   import gov .va.med.im aging.exch ange.enums .ImagingSe curityCont extType;
  47   import gov .va.med.im aging.tran sactioncon text.Trans actionCont extFactory ;
  48   import gov .va.med.im aging.vist adatasourc e.common.V istaCommon Utilities;
  49   import gov .va.med.im aging.vist adatasourc e.session. VistaSessi on;
  50  
  51   import jav a.io.IOExc eption;
  52   import jav a.io.Input Stream;
  53   import jav a.util.Lis t;
  54   import jav a.util.Sor tedSet;
  55  
  56   import org .apache.lo gging.log4 j.LogManag er;
  57   import org .apache.lo gging.log4 j.Logger;
  58  
  59   /**
  60    * This da ta source  implementa tion shoul d not use  any VistA  Imaging RP C calls.
  61    *  It doe s not do a  real vers ion check,  it always  returns t rue.
  62    * 
  63    * @author         
WERFEJ
  64    *
  65    */
  66   public cla ss VistaPa tientDataS ourceServi ce
  67   extends Ab stractVers ionableDat aSource
  68   implements  PatientDa taSourceSp
  69   {
  70           pr ivate Logg er logger  = LogManag er.getLogg er(this.ge tClass());
  71           pu blic final  static St ring SUPPO RTED_PROTO COL = "vis ta";
  72           
  73           /* *
  74            *  @param re solvedArti factSource
  75            *  @param pr otocol
  76            * /
  77           pu blic Vista PatientDat aSourceSer vice(Resol vedArtifac tSource re solvedArti factSource , String p rotocol)
  78           {
  79                    supe r(resolved ArtifactSo urce, prot ocol);
  80                    if(!  (resolved ArtifactSo urce insta nceof Reso lvedSite)  )
  81                             throw  new Unsupp ortedOpera tionExcept ion("The a rtifact so urce must  be an inst ance of Re solvedSite  and it is  a '" + re solvedArti factSource .getClass( ).getSimpl eName() +  "'.");
  82           }
  83  
  84           /* *
  85            *  The artif act source  must be c hecked in  the constr uctor to a ssure that  it is an  instance
  86            *  of Resolv edSite.
  87            *  
  88            *  @return
  89            * /
  90           pr ivate Reso lvedSite g etResolved Site()
  91           {
  92                    retu rn (Resolv edSite)get ResolvedAr tifactSour ce();
  93           }
  94           
  95           pr ivate Site  getSite()
  96           {
  97                    retu rn getReso lvedSite() .getSite() ;
  98           }
  99           
  100           pr ivate Vist aSession g etVistaSes sion() 
  101       throws  IOExcepti on, Connec tionExcept ion, Metho dException , Security Credential sExpiredEx ception
  102       {
  103                    retu rn getVist aSession(t rue);
  104       }
  105           
  106       privat e VistaSes sion getVi staSession (boolean s etDefaultC ontext) 
  107       throws  IOExcepti on, Connec tionExcept ion, Metho dException , Security Credential sExpiredEx ception
  108       {
  109           if (setDefaul tContext)
  110                    retu rn VistaSe ssion.getO rCreate(ge tMetadataU rl(), getS ite(), Ima gingSecuri tyContextT ype.CPRS_C ONTEXT);
  111           el se
  112                    retu rn VistaSe ssion.getO rCreate(ge tMetadataU rl(), getS ite());
  113       }
  114  
  115           @O verride
  116       public  boolean i sVersionCo mpatible()
  117       {
  118                    // f or this im plementati on we are  not using  any MAG rp c calls, j ust assume  version i s ok
  119                    retu rn true;
  120       }
  121  
  122           @O verride
  123           pu blic List< String> ge tTreatingS ites(Routi ngToken gl obalRoutin gToken, Pa tientIdent ifier pati entIdentif ier,
  124                             boolea n includeT railingCha ractersFor Site200)
  125           th rows Metho dException , Connecti onExceptio
  126           {
  127                    Vist aCommonUti lities.set DataSource MethodAndV ersion("ge tTreatingS ites", get DataSource Version()) ;
  128                    Vist aSession l ocalVistaS ession = n ull;
  129                    logg er.info("g etTreating Sites(" +  patientIde ntifier +  ") Transac tionContex t (" + Tra nsactionCo ntextFacto ry.get().g etDisplayI dentity()  + ").");
  130           tr y
  131           {                          
  132                    // J MW 9/5/201 2
  133                    // t his code i s used in  multiple w ays.  When  DoD users  request s tudies fro m the VA w e get the  treating s ites and i n that cas e the user  is
  134                    // a uthenticat ed by Vist A on stati on 200.  I n that cas e the acco unt has pr ogrammer m ode in sta tion 200 s o we can c all the 
  135                    // V AFCTFU GET  TREATING  SITES rpc.   
  136                    // W hen VA use rs request  DoD data  we call th is RPC on  the CVIX t o ensure t he patient  has actua lly been s een at sit e 200 befo re calling  BHIE.
  137                    // i n that cas e the user  is not au thenticate d by VistA  and must  call the C PRS rpc to  get treat ing sites.
  138                    // W hen VA use rs on the  AWIV want  DoD data t he user is  authentic ated by Vi stA but no t station  200 (anoth er site),  so we need  to call t he CPRS
  139                    // r pc to get  treating s ites
  140                    
  141                    // i f the user  is authen ticated by  VistA tha t means it s a local  login.  Th is means t he standar d RPC to g et treatin g sites sh ould be av ailable
  142                    // i f not loca l authenti cation the n use CPRS  RPC
  143                    
  144                    // J MW 9/11/20 12
  145                    // T here was a  change (a bove) to a lways set  the contex t to CPRS  when getti ng a VistA  session s o no matte r what is  provided i t will use  the 
  146                    // C PRS contex t. In our  internal t est enviro nment usin g the CPRS  context t o call the  VAFCTFU r pc does no t work bec ause the a ccount doe sn't have  programmer  access
  147                    // b ut the acc ount we us e in produ ction does  have prog rammer acc ess.  Usin g the CPRS  rpc shoul d work in  all cases  and makes  things muc h easier
  148                    
  149                    // J MW 9/25/20 12 
  150                    // T he CPRS rp c works pr operly in  our intern al test en vironment  except the  CPRS rpc  by design  does not r eturn the  local site .  In our  internal t est enviro nment 
  151                    // w e use a SL C database  as statio n 200 but  it no long er returns  SLC as a  treating s ite which  causes pro blems for  our intern al tests.   As a resu lt for int ernal test ing
  152                    // w e need to  call a dif ferent RPC  (our old  trusty RPC )
  153                    
  154                    if(V istaDataSo urceProvid er.getVist aConfigura tion().isI nternalTes tEnvironme nt())
  155                    {
  156                             logger .info("Run ning in in ternal tes t environm ent, using  the non-C PRS rpc to  retrieve  treating s ites");
  157                             localV istaSessio n = getVis taSession( false);
  158                             return  VistaComm onUtilitie s.getTreat ingSites(l ocalVistaS ession, pa tientIdent ifier);
  159                    }
  160                    else
  161                    {
  162                             logger .debug("No t running  in interna l test env ironment,  using CPRS  rpc to re trieve tre ating site s");             
  163                             localV istaSessio n = getVis taSession( );                   
  164                             return  VistaComm onUtilitie s.getTreat ingSitesUs ingCprsRpc (localVist aSession,  patientIde ntifier);
  165                    }
  166                    
  167                    /*
  168                    
  169                    Tran sactionCon text trans actionCont ext = Tran sactionCon textFactor y.get();                           
  170                    Stri ng connect edSiteNumb er = getSi te().getSi teNumber() ;
  171                    Stri ng authent icatedSecu rityRealm  = transact ionContext .getRealm( );
  172                    if(t ransaction Context.is Authentica tedByVista () && (con nectedSite Number.equ als(authen ticatedSec urityRealm )))
  173                             return  VistaComm onUtilitie s.getTreat ingSites(l ocalVistaS ession, pa tientIcn);
  174                    else
  175                             return  VistaComm onUtilitie s.getTreat ingSitesUs ingCprsRpc (localVist aSession,  patientIcn );
  176                             */
  177           }
  178           ca tch(IOExce ption ioX)
  179           {
  180                    logg er.error(" Exception  getting Vi stA sessio n", ioX);
  181                    thro w new Conn ectionExce ption(ioX) ;
  182           }
  183           fi nally
  184           {
  185                    try{ localVista Session.cl ose();}cat ch(Throwab le t){}
  186           }
  187           }
  188           
  189       
  190       /* (no n-Javadoc)
  191            *  @see gov. va.med.ima ging.datas ource.Pati entDataSou rce#getPat ientSensit ivityLevel (java.lang .String)
  192            * /
  193           @O verride
  194           pu blic Patie ntSensitiv eValue get PatientSen sitivityLe vel(Routin gToken glo balRouting Token, Pat ientIdenti fier patie ntIdentifi er)
  195           th rows Metho dException , Connecti onExceptio
  196           {
  197                    Vist aCommonUti lities.set DataSource MethodAndV ersion("ge tPatientSe nsitivityL evel", get DataSource Version()) ;
  198                    logg er.info("g etPatientS ensitivity Level(" +  patientIde ntifier +  ") Transac tionContex t (" + Tra nsactionCo ntextFacto ry.get().g etDisplayI dentity()  + ").");                  
  199                    Vist aSession v istaSessio n = null;                          
  200           tr y
  201           {                 
  202                    vist aSession =  getVistaS ession();                 
  203                    retu rn VistaCo mmonUtilit ies.getPat ientSensit ivityValue (vistaSess ion, patie ntIdentifi er);                 
  204           } 
  205           ca tch(IOExce ption ioX)
  206                    {
  207                             logger .error("Ex ception ge tting Vist A session" , ioX);
  208                    thro w new Conn ectionExce ption(ioX) ;
  209                    }
  210                    fina lly
  211           {
  212                    try{ vistaSessi on.close() ;}catch(Th rowable t) {}
  213           }
  214           }
  215  
  216           @O verride
  217           pu blic boole an logPati entSensiti veAccess(R outingToke n globalRo utingToken ,
  218                             Patien tIdentifie r patientI dentifier)  
  219           th rows Metho dException , Connecti onExceptio n
  220           {
  221                    Vist aCommonUti lities.set DataSource MethodAndV ersion("lo gPatientSe nsitiveAcc ess", getD ataSourceV ersion());
  222                    logg er.info("l ogPatientS ensitiveAc cess(" + p atientIden tifier + " ) Transact ionContext  (" + Tran sactionCon textFactor y.get().ge tDisplayId entity() +  ").");
  223                    Vist aSession l ocalVistaS ession = n ull;
  224           tr y
  225           {
  226                    loca lVistaSess ion = getV istaSessio n();
  227                    Vist aCommonUti lities.log Restricted Access(loc alVistaSes sion, pati entIdentif ier);          
  228                    retu rn true;
  229           }
  230           ca tch(IOExce ption ioX)
  231           {
  232                    logg er.error(" Exception  getting Vi stA sessio n", ioX);
  233                    thro w new Conn ectionExce ption(ioX) ;
  234           }
  235           fi nally
  236           {
  237                    try{ localVista Session.cl ose();}cat ch(Throwab le t){}
  238           }
  239           }
  240  
  241           /*  (non-Java doc)
  242            *  @see gov. va.med.ima ging.datas ource.Pati entDataSou rceSpi#fin dPatients( gov.va.med .RoutingTo ken, java. lang.Strin g)
  243            * /
  244           @O verride
  245           pu blic Sorte dSet<Patie nt> findPa tients(Rou tingToken  globalRout ingToken,  String sea rchName) t hrows Meth odExceptio n,
  246                    Conn ectionExce ption
  247           {
  248                    thro w new Unsu pportedSer viceMethod Exception( PatientDat aSourceSpi .class, "f indPatient s");
  249           }
  250  
  251           /*  (non-Java doc)
  252            *  @see gov. va.med.ima ging.datas ource.Pati entDataSou rceSpi#get PatientIde ntificatio nImage(jav a.lang.Str ing)
  253            * /
  254           @O verride
  255           pu blic Input Stream get PatientIde ntificatio nImage(Pat ientIdenti fier patie ntIdentifi er) throws  MethodExc eption, Co nnectionEx ception
  256           {
  257                    thro w new Unsu pportedSer viceMethod Exception( PatientDat aSourceSpi .class, "g etPatientI dentificat ionImage") ;
  258           }
  259           
  260           pr otected St ring getDa taSourceVe rsion()
  261           {
  262                    retu rn "1";
  263           }
  264           
  265           /*  (non-Java doc)
  266            *  @see gov. va.med.ima ging.datas ource.Pati entDataSou rceSpi#get PatientInf ormation(g ov.va.med. RoutingTok en, java.l ang.String )
  267            * /
  268           @O verride
  269           pu blic Patie nt getPati entInforma tion(Routi ngToken gl obalRoutin gToken,
  270                             Patien tIdentifie r patientI dentifier)  
  271           th rows Metho dException , Connecti onExceptio n
  272           {
  273                    thro w new Unsu pportedSer viceMethod Exception( PatientDat aSourceSpi .class, "g etPatientI nformation ");
  274           }
  275  
  276           @O verride
  277           pu blic Patie ntMeansTes tResult ge tPatientMe ansTest(
  278                             Routin gToken glo balRouting Token, Pat ientIdenti fier patie ntIdentifi er)
  279           th rows Metho dException , Connecti onExceptio n
  280           {
  281                    Vist aCommonUti lities.set DataSource MethodAndV ersion("ge tPatientMe ansTest",  getDataSou rceVersion ());
  282                    logg er.info("g etPatientM eansTest("  + patient Identifier  + ") Tran sactionCon text (" +  Transactio nContextFa ctory.get( ).getDispl ayIdentity () + ").") ;                
  283                    Vist aSession v istaSessio n = null;                          
  284           tr y
  285           {                 
  286                    vist aSession =  getVistaS ession();                 
  287                    retu rn VistaCo mmonUtilit ies.getPat ientMeansT est(vistaS ession, pa tientIdent ifier);                 
  288           } 
  289           ca tch(IOExce ption ioX)
  290                    {
  291                             logger .error("Ex ception ge tting Vist A session" , ioX);
  292                    thro w new Conn ectionExce ption(ioX) ;
  293                    }
  294                    fina lly
  295           {
  296                    try{ vistaSessi on.close() ;}catch(Th rowable t) {}
  297           }
  298           }
  299           
  300           @O verride
  301           pu blic List< HealthSumm aryType> g etHealthSu mmaryTypes (
  302                             Routin gToken glo balRouting Token) 
  303           th rows Metho dException , Connecti onExceptio n
  304           {
  305                    thro w new Unsu pportedSer viceMethod Exception( PatientDat aSourceSpi .class, "g etHealthSu mmaryTypes ");
  306           }
  307  
  308           @O verride
  309           pu blic Strin g getHealt hSummary(H ealthSumma ryURN heal thSummaryU rn,
  310                             Patien tIdentifie r patientI dentifier)  
  311           th rows Metho dException , Connecti onExceptio n
  312           {
  313                    thro w new Unsu pportedSer viceMethod Exception( PatientDat aSourceSpi .class, "g etHealthSu mmary");
  314           }
  315  
  316           /*  (non-Java doc)
  317            *  @see gov. va.med.ima ging.datas ource.Pati entDataSou rceSpi#get PatientIde ntificatio nImage(jav a.lang.Str ing)
  318            * /
  319           @O verride
  320           pu blic Patie ntPhotoID  getPatient PhotoIdent ificationI mage(Patie ntIdentifi er patient Identifier
  321           th rows Metho dException , Connecti onExceptio n
  322           {
  323                    thro w new Unsu pportedSer viceMethod Exception( PatientDat aSourceSpi .class, "g etPatientI dentificat ionImage") ;
  324           }
  325  
  326           /*  (non-Java doc)
  327            *  @see gov. va.med.ima ging.datas ource.Pati entDataSou rceSpi#get PatientIde ntificatio nImageInfo rmation(go v.va.med.R outingToke n, gov.va. med.Patien tIdentifie r)
  328            * /
  329           @O verride
  330           pu blic Patie ntPhotoIDI nformation  getPatien tIdentific ationImage Informatio n(
  331                    Rout ingToken g lobalRouti ngToken, P atientIden tifier pat ientIdenti fier)
  332           th rows Metho dException , Connecti onExceptio n
  333           {
  334                    thro w new Unsu pportedSer viceMethod Exception( PatientDat aSourceSpi .class, "g etPatientI dentificat ionImageIn formation" );
  335           }
  336   }