Produced by Araxis Merge on 12/5/2017 12:06:51 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\VixVistaImagingDataSourceProvider\main\src\java\gov\va\med\imaging\vistaimagingdatasource\vix | VistaImagingImageAnnotationDataSourceService.java | Mon Dec 4 21:35:06 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\VixVistaImagingDataSourceProvider\main\src\java\gov\va\med\imaging\vistaimagingdatasource\vix | VistaImagingImageAnnotationDataSourceService.java | Mon Dec 4 22:07:40 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 650 |
| 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: Jun 17, 2011 | |
| 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. vix; | |
| 27 | ||
| 28 | import jav a.io.IOExc eption; | |
| 29 | import jav a.util.Lis t; | |
| 30 | ||
| 31 | import org .apache.lo gging.log4 j.LogManag er; | |
| 32 | import org .apache.lo gging.log4 j.Logger; | |
| 33 | ||
| 34 | import gov .va.med.im aging.Abst ractImagin gURN; | |
| 35 | import gov .va.med.im aging.Imag eAnnotatio nURN; | |
| 36 | import gov .va.med.im aging.arti factsource .ResolvedA rtifactSou rce; | |
| 37 | import gov .va.med.im aging.core .interface s.exceptio ns.Connect ionExcepti on; | |
| 38 | import gov .va.med.im aging.core .interface s.exceptio ns.MethodE xception; | |
| 39 | import gov .va.med.im aging.core .interface s.exceptio ns.Securit yCredentia lsExpiredE xception; | |
| 40 | import gov .va.med.im aging.data source.Ima geAnnotati onDataSour ceSpi; | |
| 41 | import gov .va.med.im aging.data source.exc eptions.In validCrede ntialsExce ption; | |
| 42 | import gov .va.med.im aging.data source.exc eptions.Un supportedP rotocolExc eption; | |
| 43 | import gov .va.med.im aging.exch ange.busin ess.Resolv edSite; | |
| 44 | import gov .va.med.im aging.exch ange.busin ess.Site; | |
| 45 | import gov .va.med.im aging.exch ange.busin ess.annota tions.Imag eAnnotatio n; | |
| 46 | import gov .va.med.im aging.exch ange.busin ess.annota tions.Imag eAnnotatio nDetails; | |
| 47 | import gov .va.med.im aging.exch ange.busin ess.annota tions.Imag eAnnotatio nSource; | |
| 48 | import gov .va.med.im aging.tran sactioncon text.Trans actionCont extFactory ; | |
| 49 | import gov .va.med.im aging.url. vista.Vist aQuery; | |
| 50 | import gov .va.med.im aging.url. vista.exce ptions.Inv alidVistaC redentials Exception; | |
| 51 | import gov .va.med.im aging.url. vista.exce ptions.Vis taMethodEx ception; | |
| 52 | import gov .va.med.im aging.vist adatasourc e.common.V istaCommon Utilities; | |
| 53 | import gov .va.med.im aging.vist adatasourc e.session. VistaSessi on; | |
| 54 | import gov .va.med.im aging.vist aimagingda tasource.A bstractVis taImagingD ataSourceS ervice; | |
| 55 | import gov .va.med.im aging.vist aimagingda tasource.c ommon.Vist aImagingCo mmonUtilit ies; | |
| 56 | import gov .va.med.im aging.vist aimagingda tasource.v ix.query.V istaImagin gVixQueryF actory; | |
| 57 | import gov .va.med.im aging.vist aimagingda tasource.v ix.transla tor.VistaI magingVixT ranslator; | |
| 58 | ||
| 59 | /** | |
| 60 | * @author
|
|
| 61 | * | |
| 62 | */ | |
| 63 | public cla ss VistaIm agingImage Annotation DataSource Service | |
| 64 | extends Ab stractVist aImagingDa taSourceSe rvice | |
| 65 | implements ImageAnno tationData SourceSpi | |
| 66 | { | |
| 67 | ||
| 68 | pr ivate Logg er logger = LogManag er.getLogg er(this.ge tClass()); | |
| 69 | ||
| 70 | pu blic final static St ring SUPPO RTED_PROTO COL = "vis taimaging" ; | |
| 71 | ||
| 72 | // The requi red versio n of VistA Imaging n eeded to e xecute the RPC calls for this operation | |
| 73 | pu blic final static St ring MAG_R EQUIRED_VE RSION = "3 .0P122"; | |
| 74 | ||
| 75 | /* * | |
| 76 | * @param re solvedArti factSource | |
| 77 | * @param pr otocol | |
| 78 | * / | |
| 79 | pu blic Vista ImagingIma geAnnotati onDataSour ceService( ResolvedAr tifactSour ce resolve dArtifactS ource, | |
| 80 | String protocol) | |
| 81 | { | |
| 82 | supe r(resolved ArtifactSo urce, prot ocol); | |
| 83 | if(! (resolved ArtifactSo urce insta nceof Reso lvedSite) ) | |
| 84 | 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() + "'."); | |
| 85 | } | |
| 86 | ||
| 87 | pu blic stati c VistaIma gingImageA nnotationD ataSourceS ervice cre ate(Resolv edArtifact Source res olvedArtif actSource, String pr otocol) | |
| 88 | th rows Conne ctionExcep tion, Unsu pportedPro tocolExcep tion | |
| 89 | { | |
| 90 | retu rn new Vis taImagingI mageAnnota tionDataSo urceServic e(resolved ArtifactSo urce, prot ocol); | |
| 91 | } | |
| 92 | ||
| 93 | /* * | |
| 94 | * The artif act source must be c hecked in the constr uctor to a ssure that it is an instance | |
| 95 | * of Resolv edSite. | |
| 96 | * | |
| 97 | * @return | |
| 98 | * / | |
| 99 | pr otected Re solvedSite getResolv edSite() | |
| 100 | { | |
| 101 | retu rn (Resolv edSite)get ResolvedAr tifactSour ce(); | |
| 102 | } | |
| 103 | ||
| 104 | pr otected Si te getSite () | |
| 105 | { | |
| 106 | retu rn getReso lvedSite() .getSite() ; | |
| 107 | } | |
| 108 | ||
| 109 | pr ivate Vist aSession g etVistaSes sion() | |
| 110 | throws IOExcepti on, Connec tionExcept ion, Metho dException | |
| 111 | { | |
| 112 | return V istaSessio n.getOrCre ate(getMet adataUrl() , getSite( )); | |
| 113 | } | |
| 114 | ||
| 115 | /* (non-Java doc) | |
| 116 | * @see gov. va.med.ima ging.datas ource.Imag ingPatient DataSource #isVersion Compatible () | |
| 117 | * / | |
| 118 | @O verride | |
| 119 | pu blic boole an isVersi onCompatib le() | |
| 120 | th rows Secur ityCredent ialsExpire dException | |
| 121 | { | |
| 122 | Stri ng version = VistaIm agingCommo nUtilities .getVistaD ataSourceI magingVers ion( | |
| 123 | getVista ImagingCon figuration (), this.g etClass(), | |
| 124 | MAG_REQU IRED_VERSI ON); | |
| 125 | ||
| 126 | logg er.info("i sVersionCo mpatible s earching f or version [" + vers ion + "], Transactio nContext ( " + Transa ctionConte xtFactory. get().getD isplayIden tity() + " )."); | |
| 127 | Vist aSession l ocalVistaS ession = n ull; | |
| 128 | try | |
| 129 | { | |
| 130 | localV istaSessio n = getVis taSession( ); | |
| 131 | return VistaImag ingCommonU tilities.i sVersionCo mpatible(v ersion, lo calVistaSe ssion); | |
| 132 | } | |
| 133 | catc h(Security Credential sExpiredEx ception sc eX) | |
| 134 | { | |
| 135 | // cau ght here t o be sure it gets th rown as Se curityCred entialsExp iredExcept ion, not C onnectionE xception | |
| 136 | throw sceX; | |
| 137 | } | |
| 138 | catc h(MethodEx ception mX ) | |
| 139 | { | |
| 140 | logger .error("Th ere was an error fin ding the i nstalled I maging ver sion from VistA", mX ); | |
| 141 | Transa ctionConte xtFactory. get().addD ebugInform ation("isV ersionComp atible() f ailed, " + (mX == nu ll ? "<nul l error>" : mX.getMe ssage())); | |
| 142 | } | |
| 143 | catc h(Connecti onExceptio n cX) | |
| 144 | { | |
| 145 | logger .error("Th ere was an error fin ding the i nstalled I maging ver sion from VistA", cX ); | |
| 146 | Transa ctionConte xtFactory. get().addD ebugInform ation("isV ersionComp atible() f ailed, " + (cX == nu ll ? "<nul l error>" : cX.getMe ssage())); | |
| 147 | } | |
| 148 | catc h(IOExcept ion ioX) | |
| 149 | { | |
| 150 | logger .error("Th ere was an error fin ding the i nstalled I maging ver sion from VistA", io X); | |
| 151 | Transa ctionConte xtFactory. get().addD ebugInform ation("isV ersionComp atible() f ailed, " + (ioX == n ull ? "<nu ll error>" : ioX.get Message()) ); | |
| 152 | } | |
| 153 | fina lly | |
| 154 | { | |
| 155 | try{lo calVistaSe ssion.clos e();} | |
| 156 | catch( Throwable t){} | |
| 157 | } | |
| 158 | retu rn false; | |
| 159 | } | |
| 160 | ||
| 161 | pr otected St ring getDa taSourceVe rsion() | |
| 162 | { | |
| 163 | retu rn "1"; | |
| 164 | } | |
| 165 | ||
| 166 | @O verride | |
| 167 | pu blic List< ImageAnnot ation> get ImageAnnot ations(Abs tractImagi ngURN imag ingUrn) | |
| 168 | th rows Metho dException , Connecti onExceptio n | |
| 169 | { | |
| 170 | Vist aCommonUti lities.set DataSource MethodAndV ersion("ge tImageAnno tations", getDataSou rceVersion ()); | |
| 171 | logg er.info("g etImageAnn otations ( " + imagin gUrn.toStr ing() + ") Transacti onContext (" + Trans actionCont extFactory .get().get DisplayIde ntity() + ")."); | |
| 172 | Vist aSession l ocalVistaS ession = n ull; | |
| 173 | try | |
| 174 | { | |
| 175 | localV istaSessio n = getVis taSession( ); | |
| 176 | VistaQ uery query = | |
| 177 | VistaIma gingVixQue ryFactory. createGetI mageAnnota tionsQuery (imagingUr n.getImagi ngIdentifi er()); | |
| 178 | String rtn = loc alVistaSes sion.call( query); | |
| 179 | //Syst em.out.pri ntln("RTN: " + rtn); | |
| 180 | return VistaImag ingVixTran slator.tra nslateImag eAnnotatio ns(imaging Urn, rtn); | |
| 181 | } | |
| 182 | catc h(IOExcept ion ioX) | |
| 183 | { | |
| 184 | logger .error("Ex ception ge tting Vist A session" , ioX); | |
| 185 | thro w new Conn ectionExce ption(ioX) ; | |
| 186 | } | |
| 187 | catc h (Invalid VistaCrede ntialsExce ption e) | |
| 188 | { | |
| 189 | throw new Invali dCredentia lsExceptio n(e.getMes sage()); | |
| 190 | } | |
| 191 | catc h (VistaMe thodExcept ion e) | |
| 192 | { | |
| 193 | throw new Method Exception( e.getMessa ge()); | |
| 194 | } | |
| 195 | fina lly | |
| 196 | { | |
| 197 | try{ localVista Session.cl ose();}cat ch(Throwab le t){} | |
| 198 | } | |
| 199 | } | |
| 200 | ||
| 201 | @O verride | |
| 202 | pu blic Image Annotation Details ge tAnnotatio nDetails( | |
| 203 | Abstra ctImagingU RN imaging Urn, | |
| 204 | ImageA nnotationU RN imageAn notationUr n) | |
| 205 | th rows Metho dException , Connecti onExceptio n | |
| 206 | { | |
| 207 | Vist aCommonUti lities.set DataSource MethodAndV ersion("ge tAnnotatio nDetails", getDataSo urceVersio n()); | |
| 208 | logg er.info("g etAnnotati onDetails (" + imagi ngUrn.toSt ring() + " ), (" + im ageAnnotat ionUrn.toS tring() + ") Transac tionContex t (" + Tra nsactionCo ntextFacto ry.get().g etDisplayI dentity() + ")."); | |
| 209 | Vist aSession l ocalVistaS ession = n ull; | |
| 210 | try | |
| 211 | { | |
| 212 | localV istaSessio n = getVis taSession( ); | |
| 213 | return getAnnota tionDetail sInternal( localVista Session, i magingUrn, imageAnno tationUrn) ; | |
| 214 | } | |
| 215 | catc h(IOExcept ion ioX) | |
| 216 | { | |
| 217 | logger .error("Ex ception ge tting Vist A session" , ioX); | |
| 218 | thro w new Conn ectionExce ption(ioX) ; | |
| 219 | } | |
| 220 | catc h (Invalid VistaCrede ntialsExce ption e) | |
| 221 | { | |
| 222 | throw new Invali dCredentia lsExceptio n(e.getMes sage()); | |
| 223 | } | |
| 224 | catc h (VistaMe thodExcept ion e) | |
| 225 | { | |
| 226 | throw new Method Exception( e.getMessa ge()); | |
| 227 | } | |
| 228 | fina lly | |
| 229 | { | |
| 230 | try{ localVista Session.cl ose();}cat ch(Throwab le t){} | |
| 231 | } | |
| 232 | } | |
| 233 | ||
| 234 | pr ivate Imag eAnnotatio nDetails g etAnnotati onDetailsI nternal(Vi staSession localVist aSession, | |
| 235 | Abstra ctImagingU RN imaging Urn, Image Annotation URN imageA nnotationU rn) | |
| 236 | th rows IOExc eption, In validVista Credential sException , VistaMet hodExcepti on, Method Exception | |
| 237 | { | |
| 238 | Vist aQuery que ry = | |
| 239 | VistaI magingVixQ ueryFactor y.createGe tImageAnno tationDeta ilsQuery( | |
| 240 | imagingUrn .getImagin gIdentifie r(), | |
| 241 | imageAnnot ationUrn.g etAnnotati onId()); | |
| 242 | Stri ng rtn = l ocalVistaS ession.cal l(query); | |
| 243 | //Sy stem.out.p rintln("Rt n: " + rtn ); | |
| 244 | retu rn VistaIm agingVixTr anslator.t ranslateIm ageAnnotat ionDetails (imagingUr n, | |
| 245 | imageAnn otationUrn , rtn); | |
| 246 | } | |
| 247 | ||
| 248 | @O verride | |
| 249 | pu blic Image Annotation storeImag eAnnotatio nDetails(A bstractIma gingURN im agingUrn, | |
| 250 | String annotatio nDetails, String ann otationVer sion, Imag eAnnotatio nSource an notationSo urce) | |
| 251 | th rows Metho dException , Connecti onExceptio n | |
| 252 | { | |
| 253 | Vist aCommonUti lities.set DataSource MethodAndV ersion("st oreImageAn notationDe tails", ge tDataSourc eVersion() ); | |
| 254 | logg er.info("s toreImageA nnotationD etails (" + imagingU rn.toStrin g() + ") T ransaction Context (" + Transac tionContex tFactory.g et().getDi splayIdent ity() + ") ."); | |
| 255 | Vist aSession l ocalVistaS ession = n ull; | |
| 256 | try | |
| 257 | { | |
| 258 | localV istaSessio n = getVis taSession( ); | |
| 259 | VistaQ uery query = | |
| 260 | VistaIma gingVixQue ryFactory. createStor eImageAnno tationDeta ilsQuery(i magingUrn. getImaging Identifier (), | |
| 261 | an notationDe tails, ann otationVer sion, anno tationSour ce); | |
| 262 | String rtn = loc alVistaSes sion.call( query); | |
| 263 | //Syst em.out.pri ntln("Rtn is: " + rt n); | |
| 264 | return VistaImag ingVixTran slator.tra nslateStor eImageAnno tationResu lt(imaging Urn, rtn.t rim()); | |
| 265 | } | |
| 266 | catc h(IOExcept ion ioX) | |
| 267 | { | |
| 268 | logger .error("Ex ception ge tting Vist A session" , ioX); | |
| 269 | thro w new Conn ectionExce ption(ioX) ; | |
| 270 | } | |
| 271 | catc h (Invalid VistaCrede ntialsExce ption e) | |
| 272 | { | |
| 273 | throw new Invali dCredentia lsExceptio n(e.getMes sage()); | |
| 274 | } | |
| 275 | catc h (VistaMe thodExcept ion e) | |
| 276 | { | |
| 277 | throw new Method Exception( e.getMessa ge()); | |
| 278 | } | |
| 279 | fina lly | |
| 280 | { | |
| 281 | try{ localVista Session.cl ose();}cat ch(Throwab le t){} | |
| 282 | } | |
| 283 | } | |
| 284 | ||
| 285 | @O verride | |
| 286 | pu blic Image Annotation Details ge tMostRecen tAnnotatio nDetails( | |
| 287 | Abstra ctImagingU RN imaging Urn) | |
| 288 | th rows Metho dException , Connecti onExceptio n | |
| 289 | { | |
| 290 | Vist aCommonUti lities.set DataSource MethodAndV ersion("ge tMostRecen tAnnotatio nDetails", getDataSo urceVersio n()); | |
| 291 | logg er.info("g etMostRece ntAnnotati onDetails (" + imagi ngUrn.toSt ring() + " ) Transact ionContext (" + Tran sactionCon textFactor y.get().ge tDisplayId entity() + ")."); | |
| 292 | Vist aSession l ocalVistaS ession = n ull; | |
| 293 | try | |
| 294 | { | |
| 295 | localV istaSessio n = getVis taSession( ); | |
| 296 | VistaQ uery query = | |
| 297 | VistaIma gingVixQue ryFactory. createGetI mageAnnota tionsQuery (imagingUr n.getImagi ngIdentifi er()); | |
| 298 | String rtn = loc alVistaSes sion.call( query); | |
| 299 | List<I mageAnnota tion> imag eAnnotatio ns = Vista ImagingVix Translator .translate ImageAnnot ations(ima gingUrn, r tn); | |
| 300 | if(ima geAnnotati ons == nul l || image Annotation s.size() < = 0) | |
| 301 | return n ull; | |
| 302 | ||
| 303 | // get the last item in th e list (th e newest a nnotation layer) | |
| 304 | ImageA nnotation mostRecent Annotation Layer = im ageAnnotat ions.get(i mageAnnota tions.size () - 1); | |
| 305 | logger .info("Ret rieving an notation l ayer '" + mostRecent Annotation Layer.getA nnotationU rn().toStr ing() + "' ."); | |
| 306 | ||
| 307 | return getAnnota tionDetail sInternal( localVista Session, i magingUrn, mostRecen tAnnotatio nLayer.get Annotation Urn()); | |
| 308 | } | |
| 309 | catc h(IOExcept ion ioX) | |
| 310 | { | |
| 311 | logger .error("Ex ception ge tting Vist A session" , ioX); | |
| 312 | thro w new Conn ectionExce ption(ioX) ; | |
| 313 | } | |
| 314 | catc h (Invalid VistaCrede ntialsExce ption e) | |
| 315 | { | |
| 316 | throw new Invali dCredentia lsExceptio n(e.getMes sage()); | |
| 317 | } | |
| 318 | catc h (VistaMe thodExcept ion e) | |
| 319 | { | |
| 320 | throw new Method Exception( e.getMessa ge()); | |
| 321 | } | |
| 322 | fina lly | |
| 323 | { | |
| 324 | try{ localVista Session.cl ose();}cat ch(Throwab le t){} | |
| 325 | } | |
| 326 | } | |
| 327 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.