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

142.1 Files compared

# Location File Last Modified
1 C:\AraxisMergeCompare\Pri_un\IV-ehmp_cif\MIXWebApp\main\src\java\gov\va\med\imaging\mix\webservices MixWebservices.java Thu Jun 29 17:23:01 2017 UTC
2 C:\AraxisMergeCompare\Pri_re\IV-ehmp_cif\MIXWebApp\main\src\java\gov\va\med\imaging\mix\webservices MixWebservices.java Thu Jul 6 15:04:52 2017 UTC

142.2 Comparison summary

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

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

142.4 Active regular expressions

No regular expressions were active.

142.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  30, 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 .webservic es;
  27  
  28   import gov .va.med.Pa tientIdent ifier;
  29   import gov .va.med.ex ceptions.R outingToke nFormatExc eption;
  30   import gov .va.med.im aging.exch ange.Routi ngTokenHel per;
  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.Insuffi cientPatie ntSensitiv ityExcepti on;
  33   import gov .va.med.im aging.core .interface s.exceptio ns.MethodE xception;
  34   import gov .va.med.im aging.exce ptions.URN FormatExce ption;
  35   import gov .va.med.im aging.mix. MixRouter;
  36   import gov .va.med.im aging.mix. MixContext ;
  37   import gov .va.med.im aging.exch ange.busin ess.Study;
  38   import gov .va.med.im aging.exch ange.busin ess.StudyF ilter;
  39   import gov .va.med.im aging.mix. webservice s.rest.exc eptions.MI XMetadataE xception;
  40   import gov .va.med.im aging.mix. webservice s.rest.typ es.v1.Filt erType;
  41   import gov .va.med.im aging.mix. webservice s.rest.typ es.v1.Repo rtStudyLis tResponseT ype;
  42   import gov .va.med.im aging.mix. webservice s.rest.typ es.v1.Repo rtType;
  43   import gov .va.med.im aging.mix. webservice s.rest.typ es.v1.Requ estorType;
  44   import gov .va.med.im aging.mix. webservice s.rest.typ es.v1.Stud yType;
  45   import gov .va.med.im aging.mix. webservice s.translat or.v1.MixT ranslator;
  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  
  49   import jav a.beans.XM LEncoder;
  50   import jav a.io.Buffe redOutputS tream;
  51   import jav a.io.FileN otFoundExc eption;
  52   import jav a.io.FileO utputStrea m;
  53   // import  java.rmi.R emoteExcep tion;
  54   import jav a.text.Par seExceptio n;
  55   import jav a.util.Lis t;
  56  
  57   import org .apache.lo g4j.Logger ;
  58  
  59   /**
  60    * @author         
WERFEJ
  61    *
  62    */
  63   public cla ss MixWebs ervices 
  64   implements  gov.va.me d.imaging. mix.webser vices.rest .v1.ImageM etadata
  65   {
  66           pr ivate MixT ranslator  mixTransla tor = new  MixTransla tor();
  67           pr ivate fina l static L ogger logg er = Logge r.getLogge r(MixWebse rvices.cla ss);
  68  
  69           //  @Override
  70           pu blic Repor tStudyList ResponseTy pe getPati entReportS tudyList(S tring data source,
  71                             Reques torType re questor, F ilterType  filter, St ring patie ntId, Bool ean fullTr ee, // ful l Tree val ue ignored ; Full ret urned
  72                             String  transacti onId, Stri ng request edSite) 
  73           th rows MIXMe tadataExce ption 
  74           {
  75                    setT ransaction Context(re questor, t ransaction Id);
  76                    Long  startTime  = System. currentTim eMillis();
  77                    Repo rtStudyLis tResponseT ype rsrt =  null;
  78                    logg er.info("s tart getPa tientRepor tStudyList  transacti on(" + tra nsactionId  + ")");
  79                    MixR outer rout er = MixCo ntext.getM ixRouter() ;
  80                    if(r outer == n ull)
  81                             throw  new MIXMet adataExcep tion("Inte rnal error , unable t o retrieve  patient r eports/stu dies");
  82                    
  83                    Stud yFilter st udyFilter  = mixTrans lator.tran sformFilte r(filter);                           
  84                    
  85                    Tran sactionCon text trans actionCont ext = Tran sactionCon textFactor y.get();
  86                    tran sactionCon text.setRe questType( "Mix WebAp p getStudy List");
  87                    //TO DO: look a t requesti ng site nu mber and s etRequesti ngSource 
  88                    tran sactionCon text.setRe questingSo urce("unkn own");               
  89                    tran sactionCon text.setPa tientID(pa tientId);
  90                    tran sactionCon text.setQu eryFilter( Transactio nContextFa ctory.getF ilterDateR ange(study Filter.get FromDate() , studyFil ter.getToD ate()));
  91                    tran sactionCon text.setQu ality("n/a ");
  92                    tran sactionCon text.setUr n("n/a");
  93                    
  94                    //TO DO: get th e site num ber from t he request  (somewher e). if non e is speci fied then  get the si te 
  95                    // n umber from  appConfig  and go ag ainst the  local site
  96                    Stri ng siteNum ber = MixC ontext.get AppConfigu ration().g etLocalSit eNumber(); // "660";                                
  97                    try 
  98                    {
  99                             List<S tudy> stud ies = rout er.getPati entStudyLi st(Routing TokenHelpe r.createSi teAppropri ateRouting Token(site Number), 
  100                                               PatientIde ntifier.ic nPatientId entifier(p atientId),  studyFilt er);
  101                    
  102                             gov.va .med.imagi ng.mix.web services.r est.types. v1.StudyTy pe[] study Types = 
  103                                      mixTrans lator.tran sformStudi es(studies );
  104                             logger .info("Con verted ["  + (studies  == null ?  0 : studi es.size())  + "] busi ness studi es into ["  + (studyT ypes == nu ll ? 0 : s tudyTypes. length) +  "] studies  to return ");
  105                             transa ctionConte xt.setEntr iesReturne d( studyTy pes == nul l ? 0 : st udyTypes.l ength );
  106                             if (st udyTypes ! = null)
  107                             {
  108                                      String d umpExchang eGraphs =  System.get env("dumpv aexchangeg raphs");
  109                                      if (dump ExchangeGr aphs != nu ll && dump ExchangeGr aphs.equal sIgnoreCas e("true"))
  110                                      {
  111                                               dumpVaStud yGraph(pat ientId, st udyTypes);
  112                                      }
  113                             }
  114                             logger .info("SUC CESS getPa tientRepor tStudyList  transacti on(" + tra nsactionId  + ") in "  + 
  115                                               (System.cu rrentTimeM illis() -  startTime)  +      "  ms)" );
  116                             rsrt =  new Repor tStudyList ResponseTy pe();
  117                             rsrt.s etPartialR esponse(fa lse); // * *** studie s.isPartia lResult()) ;
  118                             rsrt.s etStudies( studyTypes );
  119                             rsrt.s etErrors(n ull); // * **
  120   //                    for (int i  = 0; i <  studyTypes .length; i ++) {
  121   //                        rsrt.s etStudies( i, studyTy pes.get(i) );
  122   //                     }
  123  
  124                             return  rsrt;
  125                    }
  126                    catc h(Insuffic ientPatien tSensitivi tyExceptio n ipsX)
  127                    {
  128                             logger .info("Ins ufficient  patient se nsitivity  to view sp ecified pa tient, ret urning emp ty study l ist for no w... This  is not bei ng logged  as an exce ption", ip sX);
  129                             transa ctionConte xt.setEntr iesReturne d(0);
  130                             logger .info("SUC CESS getPa tientStudy List trans action(" +  transacti onId + ")  in " + 
  131                                               (System.cu rrentTimeM illis() -  startTime)  +      "  ms, return ed no stud ies)" );
  132                             return  rsrt;
  133                    }
  134                    catc h(ParseExc eption pX)
  135                    {
  136                             transa ctionConte xt.setErro rMessage(p X.getMessa ge());
  137                             transa ctionConte xt.setExce ptionClass Name(pX.ge tClass().g etSimpleNa me());
  138                             throw  new MIXMet adataExcep tion("Inte rnal error , unable t o translat e study pr ocedure da te", pX);
  139                    }
  140                    catc h(URNForma tException  iurnfX)
  141                    {
  142                             transa ctionConte xt.setErro rMessage(i urnfX.getM essage());
  143                             transa ctionConte xt.setExce ptionClass Name(iurnf X.getClass ().getSimp leName());
  144                             throw  new MIXMet adataExcep tion("Inte rnal error , unable t o translat e study me tadata", i urnfX);
  145                    }
  146                    catc h(MethodEx ception mX )
  147                    {
  148                             transa ctionConte xt.setErro rMessage(m X.getMessa ge());
  149                             transa ctionConte xt.setExce ptionClass Name(mX.ge tClass().g etSimpleNa me());
  150                             throw  new MIXMet adataExcep tion("Inte rnal error , unable t o translat e study me tadata", m X);
  151                    }
  152                    catc h(Connecti onExceptio n cX)
  153                    {
  154                             transa ctionConte xt.setErro rMessage(c X.getMessa ge());
  155                             transa ctionConte xt.setExce ptionClass Name(cX.ge tClass().g etSimpleNa me());
  156                             throw  new MIXMet adataExcep tion("Inte rnal error , unable t o translat e study me tadata", c X);
  157                    }
  158                    catc h (Routing TokenForma tException  rtfX)
  159                    {
  160                             transa ctionConte xt.setErro rMessage(r tfX.getMes sage());
  161                             transa ctionConte xt.setExce ptionClass Name(rtfX. getClass() .getSimple Name());
  162                             throw  new MIXMet adataExcep tion("Inte rnal error , unable t o translat e study me tadata", r tfX);
  163                    }
  164           }
  165           
  166           /* *
  167            *  Set the t ransaction  context p roperties  that are p assed in t he webserv ices.
  168            *  @param re questor
  169            *  @param tr ansactionI d
  170            * /
  171           pr ivate void  setTransa ctionConte xt(
  172                    gov. va.med.ima ging.mix.w ebservices .rest.type s.v1.Reque storType r equestor,
  173                    java .lang.Stri ng transac tionId)
  174           {
  175                    logg er.info(
  176                                      "setTran sactionCon text, id=' " + transa ctionId + 
  177                                      "', user name='" +  requestor  == null ||  requestor .getUserna me() == nu ll ? "null " : reques tor.getUse rname() + 
  178                                      "'.");
  179                    Tran sactionCon text trans actionCont ext = Tran sactionCon textFactor y.get();
  180                    
  181                    if(t ransaction Id != null )
  182                             transa ctionConte xt.setTran sactionId( transactio nId);
  183                    
  184                    if(r equestor ! = null)
  185                    {
  186                             if( re questor.ge tUsername( ) != null  )
  187                                      transact ionContext .setFullNa me(request or.getUser name());
  188                             if( re questor.ge tFacilityI d() != nul l )
  189                                      transact ionContext .setSiteNu mber(reque stor.getFa cilityId() );
  190                             if( re questor.ge tFacilityN ame() != n ull )
  191                                      transact ionContext .setSiteNa me(request or.getFaci lityName() );
  192                             if( re questor.ge tPurposeOf Use() != n ull )
  193                                      transact ionContext .setPurpos eOfUse(req uestor.get PurposeOfU se().toStr ing());
  194                             if( re questor.ge tSsn() !=  null )
  195                                      transact ionContext .setSsn(re questor.ge tSsn());
  196                    }
  197           }
  198  
  199           pr ivate void  dumpVaStu dyGraph(St ring patie ntIcn, gov .va.med.im aging.mix. webservice s.rest.typ es.v1.Stud yType[] ex changeStud ies)
  200           {
  201                    Stri ng vixcach e = System .getenv("v ixcache");
  202                    if ( vixcache ! = null)
  203                    {
  204                             XMLEnc oder xmlEn coder = nu ll;
  205                             try
  206                             {
  207                                      String f ileSpec =  vixcache +  "/vaexcha nge" + pat ientIcn +  ".xml";
  208                                      xmlEncod er = new X MLEncoder( new Buffer edOutputSt ream(new F ileOutputS tream(file Spec)));
  209                                      xmlEncod er.writeOb ject(excha ngeStudies );
  210                             }
  211                             catch  (FileNotFo undExcepti on ex)
  212                             {
  213                                      logger.e rror("Erro r dumping  study grap h: " + ex. getMessage ());
  214                             }
  215                             finall y
  216                             {
  217                                      if (xmlE ncoder !=  null)
  218                                      {
  219                                               xmlEncoder .close();
  220                                      }
  221                             }
  222                    }
  223           }
  224  
  225   //      @O verride
  226   //      pu blic Repor tStudyList ResponseTy pe getPati entReportS tudyList(
  227   //                        String  datasourc e, Request orType req tor, Filte rType filt r,
  228   //                        String  patId, Bo olean full Tree, Stri ng transac tId)
  229   //                        throws  MIXMetada taExceptio n {
  230   //               // T ODO Auto-g enerated m ethod stub
  231   //               retu rn null;
  232   //      }
  233  
  234           @O verride
  235           pu blic Repor tType getP atientRepo rt(String  datasource , Requesto rType reqt or,
  236                             String  patId, St ring study Id, String  transactI d)
  237                             throws  MIXMetada taExceptio n {
  238                    // T ODO Auto-g enerated m ethod stub
  239                    retu rn null;
  240           }
  241  
  242           
  243   }