Produced by Araxis Merge on 12/5/2017 12:06:50 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.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\VistaImagingDataSourceProvider\main\src\java\gov\va\med\imaging\vistaimagingdatasource | VistaImagingImageAccessLoggingDataSourceService.java | Mon Dec 4 21:34:52 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\VistaImagingDataSourceProvider\main\src\java\gov\va\med\imaging\vistaimagingdatasource | VistaImagingImageAccessLoggingDataSourceService.java | Mon Dec 4 22:06:50 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 862 |
| Changed | 2 | 4 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| 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 |
No regular expressions were active.
| 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: Feb 13, 2008 | |
| 6 | Site Nam e: Washin gton OI Fi eld Office , Silver S pring, MD | |
| 7 | Developer:
|
|
| 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; | |
| 27 | ||
| 28 | import gov .va.med.Ro utingToken ; | |
| 29 | import gov .va.med.im aging.arti factsource .ResolvedA rtifactSou rce; | |
| 30 | import gov .va.med.im aging.core .interface s.exceptio ns.Connect ionExcepti on; | |
| 31 | import gov .va.med.im aging.core .interface s.exceptio ns.MethodE xception; | |
| 32 | import gov .va.med.im aging.core .interface s.exceptio ns.Securit yCredentia lsExpiredE xception; | |
| 33 | import gov .va.med.im aging.data source.Abs tractVersi onableData Source; | |
| 34 | import gov .va.med.im aging.data source.Ima geAccessLo ggingSpi; | |
| 35 | import gov .va.med.im aging.data source.exc eptions.In validCrede ntialsExce ption; | |
| 36 | import gov .va.med.im aging.data source.exc eptions.Un supportedP rotocolExc eption; | |
| 37 | import gov .va.med.im aging.exch ange.Image AccessLogE vent; | |
| 38 | import gov .va.med.im aging.exch ange.Imagi ngLogEvent ; | |
| 39 | import gov .va.med.im aging.exch ange.busin ess.ImageA ccessReaso n; | |
| 40 | import gov .va.med.im aging.exch ange.busin ess.Resolv edSite; | |
| 41 | import gov .va.med.im aging.exch ange.busin ess.Site; | |
| 42 | import gov .va.med.im aging.exch ange.enums .ImageAcce ssReasonTy pe; | |
| 43 | import gov .va.med.im aging.core .interface s.exceptio ns.Patient NotFoundEx ception; | |
| 44 | import gov .va.med.im aging.prot ocol.vista .VistaImag ingTransla tor; | |
| 45 | import gov .va.med.im aging.tran sactioncon text.Trans actionCont extFactory ; | |
| 46 | import gov .va.med.im aging.url. vista.Vist aQuery; | |
| 47 | import gov .va.med.im aging.url. vista.exce ptions.Inv alidVistaC redentials Exception; | |
| 48 | import gov .va.med.im aging.url. vista.exce ptions.Vis taMethodEx ception; | |
| 49 | import gov .va.med.im aging.vist adatasourc e.common.V istaCommon Utilities; | |
| 50 | import gov .va.med.im aging.vist adatasourc e.session. VistaSessi on; | |
| 51 | import gov .va.med.im aging.vist aimagingda tasource.c ommon.Vist aImagingCo mmonUtilit ies; | |
| 52 | import jav a.io.IOExc eption; | |
| 53 | import jav a.util.Lis t; | |
| 54 | ||
| 55 | import org .apache.lo gging.log4 j.LogManag er; | |
| 56 | import org .apache.lo gging.log4 j.Logger; | |
| 57 | ||
| 58 | /** | |
| 59 | * @author
|
|
| 60 | * | |
| 61 | */ | |
| 62 | public cla ss VistaIm agingImage AccessLogg ingDataSou rceService | |
| 63 | extends Ab stractVers ionableDat aSource | |
| 64 | implements ImageAcce ssLoggingS pi | |
| 65 | { | |
| 66 | pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(Vist aImagingIm ageAccessL oggingData SourceServ ice.class) ; | |
| 67 | ||
| 68 | // The requi red versio n of VistA Imaging n eeded to e xecute the RPC calls for this operation | |
| 69 | pu blic final static St ring MAG_R EQUIRED_VE RSION = "3 .0P59"; // JMW reduc ing requir ed version number to work at V 2V sites w ithout P83 | |
| 70 | pu blic stati c final St ring SUPPO RTED_PROTO COL = "vis taimaging" ; | |
| 71 | ||
| 72 | /* * | |
| 73 | * @param re solvedArti factSource | |
| 74 | * @param pr otocol | |
| 75 | * / | |
| 76 | pu blic Vista ImagingIma geAccessLo ggingDataS ourceServi ce(Resolve dArtifactS ource reso lvedArtifa ctSource, | |
| 77 | Stri ng protoco l) | |
| 78 | th rows Unsup portedProt ocolExcept ion | |
| 79 | { | |
| 80 | supe r(resolved ArtifactSo urce, prot ocol); | |
| 81 | if(! (resolved ArtifactSo urce insta nceof Reso lvedSite) ) | |
| 82 | 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() + "'."); | |
| 83 | ||
| 84 | if ( ! SUPPOR TED_PROTOC OL.equals( protocol) ) | |
| 85 | throw new Unsupp ortedProto colExcepti on("This i mplementat ion does n ot support the '" + | |
| 86 | protocol + "' prot ocol."); | |
| 87 | } | |
| 88 | ||
| 89 | /* * | |
| 90 | * The artif act source must be c hecked in the constr uctor to a ssure that it is an instance | |
| 91 | * of Resolv edSite. | |
| 92 | * | |
| 93 | * @return | |
| 94 | * / | |
| 95 | pr otected Re solvedSite getResolv edSite() | |
| 96 | { | |
| 97 | retu rn (Resolv edSite)get ResolvedAr tifactSour ce(); | |
| 98 | } | |
| 99 | ||
| 100 | pr otected Si te getSite () | |
| 101 | { | |
| 102 | retu rn getReso lvedSite() .getSite() ; | |
| 103 | } | |
| 104 | ||
| 105 | ||
| 106 | ||
| 107 | pr ivate Vist aSession g etVistaSes sion() | |
| 108 | th rows IOExc eption, Co nnectionEx ception, M ethodExcep tion, Secu rityCreden tialsExpir edExceptio n | |
| 109 | { | |
| 110 | retu rn VistaSe ssion.getO rCreate(ge tMetadataU rl(), getS ite()); | |
| 111 | } | |
| 112 | ||
| 113 | /* (non-Java doc) | |
| 114 | * @see gov. va.med.ima ging.datas ource.Imag eAccessLog gingSpi#Lo gImageAcce ssEvent(go v.va.med.i maging.exc hange.Imag eAccessLog Event) | |
| 115 | * / | |
| 116 | @O verride | |
| 117 | pu blic void LogImageAc cessEvent( ImageAcces sLogEvent logEvent) | |
| 118 | th rows Unsup portedOper ationExcep tion, Meth odExceptio n, Connect ionExcepti on | |
| 119 | { | |
| 120 | Vist aCommonUti lities.set DataSource MethodAndV ersion("Lo gImageAcce ssEvent", getDataSou rceVersion ()); | |
| 121 | logg er.info("L ogImageAcc essEvent(" + logEven t.getImage Ien() + ") , Transact ionContext (" + Tran sactionCon textFactor y.get().ge tDisplayId entity() + ")."); | |
| 122 | Vist aSession v istaSessio n = null; | |
| 123 | try | |
| 124 | { | |
| 125 | // dec ode the im age ien | |
| 126 | // CTB 29Nov2009 | |
| 127 | //Stri ng imageIe n = Base32 Conversion Utility.ba se32Decode (logEvent. getImageIe n()); | |
| 128 | String imageIen = logEvent .getImageI en(); | |
| 129 | logEve nt.setDeco dedImageIe n(imageIen ); | |
| 130 | vistaS ession = g etVistaSes sion(); | |
| 131 | popula teAccessLo gPatientDf n(vistaSes sion, logE vent); | |
| 132 | // if an Imaging session h as not bee n created, create a new sessio n | |
| 133 | if(!vi staSession .isSession Created()) | |
| 134 | { | |
| 135 | VistaIma gingCommon Utilities. createSess ion(vistaS ession); | |
| 136 | vistaSes sion.setSe ssionCreat ed(true); | |
| 137 | } | |
| 138 | switch (logEvent. getEventTy pe()) | |
| 139 | { | |
| 140 | case IMA GE_ACCESS: | |
| 141 | logImageAc cess(vista Session, l ogEvent); | |
| 142 | break; | |
| 143 | case IMA GE_COPY: | |
| 144 | logImageCo py(vistaSe ssion, log Event); | |
| 145 | break; | |
| 146 | case IMA GE_PRINT: | |
| 147 | logImagePr int(vistaS ession, lo gEvent); | |
| 148 | break; | |
| 149 | case PAT IENT_ID_MI SMATCH: | |
| 150 | logPatient IdMismatch (vistaSess ion, logEv ent); | |
| 151 | break; | |
| 152 | case RES TRICTED_AC CESS: | |
| 153 | VistaCommo nUtilities .logRestri ctedAccess (vistaSess ion, logEv ent.getPat ientDfn()) ; | |
| 154 | break; | |
| 155 | } | |
| 156 | } | |
| 157 | catc h(IOExcept ion ioX) | |
| 158 | { | |
| 159 | logger .error(ioX .getMessag e()); | |
| 160 | throw new Connec tionExcept ion(ioX); | |
| 161 | } | |
| 162 | fina lly | |
| 163 | { | |
| 164 | try{vi staSession .close();} | |
| 165 | catch( Throwable t){} | |
| 166 | } | |
| 167 | } | |
| 168 | ||
| 169 | pr ivate void logImageP rint(Vista Session vi staSession , ImageAcc essLogEven t event) | |
| 170 | th rows Metho dException , IOExcept ion, Conne ctionExcep tion | |
| 171 | { | |
| 172 | logg er.info("l ogImagePri nt(" + eve nt.getImag eIen() + " ), Transac tionContex t (" + Tra nsactionCo ntextFacto ry.get().g etDisplayI dentity() + ")."); | |
| 173 | Vist aQuery log CopyQuery = VistaIma gingQueryF actory.cre ateLogImag ePrintQuer y(event); | |
| 174 | ||
| 175 | try | |
| 176 | { | |
| 177 | String rtn = vis taSession. call(logCo pyQuery); | |
| 178 | logger .info("Res ponse from logging i mage print [" + rtn + "]"); | |
| 179 | } | |
| 180 | catc h(InvalidV istaCreden tialsExcep tion ivcX) | |
| 181 | { | |
| 182 | logger .error("Ex ception lo gging imag e print", ivcX); | |
| 183 | throw new Invali dCredentia lsExceptio n(ivcX); | |
| 184 | } | |
| 185 | catc h(IOExcept ion ioX) | |
| 186 | { | |
| 187 | logger .error("Ex ception lo gging imag e print", ioX); | |
| 188 | throw new Connec tionExcept ion(ioX); | |
| 189 | } | |
| 190 | catc h(VistaMet hodExcepti on vmX) | |
| 191 | { | |
| 192 | logger .error("Ex ception lo gging imag e print", vmX); | |
| 193 | throw new Method Exception( vmX); | |
| 194 | } | |
| 195 | } | |
| 196 | ||
| 197 | pr ivate void logImageC opy(VistaS ession vis taSession, ImageAcce ssLogEvent event) | |
| 198 | th rows Metho dException , IOExcept ion, Conne ctionExcep tion | |
| 199 | { | |
| 200 | logg er.info("l ogImageCop y(" + even t.getImage Ien() + ") , Transact ionContext (" + Tran sactionCon textFactor y.get().ge tDisplayId entity() + ")."); | |
| 201 | Vist aQuery log CopyQuery = VistaIma gingQueryF actory.cre ateLogImag eCopyQuery (event); | |
| 202 | ||
| 203 | try | |
| 204 | { | |
| 205 | String rtn = vis taSession. call(logCo pyQuery); | |
| 206 | logger .info("Res ponse from logging i mage copy [" + rtn + "]"); | |
| 207 | } | |
| 208 | catc h(InvalidV istaCreden tialsExcep tion ivcX) | |
| 209 | { | |
| 210 | logger .error("Ex ception lo gging imag e copy", i vcX); | |
| 211 | throw new Invali dCredentia lsExceptio n(ivcX); | |
| 212 | } | |
| 213 | catc h(IOExcept ion ioX) | |
| 214 | { | |
| 215 | logger .error("Ex ception lo gging imag e copy", i oX); | |
| 216 | throw new Connec tionExcept ion(ioX); | |
| 217 | } | |
| 218 | catc h(VistaMet hodExcepti on vmX) | |
| 219 | { | |
| 220 | logger .error("Ex ception lo gging imag e copy", v mX); | |
| 221 | throw new Method Exception( vmX); | |
| 222 | } | |
| 223 | } | |
| 224 | ||
| 225 | pr ivate void logPatien tIdMismatc h(VistaSes sion vista Session, I mageAccess LogEvent e vent) | |
| 226 | th rows Metho dException , IOExcept ion, Conne ctionExcep tion | |
| 227 | { | |
| 228 | logg er.info("l ogPatientI dMismatch( " + event. getImageIe n() + "), Transactio nContext ( " + Transa ctionConte xtFactory. get().getD isplayIden tity() + " )."); | |
| 229 | Vist aQuery log IdMismatch Query = Vi staImaging QueryFacto ry.createL ogPatientI dMismatchQ uery(event .getDecode dImageIen( ), event.g etPatientD fn()); | |
| 230 | ||
| 231 | try | |
| 232 | { | |
| 233 | String rtn = vis taSession. call(logId MismatchQu ery); | |
| 234 | logger .info("Res ponse from logging p atient ID mismatch [ " + rtn + "]"); | |
| 235 | } | |
| 236 | catc h(InvalidV istaCreden tialsExcep tion ivcX) | |
| 237 | { | |
| 238 | logger .error("Ex ception lo gging pati ent Id mis match", iv cX); | |
| 239 | throw new Invali dCredentia lsExceptio n(ivcX); | |
| 240 | } | |
| 241 | catc h(IOExcept ion ioX) | |
| 242 | { | |
| 243 | logger .error("Ex ception lo gging pati ent Id mis match", io X); | |
| 244 | throw new Connec tionExcept ion(ioX); | |
| 245 | } | |
| 246 | catc h(VistaMet hodExcepti on vmX) | |
| 247 | { | |
| 248 | logger .error("Ex ception lo gging pati ent Id mis match", vm X); | |
| 249 | throw new Method Exception( vmX); | |
| 250 | } | |
| 251 | } | |
| 252 | ||
| 253 | pr ivate void logImageA ccess(Vist aSession v istaSessio n, ImageAc cessLogEve nt event) | |
| 254 | th rows Metho dException , IOExcept ion, Conne ctionExcep tion | |
| 255 | { | |
| 256 | logg er.info("L ogImageAcc ess(" + ev ent.getDec odedImageI en() + ":B ase32{" + event.getI mageIen() + "}), Tra nsactionCo ntext (" + Transacti onContextF actory.get ().getDisp layIdentit y() + ")." ); | |
| 257 | Vist aQuery ima geLogQuery = VistaIm agingQuery Factory.cr eateLogIma geAccessQu ery(event. isDodImage (), | |
| 258 | Transact ionContext Factory.ge t().getDuz (), event. getDecoded ImageIen() , | |
| 259 | event.ge tPatientDf n(), event .getUserSi teNumber() ); | |
| 260 | try | |
| 261 | { | |
| 262 | // don 't really care about the resul t of this RPC as lon g as it ex ecutes | |
| 263 | String rtn = vis taSession. call(image LogQuery); | |
| 264 | logger .info("Res ponse from logging i mage acces s [" + rtn + "]"); | |
| 265 | } | |
| 266 | catc h(InvalidV istaCreden tialsExcep tion ivcX) | |
| 267 | { | |
| 268 | logger .error("Ex ception lo gging imag e access", ivcX); | |
| 269 | throw new Invali dCredentia lsExceptio n(ivcX); | |
| 270 | } | |
| 271 | catc h(IOExcept ion ioX) | |
| 272 | { | |
| 273 | logger .error("Ex ception lo gging imag e access", ioX); | |
| 274 | throw new Connec tionExcept ion(ioX); | |
| 275 | } | |
| 276 | catc h(VistaMet hodExcepti on vmX) | |
| 277 | { | |
| 278 | logger .error("Ex ception lo gging imag e access", vmX); | |
| 279 | throw new Method Exception( vmX); | |
| 280 | } | |
| 281 | } | |
| 282 | ||
| 283 | @O verride | |
| 284 | pu blic void LogImaging LogEvent(I magingLogE vent logEv ent) | |
| 285 | th rows Metho dException , Connecti onExceptio n | |
| 286 | { | |
| 287 | Vist aCommonUti lities.set DataSource MethodAndV ersion("Lo gImagingLo gEvent", g etDataSour ceVersion( )); | |
| 288 | logg er.info("L ogImagingL ogEvent(" + logEvent .toString( ) + "), Tr ansactionC ontext (" + Transact ionContext Factory.ge t().getDis playIdenti ty() + "). "); | |
| 289 | Vist aSession v istaSessio n = null; | |
| 290 | try | |
| 291 | { | |
| 292 | vistaS ession = g etVistaSes sion(); | |
| 293 | if(!vi staSession .isSession Created()) | |
| 294 | { | |
| 295 | VistaIma gingCommon Utilities. createSess ion(vistaS ession); | |
| 296 | vistaSes sion.setSe ssionCreat ed(true); | |
| 297 | } | |
| 298 | ||
| 299 | String patientDf n = | |
| 300 | VistaCom monUtiliti es.getPati entDFN(vis taSession, logEvent. getPatient Icn()); | |
| 301 | ||
| 302 | VistaQ uery image LogQuery = VistaImag ingQueryFa ctory.crea teLogImagi ngQuery(lo gEvent, pa tientDfn); | |
| 303 | // don 't really care about the resul t of this RPC as lon g as it ex ecutes | |
| 304 | String rtn = vis taSession. call(image LogQuery); | |
| 305 | logger .info("Res ponse from logging i mage event [" + rtn + "]"); | |
| 306 | Transa ctionConte xtFactory. get().addD ebugInform ation("Res ponse from logging i mage event [" + rtn + "]"); | |
| 307 | if(rtn == null || (!rtn.s tartsWith( "1"))) | |
| 308 | throw ne w MethodEx ception("E rror loggi ng imaging event, " + rtn); | |
| 309 | ||
| 310 | } | |
| 311 | catc h(InvalidV istaCreden tialsExcep tion ivcX) | |
| 312 | { | |
| 313 | logger .error("Ex ception lo gging imag e event", ivcX); | |
| 314 | throw new Invali dCredentia lsExceptio n(ivcX); | |
| 315 | } | |
| 316 | catc h(IOExcept ion ioX) | |
| 317 | { | |
| 318 | logger .error("Ex ception lo gging imag e event", ioX); | |
| 319 | throw new Connec tionExcept ion(ioX); | |
| 320 | } | |
| 321 | catc h(VistaMet hodExcepti on vmX) | |
| 322 | { | |
| 323 | logger .error("Ex ception lo gging imag e event", vmX); | |
| 324 | throw new Method Exception( vmX); | |
| 325 | } | |
| 326 | fina lly | |
| 327 | { | |
| 328 | try{vi staSession .close();} | |
| 329 | catch( Throwable t){} | |
| 330 | } | |
| 331 | } | |
| 332 | ||
| 333 | /* (non-Java doc) | |
| 334 | * @see gov. va.med.ima ging.datas ource.Vers ionableDat aSourceSpi #isVersion Compatible () | |
| 335 | * / | |
| 336 | @O verride | |
| 337 | pu blic boole an isVersi onCompatib le() | |
| 338 | th rows Secur ityCredent ialsExpire dException | |
| 339 | { | |
| 340 | Stri ng version = VistaIm agingCommo nUtilities .getVistaD ataSourceI magingVers ion( | |
| 341 | VistaIma gingDataSo urceProvid er.getVist aConfigura tion(), th is.getClas s(), | |
| 342 | MAG_REQU IRED_VERSI ON); | |
| 343 | logg er.info("i sVersionCo mpatible s earching f or version [" + vers ion + "], Transactio nContext ( " + Transa ctionConte xtFactory. get().getD isplayIden tity() + " )."); | |
| 344 | Vist aSession l ocalVistaS ession = n ull; | |
| 345 | try | |
| 346 | { | |
| 347 | localV istaSessio n = getVis taSession( ); | |
| 348 | return VistaImag ingCommonU tilities.i sVersionCo mpatible(v ersion, lo calVistaSe ssion); | |
| 349 | } | |
| 350 | catc h(Security Credential sExpiredEx ception sc eX) | |
| 351 | { | |
| 352 | // cau ght here t o be sure it gets th rown as Se curityCred entialsExp iredExcept ion, not C onnectionE xception | |
| 353 | throw sceX; | |
| 354 | } | |
| 355 | catc h(MethodEx ception mX ) | |
| 356 | { | |
| 357 | logger .error("Th ere was an error fin ding the i nstalled I maging ver sion from VistA", mX ); | |
| 358 | Transa ctionConte xtFactory. get().addD ebugInform ation("isV ersionComp atible() f ailed, " + (mX == nu ll ? "<nul l error>" : mX.getMe ssage())); | |
| 359 | } | |
| 360 | catc h(Connecti onExceptio n cX) | |
| 361 | { | |
| 362 | logger .error("Th ere was an error fin ding the i nstalled I maging ver sion from VistA", cX ); | |
| 363 | Transa ctionConte xtFactory. get().addD ebugInform ation("isV ersionComp atible() f ailed, " + (cX == nu ll ? "<nul l error>" : cX.getMe ssage())); | |
| 364 | } | |
| 365 | catc h(IOExcept ion ioX) | |
| 366 | { | |
| 367 | logger .error("Th ere was an error fin ding the i nstalled I maging ver sion from VistA", io X); | |
| 368 | Transa ctionConte xtFactory. get().addD ebugInform ation("isV ersionComp atible() f ailed, " + (ioX == n ull ? "<nu ll error>" : ioX.get Message()) ); | |
| 369 | } | |
| 370 | fina lly | |
| 371 | { | |
| 372 | try{lo calVistaSe ssion.clos e();} | |
| 373 | catch( Throwable t){} | |
| 374 | } | |
| 375 | retu rn false; | |
| 376 | } | |
| 377 | ||
| 378 | pr ivate void populateA ccessLogPa tientDfn(V istaSessio n vistaSes sion, Imag eAccessLog Event even t) | |
| 379 | th rows Metho dException , IOExcept ion, Conne ctionExcep tion, Pati entNotFoun dException | |
| 380 | { | |
| 381 | if(( event.getP atientDfn( ) == null) || (event .getPatien tDfn().len gth() <= 0 )) | |
| 382 | event. setPatient Dfn( Vista CommonUtil ities.getP atientDFN( vistaSessi on, event. getPatient Icn()) ); | |
| 383 | } | |
| 384 | ||
| 385 | /* (non-Java doc) | |
| 386 | * @see gov. va.med.ima ging.datas ource.Imag eAccessLog gingSpi#ge tImageAcce ssReasons( gov.va.med .RoutingTo ken, java. util.List) | |
| 387 | * / | |
| 388 | @O verride | |
| 389 | pu blic List< ImageAcces sReason> g etImageAcc essReasons ( | |
| 390 | Routin gToken glo balRouting Token, | |
| 391 | List<I mageAccess ReasonType > reasonTy pes) | |
| 392 | th rows Metho dException , Connecti onExceptio n | |
| 393 | { | |
| 394 | Vist aCommonUti lities.set DataSource MethodAndV ersion("ge tImageAcce ssReasons" , getDataS ourceVersi on()); | |
| 395 | logg er.info("g etImageAcc essReasons (), Transa ctionConte xt (" + Tr ansactionC ontextFact ory.get(). getDisplay Identity() + ")."); | |
| 396 | Vist aSession v istaSessio n = null; | |
| 397 | try | |
| 398 | { | |
| 399 | vistaS ession = g etVistaSes sion(); | |
| 400 | ||
| 401 | VistaQ uery image LogQuery = VistaImag ingQueryFa ctory.crea teGetReaso nsListQuer y(reasonTy pes); | |
| 402 | // don 't really care about the resul t of this RPC as lon g as it ex ecutes | |
| 403 | String rtn = vis taSession. call(image LogQuery); | |
| 404 | ||
| 405 | return VistaImag ingTransla tor.transl ateImageAc cessReason s(getSite( ), rtn); | |
| 406 | } | |
| 407 | catc h(InvalidV istaCreden tialsExcep tion ivcX) | |
| 408 | { | |
| 409 | logger .error("Ex ception ge tting imag e access r easons", i vcX); | |
| 410 | throw new Invali dCredentia lsExceptio n(ivcX); | |
| 411 | } | |
| 412 | catc h(IOExcept ion ioX) | |
| 413 | { | |
| 414 | logger .error("Ex ception ge tting imag e access r easons", i oX); | |
| 415 | throw new Connec tionExcept ion(ioX); | |
| 416 | } | |
| 417 | catc h(VistaMet hodExcepti on vmX) | |
| 418 | { | |
| 419 | logger .error("Ex ception ge tting imag e access r easons", v mX); | |
| 420 | throw new Method Exception( vmX); | |
| 421 | } | |
| 422 | fina lly | |
| 423 | { | |
| 424 | try{vi staSession .close();} | |
| 425 | catch( Throwable t){} | |
| 426 | } | |
| 427 | } | |
| 428 | ||
| 429 | pr otected St ring getDa taSourceVe rsion() | |
| 430 | { | |
| 431 | retu rn "1"; | |
| 432 | } | |
| 433 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.