Produced by Araxis Merge on 7/10/2017 1:01:47 PM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | C:\AraxisMergeCompare\Pri_un\IV-ehmp_cif\VistaDataSource\main\src\java\gov\va\med\imaging\vistadatasource | VistaPatientDataSourceService.java | Thu Jun 29 17:22:01 2017 UTC |
| 2 | C:\AraxisMergeCompare\Pri_re\IV-ehmp_cif\VistaDataSource\main\src\java\gov\va\med\imaging\vistadatasource | VistaPatientDataSourceService.java | Thu Jul 6 15:05:53 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 666 |
| 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: Apr 10, 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 tadatasour ce; | |
| 27 | ||
| 28 | import gov .va.med.He althSummar yURN; | |
| 29 | import gov .va.med.Pa tientIdent ifier; | |
| 30 | import gov .va.med.Ro utingToken ; | |
| 31 | import gov .va.med.im aging.arti factsource .ResolvedA rtifactSou rce; | |
| 32 | import gov .va.med.im aging.core .interface s.exceptio ns.Connect ionExcepti on; | |
| 33 | import gov .va.med.im aging.core .interface s.exceptio ns.MethodE xception; | |
| 34 | import gov .va.med.im aging.core .interface s.exceptio ns.Securit yCredentia lsExpiredE xception; | |
| 35 | import gov .va.med.im aging.data source.Abs tractVersi onableData Source; | |
| 36 | import gov .va.med.im aging.data source.Pat ientDataSo urceSpi; | |
| 37 | import gov .va.med.im aging.data source.exc eptions.Un supportedS erviceMeth odExceptio n; | |
| 38 | import gov .va.med.im aging.exch ange.busin ess.Health SummaryTyp e; | |
| 39 | import gov .va.med.im aging.exch ange.busin ess.Patien t; | |
| 40 | import gov .va.med.im aging.exch ange.busin ess.Patien tMeansTest Result; | |
| 41 | import gov .va.med.im aging.exch ange.busin ess.Patien tPhotoID; | |
| 42 | import gov .va.med.im aging.exch ange.busin ess.Patien tPhotoIDIn formation; | |
| 43 | import gov .va.med.im aging.exch ange.busin ess.Patien tSensitive Value; | |
| 44 | import gov .va.med.im aging.exch ange.busin ess.Resolv edSite; | |
| 45 | import gov .va.med.im aging.exch ange.busin ess.Site; | |
| 46 | import gov .va.med.im aging.exch ange.enums .ImagingSe curityCont extType; | |
| 47 | import gov .va.med.im aging.tran sactioncon text.Trans actionCont extFactory ; | |
| 48 | import gov .va.med.im aging.vist adatasourc e.common.V istaCommon Utilities; | |
| 49 | import gov .va.med.im aging.vist adatasourc e.session. VistaSessi on; | |
| 50 | ||
| 51 | import jav a.io.IOExc eption; | |
| 52 | import jav a.io.Input Stream; | |
| 53 | import jav a.util.Lis t; | |
| 54 | import jav a.util.Sor tedSet; | |
| 55 | ||
| 56 | import org .apache.lo g4j.Logger ; | |
| 57 | ||
| 58 | /** | |
| 59 | * This da ta source implementa tion shoul d not use any VistA Imaging RP C calls. | |
| 60 | * It doe s not do a real vers ion check, it always returns t rue. | |
| 61 | * | |
| 62 | * @author
|
|
| 63 | * | |
| 64 | */ | |
| 65 | public cla ss VistaPa tientDataS ourceServi ce | |
| 66 | extends Ab stractVers ionableDat aSource | |
| 67 | implements PatientDa taSourceSp i | |
| 68 | { | |
| 69 | pr ivate Logg er logger = Logger.g etLogger(t his.getCla ss()); | |
| 70 | pu blic final static St ring SUPPO RTED_PROTO COL = "vis ta"; | |
| 71 | ||
| 72 | /* * | |
| 73 | * @param re solvedArti factSource | |
| 74 | * @param pr otocol | |
| 75 | * / | |
| 76 | pu blic Vista PatientDat aSourceSer vice(Resol vedArtifac tSource re solvedArti factSource , String p rotocol) | |
| 77 | { | |
| 78 | supe r(resolved ArtifactSo urce, prot ocol); | |
| 79 | if(! (resolved ArtifactSo urce insta nceof Reso lvedSite) ) | |
| 80 | 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() + "'."); | |
| 81 | } | |
| 82 | ||
| 83 | /* * | |
| 84 | * The artif act source must be c hecked in the constr uctor to a ssure that it is an instance | |
| 85 | * of Resolv edSite. | |
| 86 | * | |
| 87 | * @return | |
| 88 | * / | |
| 89 | pr ivate Reso lvedSite g etResolved Site() | |
| 90 | { | |
| 91 | retu rn (Resolv edSite)get ResolvedAr tifactSour ce(); | |
| 92 | } | |
| 93 | ||
| 94 | pr ivate Site getSite() | |
| 95 | { | |
| 96 | retu rn getReso lvedSite() .getSite() ; | |
| 97 | } | |
| 98 | ||
| 99 | pr ivate Vist aSession g etVistaSes sion() | |
| 100 | throws IOExcepti on, Connec tionExcept ion, Metho dException , Security Credential sExpiredEx ception | |
| 101 | { | |
| 102 | retu rn getVist aSession(t rue); | |
| 103 | } | |
| 104 | ||
| 105 | privat e VistaSes sion getVi staSession (boolean s etDefaultC ontext) | |
| 106 | throws IOExcepti on, Connec tionExcept ion, Metho dException , Security Credential sExpiredEx ception | |
| 107 | { | |
| 108 | if (setDefaul tContext) | |
| 109 | retu rn VistaSe ssion.getO rCreate(ge tMetadataU rl(), getS ite(), Ima gingSecuri tyContextT ype.CPRS_C ONTEXT); | |
| 110 | el se | |
| 111 | retu rn VistaSe ssion.getO rCreate(ge tMetadataU rl(), getS ite()); | |
| 112 | } | |
| 113 | ||
| 114 | @O verride | |
| 115 | public boolean i sVersionCo mpatible() | |
| 116 | { | |
| 117 | // f or this im plementati on we are not using any MAG rp c calls, j ust assume version i s ok | |
| 118 | retu rn true; | |
| 119 | } | |
| 120 | ||
| 121 | @O verride | |
| 122 | pu blic List< String> ge tTreatingS ites(Routi ngToken gl obalRoutin gToken, Pa tientIdent ifier pati entIdentif ier, | |
| 123 | boolea n includeT railingCha ractersFor Site200) | |
| 124 | th rows Metho dException , Connecti onExceptio n | |
| 125 | { | |
| 126 | Vist aCommonUti lities.set DataSource MethodAndV ersion("ge tTreatingS ites", get DataSource Version()) ; | |
| 127 | Vist aSession l ocalVistaS ession = n ull; | |
| 128 | logg er.info("g etTreating Sites(" + patientIde ntifier + ") Transac tionContex t (" + Tra nsactionCo ntextFacto ry.get().g etDisplayI dentity() + ")."); | |
| 129 | tr y | |
| 130 | { | |
| 131 | // J MW 9/5/201 2 | |
| 132 | // t his code i s used in multiple w ays. When DoD users request s tudies fro m the VA w e get the treating s ites and i n that cas e the user is | |
| 133 | // a uthenticat ed by Vist A on stati on 200. I n that cas e the acco unt has pr ogrammer m ode in sta tion 200 s o we can c all the | |
| 134 | // V AFCTFU GET TREATING SITES rpc. | |
| 135 | // W hen VA use rs request DoD data we call th is RPC on the CVIX t o ensure t he patient has actua lly been s een at sit e 200 befo re calling BHIE. | |
| 136 | // i n that cas e the user is not au thenticate d by VistA and must call the C PRS rpc to get treat ing sites. | |
| 137 | // W hen VA use rs on the AWIV want DoD data t he user is authentic ated by Vi stA but no t station 200 (anoth er site), so we need to call t he CPRS | |
| 138 | // r pc to get treating s ites | |
| 139 | ||
| 140 | // i f the user is authen ticated by VistA tha t means it s a local login. Th is means t he standar d RPC to g et treatin g sites sh ould be av ailable | |
| 141 | // i f not loca l authenti cation the n use CPRS RPC | |
| 142 | ||
| 143 | // J MW 9/11/20 12 | |
| 144 | // T here was a change (a bove) to a lways set the contex t to CPRS when getti ng a VistA session s o no matte r what is provided i t will use the | |
| 145 | // C PRS contex t. In our internal t est enviro nment usin g the CPRS context t o call the VAFCTFU r pc does no t work bec ause the a ccount doe sn't have programmer access | |
| 146 | // b ut the acc ount we us e in produ ction does have prog rammer acc ess. Usin g the CPRS rpc shoul d work in all cases and makes things muc h easier | |
| 147 | ||
| 148 | // J MW 9/25/20 12 | |
| 149 | // T he CPRS rp c works pr operly in our intern al test en vironment except the CPRS rpc by design does not r eturn the local site . In our internal t est enviro nment | |
| 150 | // w e use a SL C database as statio n 200 but it no long er returns SLC as a treating s ite which causes pro blems for our intern al tests. As a resu lt for int ernal test ing | |
| 151 | // w e need to call a dif ferent RPC (our old trusty RPC ) | |
| 152 | ||
| 153 | if(V istaDataSo urceProvid er.getVist aConfigura tion().isI nternalTes tEnvironme nt()) | |
| 154 | { | |
| 155 | logger .info("Run ning in in ternal tes t environm ent, using the non-C PRS rpc to retrieve treating s ites"); | |
| 156 | localV istaSessio n = getVis taSession( false); | |
| 157 | return VistaComm onUtilitie s.getTreat ingSites(l ocalVistaS ession, pa tientIdent ifier); | |
| 158 | } | |
| 159 | else | |
| 160 | { | |
| 161 | logger .debug("No t running in interna l test env ironment, using CPRS rpc to re trieve tre ating site s"); | |
| 162 | localV istaSessio n = getVis taSession( ); | |
| 163 | return VistaComm onUtilitie s.getTreat ingSitesUs ingCprsRpc (localVist aSession, patientIde ntifier); | |
| 164 | } | |
| 165 | ||
| 166 | /* | |
| 167 | ||
| 168 | Tran sactionCon text trans actionCont ext = Tran sactionCon textFactor y.get(); | |
| 169 | Stri ng connect edSiteNumb er = getSi te().getSi teNumber() ; | |
| 170 | Stri ng authent icatedSecu rityRealm = transact ionContext .getRealm( ); | |
| 171 | if(t ransaction Context.is Authentica tedByVista () && (con nectedSite Number.equ als(authen ticatedSec urityRealm ))) | |
| 172 | return VistaComm onUtilitie s.getTreat ingSites(l ocalVistaS ession, pa tientIcn); | |
| 173 | else | |
| 174 | return VistaComm onUtilitie s.getTreat ingSitesUs ingCprsRpc (localVist aSession, patientIcn ); | |
| 175 | */ | |
| 176 | } | |
| 177 | ca tch(IOExce ption ioX) | |
| 178 | { | |
| 179 | logg er.error(" Exception getting Vi stA sessio n", ioX); | |
| 180 | thro w new Conn ectionExce ption(ioX) ; | |
| 181 | } | |
| 182 | fi nally | |
| 183 | { | |
| 184 | try{ localVista Session.cl ose();}cat ch(Throwab le t){} | |
| 185 | } | |
| 186 | } | |
| 187 | ||
| 188 | ||
| 189 | /* (no n-Javadoc) | |
| 190 | * @see gov. va.med.ima ging.datas ource.Pati entDataSou rce#getPat ientSensit ivityLevel (java.lang .String) | |
| 191 | * / | |
| 192 | @O verride | |
| 193 | pu blic Patie ntSensitiv eValue get PatientSen sitivityLe vel(Routin gToken glo balRouting Token, Pat ientIdenti fier patie ntIdentifi er) | |
| 194 | th rows Metho dException , Connecti onExceptio n | |
| 195 | { | |
| 196 | Vist aCommonUti lities.set DataSource MethodAndV ersion("ge tPatientSe nsitivityL evel", get DataSource Version()) ; | |
| 197 | logg er.info("g etPatientS ensitivity Level(" + patientIde ntifier + ") Transac tionContex t (" + Tra nsactionCo ntextFacto ry.get().g etDisplayI dentity() + ")."); | |
| 198 | Vist aSession v istaSessio n = null; | |
| 199 | tr y | |
| 200 | { | |
| 201 | vist aSession = getVistaS ession(); | |
| 202 | retu rn VistaCo mmonUtilit ies.getPat ientSensit ivityValue (vistaSess ion, patie ntIdentifi er); | |
| 203 | } | |
| 204 | ca tch(IOExce ption ioX) | |
| 205 | { | |
| 206 | logger .error("Ex ception ge tting Vist A session" , ioX); | |
| 207 | thro w new Conn ectionExce ption(ioX) ; | |
| 208 | } | |
| 209 | fina lly | |
| 210 | { | |
| 211 | try{ vistaSessi on.close() ;}catch(Th rowable t) {} | |
| 212 | } | |
| 213 | } | |
| 214 | ||
| 215 | @O verride | |
| 216 | pu blic boole an logPati entSensiti veAccess(R outingToke n globalRo utingToken , | |
| 217 | Patien tIdentifie r patientI dentifier) | |
| 218 | th rows Metho dException , Connecti onExceptio n | |
| 219 | { | |
| 220 | Vist aCommonUti lities.set DataSource MethodAndV ersion("lo gPatientSe nsitiveAcc ess", getD ataSourceV ersion()); | |
| 221 | logg er.info("l ogPatientS ensitiveAc cess(" + p atientIden tifier + " ) Transact ionContext (" + Tran sactionCon textFactor y.get().ge tDisplayId entity() + ")."); | |
| 222 | Vist aSession l ocalVistaS ession = n ull; | |
| 223 | tr y | |
| 224 | { | |
| 225 | loca lVistaSess ion = getV istaSessio n(); | |
| 226 | Vist aCommonUti lities.log Restricted Access(loc alVistaSes sion, pati entIdentif ier); | |
| 227 | retu rn true; | |
| 228 | } | |
| 229 | ca tch(IOExce ption ioX) | |
| 230 | { | |
| 231 | logg er.error(" Exception getting Vi stA sessio n", ioX); | |
| 232 | thro w new Conn ectionExce ption(ioX) ; | |
| 233 | } | |
| 234 | fi nally | |
| 235 | { | |
| 236 | try{ localVista Session.cl ose();}cat ch(Throwab le t){} | |
| 237 | } | |
| 238 | } | |
| 239 | ||
| 240 | /* (non-Java doc) | |
| 241 | * @see gov. va.med.ima ging.datas ource.Pati entDataSou rceSpi#fin dPatients( gov.va.med .RoutingTo ken, java. lang.Strin g) | |
| 242 | * / | |
| 243 | @O verride | |
| 244 | pu blic Sorte dSet<Patie nt> findPa tients(Rou tingToken globalRout ingToken, String sea rchName) t hrows Meth odExceptio n, | |
| 245 | Conn ectionExce ption | |
| 246 | { | |
| 247 | thro w new Unsu pportedSer viceMethod Exception( PatientDat aSourceSpi .class, "f indPatient s"); | |
| 248 | } | |
| 249 | ||
| 250 | /* (non-Java doc) | |
| 251 | * @see gov. va.med.ima ging.datas ource.Pati entDataSou rceSpi#get PatientIde ntificatio nImage(jav a.lang.Str ing) | |
| 252 | * / | |
| 253 | @O verride | |
| 254 | pu blic Input Stream get PatientIde ntificatio nImage(Pat ientIdenti fier patie ntIdentifi er) throws MethodExc eption, Co nnectionEx ception | |
| 255 | { | |
| 256 | thro w new Unsu pportedSer viceMethod Exception( PatientDat aSourceSpi .class, "g etPatientI dentificat ionImage") ; | |
| 257 | } | |
| 258 | ||
| 259 | pr otected St ring getDa taSourceVe rsion() | |
| 260 | { | |
| 261 | retu rn "1"; | |
| 262 | } | |
| 263 | ||
| 264 | /* (non-Java doc) | |
| 265 | * @see gov. va.med.ima ging.datas ource.Pati entDataSou rceSpi#get PatientInf ormation(g ov.va.med. RoutingTok en, java.l ang.String ) | |
| 266 | * / | |
| 267 | @O verride | |
| 268 | pu blic Patie nt getPati entInforma tion(Routi ngToken gl obalRoutin gToken, | |
| 269 | Patien tIdentifie r patientI dentifier) | |
| 270 | th rows Metho dException , Connecti onExceptio n | |
| 271 | { | |
| 272 | thro w new Unsu pportedSer viceMethod Exception( PatientDat aSourceSpi .class, "g etPatientI nformation "); | |
| 273 | } | |
| 274 | ||
| 275 | @O verride | |
| 276 | pu blic Patie ntMeansTes tResult ge tPatientMe ansTest( | |
| 277 | Routin gToken glo balRouting Token, Pat ientIdenti fier patie ntIdentifi er) | |
| 278 | th rows Metho dException , Connecti onExceptio n | |
| 279 | { | |
| 280 | Vist aCommonUti lities.set DataSource MethodAndV ersion("ge tPatientMe ansTest", getDataSou rceVersion ()); | |
| 281 | logg er.info("g etPatientM eansTest(" + patient Identifier + ") Tran sactionCon text (" + Transactio nContextFa ctory.get( ).getDispl ayIdentity () + ").") ; | |
| 282 | Vist aSession v istaSessio n = null; | |
| 283 | tr y | |
| 284 | { | |
| 285 | vist aSession = getVistaS ession(); | |
| 286 | retu rn VistaCo mmonUtilit ies.getPat ientMeansT est(vistaS ession, pa tientIdent ifier); | |
| 287 | } | |
| 288 | ca tch(IOExce ption ioX) | |
| 289 | { | |
| 290 | logger .error("Ex ception ge tting Vist A session" , ioX); | |
| 291 | thro w new Conn ectionExce ption(ioX) ; | |
| 292 | } | |
| 293 | fina lly | |
| 294 | { | |
| 295 | try{ vistaSessi on.close() ;}catch(Th rowable t) {} | |
| 296 | } | |
| 297 | } | |
| 298 | ||
| 299 | @O verride | |
| 300 | pu blic List< HealthSumm aryType> g etHealthSu mmaryTypes ( | |
| 301 | Routin gToken glo balRouting Token) | |
| 302 | th rows Metho dException , Connecti onExceptio n | |
| 303 | { | |
| 304 | thro w new Unsu pportedSer viceMethod Exception( PatientDat aSourceSpi .class, "g etHealthSu mmaryTypes "); | |
| 305 | } | |
| 306 | ||
| 307 | @O verride | |
| 308 | pu blic Strin g getHealt hSummary(H ealthSumma ryURN heal thSummaryU rn, | |
| 309 | Patien tIdentifie r patientI dentifier) | |
| 310 | th rows Metho dException , Connecti onExceptio n | |
| 311 | { | |
| 312 | thro w new Unsu pportedSer viceMethod Exception( PatientDat aSourceSpi .class, "g etHealthSu mmary"); | |
| 313 | } | |
| 314 | ||
| 315 | /* (non-Java doc) | |
| 316 | * @see gov. va.med.ima ging.datas ource.Pati entDataSou rceSpi#get PatientIde ntificatio nImage(jav a.lang.Str ing) | |
| 317 | * / | |
| 318 | @O verride | |
| 319 | pu blic Patie ntPhotoID getPatient PhotoIdent ificationI mage(Patie ntIdentifi er patient Identifier ) | |
| 320 | th rows Metho dException , Connecti onExceptio n | |
| 321 | { | |
| 322 | thro w new Unsu pportedSer viceMethod Exception( PatientDat aSourceSpi .class, "g etPatientI dentificat ionImage") ; | |
| 323 | } | |
| 324 | ||
| 325 | /* (non-Java doc) | |
| 326 | * @see gov. va.med.ima ging.datas ource.Pati entDataSou rceSpi#get PatientIde ntificatio nImageInfo rmation(go v.va.med.R outingToke n, gov.va. med.Patien tIdentifie r) | |
| 327 | * / | |
| 328 | @O verride | |
| 329 | pu blic Patie ntPhotoIDI nformation getPatien tIdentific ationImage Informatio n( | |
| 330 | Rout ingToken g lobalRouti ngToken, P atientIden tifier pat ientIdenti fier) | |
| 331 | th rows Metho dException , Connecti onExceptio n | |
| 332 | { | |
| 333 | thro w new Unsu pportedSer viceMethod Exception( PatientDat aSourceSpi .class, "g etPatientI dentificat ionImageIn formation" ); | |
| 334 | } | |
| 335 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.