198. EPMO Open Source Coordination Office Redaction File Detail Report

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

198.1 Files compared

# Location File Last Modified
1 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\FederationWebApp\main\src\java\gov\va\med\imaging\federation\webservices FederationWebservices.java Mon Dec 4 21:35:10 2017 UTC
2 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\FederationWebApp\main\src\java\gov\va\med\imaging\federation\webservices FederationWebservices.java Mon Dec 4 22:00:43 2017 UTC

198.2 Comparison summary

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

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

198.4 Active regular expressions

No regular expressions were active.

198.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: Mar  4, 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.fed eration.we bservices;
  27  
  28   import gov .va.med.Pa tientIdent ifier;
  29   import gov .va.med.ex ceptions.G lobalArtif actIdentif ierFormatE xception;
  30   import gov .va.med.ex ceptions.R outingToke nFormatExc eption;
  31   import gov .va.med.im aging.exch ange.Routi ngTokenHel per;
  32   import gov .va.med.im aging.arti factsource .ResolvedA rtifactSou rce;
  33   import gov .va.med.im aging.core .interface s.exceptio ns.Connect ionExcepti on;
  34   import gov .va.med.im aging.core .interface s.exceptio ns.MethodE xception;
  35   import gov .va.med.im aging.exce ptions.URN FormatExce ption;
  36   import gov .va.med.im aging.exch ange.Image AccessLogE vent;
  37   import gov .va.med.im aging.exch ange.busin ess.Patien t;
  38   import gov .va.med.im aging.exch ange.busin ess.Study;
  39   import gov .va.med.im aging.exch ange.busin ess.StudyF ilter;
  40   import gov .va.med.im aging.fede ration.Fed erationRou ter;
  41   import gov .va.med.im aging.fede ration.Ima gingFedera tionContex t;
  42   import gov .va.med.im aging.fede ration.web services.i ntf.ImageF ederationM etadata;
  43   import gov .va.med.im aging.fede ration.web services.t ranslator. Federation WebAppTran slator;
  44   import gov .va.med.im aging.fede ration.web services.t ypes.Feder ationFilte rType;
  45   import gov .va.med.im aging.fede ration.web services.t ypes.Feder ationImage AccessLogE ventType;
  46   import gov .va.med.im aging.fede ration.web services.t ypes.Feder ationStudy Type;
  47   import gov .va.med.im aging.fede ration.web services.t ypes.Patie ntType;
  48   import gov .va.med.im aging.fede ration.web services.t ypes.Reque storType;
  49   import gov .va.med.im aging.tran sactioncon text.Trans actionCont ext;
  50   import gov .va.med.im aging.tran sactioncon text.Trans actionCont extFactory ;
  51  
  52   import jav a.rmi.Remo teExceptio n;
  53   import jav a.text.Par seExceptio n;
  54   import jav a.util.Lis t;
  55  
  56   import org .apache.lo gging.log4 j.LogManag er;
  57   import org .apache.lo gging.log4 j.Logger;
  58  
  59   /**
  60    * @author         
WERFEJ
  61    *
  62    */
  63   public cla ss Federat ionWebserv ices 
  64   extends Ab stractFede rationWebs ervices
  65   implements  ImageFede rationMeta data 
  66   {
  67           pr ivate fina l static F ederationW ebAppTrans lator fede rationTran slator = n ew Federat ionWebAppT ranslator( );
  68           pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(Fede rationWebs ervices.cl ass);
  69  
  70           /*  (non-Java doc)
  71            *  @see gov. va.med.ima ging.feder ation.webs ervices.in tf.ImageFe derationMe tadata#get PatientStu dyList(gov .va.med.im aging.webs ervices.ty pes.Reques torType, g ov.va.med. imaging.we bservices. types.Vist aFilterTyp e, java.la ng.String,  java.lang .String, j ava.lang.S tring)
  72            * /
  73           @O verride
  74           pu blic Feder ationStudy Type[] get PatientStu dyList(Req uestorType  requestor ,
  75                             Federa tionFilter Type filte r, String  patientId,  String tr ansactionI d,
  76                             String  siteId) 
  77           th rows Remot eException  
  78           {
  79                    setT ransaction Id(transac tionId);
  80                    Long  startTime  = System. currentTim eMillis();
  81                    logg er.info("s tart Feder ation getP atientStud yList tran saction("  + transact ionId + ") " );
  82                    Stud yFilter st udyFilter  = null;
  83                    try
  84                    {
  85                             studyF ilter = fe derationTr anslator.t ransformFi lter(filte r);
  86                    }
  87                    catc h (GlobalA rtifactIde ntifierFor matExcepti on x)
  88                    {
  89                             getLog ger().erro r(x);
  90                             throw  new Remote Exception( x.getMessa ge());
  91                    }
  92                    Tran sactionCon text trans actionCont ext = Tran sactionCon textFactor y.get();
  93                    tran sactionCon text.setRe questType( "Federatio n WebApp g etPatientS tudyList") ;
  94                    tran sactionCon text.setPa tientID(pa tientId);
  95                    tran sactionCon text.setQu eryFilter( Transactio nContextFa ctory.getF ilterDateR ange(study Filter.get FromDate() , studyFil ter.getToD ate()));
  96                    tran sactionCon text.setQu ality("n/a ");
  97                    tran sactionCon text.setUr n("n/a");
  98                    
  99                    Fede rationRout er router  = ImagingF ederationC ontext.get Federation Router();
  100                    if(r outer == n ull)
  101                             throw  new Remote Exception( "Internal  error, una ble to ret rieve pati ent studie s");
  102                    
  103                    //tr ansactionC ontext.set Requesting Source(tra nsactionCo ntext.getS iteNumber( ));
  104                    // J MW 4/8/08  - the tran saction co ntext cont ains the c urrent sit e details,  not detai ls from re questor, t hat is in  the reques tor object
  105                    tran sactionCon text.setRe questingSo urce(reque stor.getFa cilityId() );
  106                    // n ot sure ab out this n ext line.. . 4/8/08 j mw
  107                    tran sactionCon text.setSi teNumber(r equestor.g etFacility Id());
  108                    gov. va.med.ima ging.feder ation.webs ervices.ty pes.Federa tionStudyT ype[] resu lt = null;              
  109                    try
  110                    {
  111                             List<S tudy> stud ies = rout er.getPati entStudyLi st(Routing TokenHelpe r.createSi teAppropri ateRouting Token(site Id), 
  112                                               PatientIde ntifier.ic nPatientId entifier(p atientId),  studyFilt er);
  113                             transa ctionConte xt.setEntr iesReturne d( studies  == null ?  0 : studi es.size()  );
  114                             logger .info("Rec eived [" +  (studies  == null ?  "0" : stud ies.size() ) + "] stu dies from  router");                   
  115                             result  = federat ionTransla tor.transf ormStudies (studies);
  116                    }
  117                    catc h(MethodEx ception mX )
  118                    {
  119                             logger .error("FA ILED getPa tientStudy List metho d Exceptio n: " + mX. toString()  + " ms",  mX );
  120                             transa ctionConte xt.setErro rMessage(m X.getMessa ge());
  121                             transa ctionConte xt.setExce ptionClass Name(mX.ge tClass().g etSimpleNa me());
  122                             throw  new Remote Exception( "Internal  error, una ble to ret rieve pati ent studie s", mX);
  123                    }
  124                    /*
  125                    catc h(ImagingU RNFormatEx ception iu rnfX)
  126                    {
  127                             logger .error("FA ILED getPa tientStudy List trans action(" +  transacti onId, iurn fX );
  128                             transa ctionConte xt.setErro rMessage(i urnfX.getM essage());
  129                             throw  new Remote Exception( "Internal  error, una ble to tra nslate stu dy metadat a", iurnfX );
  130                    }
  131                    */
  132                    catc h(ParseExc eption pX)
  133                    {
  134                             logger .error("FA ILED getPa tientStudy List trans action(" +  transacti onId, pX ) ;
  135                             transa ctionConte xt.setErro rMessage(p X.getMessa ge());
  136                             transa ctionConte xt.setExce ptionClass Name(pX.ge tClass().g etSimpleNa me());
  137                             throw  new Remote Exception( "Internal  error, una ble to tra nslate stu dy metadat a", pX);
  138                    }
  139                    catc h(Connecti onExceptio n cX)
  140                    {
  141                             logger .error("FA ILED getPa tientStudy List with  Connection  Exception : " + cX.t oString(),  cX );
  142                             transa ctionConte xt.setErro rMessage(c X.getMessa ge());
  143                             transa ctionConte xt.setExce ptionClass Name(cX.ge tClass().g etSimpleNa me());
  144                             throw  new Remote Exception( "Internal  error, una ble to ret rieve pati ent studie s", cX);
  145                    }
  146                    catc h (Routing TokenForma tException  rtfX)
  147                    {
  148                             logger .error("FA ILED getPa tientStudy List with  Connection  Exception : " + rtfX .toString( ), rtfX );
  149                             transa ctionConte xt.setErro rMessage(r tfX.getMes sage());
  150                             transa ctionConte xt.setExce ptionClass Name(rtfX. getClass() .getSimple Name());
  151                             throw  new Remote Exception( "Internal  error, una ble to ret rieve pati ent studie s", rtfX);
  152                    }
  153                    
  154                    logg er.info("c omplete Fe deration g etPatientS tudyList t ransaction (" + trans actionId +  ") in " +  
  155                                      (System. currentTim eMillis()  - startTim e) +       " ms)" );
  156                    retu rn result;
  157           }
  158  
  159           /*  (non-Java doc)
  160            *  @see gov. va.med.ima ging.feder ation.webs ervices.in tf.ImageFe derationMe tadata#pos tImageAcce ssEvent(ja va.lang.St ring, gov. va.med.ima ging.webse rvices.typ es.VistaIm ageAccessL ogEventTyp e)
  161            * /
  162           @O verride
  163           pu blic boole an postIma geAccessEv ent(String  transacti onId, 
  164                             Federa tionImageA ccessLogEv entType lo gEvent) 
  165           th rows Remot eException  
  166           {
  167                    setT ransaction Id(transac tionId);
  168           lo ng startTi me = Syste m.currentT imeMillis( );
  169           Tr ansactionC ontext tra nsactionCo ntext = Tr ansactionC ontextFact ory.get();
  170  
  171                    Fede rationRout er router  = ImagingF ederationC ontext.get Federation Router();
  172                    if(r outer == n ull)
  173                             throw  new Remote Exception( "Internal  error, una ble to ret rieve pati ent studie s");
  174                    
  175           lo gger.info( "start Fed eration po stImageAcc essEvent t ransaction (" + trans actionId +  ")" );
  176                    logg er.info("l ogEvent im age [" + l ogEvent.ge tImageId()  + "].");
  177                    try
  178                    {
  179                             ImageA ccessLogEv ent event  = federati onTranslat or.transfo rmLogEvent (logEvent) ;
  180                             // not  sure if t his should  be here,  what if IC N is empty ?
  181                             
  182                             transa ctionConte xt.setPati entID(even t.getPatie ntIcn());
  183                             transa ctionConte xt.setRequ estType("F ederation  WebApp pos tImageAcce ssEvent ["  + logEven t.getEvent Type() + " ]");
  184                             transa ctionConte xt.setQuer yFilter("n /a");
  185                             transa ctionConte xt.setQual ity("n/a") ;
  186                             transa ctionConte xt.setRequ estingSour ce(transac tionContex t.getSiteN umber());
  187                             // nee d to use t he Id from  the webse rvice log  event sinc e it is th e full URN  and not j ust 
  188                             // the  individua l image id entifier
  189                             transa ctionConte xt.setUrn( logEvent.g etImageId( ));
  190                             router .logImageA ccessEvent (event);
  191                    }
  192                    catc h(MethodEx ception mX )
  193                    {
  194                             logger .info("FAI LED postIm ageAccessE vent metho d exceptio n (" + tra nsactionId  + ") afte r " + (Sys tem.curren tTimeMilli s() - star tTime) + "  ms", mX);
  195                             transa ctionConte xt.setErro rMessage(m X.getMessa ge());
  196                             transa ctionConte xt.setExce ptionClass Name(mX.ge tClass().g etSimpleNa me());
  197                             throw  new Remote Exception( "Internal  error, una ble to pos t image ac cess", mX) ;
  198                    }
  199                    catc h(Connecti onExceptio n cX)
  200                    {
  201                             logger .info("FAI LED postIm ageAccessE vent conne ction exce ption (" +  transacti onId + ")  after " +  (System.cu rrentTimeM illis() -  startTime)  + " ms",  cX);
  202                             transa ctionConte xt.setErro rMessage(c X.getMessa ge());
  203                             transa ctionConte xt.setExce ptionClass Name(cX.ge tClass().g etSimpleNa me());
  204                             throw  new Remote Exception( "Internal  error, una ble to pos t image ac cess", cX) ;
  205                    }
  206                    catc h(URNForma tException  iurnfX) {
  207                             transa ctionConte xt.setErro rMessage(i urnfX.getM essage());
  208                             transa ctionConte xt.setExce ptionClass Name(iurnf X.getClass ().getSimp leName());
  209                             logger .info("FAI lED postIm ageAccessE vent trans action ("  + transact ionId + ") , unable t o translat e image Id ", iurnfX) ;
  210                             throw  new Remote Exception( "Internal  error, una ble to tra nslate ima ge Id", iu rnfX);
  211                    }
  212                    
  213                    logg er.info("c omplete Fe deration p ostImageAc cessEvent  transactio n(" + tran sactionId  + ") in "  + (System. currentTim eMillis()  - startTim e) + " ms"  );
  214                    retu rn true;
  215           }
  216  
  217           /*  (non-Java doc)
  218            *  @see gov. va.med.ima ging.feder ation.webs ervices.in tf.ImageFe derationMe tadata#pre fetchStudy List(java. lang.Strin g, java.la ng.String,  java.lang .String, g ov.va.med. imaging.we bservices. types.Vist aFilterTyp e)
  219            * /
  220           @O verride
  221           pu blic Strin g prefetch StudyList( String tra nsactionId , String s iteId,
  222                             String  patientId , Federati onFilterTy pe filter)  
  223           th rows Remot eException  
  224           {
  225                    // T ODO Auto-g enerated m ethod stub
  226                    retu rn null;
  227           }
  228           
  229           @O verride
  230           pu blic Strin g getImage DevFields( String ima geUrn, Str ing flags,
  231                             String  transacti onId) 
  232           th rows Remot eException  
  233           {
  234                    retu rn getImag eDevFields InternalHa ndleExcept ions(image Urn, flags , transact ionId);
  235           }
  236  
  237           @O verride
  238           pu blic Strin g getImage Informatio n(String i mageUrn, S tring tran sactionId)
  239           th rows Remot eException  
  240           {
  241                    retu rn getImag eInformati onInternal HandleExce ptions(ima geUrn, tra nsactionId );
  242           }
  243  
  244           @O verride
  245           pu blic Strin g getImage SystemGlob alNode(Str ing imageU rn, String  transacti onId)
  246           th rows Remot eException  
  247           {
  248                    retu rn getImag eSystemGlo balNodeInt ernalHandl eException s(imageUrn , transact ionId);
  249           }
  250  
  251           @O verride
  252           pu blic Strin g[] getPat ientSitesV isited(Str ing patien tIcn, Stri ng transac tionId, 
  253                    Stri ng siteId)  
  254           th rows Remot eException  
  255           {
  256                    retu rn getPati entSitesVi sitedInter nalHandleE xceptions( patientIcn , transact ionId, sit eId);
  257           }
  258  
  259           @O verride
  260           pu blic Patie ntType[] s earchPatie nts(String  searchCri teria,
  261                             String  transacti onId, Stri ng siteId)  
  262           th rows Remot eException  
  263           {
  264                    setT ransaction Id(transac tionId);
  265                    long  startTime  = System. currentTim eMillis();
  266                    logg er.info("s tart Feder ation sear chPatients  transacti on(" + tra nsactionId  + ")" );
  267                    
  268                    Tran sactionCon text trans actionCont ext = Tran sactionCon textFactor y.get();
  269                    try{
  270                             transa ctionConte xt.setPati entID("n/a ");
  271                             transa ctionConte xt.setRequ estType("F ederation  WebApp sea rchPatient s");
  272                             transa ctionConte xt.setQuer yFilter("n /a");
  273                             transa ctionConte xt.setQual ity("n/a") ;
  274                             transa ctionConte xt.setRequ estingSour ce(transac tionContex t.getSiteN umber());
  275                             Federa tionRouter  router =  ImagingFed erationCon text.getFe derationRo uter();
  276                             if(rou ter == nul l)
  277                                      throw ne w RemoteEx ception("I nternal er ror, unabl e to retri eve patien t studies" );
  278                             
  279                             List<P atient> pa tients = r outer.getP atientList (searchCri teria, Rou tingTokenH elper.crea teSiteAppr opriateRou tingToken( siteId) );
  280                             gov.va .med.imagi ng.federat ion.webser vices.type s.PatientT ype[] resp onse = fed erationTra nslator.tr ansformPat ients(pati ents);
  281                             transa ctionConte xt.setEntr iesReturne d( respons e == null  ? 0 : resp onse.lengt h );
  282                             logger .info("com plete Fede ration sea rchPatient s transact ion(" + tr ansactionI d + ") in  " + (Syste m.currentT imeMillis( ) - startT ime) + " m s" );
  283                             return  response;
  284                    }                 
  285                    catc h(MethodEx ception mX )
  286                    {
  287                             logger .info("FAI LED search Patients m ethod exce ption (" +  transacti onId + ")  after " +  (System.cu rrentTimeM illis() -  startTime)  + " ms",  mX);
  288                             transa ctionConte xt.setErro rMessage(m X.getMessa ge());
  289                             transa ctionConte xt.setExce ptionClass Name(mX.ge tClass().g etSimpleNa me());
  290                             throw  new Remote Exception( "Internal  error, una ble to ret rieve stud y image gl obal node" , mX);
  291                    }
  292                    catc h(Connecti onExceptio n cX)
  293                    {
  294                             logger .info("FAI LED search Patients c onnection  exception  (" + trans actionId +  ") after  " + (Syste m.currentT imeMillis( ) - startT ime) + " m s", cX);
  295                             transa ctionConte xt.setErro rMessage(c X.getMessa ge());
  296                             transa ctionConte xt.setExce ptionClass Name(cX.ge tClass().g etSimpleNa me());
  297                             throw  new Remote Exception( "Internal  error, una ble to ret rieve imag e dev fiel ds", cX);
  298                    }
  299                    catc h (Routing TokenForma tException  rtfX)
  300                    {
  301                             logger .info("FAI LED search Patients e xception ( " + transa ctionId +  ") after "  + (System .currentTi meMillis()  - startTi me) + " ms ", rtfX);
  302                             transa ctionConte xt.setErro rMessage(r tfX.getMes sage());
  303                             transa ctionConte xt.setExce ptionClass Name(rtfX. getClass() .getSimple Name());
  304                             throw  new Remote Exception( "Internal  error, una ble to ret rieve imag e dev fiel ds", rtfX) ;
  305                    }
  306           }
  307           
  308           /*  (non-Java doc)
  309            *  @see gov. va.med.ima ging.feder ation.webs ervices.Ab stractFede rationWebs ervices#ge tWepAppNam e()
  310            * /
  311           @O verride
  312           pr otected St ring getWe pAppName()  
  313           {
  314                    retu rn "Federa tion WebAp p V1";
  315           }
  316  
  317           /*  (non-Java doc)
  318            *  @see gov. va.med.ima ging.feder ation.webs ervices.Ab stractFede rationWebs ervices#tr ansformSit esToSiteNu mberArary( java.util. List)
  319            * /
  320           @O verride
  321           pr otected St ring[] tra nsformSite sToSiteNum berArray(L ist<Resolv edArtifact Source> si tes) 
  322           {
  323                    retu rn federat ionTransla tor.transf ormSitesTo SiteNumber Arary(site s);
  324           }
  325           
  326   }