Produced by Araxis Merge on 12/5/2017 12:06:36 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\ClinicalDisplayWebApp\main\src\java\gov\va\med\imaging\clinicaldisplay\web | ClinicalDisplayImageAccessServlet.java | Mon Dec 4 21:35:04 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ClinicalDisplayWebApp\main\src\java\gov\va\med\imaging\clinicaldisplay\web | ClinicalDisplayImageAccessServlet.java | Mon Dec 4 21:58:10 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 550 |
| Changed | 1 | 2 |
| 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: Augu st 10, 200 6 | |
| 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.cli nicaldispl ay.web; | |
| 27 | ||
| 28 | import gov .va.med.ex ceptions.R outingToke nFormatExc eption; | |
| 29 | import gov .va.med.im aging.core .interface s.exceptio ns.Securit yCredentia lsExpiredE xception; | |
| 30 | import gov .va.med.im aging.exch ange.enums .ImageForm at; | |
| 31 | import gov .va.med.im aging.http .exception s.HttpHead erParseExc eption; | |
| 32 | import gov .va.med.im aging.tran sactioncon text.Trans actionCont ext; | |
| 33 | import gov .va.med.im aging.tran sactioncon text.Trans actionCont extFactory ; | |
| 34 | import gov .va.med.im aging.wado .query.Wad oRequest; | |
| 35 | import gov .va.med.im aging.wado .query.exc eptions.Wa doQueryCom plianceExc eption; | |
| 36 | ||
| 37 | import jav a.io.IOExc eption; | |
| 38 | import jav a.util.Arr ayList; | |
| 39 | import jav a.util.Lis t; | |
| 40 | ||
| 41 | import jav ax.servlet .ServletEx ception; | |
| 42 | import jav ax.servlet .http.Http ServletReq uest; | |
| 43 | import jav ax.servlet .http.Http ServletRes ponse; | |
| 44 | ||
| 45 | import org .apache.lo gging.log4 j.LogManag er; | |
| 46 | import org .apache.lo gging.log4 j.Logger; | |
| 47 | ||
| 48 | /** | |
| 49 | * @author Chris Bec key | |
| 50 | * @since 1.0 | |
| 51 | * | |
| 52 | * ------- ---------- ---------- ---------- ---------- ---------- ----- | |
| 53 | * @web.se rvlet | |
| 54 | * name= "ClinicalD isplayImag eAccessSer vlet" | |
| 55 | * displ ay-name="C linical Di splay Imag e Access" | |
| 56 | * descr iption="Se rvlet impl ementing t he WAI spe cification of VIX IC D." | |
| 57 | * | |
| 58 | * @web.se rvlet-mapp ing | |
| 59 | * url-p attern="/x change/*" | |
| 60 | * ------- ---------- ---------- ---------- ---------- ---------- ------- | |
| 61 | */ | |
| 62 | public cla ss Clinica lDisplayIm ageAccessS ervlet | |
| 63 | extends Ab stractBase ClinicalDi splayImage AccessServ let | |
| 64 | { | |
| 65 | pr ivate stat ic final l ong serial VersionUID = 1L; | |
| 66 | ||
| 67 | pu blic stati c final Li st<ImageFo rmat> acce ptableThum bnailRespo nseTypes; | |
| 68 | pu blic stati c final Li st<ImageFo rmat> acce ptableRefe renceRespo nseTypes; | |
| 69 | pu blic stati c final Li st<ImageFo rmat> acce ptableDiag nosticResp onseTypes; | |
| 70 | ||
| 71 | st atic | |
| 72 | { | |
| 73 | acce ptableThum bnailRespo nseTypes = new Array List<Image Format>(); | |
| 74 | acce ptableThum bnailRespo nseTypes.a dd(ImageFo rmat.JPEG) ; | |
| 75 | acce ptableThum bnailRespo nseTypes.a dd(ImageFo rmat.BMP); | |
| 76 | acce ptableThum bnailRespo nseTypes.a dd(ImageFo rmat.TGA); | |
| 77 | acce ptableThum bnailRespo nseTypes.a dd(ImageFo rmat.ORIGI NAL); | |
| 78 | ||
| 79 | acce ptableRefe renceRespo nseTypes = new Array List<Image Format>(); | |
| 80 | acce ptableRefe renceRespo nseTypes.a dd(ImageFo rmat.DICOM JPEG2000); | |
| 81 | acce ptableRefe renceRespo nseTypes.a dd(ImageFo rmat.TGA); | |
| 82 | acce ptableRefe renceRespo nseTypes.a dd(ImageFo rmat.PDF); | |
| 83 | acce ptableRefe renceRespo nseTypes.a dd(ImageFo rmat.DOC); | |
| 84 | acce ptableRefe renceRespo nseTypes.a dd(ImageFo rmat.RTF); | |
| 85 | acce ptableRefe renceRespo nseTypes.a dd(ImageFo rmat.TEXT_ PLAIN); | |
| 86 | acce ptableRefe renceRespo nseTypes.a dd(ImageFo rmat.AVI); | |
| 87 | acce ptableRefe renceRespo nseTypes.a dd(ImageFo rmat.BMP); | |
| 88 | acce ptableRefe renceRespo nseTypes.a dd(ImageFo rmat.HTML) ; | |
| 89 | acce ptableRefe renceRespo nseTypes.a dd(ImageFo rmat.MP3); | |
| 90 | acce ptableRefe renceRespo nseTypes.a dd(ImageFo rmat.MPG); | |
| 91 | acce ptableRefe renceRespo nseTypes.a dd(ImageFo rmat.J2K); | |
| 92 | acce ptableRefe renceRespo nseTypes.a dd(ImageFo rmat.JPEG) ; | |
| 93 | acce ptableRefe renceRespo nseTypes.a dd(ImageFo rmat.TIFF) ; | |
| 94 | acce ptableRefe renceRespo nseTypes.a dd(ImageFo rmat.HTML) ; | |
| 95 | acce ptableRefe renceRespo nseTypes.a dd(ImageFo rmat.WAV); | |
| 96 | acce ptableRefe renceRespo nseTypes.a dd(ImageFo rmat.ORIGI NAL); | |
| 97 | //ac ceptableRe ferenceRes ponseTypes .add(Image Format.ANY THING); | |
| 98 | ||
| 99 | acce ptableDiag nosticResp onseTypes = new Arra yList<Imag eFormat>() ; | |
| 100 | acce ptableDiag nosticResp onseTypes. add(ImageF ormat.DICO MJPEG2000) ; | |
| 101 | acce ptableDiag nosticResp onseTypes. add(ImageF ormat.TGA) ; | |
| 102 | acce ptableDiag nosticResp onseTypes. add(ImageF ormat.J2K) ; | |
| 103 | acce ptableDiag nosticResp onseTypes. add(ImageF ormat.JPEG ); | |
| 104 | acce ptableDiag nosticResp onseTypes. add(ImageF ormat.PDF) ; | |
| 105 | acce ptableDiag nosticResp onseTypes. add(ImageF ormat.DOC) ; | |
| 106 | acce ptableDiag nosticResp onseTypes. add(ImageF ormat.RTF) ; | |
| 107 | acce ptableDiag nosticResp onseTypes. add(ImageF ormat.TEXT _PLAIN); | |
| 108 | acce ptableDiag nosticResp onseTypes. add(ImageF ormat.AVI) ; | |
| 109 | acce ptableDiag nosticResp onseTypes. add(ImageF ormat.BMP) ; | |
| 110 | acce ptableDiag nosticResp onseTypes. add(ImageF ormat.HTML ); | |
| 111 | acce ptableDiag nosticResp onseTypes. add(ImageF ormat.MP3) ; | |
| 112 | acce ptableDiag nosticResp onseTypes. add(ImageF ormat.MPG) ; | |
| 113 | acce ptableDiag nosticResp onseTypes. add(ImageF ormat.TIFF ); | |
| 114 | acce ptableDiag nosticResp onseTypes. add(ImageF ormat.HTML ); | |
| 115 | acce ptableDiag nosticResp onseTypes. add(ImageF ormat.WAV) ; | |
| 116 | acce ptableDiag nosticResp onseTypes. add(ImageF ormat.ORIG INAL); | |
| 117 | } | |
| 118 | ||
| 119 | pr ivate Logg er logger = LogManag er.getLogg er(this.ge tClass()); | |
| 120 | ||
| 121 | /* (non-Java doc) | |
| 122 | * @see gov. va.med.ima ging.clini caldisplay .web.Abstr actBaseCli nicalDispl ayImageAcc essServlet #getAccept ableDiagno sticRespon seTypes() | |
| 123 | * / | |
| 124 | @O verride | |
| 125 | pr otected Li st<ImageFo rmat> getA cceptableD iagnosticR esponseTyp es(boolean includeSu bTypes) | |
| 126 | { | |
| 127 | if(i ncludeSubT ypes) | |
| 128 | { | |
| 129 | List<I mageFormat > formats = new Arra yList<Imag eFormat>(a cceptableD iagnosticR esponseTyp es); | |
| 130 | format s.add(0, I mageFormat .DICOM); / / cannot b e at the b ottom (ORI GINAL must be last), top doesn 't really matter | |
| 131 | return formats; | |
| 132 | } | |
| 133 | else | |
| 134 | { | |
| 135 | return acceptabl eDiagnosti cResponseT ypes; | |
| 136 | } | |
| 137 | } | |
| 138 | ||
| 139 | /* (non-Java doc) | |
| 140 | * @see gov. va.med.ima ging.clini caldisplay .web.Abstr actBaseCli nicalDispl ayImageAcc essServlet #getAccept ableRefere nceRespons eTypes() | |
| 141 | * / | |
| 142 | @O verride | |
| 143 | pr otected Li st<ImageFo rmat> getA cceptableR eferenceRe sponseType s(boolean includeSub Types) | |
| 144 | { | |
| 145 | if(i ncludeSubT ypes) | |
| 146 | { | |
| 147 | List<I mageFormat > formats = new Arra yList<Imag eFormat>(a cceptableR eferenceRe sponseType s); | |
| 148 | format s.add(0, I mageFormat .DICOM); / / cannot b e at the b ottom (ORI GINAL must be last), top doesn 't really matter | |
| 149 | return formats; | |
| 150 | } | |
| 151 | else | |
| 152 | { | |
| 153 | return acceptabl eReference ResponseTy pes; | |
| 154 | } | |
| 155 | } | |
| 156 | ||
| 157 | /* (non-Java doc) | |
| 158 | * @see gov. va.med.ima ging.clini caldisplay .web.Abstr actBaseCli nicalDispl ayImageAcc essServlet #getAccept ableThumbn ailRespons eTypes() | |
| 159 | * / | |
| 160 | @O verride | |
| 161 | pr otected Li st<ImageFo rmat> getA cceptableT humbnailRe sponseType s() | |
| 162 | { | |
| 163 | retu rn accepta bleThumbna ilResponse Types; | |
| 164 | } | |
| 165 | ||
| 166 | /* * | |
| 167 | * | |
| 168 | * / | |
| 169 | pu blic Clini calDisplay ImageAcces sServlet() | |
| 170 | { | |
| 171 | supe r(); | |
| 172 | } | |
| 173 | ||
| 174 | /* * | |
| 175 | * Initializ ation of t he servlet . <br> | |
| 176 | * | |
| 177 | * @throws S ervletExce ption if a n error oc cur | |
| 178 | * / | |
| 179 | pu blic void init() | |
| 180 | th rows Servl etExceptio n | |
| 181 | { | |
| 182 | supe r.init(); | |
| 183 | } | |
| 184 | ||
| 185 | /* * | |
| 186 | * | |
| 187 | * @see java x.servlet. http.HttpS ervlet#doG et(javax.s ervlet.htt p.HttpServ letRequest , javax.se rvlet.http .HttpServl etResponse ) | |
| 188 | * / | |
| 189 | pr otected vo id doGet(H ttpServlet Request re q, HttpSer vletRespon se resp) | |
| 190 | th rows Servl etExceptio n, IOExcep tion | |
| 191 | { | |
| 192 | Wado Request wa doRequest= null; | |
| 193 | long bytesTran sferred = 0; | |
| 194 | Tran sactionCon text trans actionCont ext = Tran sactionCon textFactor y.get(); | |
| 195 | ||
| 196 | logg er.info("B eginning G ET handler : servlet path=[" + req.getSer vletPath() + | |
| 197 | "], path info=[" + req.getPa thInfo() + | |
| 198 | "]\nquery string: [ " + req.ge tQueryStri ng() + "]" ); | |
| 199 | ||
| 200 | try | |
| 201 | { | |
| 202 | wadoRe quest = Wa doRequest. createPars edCDTPComp liantWadoR equest(req ); | |
| 203 | initTr ansactionC ontext(wad oRequest); | |
| 204 | transa ctionConte xt.setRequ estType("C linical Di splay WebA pp V2 " + transactio nContext.g etRequestT ype()); | |
| 205 | logger .debug("XC HANGE w/ex tensions c ompliance requested, Request i s [" + wad oRequest.t oString() + "]" ); | |
| 206 | bytesT ransferred = doExcha ngeComplia ntGet(wado Request, r esp, true) ; | |
| 207 | transa ctionConte xt.setEntr iesReturne d( bytesTr ansferred= =0 ? 0 : 1 ); | |
| 208 | transa ctionConte xt.setFaca deBytesSen t(bytesTra nsferred); | |
| 209 | transa ctionConte xt.setResp onseCode(H ttpServlet Response.S C_OK + "") ; | |
| 210 | } | |
| 211 | catc h( WadoQue ryComplian ceExceptio n wadoX ) | |
| 212 | { | |
| 213 | String msg = "Re quest is n ot a valid Exchange (WAI) prot ocol reque st: " + wa doX.getMes sage(); | |
| 214 | logger .error(msg ); | |
| 215 | transa ctionConte xt.setErro rMessage(m sg); | |
| 216 | transa ctionConte xt.setExce ptionClass Name(wadoX .getClass( ).getSimpl eName()); | |
| 217 | transa ctionConte xt.setResp onseCode(H ttpServlet Response.S C_NOT_ACCE PTABLE + " "); | |
| 218 | resp.s endError(H ttpServlet Response.S C_NOT_ACCE PTABLE, ms g ); | |
| 219 | } | |
| 220 | catc h( HttpHea derParseEx ception ht tpParseX ) | |
| 221 | { | |
| 222 | String msg = "Er ror parsin g HTTP hea der inform ation: " + httpParse X.getMessa ge(); | |
| 223 | logger .error(msg ); | |
| 224 | transa ctionConte xt.setErro rMessage(m sg); | |
| 225 | transa ctionConte xt.setExce ptionClass Name(httpP arseX.getC lass().get SimpleName ()); | |
| 226 | transa ctionConte xt.setResp onseCode(H ttpServlet Response.S C_INTERNAL _SERVER_ER ROR + ""); | |
| 227 | resp.s endError(H ttpServlet Response.S C_INTERNAL _SERVER_ER ROR, msg ) ; | |
| 228 | } | |
| 229 | catc h (IOExcep tion ioX) | |
| 230 | { | |
| 231 | String msg = "I/ O error wh en sending image con tent: " + ioX.getMes sage(); | |
| 232 | logger .error(msg ); | |
| 233 | transa ctionConte xt.setErro rMessage(m sg); | |
| 234 | transa ctionConte xt.setExce ptionClass Name(ioX.g etClass(). getSimpleN ame()); | |
| 235 | transa ctionConte xt.setResp onseCode(H ttpServlet Response.S C_INTERNAL _SERVER_ER ROR + ""); | |
| 236 | resp.s endError(H ttpServlet Response.S C_INTERNAL _SERVER_ER ROR, msg ) ; | |
| 237 | } | |
| 238 | catc h (ImageSe rvletExcep tion isX) | |
| 239 | { | |
| 240 | String msg = isX .getMessag e(); | |
| 241 | logger .error(msg ); | |
| 242 | transa ctionConte xt.setErro rMessage(m sg); | |
| 243 | // don 't set the transacti onContext. setExcepti onClassNam e() proper ty here | |
| 244 | // it gets set i n the Abst ractBaseIm ageServlet because t hat is whe re the rea l | |
| 245 | // exc eption is caught | |
| 246 | //tran sactionCon text.setEx ceptionCla ssName(isX .getClass( ).getName( )); | |
| 247 | transa ctionConte xt.setResp onseCode(i sX.getResp onseCode() + ""); | |
| 248 | resp.s endError(i sX.getResp onseCode() , msg ); | |
| 249 | } | |
| 250 | catc h(Security Credential sExpiredEx ception sc eX) | |
| 251 | { | |
| 252 | String msg = "Se curityCred entials ex pired: " + sceX.getM essage(); | |
| 253 | // log ging of er ror alread y done | |
| 254 | // jus t need to set approp riate erro r code | |
| 255 | transa ctionConte xt.setResp onseCode(H ttpServlet Response.S C_PRECONDI TION_FAILE D + ""); | |
| 256 | transa ctionConte xt.setErro rMessage(m sg); | |
| 257 | resp.s endError(H ttpServlet Response.S C_PRECONDI TION_FAILE D, msg); | |
| 258 | } | |
| 259 | catc h (Routing TokenForma tException rtfX) | |
| 260 | { | |
| 261 | String msg = "Un expected e rror build ing routin g token: " + rtfX.ge tMessage() ; | |
| 262 | // log ging of er ror alread y done | |
| 263 | // jus t need to set approp riate erro r code | |
| 264 | transa ctionConte xt.setResp onseCode(H ttpServlet Response.S C_PRECONDI TION_FAILE D + ""); | |
| 265 | transa ctionConte xt.setErro rMessage(m sg); | |
| 266 | resp.s endError(H ttpServlet Response.S C_PRECONDI TION_FAILE D, msg); | |
| 267 | } | |
| 268 | ||
| 269 | logg er.info( | |
| 270 | "GET h andler ret urned " + | |
| 271 | (bytes Transferre d) + | |
| 272 | " byte s for quer y string: [" + req.g etQueryStr ing() + "] "); | |
| 273 | } | |
| 274 | ||
| 275 | ||
| 276 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.