13. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 3/25/2019 8:58:00 AM 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.

13.1 Files compared

# Location File Last Modified
1 C:\AraxisMergeCompare\Pri_un\IMAG_Source\VISA\Java\ExchangeDataSource\main\src\java\gov\va\med\imaging\exchangedatasource ExchangeStudyGraphDataSourceServiceV2.java Mon Mar 18 20:39:06 2019 UTC
2 C:\AraxisMergeCompare\Pri_re\IMAG_Source\VISA\Java\ExchangeDataSource\main\src\java\gov\va\med\imaging\exchangedatasource ExchangeStudyGraphDataSourceServiceV2.java Tue Mar 19 12:03:30 2019 UTC

13.2 Comparison summary

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

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

13.4 Active regular expressions

No regular expressions were active.

13.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: Sep  30, 2010
  6     Site Nam e:  Washin gton OI Fi eld Office , Silver S pring, MD
  7       Developer:     DNS     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.exc hangedatas ource;
  27  
  28   import gov .va.med.Gl obalArtifa ctIdentifi er;
  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 yException ;
  35   import gov .va.med.im aging.data source.Abs tractVersi onableData Source;
  36   import gov .va.med.im aging.data source.Stu dyGraphDat aSourceSpi ;
  37   import gov .va.med.im aging.data source.exc eptions.Un supportedP rotocolExc eption;
  38   import gov .va.med.im aging.data source.exc eptions.Un supportedS erviceMeth odExceptio n;
  39   import gov .va.med.im aging.exch ange.busin ess.*;
  40   import gov .va.med.im aging.exch ange.enums .StudyLoad Level;
  41   import gov .va.med.im aging.exch ange.proxy .v1.Exchan geProxyUti lities;
  42   import gov .va.med.im aging.exch ange.proxy .v2.ImageX ChangeStud yProxyV2;
  43   import gov .va.med.im aging.prox y.exceptio ns.ProxySe rviceNotFo undExcepti on;
  44   import gov .va.med.im aging.prox y.services .ProxyServ iceType;
  45   import gov .va.med.im aging.prox y.services .ProxyServ ices;
  46   import gov .va.med.im aging.tran sactioncon text.Trans actionCont ext;
  47   import gov .va.med.im aging.tran sactioncon text.Trans actionCont extFactory ;
  48   import gov .va.med.im aging.url. exchange.E xchangeCon nection;
  49   import gov .va.med.im aging.url. exchange.c onfigurati on.Exchang eSiteConfi guration;
  50   import gov .va.med.im aging.url. exchange.e xceptions. ExchangeCo nfiguratio nException ;
  51   import gov .va.med.im aging.url. exchange.e xceptions. ExchangeCo nnectionEx ception;
  52  
  53   import jav a.io.IOExc eption;
  54   import jav a.util.Lis t;
  55   import jav a.util.Sor tedSet;
  56   import org .apache.lo gging.log4 j.LogManag er;
  57   import org .apache.lo gging.log4 j.Logger;
  58  
  59   /**
  60    * @author   DNS     werfej
  61    *
  62    */
  63   public cla ss Exchang eStudyGrap hDataSourc eServiceV2
  64   extends Ab stractVers ionableDat aSource
  65   implements  StudyGrap hDataSourc eSpi
  66   {
  67           pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(Exch angeStudyG raphDataSo urceServic eV2.class) ;
  68           
  69           pr ivate fina l Exchange Connection  exchangeC onnection;
  70           pr ivate Imag eXChangeSt udyProxyV2  proxy = n ull;
  71           
  72           pr ivate fina l static S tring EXCH ANGE_PROXY _SERVICE_N AME = "Exc hange";
  73           pr ivate fina l static S tring DATA SOURCE_VER SION = "2" ;
  74           pr ivate Exch angeSiteCo nfiguratio n exchange Configurat ion = null ;
  75           pu blic final  static St ring SUPPO RTED_PROTO COL = "exc hange";
  76           pr ivate Prox yServices  exchangePr oxyService s = null;
  77           
  78           /* *
  79        * The  Provider  will use t he create( ) factory  method pre ferentiall y
  80        * ove r a constr uctor.  Th is allows  for cachin g of Vista StudyGraph DataSource Service
  81        * ins tances acc ording to  the criter ia set her e.
  82        * 
  83        * @pa ram url
  84        * @pa ram site
  85        * @re turn
  86        * @th rows Conne ctionExcep tion
  87        * @th rows Unsup portedProt ocolExcept ion 
  88        */
  89       public  static Ex changeStud yGraphData SourceServ iceV2 crea te(Resolve dArtifactS ource reso lvedArtifa ctSource,  String pro tocol)
  90       throws  Connectio nException , Unsuppor tedProtoco lException
  91       {
  92           re turn new E xchangeStu dyGraphDat aSourceSer viceV2(res olvedArtif actSource,  protocol) ;
  93       }
  94           
  95           pu blic Excha ngeStudyGr aphDataSou rceService V2(Resolve dArtifactS ource reso lvedArtifa ctSource,  String pro tocol)
  96           th rows Unsup portedProt ocolExcept ion
  97           {
  98                    supe r(resolved ArtifactSo urce, prot ocol);
  99                    if(!  (resolved ArtifactSo urce insta nceof Reso lvedSite)  )
  100                             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() +  "'.");
  101                    
  102                    exch angeConnec tion = new  ExchangeC onnection( getMetadat aUrl());
  103           }
  104           
  105           /* *
  106            *  The artif act source  must be c hecked in  the constr uctor to a ssure that  it is an  instance
  107            *  of Resolv edSite.
  108            *  
  109            *  @return
  110            * /
  111           pr ivate Reso lvedSite g etResolved Site()
  112           {
  113                    retu rn (Resolv edSite)get ResolvedAr tifactSour ce();
  114           }
  115           
  116           pr ivate Site  getSite()
  117           {
  118                    retu rn getReso lvedSite() .getSite() ;
  119           }
  120  
  121           @S uppressWar nings("box ing")
  122           @O verride
  123           pu blic Study SetResult  getPatient Studies(Ro utingToken  globalRou tingToken,  PatientId entifier p atientIden tifier,
  124                             StudyF ilter filt er, StudyL oadLevel s tudyLoadLe vel)
  125           th rows Metho dException , Connecti onExceptio n
  126           {
  127                    // i f the stud y load lev el is full , then als o need to  get the st udy report s for each  study ret urned!
  128                    Exch angeDataSo urceCommon .setDataSo urceMethod AndVersion ("getPatie ntStudies" , DATASOUR CE_VERSION );
  129                    logg er.info("g etPatientS tudies for  patient ( " + patien tIdentifie r + ") Tra nsactionCo ntext (" +  Transacti onContextF actory.get ().getDisp layIdentit y() + ")." );
  130                    if(p atientIden tifier.get PatientIde ntifierTyp e().isLoca l())
  131                             throw  new Method Exception( "Cannot us e local pa tient iden tifier to  retrieve r emote pati ent inform ation");
  132                    Stri ng patient Icn = pati entIdentif ier.getVal ue();
  133                    try 
  134                    {
  135                             exchan geConnecti on.connect ();                     
  136                    }
  137                    catc h(IOExcept ion ioX) 
  138                    {
  139                             logger .error("Er ror gettin g patient  studies",  ioX);
  140                             throw  new Exchan geConnecti onExceptio n(ioX);
  141                    }
  142                    
  143                    Stud ySetResult  studySetR esult = ge tProxy().g etPatientS tudies(pat ientIcn, f ilter, stu dyLoadLeve l);
  144                    logg er.info("g etPatientS tudies got  [" + (stu dySetResul t == null  ? "null" :  (studySet Result.get Artifacts( ) == null  ? "null st udies" : s tudySetRes ult.getArt ifacts().s ize())) +  "] studies  from site  [" + getS ite().getS iteNumber( ) + "]");
  145                    
  146                    // i f the requ estor want ed reports  along wit h the stud ies, they  are not al ready incl uded so th ey need to  be added 
  147                    if(s tudyLoadLe vel.isIncl udeReport( ))
  148                    {
  149                             Transa ctionConte xt transac tionContex t = Transa ctionConte xtFactory. get();
  150                             
  151                             if(stu dySetResul t != null)
  152                             {
  153                                      SortedSe t<Study> s tudies = s tudySetRes ult.getArt ifacts();
  154                                      if(studi es != null )
  155                                      {
  156                                               for(Study  study : st udies)
  157                                               {
  158                                                       //  if the st udy does n ot have th e report,  then need  to get it
  159                                                       if (!study.ge tStudyLoad Level().is IncludeRep ort())
  160                                                       {
  161                                                                try
  162                                                                {
  163                                                                         transa ctionConte xt.addDebu gInformati on("Gettin g report f or study ' " + study. getGlobalA rtifactIde ntifier(). toString()  + "'.");
  164                                                                         String  report =  getStudyRe portIntern al(patient Icn, 
  165                                                                                           study.getG lobalArtif actIdentif ier());
  166                                                                         // thi s will upd ate the st udy load l evel
  167                                                                         study. setRadiolo gyReport(r eport);
  168                                                                }
  169                                                                catc h(MethodEx ception mX )
  170                                                                {
  171                                                                         logger .warn("Met hodExcepti on getting  report fo r study '"  + study.g etStudyUrn ().toStrin g() + ", "  + mX.getM essage());
  172                                                                }
  173                                                                catc h(Connecti onExceptio n cX)
  174                                                                {
  175                                                                         logger .warn("Con nectionExc eption get ting repor t for stud y '" + stu dy.getStud yUrn().toS tring() +  ", " + cX. getMessage ());
  176                                                                }
  177                                                       }
  178                                               }
  179                                      }
  180                             }
  181                    }
  182                    
  183                    retu rn studySe tResult;
  184           }
  185  
  186           @O verride
  187           pu blic Strin g getStudy Report(Pat ientIdenti fier patie ntIdentifi er,
  188                             Global ArtifactId entifier s tudyId) 
  189           th rows Metho dException , Connecti onExceptio n
  190           {
  191                    Exch angeDataSo urceCommon .setDataSo urceMethod AndVersion ("getStudy Report", D ATASOURCE_ VERSION);
  192                    if(p atientIden tifier.get PatientIde ntifierTyp e().isLoca l())
  193                             throw  new Method Exception( "Cannot us e local pa tient iden tifier to  retrieve r emote pati ent inform ation");
  194                    Stri ng patient Icn = pati entIdentif ier.getVal ue();
  195                    retu rn getStud yReportInt ernal(pati entIcn, st udyId);
  196           }
  197           
  198           pr ivate Stri ng getStud yReportInt ernal(Stri ng patient Icn,
  199                             Global ArtifactId entifier s tudyId) 
  200           th rows Metho dException , Connecti onExceptio n
  201           {
  202                    logg er.info("g etStudyRep ort for pa tient (" +  patientIc n + ") Tra nsactionCo ntext (" +  Transacti onContextF actory.get ().getDisp layIdentit y() + ")." );
  203                    try 
  204                    {
  205                             exchan geConnecti on.connect ();                     
  206                    }
  207                    catc h(IOExcept ion ioX) 
  208                    {
  209                             logger .error("Er ror gettin g patient  studies",  ioX);
  210                             throw  new Exchan geConnecti onExceptio n(ioX);
  211                    }
  212                    
  213                    retu rn getProx y().getStu dyReport(p atientIcn,  studyId);           
  214           }
  215  
  216           @O verride
  217           pu blic boole an isVersi onCompatib le() 
  218           th rows Secur ityExcepti on
  219           {
  220                    Prox yServiceTy pe service Type = Pro xyServiceT ype.metada ta;
  221                    try
  222                    {
  223                             ProxyS ervices pr oxyService s = getExc hangeProxy Services() ;       
  224                             if(pro xyServices  == null)
  225                             {
  226                                      logger.w arn("Got n ull proxy  services b ack, indic ates site  '" + getSi te().getSi teNumber()  + "' for  version '"  + DATASOU RCE_VERSIO N + "' is  not versio n compatib le.");
  227                                      return f alse;
  228                             }
  229                             proxyS ervices.ge tProxyServ ice(servic eType);
  230                    }
  231                    catc h(IOExcept ion ioX)
  232                    {
  233                             logger .error("Er ror findin g proxy se rvices fro m site '"  + getSite( ).getSiteN umber() +  "'.");
  234                             return  false;
  235                    }
  236                    catc h(ProxySer viceNotFou ndExceptio n psnfX)
  237                    {
  238                             logger .error("Co uld not fi nd proxy s ervice typ e '" + ser viceType +  "' from s ite '" + g etSite().g etSiteNumb er() + "'. ");
  239                    }
  240                    
  241                    retu rn true;
  242           }
  243           
  244           pr otected Pr oxyService s getExcha ngeProxySe rvices()
  245           th rows IOExc eption
  246           {
  247                    if(e xchangePro xyServices  == null)
  248                    {
  249                             exchan geProxySer vices = 
  250                                      Exchange ProxyUtili ties.getEx changeProx yServices( getExchang eSiteConfi guration() , getSite( ).getSiteN umber(), 
  251                                                       EX CHANGE_PRO XY_SERVICE _NAME, DAT ASOURCE_VE RSION, exc hangeConne ction.getU RL().getHo st(), 
  252                                                       ex changeConn ection.get URL().getP ort(), nul l);
  253                    }
  254                    retu rn exchang eProxyServ ices;
  255           }
  256           
  257           pr ivate Exch angeSiteCo nfiguratio n getExcha ngeSiteCon figuration ()
  258           th rows IOExc eption
  259           {
  260                    if(e xchangeCon figuration  == null)
  261                    {
  262                             try 
  263                             {
  264                                      exchange Configurat ion = 
  265                                               ExchangeDa taSourcePr ovider.get ExchangeCo nfiguratio n().getSit eConfigura tion(getSi te().getSi teNumber() , null);
  266                             }
  267                             catch( ExchangeCo nfiguratio nException  ecX)
  268                             {
  269                                      throw ne w IOExcept ion(ecX);
  270                             }
  271                    }
  272                    retu rn exchang eConfigura tion;
  273           }
  274           
  275           pr ivate Imag eXChangeSt udyProxyV2  getProxy( )
  276           th rows Conne ctionExcep tion
  277           {
  278                    if(p roxy == nu ll)
  279                    {
  280                             try
  281                             {
  282                                      proxy =  new ImageX ChangeStud yProxyV2(g etExchange ProxyServi ces(), get Site(), 
  283                                                       Ex changeData SourceProv ider.getEx changeConf iguration( ));
  284                             }
  285                             catch( IOExceptio n ioX)
  286                             {
  287                                      throw ne w Connecti onExceptio n(ioX);
  288                             }                                                    
  289                    }
  290                    retu rn proxy;
  291           }
  292  
  293           /*  (non-Java doc)
  294            *  @see gov. va.med.ima ging.datas ource.Stud yGraphData SourceSpi# getStudy(j ava.lang.S tring, gov .va.med.Gl obalArtifa ctIdentifi er)
  295            * /
  296           @O verride
  297           pu blic Study  getStudy( PatientIde ntifier pa tientIdent ifier, Glo balArtifac tIdentifie r studyId)  throws Me thodExcept ion,
  298                    Conn ectionExce ption
  299           {
  300                    thro w new Unsu pportedSer viceMethod Exception( StudyGraph DataSource Spi.class,  "getStudy ");
  301           }
  302  
  303           @O verride
  304           pu blic List< StoredStud yFilter> g etStoredFi lters(Rout ingToken g lobalRouti ngToken)
  305           th rows Metho dException , Connecti onExceptio n {
  306                    thro w new Unsu pportedSer viceMethod Exception( StudyGraph DataSource Spi.class,  "getStore dFilters") ;
  307           }
  308   }