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.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ROIVistaImagingDataSourceProvider\main\src\java\gov\va\med\imaging\vistaimagingdatasource\roi | VistaImagingROIExportQueueDataSourceService.java | Mon Dec 4 21:35:08 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ROIVistaImagingDataSourceProvider\main\src\java\gov\va\med\imaging\vistaimagingdatasource\roi | VistaImagingROIExportQueueDataSourceService.java | Mon Dec 4 22:05:27 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 532 |
| 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 17, 2012 | |
| 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. roi; | |
| 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.Ro utingToken ; | |
| 35 | import gov .va.med.im aging.Abst ractImagin gURN; | |
| 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.exc eptions.In validCrede ntialsExce ption; | |
| 41 | import gov .va.med.im aging.data source.exc eptions.Un supportedP rotocolExc eption; | |
| 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.roi. datasource .ExportQue ueDataSour ceSpi; | |
| 45 | import gov .va.med.im aging.roi. queue.Dico mExportQue ue; | |
| 46 | import gov .va.med.im aging.roi. queue.Abst ractExport QueueURN; | |
| 47 | import gov .va.med.im aging.roi. queue.NonD icomExport Queue; | |
| 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.r oi.query.V istaImagin gROIQueryF actory; | |
| 57 | import gov .va.med.im aging.vist aimagingda tasource.r oi.transla tor.VistaI magingROIT ranslator; | |
| 58 | ||
| 59 | /** | |
| 60 | * @author
|
|
| 61 | * | |
| 62 | */ | |
| 63 | public cla ss VistaIm agingROIEx portQueueD ataSourceS ervice | |
| 64 | extends Ab stractVist aImagingDa taSourceSe rvice | |
| 65 | implements ExportQue ueDataSour ceSpi | |
| 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. 0P130"; // "3.0P130" ; | |
| 74 | // TODO: fix the versio n to P130 when the K IDS proper ly reports P130 | |
| 75 | ||
| 76 | /* * | |
| 77 | * @param re solvedArti factSource | |
| 78 | * @param pr otocol | |
| 79 | * / | |
| 80 | pu blic Vista ImagingROI ExportQueu eDataSourc eService(R esolvedArt ifactSourc e resolved ArtifactSo urce, | |
| 81 | String protocol) | |
| 82 | { | |
| 83 | supe r(resolved ArtifactSo urce, prot ocol); | |
| 84 | if(! (resolved ArtifactSo urce insta nceof Reso lvedSite) ) | |
| 85 | 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() + "'."); | |
| 86 | } | |
| 87 | ||
| 88 | pu blic stati c VistaIma gingROIExp ortQueueDa taSourceSe rvice crea te(Resolve dArtifactS ource reso lvedArtifa ctSource, String pro tocol) | |
| 89 | th rows Conne ctionExcep tion, Unsu pportedPro tocolExcep tion | |
| 90 | { | |
| 91 | retu rn new Vis taImagingR OIExportQu eueDataSou rceService (resolvedA rtifactSou rce, proto col); | |
| 92 | } | |
| 93 | ||
| 94 | /* * | |
| 95 | * The artif act source must be c hecked in the constr uctor to a ssure that it is an instance | |
| 96 | * of Resolv edSite. | |
| 97 | * | |
| 98 | * @return | |
| 99 | * / | |
| 100 | pr otected Re solvedSite getResolv edSite() | |
| 101 | { | |
| 102 | retu rn (Resolv edSite)get ResolvedAr tifactSour ce(); | |
| 103 | } | |
| 104 | ||
| 105 | pr otected Si te getSite () | |
| 106 | { | |
| 107 | retu rn getReso lvedSite() .getSite() ; | |
| 108 | } | |
| 109 | ||
| 110 | pr ivate Vist aSession g etVistaSes sion() | |
| 111 | throws IOExcepti on, Connec tionExcept ion, Metho dException | |
| 112 | { | |
| 113 | return V istaSessio n.getOrCre ate(getMet adataUrl() , getSite( )); | |
| 114 | } | |
| 115 | ||
| 116 | /* (non-Java doc) | |
| 117 | * @see gov. va.med.ima ging.datas ource.Imag ingPatient DataSource #isVersion Compatible () | |
| 118 | * / | |
| 119 | @O verride | |
| 120 | pu blic boole an isVersi onCompatib le() | |
| 121 | th rows Secur ityCredent ialsExpire dException | |
| 122 | { | |
| 123 | Stri ng version = VistaIm agingCommo nUtilities .getVistaD ataSourceI magingVers ion( | |
| 124 | getVista ImagingCon figuration (), this.g etClass(), | |
| 125 | MAG_REQU IRED_VERSI ON); | |
| 126 | ||
| 127 | logg er.info("i sVersionCo mpatible s earching f or version [" + vers ion + "], Transactio nContext ( " + Transa ctionConte xtFactory. get().getD isplayIden tity() + " )."); | |
| 128 | Vist aSession l ocalVistaS ession = n ull; | |
| 129 | try | |
| 130 | { | |
| 131 | localV istaSessio n = getVis taSession( ); | |
| 132 | return VistaImag ingCommonU tilities.i sVersionCo mpatible(v ersion, lo calVistaSe ssion); | |
| 133 | } | |
| 134 | catc h(Security Credential sExpiredEx ception sc eX) | |
| 135 | { | |
| 136 | // cau ght here t o be sure it gets th rown as Se curityCred entialsExp iredExcept ion, not C onnectionE xception | |
| 137 | throw sceX; | |
| 138 | } | |
| 139 | catc h(MethodEx ception mX ) | |
| 140 | { | |
| 141 | logger .error("Th ere was an error fin ding the i nstalled I maging ver sion from VistA", mX ); | |
| 142 | Transa ctionConte xtFactory. get().addD ebugInform ation("isV ersionComp atible() f ailed, " + (mX == nu ll ? "<nul l error>" : mX.getMe ssage())); | |
| 143 | } | |
| 144 | catc h(Connecti onExceptio n cX) | |
| 145 | { | |
| 146 | logger .error("Th ere was an error fin ding the i nstalled I maging ver sion from VistA", cX ); | |
| 147 | Transa ctionConte xtFactory. get().addD ebugInform ation("isV ersionComp atible() f ailed, " + (cX == nu ll ? "<nul l error>" : cX.getMe ssage())); | |
| 148 | } | |
| 149 | catc h(IOExcept ion ioX) | |
| 150 | { | |
| 151 | logger .error("Th ere was an error fin ding the i nstalled I maging ver sion from VistA", io X); | |
| 152 | Transa ctionConte xtFactory. get().addD ebugInform ation("isV ersionComp atible() f ailed, " + (ioX == n ull ? "<nu ll error>" : ioX.get Message()) ); | |
| 153 | } | |
| 154 | fina lly | |
| 155 | { | |
| 156 | try{lo calVistaSe ssion.clos e();} | |
| 157 | catch( Throwable t){} | |
| 158 | } | |
| 159 | retu rn false; | |
| 160 | } | |
| 161 | ||
| 162 | pr otected St ring getDa taSourceVe rsion() | |
| 163 | { | |
| 164 | retu rn "1"; | |
| 165 | } | |
| 166 | ||
| 167 | @O verride | |
| 168 | pu blic List< DicomExpor tQueue> ge tDicomExpo rtQueues( | |
| 169 | Routin gToken glo balRouting Token) | |
| 170 | th rows Metho dException , Connecti onExceptio n | |
| 171 | { | |
| 172 | Vist aCommonUti lities.set DataSource MethodAndV ersion("ge tDicomExpo rtQueues", getDataSo urceVersio n()); | |
| 173 | logg er.info("g etDicomExp ortQueues (" + globa lRoutingTo ken.toRout ingTokenSt ring() + " ) Transact ionContext (" + Tran sactionCon textFactor y.get().ge tDisplayId entity() + ")."); | |
| 174 | Vist aSession l ocalVistaS ession = n ull; | |
| 175 | try | |
| 176 | { | |
| 177 | localV istaSessio n = getVis taSession( ); | |
| 178 | VistaQ uery query = VistaIm agingROIQu eryFactory .createGet DicomQueue sQuery(glo balRouting Token); | |
| 179 | String rtn = loc alVistaSes sion.call( query); | |
| 180 | return VistaImag ingROITran slator.tra nslateDico mExportQue ues(global RoutingTok en, 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 List< NonDicomEx portQueue> getNonDic omExportQu eues( | |
| 203 | Routin gToken glo balRouting Token) | |
| 204 | th rows Metho dException , Connecti onExceptio n | |
| 205 | { | |
| 206 | Vist aCommonUti lities.set DataSource MethodAndV ersion("ge tNonDicomE xportQueue s", getDat aSourceVer sion()); | |
| 207 | logg er.info("g etNonDicom ExportQueu es (" + gl obalRoutin gToken.toR outingToke nString() + ") Trans actionCont ext (" + T ransaction ContextFac tory.get() .getDispla yIdentity( ) + ")."); | |
| 208 | Vist aSession l ocalVistaS ession = n ull; | |
| 209 | try | |
| 210 | { | |
| 211 | localV istaSessio n = getVis taSession( ); | |
| 212 | VistaQ uery query = VistaIm agingROIQu eryFactory .createGet NonDicomQu euesQuery( ); | |
| 213 | String rtn = loc alVistaSes sion.call( query); | |
| 214 | return VistaImag ingROITran slator.tra nslateNonD icomExport Queues(glo balRouting Token, rtn ); | |
| 215 | } | |
| 216 | catc h(IOExcept ion ioX) | |
| 217 | { | |
| 218 | logger .error("Ex ception ge tting Vist A session" , ioX); | |
| 219 | thro w new Conn ectionExce ption(ioX) ; | |
| 220 | } | |
| 221 | catc h (Invalid VistaCrede ntialsExce ption e) | |
| 222 | { | |
| 223 | throw new Invali dCredentia lsExceptio n(e.getMes sage()); | |
| 224 | } | |
| 225 | catc h (VistaMe thodExcept ion e) | |
| 226 | { | |
| 227 | throw new Method Exception( e.getMessa ge()); | |
| 228 | } | |
| 229 | fina lly | |
| 230 | { | |
| 231 | try{ localVista Session.cl ose();}cat ch(Throwab le t){} | |
| 232 | } | |
| 233 | } | |
| 234 | ||
| 235 | @O verride | |
| 236 | pu blic boole an exportI mages(Abst ractExport QueueURN q ueueUrn, | |
| 237 | Abstra ctImagingU RN imaging Urn, int p riority) | |
| 238 | th rows Metho dException , Connecti onExceptio n | |
| 239 | { | |
| 240 | Vist aCommonUti lities.set DataSource MethodAndV ersion("ex portImages ", getData SourceVers ion()); | |
| 241 | logg er.info("e xportImage s (" + que ueUrn.toSt ring() + " ) for imag e '" + ima gingUrn.to String() + "' Transa ctionConte xt (" + Tr ansactionC ontextFact ory.get(). getDisplay Identity() + ")."); | |
| 242 | Vist aSession l ocalVistaS ession = n ull; | |
| 243 | try | |
| 244 | { | |
| 245 | localV istaSessio n = getVis taSession( ); | |
| 246 | VistaQ uery query = VistaIm agingROIQu eryFactory .createExp ortImageQu ery(queueU rn, imagin gUrn, prio rity); | |
| 247 | String rtn = loc alVistaSes sion.call( query); | |
| 248 | return VistaImag ingROITran slator.tra nslateExpo rtQueueReq uestResult (rtn); | |
| 249 | } | |
| 250 | catc h(IOExcept ion ioX) | |
| 251 | { | |
| 252 | logger .error("Ex ception ge tting Vist A session" , ioX); | |
| 253 | thro w new Conn ectionExce ption(ioX) ; | |
| 254 | } | |
| 255 | catc h (Invalid VistaCrede ntialsExce ption e) | |
| 256 | { | |
| 257 | throw new Invali dCredentia lsExceptio n(e.getMes sage()); | |
| 258 | } | |
| 259 | catc h (VistaMe thodExcept ion e) | |
| 260 | { | |
| 261 | throw new Method Exception( e.getMessa ge()); | |
| 262 | } | |
| 263 | fina lly | |
| 264 | { | |
| 265 | try{ localVista Session.cl ose();}cat ch(Throwab le t){} | |
| 266 | } | |
| 267 | } | |
| 268 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.