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 | ClinicalDisplayImageAccessServletV3.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 | ClinicalDisplayImageAccessServletV3.java | Mon Dec 4 21:58:10 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 558 |
| 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: Sep 8, 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.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 | * | |
| 50 | * Version 3 impleme ntation of the Clini calDisplay web image servlet. The major difference | |
| 51 | * for ver sion 3 fro m version is that ve rsion 3 do es not exp licitly lo g image ac cess when | |
| 52 | * an imag e is reque sted. Imag e access l ogging is expected t o be done by the cli ent when | |
| 53 | * the ima ge is actu ally viewe d. | |
| 54 | * | |
| 55 | * @author
|
|
| 56 | * | |
| 57 | */ | |
| 58 | public cla ss Clinica lDisplayIm ageAccessS ervletV3 | |
| 59 | extends Ab stractBase ClinicalDi splayImage AccessServ let | |
| 60 | { | |
| 61 | ||
| 62 | pr ivate stat ic final l ong serial VersionUID = 1L; | |
| 63 | ||
| 64 | pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(Clin icalDispla yImageAcce ssServletV 3.class); | |
| 65 | ||
| 66 | pr ivate stat ic final L ist<ImageF ormat> acc eptableThu mbnailResp onseTypes; | |
| 67 | pr ivate stat ic final L ist<ImageF ormat> acc eptableRef erenceResp onseTypes; | |
| 68 | pr ivate stat ic final L ist<ImageF ormat> acc eptableDia gnosticRes ponseTypes ; | |
| 69 | ||
| 70 | st atic | |
| 71 | { | |
| 72 | acce ptableThum bnailRespo nseTypes = new Array List<Image Format>(); | |
| 73 | acce ptableThum bnailRespo nseTypes.a dd(ImageFo rmat.JPEG) ; | |
| 74 | acce ptableThum bnailRespo nseTypes.a dd(ImageFo rmat.BMP); | |
| 75 | acce ptableThum bnailRespo nseTypes.a dd(ImageFo rmat.TGA); | |
| 76 | acce ptableThum bnailRespo nseTypes.a dd(ImageFo rmat.ORIGI NAL); | |
| 77 | ||
| 78 | acce ptableRefe renceRespo nseTypes = new Array List<Image Format>(); | |
| 79 | acce ptableRefe renceRespo nseTypes.a dd(ImageFo rmat.DICOM JPEG2000); | |
| 80 | //ac ceptableRe ferenceRes ponseTypes .add(Image Format.DIC OM); | |
| 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.WAV); | |
| 95 | acce ptableRefe renceRespo nseTypes.a dd(ImageFo rmat.DOCX) ; | |
| 96 | acce ptableRefe renceRespo nseTypes.a dd(ImageFo rmat.XML); | |
| 97 | acce ptableRefe renceRespo nseTypes.a dd(ImageFo rmat.ORIGI NAL); | |
| 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.WAV) ; | |
| 115 | acce ptableDiag nosticResp onseTypes. add(ImageF ormat.DOCX ); | |
| 116 | acce ptableDiag nosticResp onseTypes. add(ImageF ormat.XML) ; | |
| 117 | acce ptableDiag nosticResp onseTypes. add(ImageF ormat.ORIG INAL); | |
| 118 | } | |
| 119 | ||
| 120 | pu blic Clini calDisplay ImageAcces sServletV3 () | |
| 121 | { | |
| 122 | supe r(); | |
| 123 | } | |
| 124 | ||
| 125 | /* (non-Java doc) | |
| 126 | * @see gov. va.med.ima ging.wado. AbstractBa seImageSer vlet#doGet (javax.ser vlet.http. HttpServle tRequest, javax.serv let.http.H ttpServlet Response) | |
| 127 | * / | |
| 128 | @O verride | |
| 129 | pr otected vo id doGet(H ttpServlet Request re q, HttpSer vletRespon se resp) | |
| 130 | th rows Servl etExceptio n, IOExcep tion | |
| 131 | { | |
| 132 | Wado Request wa doRequest= null; | |
| 133 | long bytesTran sferred = 0; | |
| 134 | Tran sactionCon text trans actionCont ext = Tran sactionCon textFactor y.get(); | |
| 135 | ||
| 136 | logg er.info("B eginning G ET handler : servlet path=[" + req.getSer vletPath() + | |
| 137 | "], path info=[" + req.getPa thInfo() + | |
| 138 | "]\nquery string: [ " + req.ge tQueryStri ng() + "]" ); | |
| 139 | ||
| 140 | try | |
| 141 | { | |
| 142 | wadoRe quest = Wa doRequest. createPars edCDTPComp liantWadoR equest(req ); | |
| 143 | initTr ansactionC ontext(wad oRequest); | |
| 144 | transa ctionConte xt.setRequ estType(ge tWepAppNam e() + " " + transact ionContext .getReques tType()); | |
| 145 | logger .debug("XC HANGE w/ex tensions c ompliance requested, Request i s [" + wad oRequest.t oString() + "]" ); | |
| 146 | bytesT ransferred = doExcha ngeComplia ntGet(wado Request, r esp, false ); | |
| 147 | transa ctionConte xt.setEntr iesReturne d( bytesTr ansferred= =0 ? 0 : 1 ); | |
| 148 | transa ctionConte xt.setFaca deBytesSen t(bytesTra nsferred); | |
| 149 | transa ctionConte xt.setResp onseCode(H ttpServlet Response.S C_OK + "") ; | |
| 150 | } | |
| 151 | catc h( WadoQue ryComplian ceExceptio n wadoX ) | |
| 152 | { | |
| 153 | String msg = "Re quest is n ot a valid Exchange (WAI) prot ocol reque st: " + wa doX.getMes sage(); | |
| 154 | logger .error(msg ); | |
| 155 | transa ctionConte xt.setErro rMessage(m sg); | |
| 156 | transa ctionConte xt.setExce ptionClass Name(wadoX .getClass( ).getSimpl eName()); | |
| 157 | transa ctionConte xt.setResp onseCode(H ttpServlet Response.S C_NOT_ACCE PTABLE + " "); | |
| 158 | resp.s endError(H ttpServlet Response.S C_NOT_ACCE PTABLE, ms g ); | |
| 159 | } | |
| 160 | catc h( HttpHea derParseEx ception ht tpParseX ) | |
| 161 | { | |
| 162 | String msg = "Er ror parsin g HTTP hea der inform ation: " + httpParse X.getMessa ge(); | |
| 163 | logger .error(msg ); | |
| 164 | transa ctionConte xt.setErro rMessage(m sg); | |
| 165 | transa ctionConte xt.setExce ptionClass Name(httpP arseX.getC lass().get SimpleName ()); | |
| 166 | transa ctionConte xt.setResp onseCode(H ttpServlet Response.S C_INTERNAL _SERVER_ER ROR + ""); | |
| 167 | resp.s endError(H ttpServlet Response.S C_INTERNAL _SERVER_ER ROR, msg ) ; | |
| 168 | } | |
| 169 | catc h (IOExcep tion ioX) | |
| 170 | { | |
| 171 | String msg = "I/ O error wh en sending image con tent: " + ioX.getMes sage(); | |
| 172 | logger .error(msg ); | |
| 173 | transa ctionConte xt.setErro rMessage(m sg); | |
| 174 | transa ctionConte xt.setExce ptionClass Name(ioX.g etClass(). getSimpleN ame()); | |
| 175 | transa ctionConte xt.setResp onseCode(H ttpServlet Response.S C_INTERNAL _SERVER_ER ROR + ""); | |
| 176 | resp.s endError(H ttpServlet Response.S C_INTERNAL _SERVER_ER ROR, msg ) ; | |
| 177 | } | |
| 178 | catc h (ImageSe rvletExcep tion isX) | |
| 179 | { | |
| 180 | String msg = isX .getMessag e(); | |
| 181 | logger .error(msg ); | |
| 182 | transa ctionConte xt.setErro rMessage(m sg); | |
| 183 | // don 't set the transacti onContext. setExcepti onClassNam e() proper ty here | |
| 184 | // it gets set i n the Abst ractBaseIm ageServlet because t hat is whe re the rea l | |
| 185 | // exc eption is caught | |
| 186 | //tran sactionCon text.setEx ceptionCla ssName(isX .getClass( ).getName( )); | |
| 187 | transa ctionConte xt.setResp onseCode(i sX.getResp onseCode() + ""); | |
| 188 | resp.s endError(i sX.getResp onseCode() , msg ); | |
| 189 | } | |
| 190 | catc h(Security Credential sExpiredEx ception sc eX) | |
| 191 | { | |
| 192 | String msg = "Se curityCred entials ex pired: " + sceX.getM essage(); | |
| 193 | // log ging of er ror alread y done | |
| 194 | // jus t need to set approp riate erro r code | |
| 195 | transa ctionConte xt.setResp onseCode(H ttpServlet Response.S C_PRECONDI TION_FAILE D + ""); | |
| 196 | transa ctionConte xt.setErro rMessage(m sg); | |
| 197 | resp.s endError(H ttpServlet Response.S C_PRECONDI TION_FAILE D, msg); | |
| 198 | } | |
| 199 | catc h (Routing TokenForma tException rtfX) | |
| 200 | { | |
| 201 | String msg = "Un expected e rror build ing routin g token: " + rtfX.ge tMessage() ; | |
| 202 | // log ging of er ror alread y done | |
| 203 | // jus t need to set approp riate erro r code | |
| 204 | transa ctionConte xt.setResp onseCode(H ttpServlet Response.S C_PRECONDI TION_FAILE D + ""); | |
| 205 | transa ctionConte xt.setErro rMessage(m sg); | |
| 206 | resp.s endError(H ttpServlet Response.S C_PRECONDI TION_FAILE D, msg); | |
| 207 | } | |
| 208 | ||
| 209 | logg er.info( | |
| 210 | "GET h andler ret urned " + | |
| 211 | (bytes Transferre d) + | |
| 212 | " byte s for quer y string: [" + req.g etQueryStr ing() + "] "); | |
| 213 | ||
| 214 | } | |
| 215 | ||
| 216 | ||
| 217 | /* (non-Java doc) | |
| 218 | * @see gov. va.med.ima ging.wado. AbstractBa seImageSer vlet#init( ) | |
| 219 | * / | |
| 220 | @O verride | |
| 221 | pu blic void init() thr ows Servle tException { | |
| 222 | // T ODO Auto-g enerated m ethod stub | |
| 223 | supe r.init(); | |
| 224 | } | |
| 225 | ||
| 226 | ||
| 227 | ||
| 228 | /* (non-Java doc) | |
| 229 | * @see gov. va.med.ima ging.clini caldisplay .web.Abstr actBaseCli nicalDispl ayImageAcc essServlet #getAccept ableDiagno sticRespon seTypes() | |
| 230 | * / | |
| 231 | @O verride | |
| 232 | pr otected Li st<ImageFo rmat> getA cceptableD iagnosticR esponseTyp es(boolean includeSu bTypes) | |
| 233 | { | |
| 234 | if(i ncludeSubT ypes) | |
| 235 | { | |
| 236 | List<I mageFormat > formats = new Arra yList<Imag eFormat>(a cceptableD iagnosticR esponseTyp es); | |
| 237 | format s.add(0, I mageFormat .DICOM); / / cannot b e at the b ottom (ORI GINAL must be last), top doesn 't really matter | |
| 238 | format s.add(0, I mageFormat .DICOMJPEG ); | |
| 239 | format s.add(0, I mageFormat .DICOMPDF) ; | |
| 240 | return formats; | |
| 241 | } | |
| 242 | else | |
| 243 | { | |
| 244 | return acceptabl eDiagnosti cResponseT ypes; | |
| 245 | } | |
| 246 | } | |
| 247 | ||
| 248 | /* (non-Java doc) | |
| 249 | * @see gov. va.med.ima ging.clini caldisplay .web.Abstr actBaseCli nicalDispl ayImageAcc essServlet #getAccept ableRefere nceRespons eTypes() | |
| 250 | * / | |
| 251 | @O verride | |
| 252 | pr otected Li st<ImageFo rmat> getA cceptableR eferenceRe sponseType s(boolean includeSub Types) | |
| 253 | { | |
| 254 | if(i ncludeSubT ypes) | |
| 255 | { | |
| 256 | List<I mageFormat > formats = new Arra yList<Imag eFormat>(a cceptableR eferenceRe sponseType s); | |
| 257 | format s.add(0, I mageFormat .DICOM); / / cannot b e at the b ottom (ORI GINAL must be last), top doesn 't really matter | |
| 258 | format s.add(0, I mageFormat .DICOMJPEG ); | |
| 259 | format s.add(0, I mageFormat .DICOMPDF) ; | |
| 260 | return formats; | |
| 261 | } | |
| 262 | else | |
| 263 | { | |
| 264 | return acceptabl eReference ResponseTy pes; | |
| 265 | } | |
| 266 | } | |
| 267 | ||
| 268 | /* (non-Java doc) | |
| 269 | * @see gov. va.med.ima ging.clini caldisplay .web.Abstr actBaseCli nicalDispl ayImageAcc essServlet #getAccept ableThumbn ailRespons eTypes() | |
| 270 | * / | |
| 271 | @O verride | |
| 272 | pr otected Li st<ImageFo rmat> getA cceptableT humbnailRe sponseType s() | |
| 273 | { | |
| 274 | retu rn accepta bleThumbna ilResponse Types; | |
| 275 | } | |
| 276 | ||
| 277 | pr otected St ring getWe pAppName() | |
| 278 | { | |
| 279 | retu rn "Clinic al Display WebApp V3 "; | |
| 280 | } | |
| 281 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.