93. EPMO Open Source Coordination Office Redaction File Detail Report

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

93.1 Files compared

# Location File Last Modified
1 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ClinicalDisplayWebApp\main\src\java\gov\va\med\imaging\clinicaldisplay\webservices ClinicalDisplayWebservices_v3.java Mon Dec 4 21:35:04 2017 UTC
2 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ClinicalDisplayWebApp\main\src\java\gov\va\med\imaging\clinicaldisplay\webservices ClinicalDisplayWebservices_v3.java Mon Dec 4 21:58:13 2017 UTC

93.2 Comparison summary

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

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

93.4 Active regular expressions

No regular expressions were active.

93.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  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.cli nicaldispl ay.webserv ices;
  27  
  28   import gov .va.med.Pa tientIdent ifier;
  29   import gov .va.med.Ro utingToken ;
  30   import gov .va.med.SE RIALIZATIO N_FORMAT;
  31   import gov .va.med.UR NFactory;
  32   import gov .va.med.ex ceptions.R outingToke nFormatExc eption;
  33   import gov .va.med.im aging.Abst ractImagin gURN;
  34   import gov .va.med.im aging.exch ange.Routi ngTokenHel per;
  35   import gov .va.med.im aging.Stud yURN;
  36   import gov .va.med.im aging.clin icaldispla y.Clinical DisplayRou ter;
  37   import gov .va.med.im aging.clin icaldispla y.ImagingC linicalDis playContex t;
  38   import gov .va.med.im aging.clin icaldispla y.webservi ces.soap.v 3.FatImage Type;
  39   import gov .va.med.im aging.clin icaldispla y.webservi ces.soap.v 3.FilterTy pe;
  40   import gov .va.med.im aging.clin icaldispla y.webservi ces.soap.v 3.ImageAcc essLogEven tType;
  41   import gov .va.med.im aging.clin icaldispla y.webservi ces.soap.v 3.ImageCli nicalDispl ayMetadata ;
  42   import gov .va.med.im aging.clin icaldispla y.webservi ces.soap.v 3.PingServ erTypePing Response;
  43   import gov .va.med.im aging.clin icaldispla y.webservi ces.soap.v 3.Prefetch ResponseTy pePrefetch Response;
  44   import gov .va.med.im aging.clin icaldispla y.webservi ces.soap.v 3.ShallowS tudyType;
  45   import gov .va.med.im aging.clin icaldispla y.webservi ces.soap.v 3.UserCred entials;
  46   import gov .va.med.im aging.clin icaldispla y.webservi ces.transl ator.Clini calDisplay Translator 3;
  47   import gov .va.med.im aging.core .interface s.exceptio ns.Connect ionExcepti on;
  48   import gov .va.med.im aging.core .interface s.exceptio ns.ImageNo tFoundExce ption;
  49   import gov .va.med.im aging.core .interface s.exceptio ns.MethodE xception;
  50   import gov .va.med.im aging.exce ptions.URN FormatExce ption;
  51   import gov .va.med.im aging.exch ange.Image AccessLogE vent;
  52   import gov .va.med.im aging.exch ange.busin ess.Artifa ctResults;
  53   import gov .va.med.im aging.exch ange.busin ess.Study;
  54   import gov .va.med.im aging.exch ange.busin ess.StudyF ilter;
  55   import gov .va.med.im aging.exch ange.busin ess.Reques tor.Purpos eOfUse;
  56   import gov .va.med.im aging.exch ange.busin ess.util.E xchangeUti l;
  57   import gov .va.med.im aging.exch ange.enums .SiteConne ctivitySta tus;
  58   import gov .va.med.im aging.tran sactioncon text.Trans actionCont ext;
  59   import gov .va.med.im aging.tran sactioncon text.Trans actionCont extFactory ;
  60  
  61   import jav a.rmi.Remo teExceptio n;
  62  
  63   import org .apache.lo gging.log4 j.Level;
  64   import org .apache.lo gging.log4 j.LogManag er;
  65   import org .apache.lo gging.log4 j.Logger;
  66  
  67   /**
  68    * @author         
WERFEJ
  69    *
  70    */
  71   public cla ss Clinica lDisplayWe bservices_ v3 
  72   extends Ab stractClin icalDispla yWebservic es
  73   implements  ImageClin icalDispla yMetadata
  74   {
  75           
  76           pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(Clin icalDispla yWebservic es_v3.clas s);
  77           pr ivate fina l static C linicalDis playTransl ator3 inte rpreter =  new Clinic alDisplayT ranslator3 ();
  78  
  79           /*  (non-Java doc)
  80            *  @see gov. va.med.ima ging.clini caldisplay .webservic es.soap.v3 .ImageClin icalDispla yMetadata# getPatient ShallowStu dyList(jav a.lang.Str ing, java. lang.Strin g, java.la ng.String,  gov.va.me d.imaging. clinicaldi splay.webs ervices.so ap.v3.Filt erType, go v.va.med.i maging.cli nicaldispl ay.webserv ices.soap. v3.UserCre dentials)
  81            * /
  82           @O verride
  83           pu blic Shall owStudyTyp e[] getPat ientShallo wStudyList (String tr ansactionI d,
  84                             String  siteId, S tring pati entId, Fil terType fi lter,
  85                             UserCr edentials  credential s) 
  86           th rows Remot eException  
  87           {
  88                    setT ransaction Context(cr edentials,  transacti onId);
  89                    Long  startTime  = System. currentTim eMillis();
  90                    logg er.info("s tart Clini calDisplay  getPatien tShallowSt udyList tr ansaction( " + transa ctionId +  ")" );
  91                    Tran sactionCon text trans actionCont ext = Tran sactionCon textFactor y.get();
  92                    Stud yFilter in ternalFilt er = inter preter.tra nsformFilt er(filter) ;
  93                    // i nitialize  the transa ction cont ext
  94                    //TO DO: set Re quest type  generical ly
  95                    tran sactionCon text.setRe questType( getWepAppN ame() + "  getPatient ShallowStu dyList");
  96                    tran sactionCon text.setPa tientID(pa tientId);
  97                    tran sactionCon text.setQu eryFilter( Transactio nContextFa ctory.getF ilterDateR ange(inter nalFilter. getFromDat e(), inter nalFilter. getToDate( )));
  98                    tran sactionCon text.setQu ality("n/a ");
  99                    tran sactionCon text.setUr n("n/a");
  100                    if(E xchangeUti l.isSiteDO D(credenti als.getSit eNumber()) )
  101                    {
  102                             transa ctionConte xt.setRequ estingSour ce("DOD");
  103                    }
  104                    else
  105                    {
  106                             transa ctionConte xt.setRequ estingSour ce("VA");
  107                    }
  108                    
  109                    // g et the mes sage conte xt first
  110           // MessageCon text msgCo ntext = Me ssageConte xt.getCurr entContext ();
  111           // HttpServle tRequest r equest = ( HttpServle tRequest)  msgContext .getProper ty(HTTPCon stants.MC_ HTTP_SERVL ETREQUEST) ;
  112                    
  113                    logg er.debug(" getPatient ShallowStu dyList tra nsforming  filter int o business  object.") ;
  114                    
  115                    Clin icalDispla yRouter rt r = Imagin gClinicalD isplayCont ext.getRou ter(); 
  116                    //Ro uter route r = Imagin gClinicalD isplayCont ext.getVix Router();
  117  
  118                    logg er.debug(" getPatient ShallowStu dyList get ting patie nt studies  list from  " + rtr.g etClass(). getName() 
  119                                      " type m anager ins tance.");
  120                    gov. va.med.ima ging.clini caldisplay .webservic es.soap.v3 .ShallowSt udyType[]  result = n ull;
  121                    
  122                    try      
  123                    {                                  
  124                             Routin gToken rou tingToken  = RoutingT okenHelper .createSit eAppropria teRoutingT oken(siteI d);
  125                             logger .info("Rou ting getPa tientShall owStudyLis t to site  '" + routi ngToken.to RoutingTok enString()  + "'.");
  126                             // mus t call pat ient artif act comman d in order  to get al l studies  if calling  a VA site  with patc h 104 inst alled (sin ce study g raph SPI n ow only re turns radi ology data )
  127                             Artifa ctResults  artifactRe sults = rt r.getStudy WithReport ArtifactRe sultsForPa tientFromS ite(
  128                                               routingTok en, 
  129                                               PatientIde ntifier.ic nPatientId entifier(p atientId),
  130                                               internalFi lter, true , false);
  131                             
  132                             // upd ate the tr ansaction  context wi th the stu dy count
  133                             transa ctionConte xt.setEntr iesReturne d( artifac tResults = = null ? 0  : artifac tResults.g etArtifact Size() );
  134                             logger .debug("ge tPatientSh allowStudy List trans forming re sults from  business  objects.") ;
  135                             result  = interpr eter.trans formStudie sToShallow Studies(ar tifactResu lts);
  136                    }
  137                    catc h(MethodEx ception mX )
  138                    {
  139                             logger .error("FA ILED getPa tientShall owStudyLis t method E xception:  " + mX.toS tring() +  " ms", mX  );
  140                             transa ctionConte xt.setErro rMessage(m X.getMessa ge());
  141                             transa ctionConte xt.setExce ptionClass Name(mX.ge tClass().g etSimpleNa me());
  142                             throw  new Remote Exception( "Internal  error, una ble to ret rieve pati ent studie s", mX);
  143                    }
  144                    catc h(Connecti onExceptio n cX)
  145                    {
  146                             logger .error("FA ILED getPa tientShall owStudyLis t connecti on Excepti on: " + cX .toString( ) + " ms",  cX );
  147                             transa ctionConte xt.setErro rMessage(c X.getMessa ge());
  148                             transa ctionConte xt.setExce ptionClass Name(cX.ge tClass().g etSimpleNa me());
  149                             throw  new Remote Exception( "Internal  error, una ble to ret rieve pati ent studie s", cX);
  150                    }
  151                    catc h(URNForma tException  iurnfX)
  152                    {
  153                             logger .error("FA ILED getPa tientShall owStudyLis t transact ion(" + tr ansactionI d, iurnfX  );
  154                             transa ctionConte xt.setErro rMessage(i urnfX.getM essage());
  155                             transa ctionConte xt.setExce ptionClass Name(iurnf X.getClass ().getSimp leName());
  156                             throw  new Remote Exception( "Internal  error, una ble to tra nslate stu dy metadat a", iurnfX );
  157                    }        
  158                    catc h (Routing TokenForma tException  rtfX)
  159                    {
  160                             logger .error("FA ILED getPa tientShall owStudyLis t transact ion(" + tr ansactionI d, rtfX );
  161                             transa ctionConte xt.setErro rMessage(r tfX.getMes sage());
  162                             transa ctionConte xt.setExce ptionClass Name(rtfX. getClass() .getSimple Name());
  163                             throw  new Remote Exception( "Internal  error, una ble to tra nslate stu dy metadat a", rtfX);
  164                    }        
  165                    
  166                    if(  logger.get Level() ==  Level.DEB UG )
  167                    {
  168                             String Builder sb  = new Str ingBuilder ();
  169                             
  170                             sb.app end("getPa tientShall owStudyLis t returnin g " + (res ult == nul l ? "<null >" : resul t.length)  + " study  IDs: \n");
  171                             for(in t studyInd ex = 0; re sult != nu ll && stud yIndex < r esult.leng th; ++stud yIndex)
  172                                      sb.appen d("  - " +  result[st udyIndex]. getStudyId () + " \n" );
  173                             
  174                             logger .debug(sb. toString() );
  175                    }
  176                    
  177                    logg er.info("c omplete Cl inicalDisp lay getPat ientShallo wStudyList  transacti on(" + tra nsactionId  + ") in "  + 
  178                                      (System. currentTim eMillis()  - startTim e) +       " ms)" );
  179           re turn resul t;
  180           }
  181  
  182           /*  (non-Java doc)
  183            *  @see gov. va.med.ima ging.clini caldisplay .webservic es.soap.v3 .ImageClin icalDispla yMetadata# getStudyIm ageList(ja va.lang.St ring, java .lang.Stri ng, gov.va .med.imagi ng.clinica ldisplay.w ebservices .soap.v3.U serCredent ials)
  184            * /
  185           @O verride
  186           pu blic FatIm ageType[]  getStudyIm ageList(St ring trans actionId,
  187                             String  studyId,  UserCreden tials cred entials) 
  188           th rows Remot eException  
  189           {
  190                    setT ransaction Context(cr edentials,  transacti onId);
  191           
  192           lo ng startTi me = Syste m.currentT imeMillis( );
  193                    logg er.info("s tart Clini calDisplay  getStudyI mageList t ransaction (" + trans actionId +  ")" );
  194                    
  195                    Tran sactionCon text trans actionCont ext = Tran sactionCon textFactor y.get();
  196                    Stud yURN study Urn = null ;
  197                    gov. va.med.ima ging.clini caldisplay .webservic es.soap.v3 .FatImageT ype[] resu lt = null;
  198                    // i nitialize  the transa ction cont ext
  199                    //TO DO: set Re quest type  generical ly
  200                    
  201                    if(E xchangeUti l.isSiteDO D(credenti als.getSit eNumber()) )
  202                    {
  203                             transa ctionConte xt.setRequ estingSour ce("DOD");
  204                    }
  205                    else
  206                    {
  207                             transa ctionConte xt.setRequ estingSour ce("VA");
  208                    }
  209                    
  210                    tran sactionCon text.setRe questType( getWepAppN ame() + "  getStudyIm ageList");
  211                    tran sactionCon text.setQu eryFilter( "n/a");
  212                    tran sactionCon text.setQu ality("n/a ");
  213                    
  214                    try  {
  215                             studyU rn = URNFa ctory.crea te(studyId , SERIALIZ ATION_FORM AT.CDTP, S tudyURN.cl ass);
  216                             
  217                             transa ctionConte xt.setUrn( studyId);
  218                             // upd ate the tr ansaction  context wi th patient Id
  219                             transa ctionConte xt.setPati entID(stud yUrn.getPa tientId()) ;
  220                             Clinic alDisplayR outer rtr  = ImagingC linicalDis playContex t.getRoute r(); 
  221                             //Rout er vixCore  = Imaging ClinicalDi splayConte xt.getVixR outer();
  222                             
  223                             Study  study = rt r.getPatie ntStudy(st udyUrn);
  224                             transa ctionConte xt.setEntr iesReturne d( study = = null ? 0  : study.g etImageCou nt());
  225                             result  = interpr eter.trans formStudyT oFatImages (study);
  226                             /*
  227                             images  = vixCore .getStudyI mageList(s tudyUrn);
  228                             // upd ate the tr ansaction  context wi th the ima ge count
  229                             transa ctionConte xt.setEntr iesReturne d( images  == null ?  0 : images .size() );
  230                             result  = (gov.va .med.imagi ng.clinica ldisplay.w ebservices .soap.v3.F atImageTyp e[])interp reter.tran sformImage sToFatImag es(images) ;
  231                             */
  232                    }
  233                    catc h (ClassCa stExceptio n e)
  234           {
  235                             // the  URN.creat e() can th row a Clas sCastExcep tion if th e string U RN has the  wrong nam espace ide ntifier
  236                             String  msg = "'"  + studyId  + "' is n ot a valid  study ide ntifier (S tudyURN)." ;
  237                             logger .info(msg) ;
  238                             transa ctionConte xt.setErro rMessage(m sg);
  239                             transa ctionConte xt.setExce ptionClass Name(e.get Class().ge tSimpleNam e());
  240                             throw  new Remote Exception( "Internal  error, una ble to tra nslate stu dy Id", e) ;
  241           } 
  242                    catc h(URNForma tException  iurnfX) {
  243                             logger .info("FAI LED getStu dyImageLis t transact ion(" + tr ansactionI d + ") aft er " + (Sy stem.curre ntTimeMill is() - sta rtTime) +  " ms", iur nfX);
  244                             transa ctionConte xt.setErro rMessage(i urnfX.getM essage());
  245                             transa ctionConte xt.setExce ptionClass Name(iurnf X.getClass ().getSimp leName());
  246                             throw  new Remote Exception( "Internal  error, una ble " + (( studyUrn== null) ? "t o translat e study Id " : "to tr ansform Im ages"), iu rnfX);
  247                    }
  248                    catc h(Connecti onExceptio n cX)
  249                    {
  250                             logger .error("FA ILED getSt udyImageLi st connect ion Except ion: " + c X.toString () + " ms" , cX );
  251                             transa ctionConte xt.setErro rMessage(c X.getMessa ge());
  252                             transa ctionConte xt.setExce ptionClass Name(cX.ge tClass().g etSimpleNa me());
  253                             throw  new Remote Exception( "Internal  error, una ble to ret rieve pati ent studie s", cX);
  254                    }
  255                    catc h(MethodEx ception mX ) {
  256                             logger .info("FAI LED getStu dyImageLis t method e xception ( " + transa ctionId +  ") after "  + (System .currentTi meMillis()  - startTi me) + " ms ", mX);
  257                             transa ctionConte xt.setErro rMessage(m X.getMessa ge());
  258                             transa ctionConte xt.setExce ptionClass Name(mX.ge tClass().g etSimpleNa me());
  259                             throw  new Remote Exception( "Internal  error, una ble to ret rieve stud y images",  mX);
  260                    }
  261                    logg er.info("c omplete Cl inicalDisp lay getStu dyImageLis t transact ion(" + tr ansactionI d + ") in  " + 
  262                                      (System. currentTim eMillis()  - startTim e) +       " ms" );
  263                    retu rn result;    
  264           }
  265           
  266           
  267  
  268           /*  (non-Java doc)
  269            *  @see gov. va.med.ima ging.clini caldisplay .webservic es.soap.v3 .ImageClin icalDispla yMetadata# pingServer Event(java .lang.Stri ng, java.l ang.String , java.lan g.String,  gov.va.med .imaging.c linicaldis play.webse rvices.soa p.v3.UserC redentials )
  270            * /
  271           @O verride
  272           pu blic PingS erverTypeP ingRespons e pingServ erEvent(St ring trans actionId,
  273                             String  clientWor kstation,  String req uestSiteNu mber, User Credential s credenti als) 
  274           th rows Remot eException  
  275           {
  276                    setT ransaction Context(cr edentials,  transacti onId);
  277                    logg er.info("p ingServerE vent from  [" + clien tWorkstati on + "] go ing to sit e number [ " + reques tSiteNumbe r + "]");
  278           
  279                    //IA ppConfigur ation appC onfigurati on = Imagi ngClinical DisplayCon text.getAp pConfigura tion();
  280                    Ping ServerType PingRespon se respons e = PingSe rverTypePi ngResponse .SERVER_UN AVAILABLE;
  281                    
  282                    Tran sactionCon text trans actionCont ext = Tran sactionCon textFactor y.get();
  283                    tran sactionCon text.setRe questType( getWepAppN ame() + "  pingServer  to (" + r equestSite Number + " )");
  284                    tran sactionCon text.setQu eryFilter( "n/a");
  285                    tran sactionCon text.setQu ality("n/a ");
  286                    tran sactionCon text.setUr n("n/a");
  287                    tran sactionCon text.setRe questingSo urce(crede ntials.get SiteNumber ());
  288                    
  289                    Clin icalDispla yRouter rt r = Imagin gClinicalD isplayCont ext.getRou ter(); 
  290                    try
  291                    {
  292                             /*
  293                             Clinic alDisplayW ebAppConfi guration c onfigurati on = getCl inicalDisp layConfigu ration();
  294                             // if  the reques ted site i s DOD or i f V2V is a llowed, th en check f or site st atus
  295                             // if  not DOD an d V2V not  allowed, d on't bothe r checking , just ret urn unavai lable
  296                             if(Exc hangeUtil. isSiteDOD( requestSit eNumber) | | (configu ration.get AllowV2V() ))
  297                             {
  298                                      SiteConn ectivitySt atus siteS tatus = rt r.isSiteAv ailable(re questSiteN umber);                       
  299                                      response  = interpr eter.trans formServer StatusToPi ngServerRe sponse(sit eStatus);
  300                             }
  301                             */                        
  302                             SiteCo nnectivity Status sit eStatus =  rtr.isSite Available( RoutingTok enHelper.c reateSiteA ppropriate RoutingTok en(request SiteNumber ));                         
  303                             respon se = inter preter.tra nsformServ erStatusTo PingServer Response(s iteStatus) ;
  304                    }
  305                    catc h(Connecti onExceptio n cX)
  306                    {
  307                             logger .error("FA ILED pingS erverEvent  connectio n Exceptio n: " + cX. toString()  + " ms",  cX );
  308                             transa ctionConte xt.setErro rMessage(c X.getMessa ge());
  309                             transa ctionConte xt.setExce ptionClass Name(cX.ge tClass().g etSimpleNa me());
  310                             throw  new Remote Exception( "Internal  error, una ble to ret rieve pati ent studie s", cX);
  311                    }
  312                    catc h(MethodEx ception cX )
  313                    {
  314                             logger .error("FA ILED pingS erverEvent  connectio n Exceptio n: " + cX. toString()  + " ms",  cX );
  315                             transa ctionConte xt.setErro rMessage(c X.getMessa ge());
  316                             transa ctionConte xt.setExce ptionClass Name(cX.ge tClass().g etSimpleNa me());
  317                             throw  new Remote Exception( "Internal  error, una ble to ret rieve pati ent studie s", cX);
  318                    }
  319                    catc h (Routing TokenForma tException  rtfX)
  320                    {
  321                             logger .error("FA ILED getPa tientShall owStudyLis t transact ion(" + tr ansactionI d, rtfX );
  322                             transa ctionConte xt.setErro rMessage(r tfX.getMes sage());
  323                             transa ctionConte xt.setExce ptionClass Name(rtfX. getClass() .getSimple Name());
  324                             throw  new Remote Exception( "Internal  error, una ble to tra nslate stu dy metadat a", rtfX);
  325                    }        
  326                    
  327                    retu rn respons e;
  328           }
  329           
  330  
  331           /*  (non-Java doc)
  332            *  @see gov. va.med.ima ging.clini caldisplay .webservic es.soap.v3 .ImageClin icalDispla yMetadata# postImageA ccessEvent (java.lang .String, g ov.va.med. imaging.cl inicaldisp lay.webser vices.soap .v3.ImageA ccessLogEv entType)
  333            * /
  334           @O verride
  335           pu blic boole an postIma geAccessEv ent(String  transacti onId,
  336                             ImageA ccessLogEv entType lo gEvent) 
  337           th rows Remot eException  
  338           {
  339                    setT ransaction Context(lo gEvent.get Credential s(), trans actionId);
  340                    Tran sactionCon text trans actionCont ext = Tran sactionCon textFactor y.get();
  341           lo ng startTi me = Syste m.currentT imeMillis( );
  342                    logg er.info("s tart Clini calDisplay  postImage AccessEven t transact ion(" + tr ansactionI d + ")" );
  343                    logg er.info("l ogEvent im age [" + l ogEvent.ge tId() + "] .");
  344                    try
  345                    {
  346                             transa ctionConte xt.setRequ estType(ge tWepAppNam e() + " po stImageAcc essEvent [ " + logEve nt.getEven tType() +  "]");
  347                             transa ctionConte xt.setQuer yFilter("n /a");
  348                             transa ctionConte xt.setQual ity("n/a") ;
  349                             // 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 
  350                             // the  individua l image id entifier
  351                             transa ctionConte xt.setUrn( logEvent.g etId());
  352                             ImageA ccessLogEv ent event  = interpre ter.transf ormLogEven t(logEvent );
  353                             transa ctionConte xt.setPati entID(even t.getPatie ntIcn());
  354                             Clinic alDisplayR outer rtr  = ImagingC linicalDis playContex t.getRoute r(); 
  355                             //Rout er vixCore  = Imaging ClinicalDi splayConte xt.getVixR outer();
  356                             rtr.lo gImageAcce ssEvent(ev ent);
  357                    }
  358                    catc h(Connecti onExceptio n cX)
  359                    {
  360                             getLog ger().erro r("FAILED  postImageA ccessEvent  connectio n Exceptio n: " + cX. toString()  + " ms",  cX );
  361                             transa ctionConte xt.setErro rMessage(c X.getMessa ge());
  362                             transa ctionConte xt.setExce ptionClass Name(cX.ge tClass().g etSimpleNa me());
  363                             throw  new Remote Exception( "Internal  error, una ble to pos t image ac cess", cX) ;
  364                    }
  365                    catc h(MethodEx ception cX )
  366                    {
  367                             getLog ger().erro r("FAILED  postImageA ccessEvent  method Ex ception: "  + cX.toSt ring() + "  ms", cX ) ;
  368                             transa ctionConte xt.setErro rMessage(c X.getMessa ge());
  369                             transa ctionConte xt.setExce ptionClass Name(cX.ge tClass().g etSimpleNa me());
  370                             handle MethodExce ption(cX);
  371                             throw  new Remote Exception( "Internal  error, una ble to pos t image ac cess", cX) ;
  372                    }
  373                    catc h(URNForma tException  iurnfX) {
  374                             logger .info("FAI LED postIm ageAccessE vent trans action ("  + transact ionId + ") , unable t o translat e image Id ", iurnfX) ;
  375                             transa ctionConte xt.setErro rMessage(i urnfX.getM essage());
  376                             transa ctionConte xt.setExce ptionClass Name(iurnf X.getClass ().getSimp leName());
  377                             throw  new Remote Exception( "Internal  error, una ble to tra nslate ima ge Id", iu rnfX);
  378                    } 
  379                    logg er.info("c omplete Cl inicalDisp lay postIm ageAccessE vent trans action(" +  transacti onId + ")  in " + (Sy stem.curre ntTimeMill is() - sta rtTime) +  " ms" );
  380                    retu rn true;
  381           }
  382  
  383           /*  (non-Java doc)
  384            *  @see gov. va.med.ima ging.clini caldisplay .webservic es.soap.v3 .ImageClin icalDispla yMetadata# prefetchSt udyList(ja va.lang.St ring, java .lang.Stri ng, java.l ang.String , gov.va.m ed.imaging .clinicald isplay.web services.s oap.v3.Fil terType, g ov.va.med. imaging.cl inicaldisp lay.webser vices.soap .v3.UserCr edentials)
  385            * /
  386           @O verride
  387           pu blic Prefe tchRespons eTypePrefe tchRespons e prefetch StudyList( String tra nsactionId , String s iteId, Str ing patien tId, 
  388                             Filter Type filte r, UserCre dentials c redentials )
  389           th rows Remot eException  
  390           {
  391                    // T ODO Auto-g enerated m ethod stub
  392                    retu rn null;
  393           }
  394           
  395           
  396           
  397           @O verride
  398           pu blic Strin g getImage Informatio n(String i mageId, St ring trans actionId,
  399                             UserCr edentials  credential s) 
  400           th rows Remot eException  
  401           {
  402                    setT ransaction Context(cr edentials,  transacti onId);
  403                    long  startTime  = System. currentTim eMillis();
  404                    logg er.info("s tart Clini calDisplay  getImageI nformation  transacti on(" + tra nsactionId  + ")" );
  405                    
  406                    Tran sactionCon text trans actionCont ext = Tran sactionCon textFactor y.get();
  407                    Abst ractImagin gURN urn =  null;
  408                    try
  409                    {
  410                             urn =  URNFactory .create(im ageId, SER IALIZATION _FORMAT.CD TP, Abstra ctImagingU RN.class);
  411                             transa ctionConte xt.setPati entID(urn. getPatient Id());
  412                             transa ctionConte xt.setRequ estType(ge tWepAppNam e() + " ge tImageInfo rmation");
  413                             transa ctionConte xt.setQuer yFilter("n /a");
  414                             transa ctionConte xt.setQual ity("n/a") ;
  415                             transa ctionConte xt.setUrn( urn.toStri ng());
  416                             transa ctionConte xt.setRequ estingSour ce(transac tionContex t.getSiteN umber());
  417                             Clinic alDisplayR outer rtr  = ImagingC linicalDis playContex t.getRoute r(); 
  418                             //Rout er vixCore  = Imaging ClinicalDi splayConte xt.getVixR outer();
  419                             String  response  = rtr.getI mageInform ation(urn) ;
  420                             logger .info("com plete Clin icalDispla y getImage Informatio n transact ion(" + tr ansactionI d + ") in  " + (Syste m.currentT imeMillis( ) - startT ime) + " m s" );
  421                             return  response;
  422                    }
  423                    catc h (ClassCa stExceptio n e)
  424           {
  425                             // the  URN.creat e() can th row a Clas sCastExcep tion if th e string U RN has the  wrong nam espace ide ntifier
  426                             String  msg = "'"  + imageId  + "' is n ot a valid  image ide ntifier (I mageURN)." ;
  427                             logger .info(msg) ;
  428                             transa ctionConte xt.setErro rMessage(m sg);
  429                             transa ctionConte xt.setExce ptionClass Name(e.get Class().ge tSimpleNam e());
  430                             throw  new Remote Exception( "Internal  error, una ble to tra nslate ima ge Id", e) ;
  431           } 
  432                    catc h(URNForma tException  iurnfX)
  433                    {
  434                             logger .info("FAI lED getIma geInformat ion transa ction (" +  transacti onId + "),  unable to  translate  image Id" , iurnfX);
  435                             transa ctionConte xt.setErro rMessage(i urnfX.getM essage());
  436                             transa ctionConte xt.setExce ptionClass Name(iurnf X.getClass ().getSimp leName());
  437                             throw  new Remote Exception( "Internal  error, una ble to tra nslate ima ge Id", iu rnfX);
  438                    }
  439                    catc h(ImageNot FoundExcep tion infX)
  440                    {
  441                             logger .info("FAI LED getIma geInformat ion method  exception  (" + tran sactionId  + ") after  " + (Syst em.current TimeMillis () - start Time) + "  ms", infX) ;
  442                             transa ctionConte xt.setErro rMessage(i nfX.getMes sage());
  443                             transa ctionConte xt.setExce ptionClass Name(infX. getClass() .getSimple Name());
  444                             throw  new Remote Exception( "Internal  error, una ble to ret rieve imag e informat ion", infX );
  445                    }
  446                    catc h(Connecti onExceptio n ioX)
  447                    {
  448                             logger .info("FAI LED getIma geInformat ion method  exception  (" + tran sactionId  + ") after  " + (Syst em.current TimeMillis () - start Time) + "  ms", ioX);
  449                             transa ctionConte xt.setErro rMessage(i oX.getMess age());
  450                             transa ctionConte xt.setExce ptionClass Name(ioX.g etClass(). getSimpleN ame());
  451                             throw  new Remote Exception( "Internal  error, una ble to ret rieve imag e informat ion", ioX) ;
  452                    }
  453                    catc h(MethodEx ception mX )
  454                    {
  455                             logger .info("FAI LED getIma geInformat ion method  exception  (" + tran sactionId  + ") after  " + (Syst em.current TimeMillis () - start Time) + "  ms", mX);
  456                             transa ctionConte xt.setErro rMessage(m X.getMessa ge());
  457                             transa ctionConte xt.setExce ptionClass Name(mX.ge tClass().g etSimpleNa me());
  458                             throw  new Remote Exception( "Internal  error, una ble to ret rieve imag e informat ion", mX);
  459                    }
  460           }
  461  
  462           @O verride
  463           pu blic Strin g getImage SystemGlob alNode(Str ing imageI d, String  transactio nId, 
  464                    User Credential s credenti als)
  465           th rows Remot eException  
  466           {
  467                    setT ransaction Context(cr edentials,  transacti onId);
  468                    long  startTime  = System. currentTim eMillis();
  469                    logg er.info("s tart Clini calDisplay  getImageS ystemGloba lNode tran saction("  + transact ionId + ") " );
  470                    
  471                    Tran sactionCon text trans actionCont ext = Tran sactionCon textFactor y.get();
  472                    Abst ractImagin gURN urn =  null;
  473                    try
  474                    {
  475                             urn =  URNFactory .create(im ageId, SER IALIZATION _FORMAT.CD TP, Abstra ctImagingU RN.class);
  476                             transa ctionConte xt.setPati entID(urn. getPatient Id());
  477                             transa ctionConte xt.setRequ estType(ge tWepAppNam e() + " ge tImageSyst emGlobalNo de");
  478                             transa ctionConte xt.setQuer yFilter("n /a");
  479                             transa ctionConte xt.setQual ity("n/a") ;
  480                             transa ctionConte xt.setUrn( urn.toStri ng());
  481                             transa ctionConte xt.setRequ estingSour ce(transac tionContex t.getSiteN umber());
  482                             Clinic alDisplayR outer rtr  = ImagingC linicalDis playContex t.getRoute r(); 
  483                             //Rout er vixCore  = Imaging ClinicalDi splayConte xt.getVixR outer();
  484                             String  response  = rtr.getI mageSystem GlobalNode (urn);
  485                             logger .info("com plete Clin icalDispla y getImage SystemGlob alNode tra nsaction("  + transac tionId + " ) in " + ( System.cur rentTimeMi llis() - s tartTime)  + " ms" );
  486                             return  response;
  487                    }
  488                    catc h (ClassCa stExceptio n e)
  489           {
  490                             // the  URN.creat e() can th row a Clas sCastExcep tion if th e string U RN has the  wrong nam espace ide ntifier
  491                             String  msg = "'"  + imageId  + "' is n ot a valid  image ide ntifier (I mageURN)." ;
  492                             logger .info(msg) ;
  493                             transa ctionConte xt.setErro rMessage(m sg);
  494                             transa ctionConte xt.setExce ptionClass Name(e.get Class().ge tSimpleNam e());
  495                             throw  new Remote Exception( "Internal  error, una ble to tra nslate ima ge Id", e) ;
  496           } 
  497                    catc h(URNForma tException  iurnfX)
  498                    {
  499                             logger .info("FAI lED getIma geSystemGl obalNode t ransaction  (" + tran sactionId  + "), unab le to tran slate imag e Id", iur nfX);
  500                             transa ctionConte xt.setErro rMessage(i urnfX.getM essage());
  501                             transa ctionConte xt.setExce ptionClass Name(iurnf X.getClass ().getSimp leName());
  502                             throw  new Remote Exception( "Internal  error, una ble to tra nslate ima ge Id", iu rnfX);
  503                    }
  504                    catc h(ImageNot FoundExcep tion infX)
  505                    {
  506                             logger .info("FAI LED getIma geSystemGl obalNode m ethod exce ption (" +  transacti onId + ")  after " +  (System.cu rrentTimeM illis() -  startTime)  + " ms",  infX);
  507                             transa ctionConte xt.setErro rMessage(i nfX.getMes sage());
  508                             transa ctionConte xt.setExce ptionClass Name(infX. getClass() .getSimple Name());
  509                             throw  new Remote Exception( "Internal  error, una ble to ret rieve imag e global n ode", infX );
  510                    }
  511                    catc h(Connecti onExceptio n ioX)
  512                    {
  513                             logger .info("FAI LED getIma geSystemGl obalNode m ethod exce ption (" +  transacti onId + ")  after " +  (System.cu rrentTimeM illis() -  startTime)  + " ms",  ioX);
  514                             transa ctionConte xt.setErro rMessage(i oX.getMess age());
  515                             transa ctionConte xt.setExce ptionClass Name(ioX.g etClass(). getSimpleN ame());
  516                             throw  new Remote Exception( "Internal  error, una ble to ret rieve imag e global n ode", ioX) ;
  517                    }
  518                    catc h(MethodEx ception mX )
  519                    {
  520                             logger .info("FAI LED getIma geSystemGl obalNode m ethod exce ption (" +  transacti onId + ")  after " +  (System.cu rrentTimeM illis() -  startTime)  + " ms",  mX);
  521                             transa ctionConte xt.setErro rMessage(m X.getMessa ge());
  522                             transa ctionConte xt.setExce ptionClass Name(mX.ge tClass().g etSimpleNa me());
  523                             throw  new Remote Exception( "Internal  error, una ble to ret rieve imag e global n ode", mX);
  524                    }
  525           }
  526           @O verride
  527           pu blic Strin g getImage DevFields( String ima geId, Stri ng flags,  String tra nsactionId
  528                             UserCr edentials  credential s)
  529           th rows Remot eException  
  530           {
  531                    setT ransaction Context(cr edentials,  transacti onId);
  532                    long  startTime  = System. currentTim eMillis();
  533                    logg er.info("s tart Clini calDisplay  getImageD evFields t ransaction (" + trans actionId +  ")" );
  534                    
  535                    Tran sactionCon text trans actionCont ext = Tran sactionCon textFactor y.get();
  536                    Abst ractImagin gURN urn =  null;
  537                    try
  538                    {
  539                             urn =  URNFactory .create(im ageId, SER IALIZATION _FORMAT.CD TP, Abstra ctImagingU RN.class);
  540                             transa ctionConte xt.setPati entID(urn. getPatient Id());
  541                             transa ctionConte xt.setRequ estType(ge tWepAppNam e() + " ge tImageDevF ields");
  542                             transa ctionConte xt.setQuer yFilter("n /a");
  543                             transa ctionConte xt.setQual ity("n/a") ;
  544                             transa ctionConte xt.setUrn( urn.toStri ng());
  545                             transa ctionConte xt.setRequ estingSour ce(transac tionContex t.getSiteN umber());
  546                             Clinic alDisplayR outer rtr  = ImagingC linicalDis playContex t.getRoute r(); 
  547                             //Rout er vixCore  = Imaging ClinicalDi splayConte xt.getVixR outer();
  548                             String  response  = rtr.getI mageDevFie lds(urn, f lags);
  549                             logger .info("com plete Clin icalDispla y getImage DevFields  transactio n(" + tran sactionId  + ") in "  + (System. currentTim eMillis()  - startTim e) + " ms"  );
  550                             return  response;
  551                    }
  552                    catc h (ClassCa stExceptio n e)
  553           {
  554                             // the  URN.creat e() can th row a Clas sCastExcep tion if th e string U RN has the  wrong nam espace ide ntifier
  555                             String  msg = "'"  + imageId  + "' is n ot a valid  image ide ntifier (I mageURN)." ;
  556                             logger .info(msg) ;
  557                             transa ctionConte xt.setErro rMessage(m sg);
  558                             transa ctionConte xt.setExce ptionClass Name(e.get Class().ge tSimpleNam e());
  559                             throw  new Remote Exception( "Internal  error, una ble to tra nslate ima ge Id", e) ;
  560           } 
  561                    catc h(URNForma tException  iurnfX)
  562                    {
  563                             logger .info("FAI lED getIma geDevField s transact ion (" + t ransaction Id + "), u nable to t ranslate i mage Id",  iurnfX);
  564                             transa ctionConte xt.setErro rMessage(i urnfX.getM essage());
  565                             transa ctionConte xt.setExce ptionClass Name(iurnf X.getClass ().getSimp leName());
  566                             throw  new Remote Exception( "Internal  error, una ble to tra nslate ima ge Id", iu rnfX);
  567                    }
  568                    catc h(ImageNot FoundExcep tion infX)
  569                    {
  570                             logger .info("FAI LED getIma geDevField s method e xception ( " + transa ctionId +  ") after "  + (System .currentTi meMillis()  - startTi me) + " ms ", infX);
  571                             transa ctionConte xt.setErro rMessage(i nfX.getMes sage());
  572                             transa ctionConte xt.setExce ptionClass Name(infX. getClass() .getSimple Name());
  573                             throw  new Remote Exception( "Internal  error, una ble to ret rieve imag e dev fiel ds", infX) ;
  574                    }
  575                    catc h(Connecti onExceptio n ioX)
  576                    {
  577                             logger .info("FAI LED getIma geDevField s method e xception ( " + transa ctionId +  ") after "  + (System .currentTi meMillis()  - startTi me) + " ms ", ioX);
  578                             transa ctionConte xt.setErro rMessage(i oX.getMess age());
  579                             transa ctionConte xt.setExce ptionClass Name(ioX.g etClass(). getSimpleN ame());
  580                             throw  new Remote Exception( "Internal  error, una ble to ret rieve imag e dev fiel ds", ioX);
  581                    }
  582                    catc h(MethodEx ception mX )
  583                    {
  584                             logger .info("FAI LED getIma geDevField s method e xception ( " + transa ctionId +  ") after "  + (System .currentTi meMillis()  - startTi me) + " ms ", mX);
  585                             transa ctionConte xt.setErro rMessage(m X.getMessa ge());
  586                             transa ctionConte xt.setExce ptionClass Name(mX.ge tClass().g etSimpleNa me());
  587                             throw  new Remote Exception( "Internal  error, una ble to ret rieve imag e dev fiel ds", mX);
  588                    }
  589           }
  590           
  591           pr ivate void  setTransa ctionConte xt(
  592                             gov.va .med.imagi ng.clinica ldisplay.w ebservices .soap.v3.U serCredent ials crede ntials,
  593                             String  transacti onId)
  594           {
  595                    logg er.info(
  596                                      "setTran sactionCon text, id=' " + transa ctionId + 
  597                                      "', user name='" +  credential s == null  || credent ials.getFu llname() = = null ? " null" : cr edentials. getFullnam e() + 
  598                                      "'.");
  599                    Tran sactionCon text trans actionCont ext = Tran sactionCon textFactor y.get();
  600                    
  601                    if(t ransaction Id != null )
  602                             transa ctionConte xt.setTran sactionId( transactio nId);
  603                    
  604                    if(c redentials  != null)
  605                    {
  606                             if( cr edentials. getFullnam e() != nul l )
  607                                      transact ionContext .setFullNa me(credent ials.getFu llname());
  608                             if( cr edentials. getSiteNum ber() != n ull )
  609                                      transact ionContext .setSiteNu mber(crede ntials.get SiteNumber ());
  610                             if( cr edentials. getSiteNam e() != nul l )
  611                                      transact ionContext .setSiteNa me(credent ials.getSi teName());
  612                             if( cr edentials. getSsn() ! = null )
  613                                      transact ionContext .setSsn(cr edentials. getSsn());
  614                             if(cre dentials.g etDuz() !=  null)
  615                                      transact ionContext .setDuz(cr edentials. getDuz());
  616                             transa ctionConte xt.setPurp oseOfUse(P urposeOfUs e.routineM edicalCare .getDescri ption());
  617                    }                 
  618           }
  619           
  620           pr otected St ring getWe pAppName()
  621           {
  622                    retu rn "Clinic al Display  WebApp V3 ";
  623           }
  624   }