177. EPMO Open Source Coordination Office Redaction File Detail Report

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

177.1 Files compared

# Location File Last Modified
1 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ExchangeDataSource\main\src\java\gov\va\med\imaging\exchangedatasource ExchangeStudyGraphDataSourceService.java Mon Dec 4 21:34:44 2017 UTC
2 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ExchangeDataSource\main\src\java\gov\va\med\imaging\exchangedatasource ExchangeStudyGraphDataSourceService.java Mon Dec 4 22:00:07 2017 UTC

177.2 Comparison summary

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

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

177.4 Active regular expressions

No regular expressions were active.

177.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.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.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.exch ange.proxy .v1.Exchan geProxyUti lities;
  41   import gov .va.med.im aging.exch ange.proxy .v1.ImageX ChangeProx y;
  42   import gov .va.med.im aging.exch ange.proxy .v1.ImageX ChangeProx yFactory;
  43   import gov .va.med.im aging.exch ange.proxy .v1.StudyR esult;
  44   import gov .va.med.im aging.prox y.exchange .StudyPara meters;
  45   import gov .va.med.im aging.tran sactioncon text.Trans actionCont extFactory ;
  46   import gov .va.med.im aging.url. exchange.E xchangeCon nection;
  47   import gov .va.med.im aging.url. exchange.c onfigurati on.Exchang eSiteConfi guration;
  48   import gov .va.med.im aging.url. exchange.e xceptions. ExchangeCo nfiguratio nException ;
  49   import gov .va.med.im aging.url. exchange.e xceptions. ExchangeCo nnectionEx ception;
  50   import gov .va.med.im aging.url. exchange.e xceptions. ExchangeMe thodExcept ion;
  51   import gov .va.med.im aging.url. exchange.t ranslator. ExchangeTr anslator;
  52   import jav a.beans.XM LEncoder;
  53   import jav a.io.Buffe redOutputS tream;
  54   import jav a.io.FileN otFoundExc eption;
  55   import jav a.io.FileO utputStrea m;
  56   import jav a.io.IOExc eption;
  57   import jav a.net.URL;
  58   import jav a.util.Dat e;
  59   import jav ax.xml.rpc .ServiceEx ception;
  60   import org .apache.lo gging.log4 j.LogManag er;
  61   import org .apache.lo gging.log4 j.Logger;
  62  
  63   /**
  64    * @author         
WERFEJ
  65    *
  66    */
  67   public cla ss Exchang eStudyGrap hDataSourc eService 
  68   extends Ab stractVers ionableDat aSource 
  69   implements  StudyGrap hDataSourc eSpi
  70   {
  71           pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(Exch angeStudyG raphDataSo urceServic e.class);
  72           
  73           pr ivate fina l Exchange Connection  exchangeC onnection;
  74           pr ivate Imag eXChangePr oxy proxy  = null;
  75           pr otected st atic Excha ngeTransla tor transl ator = new  ExchangeT ranslator( );
  76           pr ivate fina l static S tring EXCH ANGE_PROXY _SERVICE_N AME = "Exc hange";
  77           pr ivate fina l static S tring DATA SOURCE_VER SION = "1" ;
  78           pr ivate Exch angeSiteCo nfiguratio n exchange Configurat ion = null ;
  79           pu blic final  static St ring SUPPO RTED_PROTO COL = "exc hange";
  80           
  81           /* *
  82        * The  Provider  will use t he create( ) factory  method pre ferentiall y
  83        * ove r a constr uctor.  Th is allows  for cachin g of Vista StudyGraph DataSource Service
  84        * ins tances acc ording to  the criter ia set her e.
  85        * 
  86        * @pa ram url
  87        * @pa ram site
  88        * @re turn
  89        * @th rows Conne ctionExcep tion
  90        * @th rows Unsup portedProt ocolExcept ion 
  91        */
  92       public  static Ex changeStud yGraphData SourceServ ice create (ResolvedA rtifactSou rce resolv edArtifact Source, St ring proto col)
  93       throws  Connectio nException , Unsuppor tedProtoco lException
  94       {
  95           re turn new E xchangeStu dyGraphDat aSourceSer vice(resol vedArtifac tSource, p rotocol);
  96       }
  97           
  98           pu blic Excha ngeStudyGr aphDataSou rceService (ResolvedA rtifactSou rce resolv edArtifact Source, St ring proto col)
  99           th rows Unsup portedProt ocolExcept ion
  100           {
  101                    supe r(resolved ArtifactSo urce, prot ocol);
  102                    if(!  (resolved ArtifactSo urce insta nceof Reso lvedSite)  )
  103                             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() +  "'.");
  104                    
  105                    exch angeConnec tion = new  ExchangeC onnection( getMetadat aUrl());
  106           }
  107           
  108           /* *
  109            *  The artif act source  must be c hecked in  the constr uctor to a ssure that  it is an  instance
  110            *  of Resolv edSite.
  111            *  
  112            *  @return
  113            * /
  114           pr ivate Reso lvedSite g etResolved Site()
  115           {
  116                    retu rn (Resolv edSite)get ResolvedAr tifactSour ce();
  117           }
  118           
  119           pr ivate Site  getSite()
  120           {
  121                    retu rn getReso lvedSite() .getSite() ;
  122           }
  123           
  124           @O verride
  125           pu blic boole an isVersi onCompatib le() {
  126                    Exch angeSiteCo nfiguratio n siteConf ig = null;
  127                    try
  128                    {
  129                             siteCo nfig = get ExchangeSi teConfigur ation();
  130                    }
  131                    catc h(IOExcept ion ioX)
  132                    {
  133                             logger .error("Er ror readin g configur ation for  datasource ", ioX);
  134                             return  false;
  135                    }
  136                    // i f versioni ng is turn ed on for  this site  configurat ion
  137                    if(s iteConfig. isUseVersi oning())
  138                    {
  139                             Exchan geProxyUti lities.isE xchangeSit eServiceAv ailable(ge tSite(), E XCHANGE_PR OXY_SERVIC E_NAME, DA TASOURCE_V ERSION);
  140                    }
  141                    retu rn true;
  142           }
  143  
  144           pr ivate Imag eXChangePr oxy getPro xy()
  145           th rows IOExc eption
  146           {
  147                    if(p roxy == nu ll)
  148                    {
  149                             Exchan geSiteConf iguration  exchangeSi teConfigur ation = nu ll;
  150                             try 
  151                             {
  152                                      exchange SiteConfig uration = 
  153                                               ExchangeDa taSourcePr ovider.get ExchangeCo nfiguratio n().getSit eConfigura tion(getSi te().getSi teNumber() , null);
  154                             }
  155                             catch( ExchangeCo nfiguratio nException  ecX)
  156                             {
  157                                      throw ne w IOExcept ion(ecX);
  158                             }
  159                             proxy  = ImageXCh angeProxyF actory.get Singleton( ).get(
  160                                               exchangeCo nnection.g etURL().ge tHost(), 
  161                                               exchangeCo nnection.g etURL().ge tPort(), 
  162                                               exchangeSi teConfigur ation, nul l,
  163                                               ExchangeDa taSourcePr ovider.get ExchangeCo nfiguratio n());
  164                    }
  165                    retu rn proxy;
  166           }
  167  
  168           
  169  
  170           /*  (non-Java doc)
  171            *  @see gov. va.med.ima ging.datas ource.Stud yGraphData SourceSpi# getUrl()
  172            * /
  173           pu blic URL g etUrl() {
  174                    retu rn exchang eConnectio n.getURL() ;
  175           }        
  176  
  177           @S uppressWar nings("box ing")
  178           @O verride
  179           pu blic Study SetResult  getPatient Studies(Ro utingToken  globalRou tingToken,  
  180                    Pati entIdentif ier patien tIdentifie r, 
  181                    Stud yFilter fi lter, 
  182                    Stud yLoadLevel  studyLoad Level)
  183           th rows Unsup portedOper ationExcep tion, Exch angeMethod Exception,  Connectio nException  
  184           {
  185                    Exch angeDataSo urceCommon .setDataSo urceMethod AndVersion ("getPatie ntStudies" , DATASOUR CE_VERSION );
  186                    logg er.info("g etPatientS tudies for  patient ( " + patien tIdentifie r + ") Tra nsactionCo ntext (" +  Transacti onContextF actory.get ().getDisp layIdentit y() + ")." );
  187                    if(p atientIden tifier.get PatientIde ntifierTyp e().isLoca l())
  188                             throw  new Exchan geMethodEx ception("C annot use  local pati ent identi fier to re trieve rem ote patien t informat ion");
  189                    Stri ng patient Icn = pati entIdentif ier.getVal ue();
  190                    try 
  191                    {
  192                             exchan geConnecti on.connect ();                     
  193                    }
  194                    catc h(IOExcept ion ioX) 
  195                    {
  196                             logger .error("Er ror gettin g patient  studies",  ioX);
  197                             throw  new Exchan geConnecti onExceptio n(ioX);
  198                    }
  199                    try 
  200                    {                         
  201                             StudyP arameters  parameters  = 
  202                                      new Stud yParameter s(
  203                                               patientIcn
  204                                               filter ==  null ? new  Date(0l)  : filter.g etFromDate (), 
  205                                               filter ==  null ? new  Date() :  filter.get ToDate(), 
  206                                               filter ==  null ? nul l : filter .getStudyI d()
  207                                      );                        
  208                             StudyR esult stud yResult =  getProxy() .getStudie s(paramete rs);                      
  209                             gov.va .med.imagi ng.exchang e.webservi ces.soap.t ypes.v1.St udyType[]  exchangeSt udies = st udyResult. getStudies ();
  210                             logger .info("get PatientStu dies got [ " + (excha ngeStudies  == null ?  "0" : exc hangeStudi es.length)  + "] stud ies from s ite [" + g etSite().g etSiteNumb er() + "]" );
  211                             if (ex changeStud ies != nul l)
  212                             {
  213                                      String d umpExchang eGraphs =  System.get env("dumpd odexchange graphs");
  214                                      if (dump ExchangeGr aphs != nu ll && dump ExchangeGr aphs.equal sIgnoreCas e("true"))
  215                                      {
  216                                               dumpDodStu dyGraph(pa tientIcn,  exchangeSt udies);
  217                                      }
  218                             }
  219                             return  StudySetR esult.crea teFullResu lt(transla tor.transf ormStudies (getSite() , exchange Studies, 
  220                                               filter, Ex changeData SourceProv ider.getEx changeConf iguration( ).getEmpty StudyModal ities()));       
  221                    }
  222                    catc h(IOExcept ion ioX) 
  223                    {
  224                             logger .error("Er ror gettin g patient  studies",  ioX);
  225                             throw  new Exchan geMethodEx ception(io X);
  226                    }
  227                    catc h(ServiceE xception s X) {
  228                             logger .error("Er ror gettin g patient  studies",  sX);
  229                             throw  new Exchan geMethodEx ception(sX );
  230                    }
  231           }
  232  
  233           pr ivate void  dumpDodSt udyGraph(S tring pati entIcn, go v.va.med.i maging.exc hange.webs ervices.so ap.types.v 1.StudyTyp e[] exchan geStudies)
  234           {
  235                    Stri ng vixcach e = System .getenv("v ixcache");
  236                    if ( vixcache ! = null)
  237                    {
  238                             XMLEnc oder xmlEn coder = nu ll;
  239                             try
  240                             {
  241                                      String f ileSpec =  vixcache +  "/dodexch ange" + pa tientIcn +  ".xml";
  242                                      xmlEncod er = new X MLEncoder( new Buffer edOutputSt ream(new F ileOutputS tream(file Spec)));
  243                                      xmlEncod er.writeOb ject(excha ngeStudies );
  244                             }
  245                             catch  (FileNotFo undExcepti on ex)
  246                             {
  247                                      logger.e rror("Erro r dumping  study grap h: " + ex. getMessage ());
  248                             }
  249                             finall y
  250                             {
  251                                      if (xmlE ncoder !=  null)
  252                                      {
  253                                               xmlEncoder .close();
  254                                      }
  255                             }
  256                    }
  257           }
  258           
  259           pr ivate Exch angeSiteCo nfiguratio n getExcha ngeSiteCon figuration ()
  260           th rows IOExc eption
  261           {
  262                    if(e xchangeCon figuration  == null)
  263                    {
  264                             try 
  265                             {
  266                                      exchange Configurat ion = 
  267                                               ExchangeDa taSourcePr ovider.get ExchangeCo nfiguratio n().getSit eConfigura tion(getSi te().getSi teNumber() , null);
  268                             }
  269                             catch( ExchangeCo nfiguratio nException  ecX)
  270                             {
  271                                      throw ne w IOExcept ion(ecX);
  272                             }
  273                    }
  274                    retu rn exchang eConfigura tion;
  275           }
  276  
  277           /*  (non-Java doc)
  278            *  @see gov. va.med.ima ging.datas ource.Stud yGraphData SourceSpi# getStudy(j ava.lang.S tring, gov .va.med.Gl obalArtifa ctIdentifi er)
  279            * /
  280           @O verride
  281           pu blic Study  getStudy( PatientIde ntifier pa tientIdent ifier, Glo balArtifac tIdentifie r studyId)  
  282           th rows Metho dException , Connecti onExceptio n
  283           {
  284                    thro w new Unsu pportedSer viceMethod Exception( StudyGraph DataSource Spi.class,  "getStudy ");
  285           }
  286  
  287           /*  (non-Java doc)
  288            *  @see gov. va.med.ima ging.datas ource.Stud yGraphData SourceSpi# getStudyRe port(java. lang.Strin g, gov.va. med.Global ArtifactId entifier)
  289            * /
  290           @O verride
  291           pu blic Strin g getStudy Report(Pat ientIdenti fier patie ntIdentifi er, Global ArtifactId entifier s tudyId) 
  292           th rows Metho dException , Connecti onExceptio n
  293           {
  294                    thro w new Unsu pportedSer viceMethod Exception( StudyGraph DataSource Spi.class,  "getStudy Report");
  295           }
  296           
  297   }