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

134.1 Files compared

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

134.2 Comparison summary

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

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

134.4 Active regular expressions

No regular expressions were active.

134.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: Jan  8, 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.mix datasource ;
  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.data source.Abs tractVersi onableData Source;
  35   import gov .va.med.im aging.data source.Stu dyGraphDat aSourceSpi ;
  36   import gov .va.med.im aging.data source.exc eptions.Un supportedP rotocolExc eption;
  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.*;
  39   import gov .va.med.im aging.exch ange.enums .StudyLoad Level;
  40   import gov .va.med.im aging.mix. proxy.v1.M ixProxyUti lities;
  41   import gov .va.med.im aging.mix. proxy.v1.I mageMixPro xy;
  42   import gov .va.med.im aging.mix. proxy.v1.I mageMixPro xyFactory;
  43   import gov .va.med.im aging.mix. proxy.v1.S tudyResult ;
  44   import gov .va.med.im aging.mix. translator .MixTransl ator;
  45   import gov .va.med.im aging.prox y.exchange .StudyPara meters;
  46   import gov .va.med.im aging.tran sactioncon text.Trans actionCont extFactory ;
  47   import gov .va.med.im aging.url. mix.MIXCon nection;
  48   import gov .va.med.im aging.url. mix.config uration.MI XSiteConfi guration;
  49   import gov .va.med.im aging.url. mix.except ions.MIXCo nfiguratio nException ;
  50   import gov .va.med.im aging.url. mix.except ions.MIXCo nnectionEx ception;
  51   import gov .va.med.im aging.url. mix.except ions.MIXMe thodExcept ion;
  52  
  53   import jav a.beans.XM LEncoder;
  54   import jav a.io.Buffe redOutputS tream;
  55   import jav a.io.FileN otFoundExc eption;
  56   import jav a.io.FileO utputStrea m;
  57   import jav a.io.IOExc eption;
  58   import jav a.net.URL;
  59   import jav a.util.Dat e;
  60  
  61   import jav ax.xml.rpc .ServiceEx ception;
  62  
  63   import org .apache.lo g4j.Logger ;
  64  
  65   /**
  66    * @author         
WERFEJ
  67    *
  68    */
  69   public cla ss MixStud yGraphData SourceServ ice 
  70   extends Ab stractVers ionableDat aSource 
  71   implements  StudyGrap hDataSourc eSpi
  72   {
  73           pr ivate fina l static L ogger logg er = Logge r.getLogge r(MixStudy GraphDataS ourceServi ce.class);
  74           
  75           pr ivate fina l MIXConne ction mixC onnection;
  76           pr ivate Imag eMixProxy  proxy = nu ll;
  77           pr otected st atic MixTr anslator t ranslator  = new MixT ranslator( );
  78           pr ivate fina l static S tring MIX_ PROXY_SERV ICE_NAME =  "MIX";
  79           pr ivate fina l static S tring DATA SOURCE_VER SION = "1" ;
  80           pr ivate MIXS iteConfigu ration mix Configurat ion = null ;
  81           pu blic final  static St ring SUPPO RTED_PROTO COL = "mix ";
  82           
  83           /* *
  84        * The  Provider  will use t he create( ) factory  method pre ferentiall y
  85        * ove r a constr uctor.  Th is allows  for cachin g of Vista StudyGraph DataSource Service
  86        * ins tances acc ording to  the criter ia set her e.
  87        * 
  88        * @pa ram url
  89        * @pa ram site
  90        * @re turn
  91        * @th rows Conne ctionExcep tion
  92        * @th rows Unsup portedProt ocolExcept ion 
  93        */
  94       public  static Mi xStudyGrap hDataSourc eService c reate(Reso lvedArtifa ctSource r esolvedArt ifactSourc e, String  protocol)
  95       throws  Connectio nException , Unsuppor tedProtoco lException
  96       {
  97           re turn new M ixStudyGra phDataSour ceService( resolvedAr tifactSour ce, protoc ol);
  98       }
  99           
  100           pu blic MixSt udyGraphDa taSourceSe rvice(Reso lvedArtifa ctSource r esolvedArt ifactSourc e, String  protocol)
  101           th rows Unsup portedProt ocolExcept ion
  102           {
  103                    supe r(resolved ArtifactSo urce, prot ocol);
  104                    if(!  (resolved ArtifactSo urce insta nceof Reso lvedSite)  )
  105                             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() +  "'.");
  106                    
  107                    mixC onnection  = new MIXC onnection( getMetadat aUrl());
  108           }
  109           
  110           /* *
  111            *  The artif act source  must be c hecked in  the constr uctor to a ssure that  it is an  instance
  112            *  of Resolv edSite.
  113            *  
  114            *  @return
  115            * /
  116           pr ivate Reso lvedSite g etResolved Site()
  117           {
  118                    retu rn (Resolv edSite)get ResolvedAr tifactSour ce();
  119           }
  120           
  121           pr ivate Site  getSite()
  122           {
  123                    retu rn getReso lvedSite() .getSite() ;
  124           }
  125           
  126           @O verride
  127           pu blic boole an isVersi onCompatib le() {
  128                    MIXS iteConfigu ration sit eConfig =  null;
  129                    try
  130                    {
  131                             siteCo nfig = get MixSiteCon figuration ();
  132                    }
  133                    catc h(IOExcept ion ioX)
  134                    {
  135                             logger .error("Er ror readin g configur ation for  datasource ", ioX);
  136                             return  false;
  137                    }
  138                    // i f versioni ng is turn ed on for  this site  configurat ion
  139                    if(s iteConfig. isUseVersi oning())
  140                    {
  141                             MixPro xyUtilitie s.isMixSit eServiceAv ailable(ge tSite(), M IX_PROXY_S ERVICE_NAM E, DATASOU RCE_VERSIO N);
  142                    }
  143                    retu rn true;
  144           }
  145  
  146           pr ivate Imag eMixProxy  getProxy()
  147           th rows IOExc eption
  148           {
  149                    if(p roxy == nu ll)
  150                    {
  151                             MIXSit eConfigura tion mixSi teConfigur ation = nu ll;
  152                             try 
  153                             {
  154                                      mixSiteC onfigurati on = 
  155                                               MixDataSou rceProvide r.getMixCo nfiguratio n().getSit eConfigura tion(getSi te().getSi teNumber() , null);
  156                             }
  157                             catch( MIXConfigu rationExce ption ecX)
  158                             {
  159                                      throw ne w IOExcept ion(ecX);
  160                             }
  161                             proxy  = ImageMix ProxyFacto ry.getSing leton().ge t(
  162                                               mixConnect ion.getURL ().getHost (), 
  163                                               mixConnect ion.getURL ().getPort (), 
  164                                               mixSiteCon figuration , null,
  165                                               MixDataSou rceProvide r.getMixCo nfiguratio n());
  166                    }
  167                    retu rn proxy;
  168           }
  169  
  170           
  171  
  172           /*  (non-Java doc)
  173            *  @see gov. va.med.ima ging.datas ource.Stud yGraphData SourceSpi# getUrl()
  174            * /
  175           pu blic URL g etUrl() {
  176                    retu rn mixConn ection.get URL();
  177           }        
  178  
  179           @S uppressWar nings("box ing")
  180           @O verride
  181           pu blic Study SetResult  getPatient Studies(Ro utingToken  globalRou tingToken,  
  182                    Pati entIdentif ier patien tIdentifie r, 
  183                    Stud yFilter fi lter, 
  184                    Stud yLoadLevel  studyLoad Level)
  185           th rows Unsup portedOper ationExcep tion, MIXM ethodExcep tion, Conn ectionExce ption 
  186           {
  187                    MixD ataSourceC ommon.setD ataSourceM ethodAndVe rsion("get PatientStu dies", DAT ASOURCE_VE RSION);
  188                    logg er.info("g etPatientS tudies for  patient ( " + patien tIdentifie r + ") Tra nsactionCo ntext (" +  Transacti onContextF actory.get ().getDisp layIdentit y() + ")." );
  189                    if(p atientIden tifier.get PatientIde ntifierTyp e().isLoca l())
  190                             throw  new MIXMet hodExcepti on("Cannot  use local  patient i dentifier  to retriev e remote p atient inf ormation") ;
  191                    Stri ng patient Icn = pati entIdentif ier.getVal ue();
  192                    try 
  193                    {
  194                             mixCon nection.co nnect();                           
  195                    }
  196                    catc h(IOExcept ion ioX) 
  197                    {
  198                             logger .error("Er ror gettin g patient  studies",  ioX);
  199                             throw  new MIXCon nectionExc eption(ioX );
  200                    }
  201                    try 
  202                    {                         
  203                             StudyP arameters  parameters  = 
  204                                      new Stud yParameter s(
  205                                               patientIcn
  206                                               filter ==  null ? new  Date(0l)  : filter.g etFromDate (), 
  207                                               filter ==  null ? new  Date() :  filter.get ToDate(), 
  208                                               filter ==  null ? nul l : filter .getStudyI d()
  209                                      );                        
  210                             StudyR esult stud yResult =  getProxy() .getStudie s(paramete rs);                      
  211                             gov.va .med.imagi ng.mix.web services.r est.types. v1.ReportS tudyListRe sponseType  mixStudie s = studyR esult.getS tudies();
  212                             logger .info("get PatientStu dies got [ " + (mixSt udies == n ull ? "0"  : mixStudi es.getStud ies().leng th) + "] s tudies fro m site ["  + getSite( ).getSiteN umber() +  "]");
  213                             if (mi xStudies ! = null)
  214                             {
  215                                      String d umpExchang eGraphs =  System.get env("dumpd odexchange graphs");
  216                                      if (dump ExchangeGr aphs != nu ll && dump ExchangeGr aphs.equal sIgnoreCas e("true"))
  217                                      {
  218                                               dumpDodStu dyGraph(pa tientIcn,  mixStudies .getStudie s());
  219                                      }
  220                             }
  221                             return  StudySetR esult.crea teFullResu lt(transla tor.transf ormStudies (getSite() , mixStudi es.getStud ies(), 
  222                                               filter, Mi xDataSourc eProvider. getMixConf iguration( ).getEmpty StudyModal ities()));         
  223                    }
  224                    catc h(IOExcept ion ioX) 
  225                    {
  226                             logger .error("Er ror gettin g patient  studies",  ioX);
  227                             throw  new MIXMet hodExcepti on(ioX);
  228                    }
  229                    catc h(ServiceE xception s X) {
  230                             logger .error("Er ror gettin g patient  studies",  sX);
  231                             throw  new MIXMet hodExcepti on(sX);
  232                    }
  233           }
  234  
  235           pr ivate void  dumpDodSt udyGraph(S tring pati entIcn, go v.va.med.i maging.mix .webservic es.rest.ty pes.v1.Stu dyType[] e xchangeStu dies)
  236           {
  237                    Stri ng vixcach e = System .getenv("v ixcache");
  238                    if ( vixcache ! = null)
  239                    {
  240                             XMLEnc oder xmlEn coder = nu ll;
  241                             try
  242                             {
  243                                      String f ileSpec =  vixcache +  "/dodexch ange" + pa tientIcn +  ".xml";
  244                                      xmlEncod er = new X MLEncoder( new Buffer edOutputSt ream(new F ileOutputS tream(file Spec)));
  245                                      xmlEncod er.writeOb ject(excha ngeStudies );
  246                             }
  247                             catch  (FileNotFo undExcepti on ex)
  248                             {
  249                                      logger.e rror("Erro r dumping  study grap h: " + ex. getMessage ());
  250                             }
  251                             finall y
  252                             {
  253                                      if (xmlE ncoder !=  null)
  254                                      {
  255                                               xmlEncoder .close();
  256                                      }
  257                             }
  258                    }
  259           }
  260           
  261           pr ivate MIXS iteConfigu ration get MixSiteCon figuration ()
  262           th rows IOExc eption
  263           {
  264                    if(m ixConfigur ation == n ull)
  265                    {
  266                             try 
  267                             {
  268                                      mixConfi guration =  
  269                                               MixDataSou rceProvide r.getMixCo nfiguratio n().getSit eConfigura tion(getSi te().getSi teNumber() , null);
  270                             }
  271                             catch( MIXConfigu rationExce ption ecX)
  272                             {
  273                                      throw ne w IOExcept ion(ecX);
  274                             }
  275                    }
  276                    retu rn mixConf iguration;
  277           }
  278  
  279           /*  (non-Java doc)
  280            *  @see gov. va.med.ima ging.datas ource.Stud yGraphData SourceSpi# getStudy(j ava.lang.S tring, gov .va.med.Gl obalArtifa ctIdentifi er)
  281            * /
  282           @O verride
  283           pu blic Study  getStudy( PatientIde ntifier pa tientIdent ifier, Glo balArtifac tIdentifie r studyId)  
  284           th rows Metho dException , Connecti onExceptio n
  285           {
  286                    thro w new Unsu pportedSer viceMethod Exception( StudyGraph DataSource Spi.class,  "getStudy ");
  287           }
  288  
  289           /*  (non-Java doc)
  290            *  @see gov. va.med.ima ging.datas ource.Stud yGraphData SourceSpi# getStudyRe port(java. lang.Strin g, gov.va. med.Global ArtifactId entifier)
  291            * /
  292           @O verride
  293           pu blic Strin g getStudy Report(Pat ientIdenti fier patie ntIdentifi er, Global ArtifactId entifier s tudyId) 
  294           th rows Metho dException , Connecti onExceptio n
  295           {
  296                    thro w new Unsu pportedSer viceMethod Exception( StudyGraph DataSource Spi.class,  "getStudy Report");
  297           }
  298           
  299   }