342. EPMO Open Source Coordination Office Redaction File Detail Report

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

342.1 Files compared

# Location File Last Modified
1 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\PathologyVistaImagingDataSourceProvider\main\src\java\gov\va\med\imaging\vistaimagingdatasource\pathology VistaImagingPathologyDataSourceService.java Mon Dec 4 21:35:10 2017 UTC
2 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\PathologyVistaImagingDataSourceProvider\main\src\java\gov\va\med\imaging\vistaimagingdatasource\pathology VistaImagingPathologyDataSourceService.java Mon Dec 4 22:05:05 2017 UTC

342.2 Comparison summary

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

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

342.4 Active regular expressions

No regular expressions were active.

342.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: Jul  12, 2012
  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.vis taimagingd atasource. pathology;
  27  
  28   import jav a.io.IOExc eption;
  29   import jav a.util.Arr ayList;
  30   import jav a.util.Dat e;
  31   import jav a.util.Lis t;
  32  
  33   import org .apache.lo gging.log4 j.LogManag er;
  34   import org .apache.lo gging.log4 j.Logger;
  35  
  36   import gov .va.med.Pa tientIdent ifier;
  37   import gov .va.med.Ro utingToken ;
  38   import gov .va.med.im aging.arti factsource .ResolvedA rtifactSou rce;
  39   import gov .va.med.im aging.core .interface s.exceptio ns.Connect ionExcepti on;
  40   import gov .va.med.im aging.core .interface s.exceptio ns.MethodE xception;
  41   import gov .va.med.im aging.data source.exc eptions.In validCrede ntialsExce ption;
  42   import gov .va.med.im aging.exch ange.busin ess.Resolv edSite;
  43   import gov .va.med.im aging.exch ange.busin ess.Site;
  44   import gov .va.med.im aging.path ology.Abst ractPathol ogySite;
  45   import gov .va.med.im aging.path ology.Path ologyAcqui sitionSite ;
  46   import gov .va.med.im aging.path ology.Path ologyCase;
  47   import gov .va.med.im aging.path ology.Path ologyCaseC onsultatio nURN;
  48   import gov .va.med.im aging.path ology.Path ologyCaseR eportField ;
  49   import gov .va.med.im aging.path ology.Path ologyCaseS pecimen;
  50   import gov .va.med.im aging.path ology.Path ologyCaseS upplementa lReport;
  51   import gov .va.med.im aging.path ology.Path ologyCaseT emplate;
  52   import gov .va.med.im aging.path ology.Path ologyCaseU RN;
  53   import gov .va.med.im aging.path ology.Path ologyCaseU pdateAttri buteResult ;
  54   import gov .va.med.im aging.path ology.Path ologyCptCo de;
  55   import gov .va.med.im aging.path ology.Path ologyCptCo deResult;
  56   import gov .va.med.im aging.path ology.Path ologyField URN;
  57   import gov .va.med.im aging.path ology.Path ologyField Value;
  58   import gov .va.med.im aging.path ology.Path ologyReadi ngSite;
  59   import gov .va.med.im aging.path ology.Path ologySaveC aseReportR esult;
  60   import gov .va.med.im aging.path ology.Path ologySite;
  61   import gov .va.med.im aging.path ology.Path ologySnome dCode;
  62   import gov .va.med.im aging.path ology.data source.Pat hologyData SourceSpi;
  63   import gov .va.med.im aging.path ology.enum s.Patholog yCaseAssis tance;
  64   import gov .va.med.im aging.path ology.enum s.Patholog yCaseConsu ltationUpd ateStatus;
  65   import gov .va.med.im aging.path ology.enum s.Patholog yCaseReser veResult;
  66   import gov .va.med.im aging.path ology.enum s.Patholog yElectroni cSignature Need;
  67   import gov .va.med.im aging.path ology.enum s.Patholog yField;
  68   import gov .va.med.im aging.tran sactioncon text.Trans actionCont extFactory ;
  69   import gov .va.med.im aging.url. vista.Vist aQuery;
  70   import gov .va.med.im aging.url. vista.exce ptions.Inv alidVistaC redentials Exception;
  71   import gov .va.med.im aging.url. vista.exce ptions.Vis taMethodEx ception;
  72   import gov .va.med.im aging.vist adatasourc e.common.V istaCommon Utilities;
  73   import gov .va.med.im aging.vist adatasourc e.session. VistaSessi on;
  74   import gov .va.med.im aging.vist aimaging.c odegenerat or.VistaIm agingCodeG eneratorDa taSourceSe rvice;
  75   import gov .va.med.im aging.vist aimaging.c odegenerat or.annotat ion.VistaI magingGene ratedDataS ourceServi ceType;
  76   import gov .va.med.im aging.vist aimaging.c odegenerat or.annotat ion.VistaI magingGene ratedDataS ourceMetho d;
  77   import gov .va.med.im aging.vist aimagingda tasource.A bstractVis taImagingD ataSourceS ervice;
  78   import gov .va.med.im aging.vist aimagingda tasource.p athology.q uery.Vista ImagingPat hologyQuer yFactory;
  79   import gov .va.med.im aging.vist aimagingda tasource.p athology.t ranslator. VistaImagi ngPatholog yTranslato r;
  80  
  81   /**
  82    * @author         
WERFEJ
  83    *
  84    */
  85   @VistaImag ingGenerat edDataSour ceServiceT ype
  86   public abs tract clas s VistaIma gingPathol ogyDataSou rceService
  87   extends Ab stractVist aImagingDa taSourceSe rvice
  88   implements  VistaImag ingCodeGen eratorData SourceServ ice, Patho logyDataSo urceSpi
  89   {
  90           
  91           pu blic final  static St ring SUPPO RTED_PROTO COL = "vis taimaging" ;
  92           pr ivate Logg er logger  = LogManag er.getLogg er(this.ge tClass());
  93           
  94           //  The requi red versio n of VistA  Imaging n eeded to e xecute the  RPC calls  for this  operation
  95           pu blic final  static St ring MAG_R EQUIRED_VE RSION = "3 .0P122"; 
  96           
  97           pu blic Vista ImagingPat hologyData SourceServ ice(Resolv edArtifact Source res olvedArtif actSource,  
  98                             String  protocol)
  99           {
  100                    supe r(resolved ArtifactSo urce, prot ocol);
  101                    if(!  (resolved ArtifactSo urce insta nceof Reso lvedSite)  )
  102                             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() +  "'.");
  103           }
  104           
  105           @O verride
  106           pu blic Strin g getVista ImagingReq uiredVersi on()
  107           {
  108                    retu rn MAG_REQ UIRED_VERS ION;
  109           }
  110  
  111           /* *
  112            *  The artif act source  must be c hecked in  the constr uctor to a ssure that  it is an  instance
  113            *  of Resolv edSite.
  114            *  
  115            *  @return
  116            * /
  117           pr otected Re solvedSite  getResolv edSite()
  118           {
  119                    retu rn (Resolv edSite)get ResolvedAr tifactSour ce();
  120           }
  121           
  122           pr otected Si te getSite ()
  123           {
  124                    retu rn getReso lvedSite() .getSite() ;
  125           }
  126  
  127           @V istaImagin gGenerated DataSource Method(que ryFactoryM ethodName= "gov.va.me d.imaging. vistaimagi ngdatasour ce.patholo gy.query.V istaImagin gPathology QueryFacto ry.createG etLockMinu tesQuery",
  128                             transl ationResul tMethodNam e="gov.va. med.imagin g.vistaima gingdataso urce.patho logy.trans lator.Vist aImagingPa thologyTra nslator.tr anslateLoc kMinutes",
  129                             queryF actoryPara meters="")
  130           pu blic abstr act Intege r getLockE xpiresMinu tes(Routin gToken glo balRouting Token)
  131           th rows Metho dException , Connecti onExceptio n;
  132           
  133           @V istaImagin gGenerated DataSource Method(que ryFactoryM ethodName= "gov.va.me d.imaging. vistaimagi ngdatasour ce.patholo gy.query.V istaImagin gPathology QueryFacto ry.createG etSlidesVi staQuery",
  134                             transl ationResul tMethodNam e="gov.va. med.imagin g.vistaima gingdataso urce.patho logy.trans lator.Vist aImagingPa thologyTra nslator.tr anslateSpe cimens",
  135                             inputP arametersD escription ="patholog yCaseUrn.t oString()" )
  136           pu blic abstr act List<P athologyCa seSpecimen > getCaseS pecimens(
  137                             Pathol ogyCaseURN  pathology CaseUrn) 
  138           th rows Metho dException , Connecti onExceptio n;
  139  
  140           @O verride
  141           pu blic List< PathologyC ase> getCa ses(Routin gToken glo balRouting Token,
  142                             boolea n released , int days , String r equestingS iteId) 
  143           th rows Metho dException , Connecti onExceptio n
  144           {
  145                    Vist aCommonUti lities.set DataSource MethodAndV ersion("ge tCases", g etDataSour ceVersion( ));
  146                    logg er.info("g etCases ("  + (releas ed == true  ? "releas ed" : "unr eleased")  + ", days= '" + days  + "'" + (r equestingS iteId == n ull ? "" :  " request ingSiteId= '" + reque stingSiteI d + "'") +  ") Transa ctionConte xt (" + Tr ansactionC ontextFact ory.get(). getDisplay Identity()  + ").");
  147                    Vist aSession l ocalVistaS ession = n ull;
  148                    try 
  149                    {
  150                             localV istaSessio n = getVis taSession( );
  151                             VistaQ uery query  = 
  152                                      VistaIma gingPathol ogyQueryFa ctory.crea teGetCases VistaQuery (released,  days, req uestingSit eId);
  153                             String  rtn = loc alVistaSes sion.call( query);
  154                             return  translate AndLoadCas eResult(lo calVistaSe ssion, rtn );
  155                    }
  156                    catc h(IOExcept ion ioX)
  157                    {
  158                             logger .error("Ex ception ge tting Vist A session" , ioX);
  159                    thro w new Conn ectionExce ption(ioX) ;
  160                    }
  161                    catc h (Invalid VistaCrede ntialsExce ption e)
  162                    {
  163                             throw  new Invali dCredentia lsExceptio n(e.getMes sage());
  164                    }
  165                    catc h (VistaMe thodExcept ion e)
  166                    {
  167                             throw  new Method Exception( e.getMessa ge());
  168                    }
  169                    fina lly
  170           {
  171                    try{ localVista Session.cl ose();}cat ch(Throwab le t){}
  172           }
  173           }
  174           
  175           pr ivate List <Pathology Case> tran slateAndLo adCaseResu lt(VistaSe ssion vist aSession,  String vis taResult) 
  176           th rows Metho dException , IOExcept ion, Inval idVistaCre dentialsEx ception, V istaMethod Exception
  177           {
  178                    List <Pathology Case> case s = VistaI magingPath ologyTrans lator.tran slateLabCa sesResult( getSite(),  vistaResu lt);
  179                    
  180                    /*
  181                    // J MW 6/28/30 13 p138 -  no longer  loading co nsultation  status in formation  for each c ase. This  functional ity
  182                    // i s de-scope d from the  patch and  the RPC i s no longe r included  in the KI DS
  183                     
  184                    for( PathologyC ase pathol ogyCase :  cases)
  185                    {
  186                             VistaQ uery query  = VistaIm agingPatho logyQueryF actory.cre ateGetCons ultStatusQ uery(patho logyCase.g etPatholog yCaseUrn() );
  187                             String  rtn = vis taSession. call(query );
  188                             
  189                             pathol ogyCase.se tConsultat ions(Vista ImagingPat hologyTran slator.tra nslateCons ultations( pathologyC ase.getPat hologyCase Urn(), rtn ));
  190                    }*/
  191                    
  192                    retu rn cases;
  193           }
  194  
  195           @O verride
  196           pu blic List< PathologyC ase> getPa tientCases (RoutingTo ken global RoutingTok en,
  197                             Patien tIdentifie r patientI dentifier,  String re questingSi teId) 
  198           th rows Metho dException , Connecti onExceptio n
  199           {
  200                    Vist aCommonUti lities.set DataSource MethodAndV ersion("ge tSites", g etDataSour ceVersion( ));
  201                    logg er.info("g etPatientC ases (" +  patientIde ntifier +  ") Transac tionContex t (" + Tra nsactionCo ntextFacto ry.get().g etDisplayI dentity()  + ").");
  202                    Vist aSession l ocalVistaS ession = n ull;
  203                    try 
  204                    {
  205                             localV istaSessio n = getVis taSession( );
  206                             String  patientDf n = getPat ientDfn(lo calVistaSe ssion, pat ientIdenti fier);                          
  207                             VistaQ uery query  = 
  208                                      VistaIma gingPathol ogyQueryFa ctory.crea teGetPatie ntCasesVis taQuery(pa tientDfn,
  209                                                       re questingSi teId);
  210                             String  rtn = loc alVistaSes sion.call( query);
  211                             return  translate AndLoadCas eResult(lo calVistaSe ssion, rtn );
  212                    }
  213                    catc h(IOExcept ion ioX)
  214                    {
  215                             logger .error("Ex ception ge tting Vist A session" , ioX);
  216                    thro w new Conn ectionExce ption(ioX) ;
  217                    }
  218                    catc h (Invalid VistaCrede ntialsExce ption e)
  219                    {
  220                             throw  new Invali dCredentia lsExceptio n(e.getMes sage());
  221                    }
  222                    catc h (VistaMe thodExcept ion e)
  223                    {
  224                             throw  new Method Exception( e.getMessa ge());
  225                    }
  226                    fina lly
  227           {
  228                    try{ localVista Session.cl ose();}cat ch(Throwab le t){}
  229           }
  230           }
  231  
  232           @O verride
  233           @V istaImagin gGenerated DataSource Method(que ryFactoryM ethodName= "gov.va.me d.imaging. vistaimagi ngdatasour ce.patholo gy.query.V istaImagin gPathology QueryFacto ry.createG etSitesVis taQuery",
  234                             queryF actoryPara meters="re ading",
  235                             transl ationResul tMethodNam e="gov.va. med.imagin g.vistaima gingdataso urce.patho logy.trans lator.Vist aImagingPa thologyTra nslator.tr anslatePat hologySite s",
  236                             transl ationResul tMethodPar ameters="r tn, readin g",
  237                             inputP arametersD escription ="reading" )                    
  238           pu blic abstr act List<A bstractPat hologySite > getSites (
  239                             Routin gToken glo balRouting Token, boo lean readi ng)
  240           th rows Metho dException , Connecti onExceptio n;
  241  
  242           @O verride
  243           pu blic Patho logyCaseUp dateAttrib uteResult  lockCase(
  244                             Pathol ogyCaseURN  pathology CaseUrn, b oolean loc k)
  245           th rows Metho dException , Connecti onExceptio n
  246           {
  247                    Vist aCommonUti lities.set DataSource MethodAndV ersion("lo ckCase", g etDataSour ceVersion( ));
  248                    logg er.info("l ockCase ("  + patholo gyCaseUrn. toString()  + ", " +  lock +") T ransaction Context ("  + Transac tionContex tFactory.g et().getDi splayIdent ity() + ") .");
  249                    Vist aSession l ocalVistaS ession = n ull;
  250                    try 
  251                    {
  252                             localV istaSessio n = getVis taSession( );                   
  253                             VistaQ uery query  = 
  254                                      VistaIma gingPathol ogyQueryFa ctory.crea teLockCase VistaQuery (pathology CaseUrn, l ock);
  255                             String  rtn = loc alVistaSes sion.call( query);
  256                             return  VistaImag ingPatholo gyTranslat or.transla teCaseLock Result(rtn );
  257                    }
  258                    catc h(IOExcept ion ioX)
  259                    {
  260                             logger .error("Ex ception ge tting Vist A session" , ioX);
  261                    thro w new Conn ectionExce ption(ioX) ;
  262                    }
  263                    catc h (Invalid VistaCrede ntialsExce ption e)
  264                    {
  265                             throw  new Invali dCredentia lsExceptio n(e.getMes sage());
  266                    }
  267                    catc h (VistaMe thodExcept ion e)
  268                    {
  269                             throw  new Method Exception( e.getMessa ge());
  270                    }
  271                    fina lly
  272           {
  273                    try{ localVista Session.cl ose();}cat ch(Throwab le t){}
  274           }
  275           }
  276  
  277           @O verride
  278           pu blic Patho logyCaseUp dateAttrib uteResult  addCaseAss istance(
  279                             Pathol ogyCaseURN  pathology CaseUrn,
  280                             Pathol ogyCaseAss istance as sistanceTy pe, String  stationNu mber)
  281           th rows Metho dException , Connecti onExceptio n
  282           {
  283                    Vist aCommonUti lities.set DataSource MethodAndV ersion("ad dCaseAssis tance", ge tDataSourc eVersion() );
  284                    logg er.info("a ddCaseAssi stance ("  + patholog yCaseUrn.t oString()  + ", " + a ssistanceT ype +") Tr ansactionC ontext ("  + Transact ionContext Factory.ge t().getDis playIdenti ty() + "). ");
  285                    Vist aSession l ocalVistaS ession = n ull;
  286                    try 
  287                    {
  288                             localV istaSessio n = getVis taSession( );                   
  289                             VistaQ uery query  = 
  290                                      VistaIma gingPathol ogyQueryFa ctory.crea tePutConsu ltVistaQue ry(patholo gyCaseUrn,  assistanc eType, sta tionNumber );
  291                             String  rtn = loc alVistaSes sion.call( query);
  292                             return  VistaImag ingPatholo gyTranslat or.transla tePutCaseR esult(rtn) ;
  293                    }
  294                    catc h(IOExcept ion ioX)
  295                    {
  296                             logger .error("Ex ception ge tting Vist A session" , ioX);
  297                    thro w new Conn ectionExce ption(ioX) ;
  298                    }
  299                    catc h (Invalid VistaCrede ntialsExce ption e)
  300                    {
  301                             throw  new Invali dCredentia lsExceptio n(e.getMes sage());
  302                    }
  303                    catc h (VistaMe thodExcept ion e)
  304                    {
  305                             throw  new Method Exception( e.getMessa ge());
  306                    }
  307                    fina lly
  308           {
  309                    try{ localVista Session.cl ose();}cat ch(Throwab le t){}
  310           }
  311           }
  312  
  313           @O verride
  314           pu blic List< String> ge tSiteTempl ate(Routin gToken glo balRouting Token,
  315                             List<S tring> apS ections) 
  316           th rows Metho dException , Connecti onExceptio n
  317           {
  318                    Vist aCommonUti lities.set DataSource MethodAndV ersion("ge tSiteTempl ate", getD ataSourceV ersion());
  319                    Stri ngBuilder  sb = new S tringBuild er();
  320                    Stri ng prefix  = "";
  321                    for( String apS ection : a pSections)
  322                    {
  323                             sb.app end(prefix );
  324                             sb.app end(apSect ion);
  325                             prefix  = ", ";
  326                    }
  327                    logg er.info("g etSiteTemp late (" +  sb.toStrin g() +") Tr ansactionC ontext ("  + Transact ionContext Factory.ge t().getDis playIdenti ty() + "). ");
  328                    Vist aSession l ocalVistaS ession = n ull;
  329                    try 
  330                    {
  331                             List<S tring> res ult = new  ArrayList< String>();
  332                             localV istaSessio n = getVis taSession( );
  333                             for(St ring apSec tion : apS ections)
  334                             {
  335                                      VistaQue ry query =  
  336                                               VistaImagi ngPatholog yQueryFact ory.create GetTemplat eVistaQuer y(apSectio n);
  337                                      String r tn = local VistaSessi on.call(qu ery);
  338                                      String t emplate =  VistaImagi ngPatholog yTranslato r.translat eTemplate( rtn, apSec tion);
  339                                      result.a dd(templat e);
  340                             }
  341                             return  result;
  342                    }
  343                    catc h(IOExcept ion ioX)
  344                    {
  345                             logger .error("Ex ception ge tting Vist A session" , ioX);
  346                    thro w new Conn ectionExce ption(ioX) ;
  347                    }
  348                    catc h (Invalid VistaCrede ntialsExce ption e)
  349                    {
  350                             throw  new Invali dCredentia lsExceptio n(e.getMes sage());
  351                    }
  352                    catc h (VistaMe thodExcept ion e)
  353                    {
  354                             throw  new Method Exception( e.getMessa ge());
  355                    }
  356                    fina lly
  357           {
  358                    try{ localVista Session.cl ose();}cat ch(Throwab le t){}
  359           }
  360           }
  361  
  362           @O verride
  363           pu blic void  saveSiteTe mplate(Rou tingToken  globalRout ingToken,
  364                             String  xmlTempla te, String  apSection
  365           th rows Metho dException , Connecti onExceptio n
  366           {
  367                    Vist aCommonUti lities.set DataSource MethodAndV ersion("sa veSiteTemp late", get DataSource Version()) ;         
  368                    logg er.info("s aveSiteTem plate (" +  apSection  + ") Tran sactionCon text (" +  Transactio nContextFa ctory.get( ).getDispl ayIdentity () + ").") ;
  369                    Vist aSession l ocalVistaS ession = n ull;
  370                    try 
  371                    {                         
  372                             localV istaSessio n = getVis taSession( );
  373                             VistaQ uery query  = VistaIm agingPatho logyQueryF actory.cre ateSaveTem plateVista Query(apSe ction, xml Template);
  374                             String  rtn = loc alVistaSes sion.call( query);
  375                             if(!rt n.startsWi th("1"))
  376                             {
  377                                      throw ne w MethodEx ception("E rror updat ing site t emplate: "  + rtn);
  378                             }
  379                    }
  380                    catc h(IOExcept ion ioX)
  381                    {
  382                             logger .error("Ex ception ge tting Vist A session" , ioX);
  383                    thro w new Conn ectionExce ption(ioX) ;
  384                    }
  385                    catc h (Invalid VistaCrede ntialsExce ption e)
  386                    {
  387                             throw  new Invali dCredentia lsExceptio n(e.getMes sage());
  388                    }
  389                    catc h (VistaMe thodExcept ion e)
  390                    {
  391                             throw  new Method Exception( e.getMessa ge());
  392                    }
  393                    fina lly
  394           {
  395                    try{ localVista Session.cl ose();}cat ch(Throwab le t){}
  396           }
  397           }
  398  
  399           @O verride
  400           pu blic void  updateRead ingSite(Ro utingToken  globalRou tingToken,
  401                             Pathol ogyReading Site readi ngSite, bo olean dele te) 
  402           th rows Metho dException , Connecti onExceptio n
  403           {
  404                    Vist aCommonUti lities.set DataSource MethodAndV ersion("up dateReadin gSiteList" , getDataS ourceVersi on());    
  405                    logg er.info("u pdateReadi ngSiteList  (" + read ingSite.ge tSiteId()  + ", delet e[" + dele te + "]) T ransaction Context ("  + Transac tionContex tFactory.g et().getDi splayIdent ity() + ") .");
  406                    Vist aSession l ocalVistaS ession = n ull;
  407                    try 
  408                    {
  409                             localV istaSessio n = getVis taSession( );
  410                             VistaQ uery query  = VistaIm agingPatho logyQueryF actory.cre ateSaveRea dingSiteVi staQuery(r eadingSite , delete);
  411                             String  rtn = loc alVistaSes sion.call( query);
  412                             if(!rt n.startsWi th("1"))
  413                             {
  414                                      throw ne w MethodEx ception("E rror updat ing readin g site lis t: " + rtn );
  415                             }
  416                    }
  417                    catc h(IOExcept ion ioX)
  418                    {
  419                             logger .error("Ex ception ge tting Vist A session" , ioX);
  420                    thro w new Conn ectionExce ption(ioX) ;
  421                    }
  422                    catc h (Invalid VistaCrede ntialsExce ption e)
  423                    {
  424                             throw  new Invali dCredentia lsExceptio n(e.getMes sage());
  425                    }
  426                    catc h (VistaMe thodExcept ion e)
  427                    {
  428                             throw  new Method Exception( e.getMessa ge());
  429                    }
  430                    fina lly
  431           {
  432                    try{ localVista Session.cl ose();}cat ch(Throwab le t){}
  433           }
  434           }
  435  
  436           @O verride
  437           pu blic void  updateAcqu isitionSit e(RoutingT oken globa lRoutingTo ken,
  438                             Pathol ogyAcquisi tionSite a cquisition Site, bool ean delete )
  439           th rows Metho dException , Connecti onExceptio n
  440           {
  441                    Vist aCommonUti lities.set DataSource MethodAndV ersion("up dateAcquis itionSiteL ist", getD ataSourceV ersion());         
  442                    logg er.info("u pdateAcqui sitionSite List (" +  acquisitio nSite.getS iteId() +  ", delete[ " + delete  + "]) Tra nsactionCo ntext (" +  Transacti onContextF actory.get ().getDisp layIdentit y() + ")." );
  443                    Vist aSession l ocalVistaS ession = n ull;
  444                    try 
  445                    {
  446                             localV istaSessio n = getVis taSession( );
  447                             VistaQ uery query  = VistaIm agingPatho logyQueryF actory.cre ateSaveAcq uisitionSi teVistaQue ry(acquisi tionSite,  delete);
  448                             String  rtn = loc alVistaSes sion.call( query);
  449                             if(!rt n.startsWi th("1"))
  450                             {
  451                                      throw ne w MethodEx ception("E rror updat ing acquis ition site  list: " +  rtn);
  452                             }
  453                    }
  454                    catc h(IOExcept ion ioX)
  455                    {
  456                             logger .error("Ex ception ge tting Vist A session" , ioX);
  457                    thro w new Conn ectionExce ption(ioX) ;
  458                    }
  459                    catc h (Invalid VistaCrede ntialsExce ption e)
  460                    {
  461                             throw  new Invali dCredentia lsExceptio n(e.getMes sage());
  462                    }
  463                    catc h (VistaMe thodExcept ion e)
  464                    {
  465                             throw  new Method Exception( e.getMessa ge());
  466                    }
  467                    fina lly
  468           {
  469                    try{ localVista Session.cl ose();}cat ch(Throwab le t){}
  470           }
  471           }
  472  
  473           @O verride
  474           pu blic Strin g getPatho logyCaseRe port(Patho logyCaseUR N patholog yCaseUrn)
  475           th rows Metho dException , Connecti onExceptio n
  476           {
  477                    Vist aCommonUti lities.set DataSource MethodAndV ersion("ge tPathology CaseReport ", getData SourceVers ion());   
  478                    logg er.info("g etPatholog yCaseRepor t (" + pat hologyCase Urn.toStri ng() + ")  Transactio nContext ( " + Transa ctionConte xtFactory. get().getD isplayIden tity() + " ).");
  479                    Vist aSession l ocalVistaS ession = n ull;
  480                    try 
  481                    {
  482                             localV istaSessio n = getVis taSession( );
  483                             VistaQ uery query  = VistaIm agingPatho logyQueryF actory.cre ateGetCprs CaseReport (pathology CaseUrn);
  484                             String  rtn = loc alVistaSes sion.call( query);
  485                             return  VistaImag ingPatholo gyTranslat or.transla tePatholog yReport(rt n);
  486                    }
  487                    catc h(IOExcept ion ioX)
  488                    {
  489                             logger .error("Ex ception ge tting Vist A session" , ioX);
  490                    thro w new Conn ectionExce ption(ioX) ;
  491                    }
  492                    catc h (Invalid VistaCrede ntialsExce ption e)
  493                    {
  494                             throw  new Invali dCredentia lsExceptio n(e.getMes sage());
  495                    }
  496                    catc h (VistaMe thodExcept ion e)
  497                    {
  498                             throw  new Method Exception( e.getMessa ge());
  499                    }
  500                    fina lly
  501           {
  502                    try{ localVista Session.cl ose();}cat ch(Throwab le t){}
  503           }
  504           }
  505  
  506           @O verride
  507           pu blic List< PathologyC aseSupplem entalRepor t> getCase Supplement alReports(
  508                             Pathol ogyCaseURN  pathology CaseUrn) 
  509           th rows Metho dException , Connecti onExceptio n
  510           {
  511                    Vist aCommonUti lities.set DataSource MethodAndV ersion("ge tSupplemen talReports ", getData SourceVers ion());   
  512                    logg er.info("g etSuppleme ntalReport s (" + pat hologyCase Urn.toStri ng() + ")  Transactio nContext ( " + Transa ctionConte xtFactory. get().getD isplayIden tity() + " ).");
  513                    Vist aSession l ocalVistaS ession = n ull;
  514                    try 
  515                    {
  516                             localV istaSessio n = getVis taSession( );
  517                             VistaQ uery query  = VistaIm agingPatho logyQueryF actory.cre ateGetSupp lementalRe ports(path ologyCaseU rn);
  518                             String  rtn = loc alVistaSes sion.call( query);
  519                             return  VistaImag ingPatholo gyTranslat or.transla teSuppleme ntalReport s(rtn);
  520                    }
  521                    catc h(IOExcept ion ioX)
  522                    {
  523                             logger .error("Ex ception ge tting Vist A session" , ioX);
  524                    thro w new Conn ectionExce ption(ioX) ;
  525                    }
  526                    catc h (Invalid VistaCrede ntialsExce ption e)
  527                    {
  528                             throw  new Invali dCredentia lsExceptio n(e.getMes sage());
  529                    }
  530                    catc h (VistaMe thodExcept ion e)
  531                    {
  532                             throw  new Method Exception( e.getMessa ge());
  533                    }
  534                    fina lly
  535           {
  536                    try{ localVista Session.cl ose();}cat ch(Throwab le t){}
  537           }
  538           }
  539  
  540           @O verride
  541           pu blic Patho logyCaseTe mplate get CaseTempla teData(
  542                             Pathol ogyCaseURN  pathology CaseUrn, L ist<String > fields)
  543           th rows Metho dException , Connecti onExceptio n
  544           {
  545                    Vist aCommonUti lities.set DataSource MethodAndV ersion("ge tTemplateD ata", getD ataSourceV ersion());   
  546                    logg er.info("g etTemplate Data (" +  pathologyC aseUrn.toS tring() +  ") Transac tionContex t (" + Tra nsactionCo ntextFacto ry.get().g etDisplayI dentity()  + ").");
  547                    Vist aSession l ocalVistaS ession = n ull;
  548                    try 
  549                    {
  550                             localV istaSessio n = getVis taSession( );
  551                             VistaQ uery query  = VistaIm agingPatho logyQueryF actory.cre ateGetTemp lateDataQu ery(pathol ogyCaseUrn , fields);
  552                             String  rtn = loc alVistaSes sion.call( query);
  553                             return  VistaImag ingPatholo gyTranslat or.transla teTemplate (rtn);
  554                    }
  555                    catc h(IOExcept ion ioX)
  556                    {
  557                             logger .error("Ex ception ge tting Vist A session" , ioX);
  558                    thro w new Conn ectionExce ption(ioX) ;
  559                    }
  560                    catc h (Invalid VistaCrede ntialsExce ption e)
  561                    {
  562                             throw  new Invali dCredentia lsExceptio n(e.getMes sage());
  563                    }
  564                    catc h (VistaMe thodExcept ion e)
  565                    {
  566                             throw  new Method Exception( e.getMessa ge());
  567                    }
  568                    fina lly
  569           {
  570                    try{ localVista Session.cl ose();}cat ch(Throwab le t){}
  571           }
  572           }
  573  
  574           @O verride
  575           pu blic Patho logyCaseRe serveResul t reserveC ase(
  576                             Pathol ogyCaseURN  pathology CaseUrn, b oolean loc k)
  577           th rows Metho dException , Connecti onExceptio n
  578           {
  579                    Vist aCommonUti lities.set DataSource MethodAndV ersion("re serveCase" , getDataS ourceVersi on());
  580                    logg er.info("r eserveCase  (" + path ologyCaseU rn.toStrin g() + ", "  + lock +  ") Transac tionContex t (" + Tra nsactionCo ntextFacto ry.get().g etDisplayI dentity()  + ").");
  581                    Vist aSession l ocalVistaS ession = n ull;
  582                    try 
  583                    {
  584                             localV istaSessio n = getVis taSession( );                   
  585                             VistaQ uery query  = 
  586                                      VistaIma gingPathol ogyQueryFa ctory.crea teReserveC aseVistaQu ery(pathol ogyCaseUrn , lock);
  587                             String  rtn = loc alVistaSes sion.call( query);
  588                             return  VistaImag ingPatholo gyTranslat or.transla teCaseRese rveResult( rtn);
  589                    }
  590                    catc h(IOExcept ion ioX)
  591                    {
  592                             logger .error("Ex ception ge tting Vist A session" , ioX);
  593                    thro w new Conn ectionExce ption(ioX) ;
  594                    }
  595                    catc h (Invalid VistaCrede ntialsExce ption e)
  596                    {
  597                             throw  new Invali dCredentia lsExceptio n(e.getMes sage());
  598                    }
  599                    catc h (VistaMe thodExcept ion e)
  600                    {
  601                             throw  new Method Exception( e.getMessa ge());
  602                    }
  603                    fina lly
  604           {
  605                    try{ localVista Session.cl ose();}cat ch(Throwab le t){}
  606           }
  607           }
  608  
  609           @O verride
  610           pu blic Patho logyElectr onicSignat ureNeed ch eckElectro nicSignatu reNeeded(
  611                             Routin gToken rou tingToken,  String ap Section)
  612           th rows Metho dException , Connecti onExceptio n
  613           {
  614                    Vist aCommonUti lities.set DataSource MethodAndV ersion("ch eckElectro nicSignatu reNeeded",  getDataSo urceVersio n());
  615                    logg er.info("c heckElectr onicSignat ureNeeded  (" + apSec tion + ")  Transactio nContext ( " + Transa ctionConte xtFactory. get().getD isplayIden tity() + " ).");
  616                    Vist aSession l ocalVistaS ession = n ull;
  617                    try 
  618                    {
  619                             localV istaSessio n = getVis taSession( );                   
  620                             VistaQ uery query  = 
  621                                      VistaIma gingPathol ogyQueryFa ctory.crea teGetElect ronicSigna tureAvaila ble(apSect ion);
  622                             String  rtn = loc alVistaSes sion.call( query);
  623                             Transa ctionConte xtFactory. get().addD ebugInform ation("ESi g required  check for  '" + apSe ction + "' , " + rtn) ;
  624                             logger .info("ESi g required  check for  '" + apSe ction + "' , " + rtn) ;
  625                             return  VistaImag ingPatholo gyTranslat or.transla teElectron icSignatur eNeedResul t(rtn);
  626                    }
  627                    catc h(IOExcept ion ioX)
  628                    {
  629                             logger .error("Ex ception ge tting Vist A session" , ioX);
  630                    thro w new Conn ectionExce ption(ioX) ;
  631                    }
  632                    catc h (Invalid VistaCrede ntialsExce ption e)
  633                    {
  634                             throw  new Invali dCredentia lsExceptio n(e.getMes sage());
  635                    }
  636                    catc h (VistaMe thodExcept ion e)
  637                    {
  638                             throw  new Method Exception( e.getMessa ge());
  639                    }
  640                    fina lly
  641           {
  642                    try{ localVista Session.cl ose();}cat ch(Throwab le t){}
  643           }
  644           }
  645  
  646           @O verride
  647           pu blic List< PathologyF ieldValue>  getPathol ogyFields(
  648                             Routin gToken glo balRouting Token, Pat hologyFiel d patholog yField,
  649                             String  searchPar ameter) 
  650           th rows Metho dException , Connecti onExceptio n
  651           {
  652                    Vist aCommonUti lities.set DataSource MethodAndV ersion("ge tPathology Fields", g etDataSour ceVersion( ));
  653                    logg er.info("g etPatholog yFields ("  + patholo gyField +  ", " + sea rchParamet er + ") Tr ansactionC ontext ("  + Transact ionContext Factory.ge t().getDis playIdenti ty() + "). ");
  654                    Vist aSession l ocalVistaS ession = n ull;
  655                    try 
  656                    {
  657                             localV istaSessio n = getVis taSession( );                   
  658                             VistaQ uery query  = 
  659                                      VistaIma gingPathol ogyQueryFa ctory.crea teGetListQ uery(patho logyField,  searchPar ameter);
  660                             String  rtn = loc alVistaSes sion.call( query);
  661                             //Tran sactionCon textFactor y.get().ad dDebugInfo rmation("E Sig requir ed check f or '" + ap Section +  "', " + rt n);
  662                             //logg er.info("E Sig requir ed check f or '" + ap Section +  "', " + rt n);
  663                             return  VistaImag ingPatholo gyTranslat or.transla teFieldVal ues(rtn, g etSite(),  pathologyF ield);
  664                    }
  665                    catc h(IOExcept ion ioX)
  666                    {
  667                             logger .error("Ex ception ge tting Vist A session" , ioX);
  668                    thro w new Conn ectionExce ption(ioX) ;
  669                    }
  670                    catc h (Invalid VistaCrede ntialsExce ption e)
  671                    {
  672                             throw  new Invali dCredentia lsExceptio n(e.getMes sage());
  673                    }
  674                    catc h (VistaMe thodExcept ion e)
  675                    {
  676                             throw  new Method Exception( e.getMessa ge());
  677                    }
  678                    fina lly
  679           {
  680                    try{ localVista Session.cl ose();}cat ch(Throwab le t){}
  681           }
  682           }
  683  
  684           @O verride
  685           pu blic void  updateCons ultationSt atus(
  686                             Pathol ogyCaseCon sultationU RN patholo gyCaseCons ultationUr n,
  687                             Pathol ogyCaseCon sultationU pdateStatu s consulta tionUpdate Status)
  688           th rows Metho dException , Connecti onExceptio n
  689           {
  690                    Vist aCommonUti lities.set DataSource MethodAndV ersion("up dateConsul tationStat us", getDa taSourceVe rsion());
  691                    logg er.info("u pdateConsu ltationSta tus (" + p athologyCa seConsulta tionUrn.to String() +  ", " + co nsultation UpdateStat us + ") Tr ansactionC ontext ("  + Transact ionContext Factory.ge t().getDis playIdenti ty() + "). ");
  692                    Vist aSession l ocalVistaS ession = n ull;
  693                    try 
  694                    {
  695                             localV istaSessio n = getVis taSession( );                   
  696                             VistaQ uery query  = 
  697                                      VistaIma gingPathol ogyQueryFa ctory.crea teChangeCo nsultation StatusQuer y(patholog yCaseConsu ltationUrn
  698                                                       co nsultation UpdateStat us);
  699                             String  rtn = loc alVistaSes sion.call( query);
  700                             if(!rt n.startsWi th("1"))
  701                             {
  702                                      throw ne w MethodEx ception("E rror updat ing pathol ogy case c onsultatio n status:  " + rtn);
  703                             }                         
  704                    }
  705                    catc h(IOExcept ion ioX)
  706                    {
  707                             logger .error("Ex ception ge tting Vist A session" , ioX);
  708                    thro w new Conn ectionExce ption(ioX) ;
  709                    }
  710                    catc h (Invalid VistaCrede ntialsExce ption e)
  711                    {
  712                             throw  new Invali dCredentia lsExceptio n(e.getMes sage());
  713                    }
  714                    catc h (VistaMe thodExcept ion e)
  715                    {
  716                             throw  new Method Exception( e.getMessa ge());
  717                    }
  718                    fina lly
  719           {
  720                    try{ localVista Session.cl ose();}cat ch(Throwab le t){}
  721           }
  722           }
  723  
  724           @O verride
  725           @V istaImagin gGenerated DataSource Method(que ryFactoryM ethodName= "gov.va.me d.imaging. vistaimagi ngdatasour ce.patholo gy.query.V istaImagin gPathology QueryFacto ry.createS aveCaseRep ortQuery",
  726                             transl ationResul tMethodNam e="gov.va. med.imagin g.vistaima gingdataso urce.patho logy.trans lator.Vist aImagingPa thologyTra nslator.tr anslateSav ingCaseRep ortFields" ,
  727                             inputP arametersD escription ="patholog yCaseUrn.t oString()" )
  728           pu blic abstr act Pathol ogySaveCas eReportRes ult saveCa seReportFi elds(Patho logyCaseUR N patholog yCaseUrn,
  729                             List<P athologyCa seReportFi eld> field s) 
  730           th rows Metho dException , Connecti onExceptio n;
  731  
  732           @O verride
  733           @V istaImagin gGenerated DataSource Method(que ryFactoryM ethodName= "gov.va.me d.imaging. vistaimagi ngdatasour ce.patholo gy.query.V istaImagin gPathology QueryFacto ry.createS aveCaseSup plementalR eportQuery ",
  734                             transl ationResul tMethodNam e="gov.va. med.imagin g.vistaima gingdataso urce.patho logy.trans lator.Vist aImagingPa thologyTra nslator.tr anslateSav ingCaseSup plementalR eport",
  735                             inputP arametersD escription ="patholog yCaseUrn.t oString()" )
  736           pu blic abstr act void s aveCaseSup plementalR eport(Path ologyCaseU RN patholo gyCaseUrn,
  737                             String  reportCon tents, Dat e date, bo olean veri fied)
  738           th rows Metho dException , Connecti onExceptio n;
  739  
  740           @O verride
  741           @V istaImagin gGenerated DataSource Method(que ryFactoryM ethodName= "gov.va.me d.imaging. vistaimagi ngdatasour ce.patholo gy.query.V istaImagin gPathology QueryFacto ry.createG etSitesQue ry",
  742                             queryF actoryPara meters="",
  743                             transl ationResul tMethodNam e="gov.va. med.imagin g.vistaima gingdataso urce.patho logy.trans lator.Vist aImagingPa thologyTra nslator.tr anslateSit es")
  744           pu blic abstr act List<P athologySi te> getSit es(Routing Token glob alRoutingT oken)
  745           th rows Metho dException , Connecti onExceptio n;
  746  
  747           @O verride
  748           @V istaImagin gGenerated DataSource Method(que ryFactoryM ethodName= "gov.va.me d.imaging. vistaimagi ngdatasour ce.patholo gy.query.V istaImagin gPathology QueryFacto ry.createS etLockMinu tesQuery",
  749                             queryF actoryPara meters="mi nutes",
  750                             transl ationResul tMethodNam e="gov.va. med.imagin g.vistaima gingdataso urce.patho logy.trans lator.Vist aImagingPa thologyTra nslator.tr anslateSav ingLockMin utes",
  751                             inputP arametersD escription ="minutes" )
  752           pu blic abstr act void s etLockExpi resMinutes (RoutingTo ken global RoutingTok en, int mi nutes)
  753           th rows Metho dException , Connecti onExceptio n;
  754  
  755           @O verride
  756           pu blic Vista Session ge tVistaSess ion() 
  757           th rows IOExc eption, Co nnectionEx ception, M ethodExcep tion
  758           {
  759                    retu rn VistaSe ssion.getO rCreate(ge tMetadataU rl(), getS ite());
  760           }
  761  
  762           @O verride
  763           pu blic Strin g getDataS ourceVersi on()
  764           {
  765                    retu rn "1";
  766           }
  767  
  768           @O verride
  769           @V istaImagin gGenerated DataSource Method(que ryFactoryM ethodName= "gov.va.me d.imaging. vistaimagi ngdatasour ce.patholo gy.query.V istaImagin gPathology QueryFacto ry.createG etUserPref erencesQue ry",
  770                             transl ationResul tMethodNam e="gov.va. med.imagin g.vistaima gingdataso urce.patho logy.trans lator.Vist aImagingPa thologyTra nslator.tr anslateUse rPreferenc es",
  771                             inputP arametersD escription ="userId,l abel",
  772                             queryF actoryPara meters="us erId,label ")
  773           pu blic abstr act String  getPrefer ences(Rout ingToken g lobalRouti ngToken, S tring user Id, String  label)
  774           th rows Metho dException , Connecti onExceptio n;
  775  
  776           @O verride
  777           @V istaImagin gGenerated DataSource Method(que ryFactoryM ethodName= "gov.va.me d.imaging. vistaimagi ngdatasour ce.patholo gy.query.V istaImagin gPathology QueryFacto ry.createS aveUserPre ferencesQu ery",
  778                             transl ationResul tMethodNam e="gov.va. med.imagin g.vistaima gingdataso urce.patho logy.trans lator.Vist aImagingPa thologyTra nslator.tr anslateSav ingUserPre ferences",
  779                             inputP arametersD escription ="userId,l abel",
  780                             queryF actoryPara meters="us erId,label ,xml")
  781           pu blic abstr act void s avePrefere nces(Routi ngToken gl obalRoutin gToken, St ring userI d, String  label, Str ing xml)
  782           th rows Metho dException , Connecti onExceptio n;
  783  
  784           @O verride
  785           @V istaImagin gGenerated DataSource Method(que ryFactoryM ethodName= "gov.va.me d.imaging. vistaimagi ngdatasour ce.patholo gy.query.V istaImagin gPathology QueryFacto ry.createG etSnomedCo desQuery",
  786                             transl ationResul tMethodNam e="gov.va. med.imagin g.vistaima gingdataso urce.patho logy.trans lator.Vist aImagingPa thologyTra nslator.tr anslateSno medResults ",
  787                             inputP arametersD escription ="patholog yCaseUrn.t oString()" )
  788           pu blic abstr act List<P athologySn omedCode>  getCaseSno medCodes(
  789                             Pathol ogyCaseURN  pathology CaseUrn) 
  790           th rows Metho dException , Connecti onExceptio n;
  791  
  792           @O verride
  793           @V istaImagin gGenerated DataSource Method(que ryFactoryM ethodName= "gov.va.me d.imaging. vistaimagi ngdatasour ce.patholo gy.query.V istaImagin gPathology QueryFacto ry.createS aveSnomedC odes",
  794                             transl ationResul tMethodNam e="gov.va. med.imagin g.vistaima gingdataso urce.patho logy.trans lator.Vist aImagingPa thologyTra nslator.tr anslateSav ingSnomedC ode",
  795                             inputP arametersD escription ="patholog yCaseUrn.t oString(), tissueId:t issueId,fi eld:pathol ogyFieldUr n.toString ()")
  796           pu blic abstr act String  saveCaseS nomedCode(
  797                             Pathol ogyCaseURN  pathology CaseUrn, 
  798                             String  tissueId,  
  799                             Pathol ogyFieldUR N patholog yFieldUrn)  
  800           th rows Metho dException , Connecti onExceptio n;
  801  
  802           @O verride
  803           @V istaImagin gGenerated DataSource Method(que ryFactoryM ethodName= "gov.va.me d.imaging. vistaimagi ngdatasour ce.patholo gy.query.V istaImagin gPathology QueryFacto ry.createS aveSnomedC odes",
  804                             transl ationResul tMethodNam e="gov.va. med.imagin g.vistaima gingdataso urce.patho logy.trans lator.Vist aImagingPa thologyTra nslator.tr anslateSav ingSnomedC ode",
  805                             inputP arametersD escription ="patholog yCaseUrn.t oString(), tissueId:t issueId,mo rphologyId :morpholog yId,etiolo gyField:et iologyFiel dUrn.toStr ing()")
  806           pu blic abstr act String  saveCaseE tiologySno medCodeFor Morphology (Pathology CaseURN pa thologyCas eUrn,
  807                             String  tissueId,  String mo rphologyId ,
  808                             Pathol ogyFieldUR N etiology FieldUrn) 
  809           th rows Metho dException , Connecti onExceptio n;
  810  
  811           @O verride
  812           @V istaImagin gGenerated DataSource Method(que ryFactoryM ethodName= "gov.va.me d.imaging. vistaimagi ngdatasour ce.patholo gy.query.V istaImagin gPathology QueryFacto ry.createS aveCptCode sQuery",
  813                             transl ationResul tMethodNam e="gov.va. med.imagin g.vistaima gingdataso urce.patho logy.trans lator.Vist aImagingPa thologyTra nslator.tr anslateSav ingCptCode ",
  814                             inputP arametersD escription ="patholog yCaseUrn.t oString(), location:l ocationFie ldUrn.toSt ring()")
  815           pu blic abstr act List<P athologyCp tCodeResul t> saveCas eCptCodes( PathologyC aseURN pat hologyCase Urn,
  816                             Pathol ogyFieldUR N location FieldUrn,  List<Strin g> cptCode s)
  817           th rows Metho dException , Connecti onExceptio n;
  818  
  819           @O verride
  820           @V istaImagin gGenerated DataSource Method(que ryFactoryM ethodName= "gov.va.me d.imaging. vistaimagi ngdatasour ce.patholo gy.query.V istaImagin gPathology QueryFacto ry.createG etCptCodes Query",
  821                             transl ationResul tMethodNam e="gov.va. med.imagin g.vistaima gingdataso urce.patho logy.trans lator.Vist aImagingPa thologyTra nslator.tr anslateCpt CodesResul ts",
  822                             inputP arametersD escription ="patholog yCaseUrn.t oString()" )
  823           pu blic abstr act List<P athologyCp tCode> get CaseCptCod es(
  824                             Pathol ogyCaseURN  pathology CaseUrn) 
  825           th rows Metho dException , Connecti onExceptio n;
  826  
  827           @O verride
  828           @V istaImagin gGenerated DataSource Method(que ryFactoryM ethodName= "gov.va.me d.imaging. vistaimagi ngdatasour ce.patholo gy.query.V istaImagin gPathology QueryFacto ry.createG etUserQuer y",
  829                             queryF actoryPara meters="",
  830                             transl ationResul tMethodNam e="gov.va. med.imagin g.vistaima gingdataso urce.patho logy.trans lator.Vist aImagingPa thologyTra nslator.tr anslateUse rKeys")
  831           pu blic abstr act List<S tring> get PathologyU serKeys(Ro utingToken  globalRou tingToken)
  832           th rows Metho dException , Connecti onExceptio n;
  833  
  834           @O verride
  835           pu blic List< PathologyC ase> getSp ecificCase s(List<Pat hologyCase URN> cases )
  836           th rows Metho dException , Connecti onExceptio n
  837           {
  838                    Vist aCommonUti lities.set DataSource MethodAndV ersion("ge tSpecificC ases", get DataSource Version()) ;
  839                    logg er.info("g etSpecific Cases () T ransaction Context ("  + Transac tionContex tFactory.g et().getDi splayIdent ity() + ") .");
  840                    Vist aSession l ocalVistaS ession = n ull;
  841                    try 
  842                    {
  843                             localV istaSessio n = getVis taSession( );
  844                             VistaQ uery query  = 
  845                                      VistaIma gingPathol ogyQueryFa ctory.crea teGetCases Query(case s);
  846                             String  rtn = loc alVistaSes sion.call( query);
  847                             return  translate AndLoadCas eResult(lo calVistaSe ssion, rtn );
  848                    }
  849                    catc h(IOExcept ion ioX)
  850                    {
  851                             logger .error("Ex ception ge tting Vist A session" , ioX);
  852                    thro w new Conn ectionExce ption(ioX) ;
  853                    }
  854                    catc h (Invalid VistaCrede ntialsExce ption e)
  855                    {
  856                             throw  new Invali dCredentia lsExceptio n(e.getMes sage());
  857                    }
  858                    catc h (VistaMe thodExcept ion e)
  859                    {
  860                             throw  new Method Exception( e.getMessa ge());
  861                    }
  862                    fina lly
  863           {
  864                    try{ localVista Session.cl ose();}cat ch(Throwab le t){}
  865           }
  866           }
  867  
  868           @O verride
  869           @V istaImagin gGenerated DataSource Method(que ryFactoryM ethodName= "gov.va.me d.imaging. vistaimagi ngdatasour ce.patholo gy.query.V istaImagin gPathology QueryFacto ry.createC heckPendin gConsultat ions",
  870                             queryF actoryPara meters="st ationNumbe r",
  871                             transl ationResul tMethodNam e="gov.va. med.imagin g.vistaima gingdataso urce.patho logy.trans lator.Vist aImagingPa thologyTra nslator.tr anslateChe ckPendingC onsultatio ns",
  872                             inputP arametersD escription ="stationN umber")
  873           pu blic abstr act Boolea n checkPen dingConsul tationStat us(
  874                             Routin gToken glo balRouting Token, Str ing statio nNumber)
  875           th rows Metho dException , Connecti onExceptio n;
  876  
  877           @O verride
  878           @V istaImagin gGenerated DataSource Method(que ryFactoryM ethodName= "gov.va.me d.imaging. vistaimagi ngdatasour ce.patholo gy.query.V istaImagin gPathology QueryFacto ry.createS aveCaseTis sues",
  879                             transl ationResul tMethodNam e="gov.va. med.imagin g.vistaima gingdataso urce.patho logy.trans lator.Vist aImagingPa thologyTra nslator.tr anslateSav ingSnomedC ode",
  880                             inputP arametersD escription ="patholog yCaseUrn.t oString()" )
  881           pu blic abstr act String  saveCaseT issue(Path ologyCaseU RN patholo gyCaseUrn,
  882                             Pathol ogyFieldUR N tissueFi eldUrn) 
  883           th rows Metho dException , Connecti onExceptio n;
  884  
  885           @O verride
  886           pu blic Patho logyCaseUR N copyCase (RoutingTo ken global RoutingTok en, Pathol ogyCaseURN  pathology CaseUrn)
  887           th rows Metho dException , Connecti onExceptio n
  888           {
  889                    Vist aCommonUti lities.set DataSource MethodAndV ersion("co pyCase", g etDataSour ceVersion( ));
  890                    logg er.info("c opyCase ("  + patholo gyCaseUrn. toString()  + ") Tran sactionCon text (" +  Transactio nContextFa ctory.get( ).getDispl ayIdentity () + ").") ;
  891                    Vist aSession l ocalVistaS ession = n ull;
  892                    try 
  893                    {
  894                             localV istaSessio n = getVis taSession( );
  895                             Patien tIdentifie r patientI dentifier  = patholog yCaseUrn.g etPatientI d();
  896                             String  patientDf n = getPat ientDfn(lo calVistaSe ssion, pat ientIdenti fier);                          
  897                             VistaQ uery query  = 
  898                                      VistaIma gingPathol ogyQueryFa ctory.crea teCopyCase Query(pati entDfn, pa thologyCas eUrn);
  899                             String  rtn = loc alVistaSes sion.call( query);
  900                             
  901                             return  VistaImag ingPatholo gyTranslat or.transla teCopyCase (rtn, getS ite(), pat hologyCase Urn.getPat ientId());
  902                    }
  903                    catc h(IOExcept ion ioX)
  904                    {
  905                             logger .error("Ex ception ge tting Vist A session" , ioX);
  906                    thro w new Conn ectionExce ption(ioX) ;
  907                    }
  908                    catc h (Invalid VistaCrede ntialsExce ption e)
  909                    {
  910                             throw  new Invali dCredentia lsExceptio n(e.getMes sage());
  911                    }
  912                    catc h (VistaMe thodExcept ion e)
  913                    {
  914                             throw  new Method Exception( e.getMessa ge());
  915                    }
  916                    fina lly
  917           {
  918                    try{ localVista Session.cl ose();}cat ch(Throwab le t){}
  919           }
  920           }
  921  
  922           @O verride
  923           @V istaImagin gGenerated DataSource Method(que ryFactoryM ethodName= "gov.va.me d.imaging. vistaimagi ngdatasour ce.patholo gy.query.V istaImagin gPathology QueryFacto ry.createD eleteSnome dCode",
  924                             transl ationResul tMethodNam e="gov.va. med.imagin g.vistaima gingdataso urce.patho logy.trans lator.Vist aImagingPa thologyTra nslator.tr anslateDel etingSnome dCode",
  925                             inputP arametersD escription ="patholog yCaseUrn.t oString(), tissueId:t issueId,sn omedId:sno medId,etio logyId:eti ologyId",
  926                             queryF actoryPara meters="pa thologyCas eUrn,tissu eId,snomed Id,snomedF ield,etiol ogyId")
  927           pu blic abstr act void d eleteSnome dCode(Path ologyCaseU RN patholo gyCaseUrn,
  928                             String  tissueId,  String sn omedId, Pa thologyFie ld snomedF ield, Stri ng etiolog yId)
  929           th rows Metho dException , Connecti onExceptio n;
  930  
  931           @O verride
  932           @V istaImagin gGenerated DataSource Method(que ryFactoryM ethodName= "gov.va.me d.imaging. vistaimagi ngdatasour ce.patholo gy.query.V istaImagin gPathology QueryFacto ry.createS aveCaseNot eQuery",
  933                             transl ationResul tMethodNam e="gov.va. med.imagin g.vistaima gingdataso urce.patho logy.trans lator.Vist aImagingPa thologyTra nslator.tr anslateSav ingCaseNot e",
  934                             inputP arametersD escription ="patholog yCaseUrn.t oString()" )
  935           pu blic abstr act void s aveCaseNot e(Patholog yCaseURN p athologyCa seUrn, Str ing note)
  936           th rows Metho dException , Connecti onExceptio n;
  937  
  938           @O verride
  939           @V istaImagin gGenerated DataSource Method(que ryFactoryM ethodName= "gov.va.me d.imaging. vistaimagi ngdatasour ce.patholo gy.query.V istaImagin gPathology QueryFacto ry.createG etCaseNote Query",
  940                             transl ationResul tMethodNam e="gov.va. med.imagin g.vistaima gingdataso urce.patho logy.trans lator.Vist aImagingPa thologyTra nslator.tr anslateCas eNote",
  941                             inputP arametersD escription ="patholog yCaseUrn.t oString()" )
  942           pu blic abstr act String  getCaseNo te(Patholo gyCaseURN  pathologyC aseUrn)
  943           th rows Metho dException , Connecti onExceptio n;
  944   }