Produced by Araxis Merge on 12/5/2017 12:06:47 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\MIXDataSource\main\src\java\gov\va\med\imaging\mixdatasource | MixImageDataSourceService.java | Mon Dec 4 21:34:38 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\MIXDataSource\main\src\java\gov\va\med\imaging\mixdatasource | MixImageDataSourceService.java | Mon Dec 4 22:04:13 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 876 |
| 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: Jan 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.mix datasource ; | |
| 27 | ||
| 28 | import gov .va.med.Gl obalArtifa ctIdentifi er; | |
| 29 | import gov .va.med.SE RIALIZATIO N_FORMAT; | |
| 30 | import gov .va.med.im aging.Abst ractImagin gURN; | |
| 31 | import gov .va.med.im aging.Imag eURN; | |
| 32 | import gov .va.med.im aging.arti factsource .ArtifactS ource; | |
| 33 | import gov .va.med.im aging.arti factsource .ResolvedA rtifactSou rce; | |
| 34 | import gov .va.med.im aging.core .interface s.exceptio ns.Connect ionExcepti on; | |
| 35 | import gov .va.med.im aging.core .interface s.exceptio ns.ImageNe arLineExce ption; | |
| 36 | import gov .va.med.im aging.core .interface s.exceptio ns.ImageNo tFoundExce ption; | |
| 37 | import gov .va.med.im aging.core .interface s.exceptio ns.MethodE xception; | |
| 38 | import gov .va.med.im aging.core .interface s.exceptio ns.MethodR emoteExcep tion; | |
| 39 | import gov .va.med.im aging.data source.Abs tractVersi onableData Source; | |
| 40 | import gov .va.med.im aging.data source.Ima geDataSour ceSpi; | |
| 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.Image; | |
| 43 | import gov .va.med.im aging.exch ange.busin ess.ImageF ormatQuali ty; | |
| 44 | import gov .va.med.im aging.exch ange.busin ess.ImageF ormatQuali tyList; | |
| 45 | import gov .va.med.im aging.exch ange.busin ess.ImageS treamRespo nse; | |
| 46 | import gov .va.med.im aging.exch ange.enums .ImageForm at; | |
| 47 | import gov .va.med.im aging.exch ange.enums .ImageQual ity; | |
| 48 | import gov .va.med.im aging.exch ange.stora ge.DataSou rceImageIn putStream; | |
| 49 | import gov .va.med.im aging.exch ange.stora ge.DataSou rceInputSt ream; | |
| 50 | import gov .va.med.im aging.mix. DODImageUR N; | |
| 51 | import gov .va.med.im aging.mix. proxy.v1.I mageMixPro xy; | |
| 52 | import gov .va.med.im aging.mix. proxy.v1.I mageMixPro xyFactory; | |
| 53 | import gov .va.med.im aging.mix. rest.proxy .AbstractM ixRestImag eProxy; | |
| 54 | import gov .va.med.im aging.mix. rest.proxy .MixRestGe tClient; | |
| 55 | import gov .va.med.im aging.mix. webservice s.rest.end points.Mix ImageWADOR estUri; | |
| 56 | import gov .va.med.im aging.tran sactioncon text.Trans actionCont extFactory ; | |
| 57 | import gov .va.med.im aging.url. mixs.MIXsC onnection; | |
| 58 | import gov .va.med.im aging.url. mix.config uration.MI XConfigura tion; | |
| 59 | import gov .va.med.im aging.url. mix.config uration.MI XSiteConfi guration; | |
| 60 | import gov .va.med.im aging.url. mix.except ions.MIXCo nfiguratio nException ; | |
| 61 | import gov .va.med.im aging.url. mix.except ions.MIXCo nnectionEx ception; | |
| 62 | ||
| 63 | import jav a.io.IOExc eption; | |
| 64 | import jav a.util.Arr ayList; | |
| 65 | import jav a.util.Has hMap; | |
| 66 | import jav a.util.Lis t; | |
| 67 | import jav a.util.Map ; | |
| 68 | ||
| 69 | import jav ax.ws.rs.c ore.MediaT ype; | |
| 70 | ||
| 71 | import org .apache.lo gging.log4 j.LogManag er; | |
| 72 | import org .apache.lo gging.log4 j.Logger; | |
| 73 | ||
| 74 | import com .sun.jerse y.api.clie nt.ClientR esponse; | |
| 75 | ||
| 76 | //import c om.sun.jer sey.api.cl ient.Clien tResponse; | |
| 77 | ||
| 78 | //import c om.sun.jer sey.api.cl ient.Clien tResponse; | |
| 79 | ||
| 80 | /** | |
| 81 | * @author
|
|
| 82 | * | |
| 83 | */ | |
| 84 | public cla ss MixImag eDataSourc eService | |
| 85 | extends Ab stractVers ionableDat aSource | |
| 86 | implements ImageData SourceSpi | |
| 87 | { | |
| 88 | ||
| 89 | pu blic stati c final Li st<ImageFo rmat> acce ptableThum bnailRespo nseTypes; | |
| 90 | pu blic stati c final Li st<ImageFo rmat> acce ptableRefe renceRespo nseTypes; | |
| 91 | pu blic stati c final Li st<ImageFo rmat> acce ptableDiag nosticResp onseTypes; | |
| 92 | ||
| 93 | st atic | |
| 94 | { | |
| 95 | acce ptableThum bnailRespo nseTypes = new Array List<Image Format>(); | |
| 96 | acce ptableThum bnailRespo nseTypes.a dd(ImageFo rmat.JPEG) ; | |
| 97 | ||
| 98 | acce ptableRefe renceRespo nseTypes = new Array List<Image Format>(); | |
| 99 | acce ptableRefe renceRespo nseTypes.a dd(ImageFo rmat.DICOM JPEG2000); | |
| 100 | ||
| 101 | acce ptableDiag nosticResp onseTypes = new Arra yList<Imag eFormat>() ; | |
| 102 | acce ptableDiag nosticResp onseTypes. add(ImageF ormat.DICO MJPEG2000) ; | |
| 103 | // acce ptableDiag nosticResp onseTypes. add(ImageF ormat.DICO M); // DIC OM must be here beca use the re quest type will be a pplication /dicom whi ch literal ly convert s to this one | |
| 104 | } | |
| 105 | ||
| 106 | pr ivate fina l MIXsConn ection mix Connection ; | |
| 107 | pr ivate MIXC onfigurati on mixConf iguration = null; | |
| 108 | pr ivate MIXS iteConfigu ration mix SiteConfig uration = null; | |
| 109 | pr ivate Abst ractMixRes tImageProx y amrip; | |
| 110 | ||
| 111 | ||
| 112 | // Hashmap t o hold pro xies based on the al ien site n umber (if empty stri ng, will r eturn prox y to BIA), otherwise will use wormhole. | |
| 113 | pr ivate Hash Map<String , ImageMix Proxy> xch angeProxie s = new Ha shMap<Stri ng, ImageM ixProxy>() ; | |
| 114 | ||
| 115 | pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(MixI mageDataSo urceServic e.class); | |
| 116 | // private f inal stati c String M IX_PROXY_S ERVICE_NAM E = "MIX"; | |
| 117 | pr ivate fina l static S tring DATA SOURCE_VER SION = "1" ; | |
| 118 | // pu blic final static St ring SUPPO RTED_PROTO COL = "mix "; | |
| 119 | ||
| 120 | /* * | |
| 121 | * The Provider will use t he create( ) factory method pre ferentiall y | |
| 122 | * ove r a constr uctor. Th is allows for cachin g of Vista StudyGraph DataSource Service | |
| 123 | * ins tances acc ording to the criter ia set her e. | |
| 124 | * | |
| 125 | * @pa ram url | |
| 126 | * @pa ram protoc ol | |
| 127 | * @re turn | |
| 128 | * @th rows Conne ctionExcep tion | |
| 129 | * @th rows Unsup portedProt ocolExcept ion | |
| 130 | */ | |
| 131 | public static Mi xImageData SourceServ ice create (ResolvedA rtifactSou rce resolv edArtifact Source, St ring proto col) | |
| 132 | throws Connectio nException , Unsuppor tedProtoco lException | |
| 133 | { | |
| 134 | re turn new M ixImageDat aSourceSer vice(resol vedArtifac tSource, p rotocol); | |
| 135 | } | |
| 136 | ||
| 137 | /** | |
| 138 | * | |
| 139 | * @pa ram resolv edArtifact Source | |
| 140 | * @pa ram protoc ol | |
| 141 | * @th rows Unsup portedProt ocolExcept ion if the ResolvedA rtifactSou rce is not an instan ce of Reso lvedSite | |
| 142 | */ | |
| 143 | pu blic MixIm ageDataSou rceService (ResolvedA rtifactSou rce resolv edArtifact Source, St ring proto col) | |
| 144 | th rows Unsup portedProt ocolExcept ion | |
| 145 | { | |
| 146 | supe r(resolved ArtifactSo urce, prot ocol); | |
| 147 | mixC onnection = new MIXs Connection (getArtifa ctUrl()); | |
| 148 | mixC onfigurati on = MixDa taSourcePr ovider.get MixConfigu ration(); | |
| 149 | } | |
| 150 | ||
| 151 | @O verride | |
| 152 | pu blic boole an isVersi onCompatib le() | |
| 153 | { | |
| 154 | // n othing rea lly to che ck | |
| 155 | retu rn true; | |
| 156 | } | |
| 157 | ||
| 158 | // /* (non-Java doc) | |
| 159 | // * @see gov. va.med.ima ging.datas ource.Imag eDataSourc eSpi#getUr l() | |
| 160 | // * / | |
| 161 | // pu blic URL g etUrl() | |
| 162 | // { | |
| 163 | // retu rn mixConn ection.get URL(); | |
| 164 | // } | |
| 165 | ||
| 166 | @O verride | |
| 167 | pu blic DataS ourceInput Stream get ImageTXTFi le(Image i mage) | |
| 168 | th rows Metho dException , Connecti onExceptio n | |
| 169 | { | |
| 170 | retu rn null; | |
| 171 | } | |
| 172 | ||
| 173 | /* * | |
| 174 | * | |
| 175 | * @see gov. va.med.ima ging.datas ource.Imag eDataSourc e#getImage (gov.va.me d.imaging. exchange.b usiness.Im age, int, java.lang. String) | |
| 176 | * / | |
| 177 | @O verride | |
| 178 | pu blic Image StreamResp onse getIm age(Image image, Ima geFormatQu alityList requestFor matQuality List) | |
| 179 | th rows Metho dException , Connecti onExceptio n | |
| 180 | { | |
| 181 | logg er.info("g etImage(" + image.ge tIen() + " ) from Ima ge object Transactio nContext ( " + Transa ctionConte xtFactory. get().getD isplayIden tity() + " )."); | |
| 182 | try | |
| 183 | { | |
| 184 | ImageM ixProxy pr oxy = getP roxy(image ); | |
| 185 | ImageU RN imageUr n = image. getImageUr n(); | |
| 186 | //Imag eURN image Urn = Imag eURN.creat e(image.ge tSiteNumbe r(), image .getIen(), image.get StudyIen() , image.ge tPatientIC N()); | |
| 187 | return getImage( imageUrn, requestFor matQuality List, prox y); | |
| 188 | } | |
| 189 | catc h(IOExcept ion ioX) | |
| 190 | { | |
| 191 | logger .error("Er ror gettin g image", ioX); | |
| 192 | throw new Method RemoteExce ption(ioX) ; | |
| 193 | } | |
| 194 | } | |
| 195 | ||
| 196 | /* (non-Java doc) | |
| 197 | * @see gov. va.med.ima ging.datas ource.Imag eDataSourc eSpi#getIm age(gov.va .med.imagi ng.ImageUR N, int, ja va.lang.St ring) | |
| 198 | * This is t he main ge tImage cal l in MIX ! !! | |
| 199 | * / | |
| 200 | @O verride | |
| 201 | pu blic Image StreamResp onse getIm age(Global ArtifactId entifier g ai, ImageF ormatQuali tyList req uestFormat QualityLis t) | |
| 202 | th rows Metho dException , MIXConne ctionExcep tion, Conn ectionExce ption | |
| 203 | { | |
| 204 | // s ubstitute if(!(gai i nstanceof ImageURN)) check | |
| 205 | DODI mageURN dI U = new DO DImageURN( ); | |
| 206 | if ( !gai.toStr ing().star tsWith(dIU .getDODPre fix())) | |
| 207 | { | |
| 208 | throw new Method Exception( "GlobalArt ifactIdent ifier '" + gai.toStr ing() + "' is not in stanceof D ODImageURN , cannot r etrieve im age from D AS."); | |
| 209 | } | |
| 210 | Imag eURN image Urn = (Ima geURN)gai; | |
| 211 | logg er.info("g etImage(" + imageUrn .toString( ) + ") fro m Image UR N Transact ionContext (" + Tran sactionCon textFactor y.get().ge tDisplayId entity() + ")."); | |
| 212 | try | |
| 213 | { | |
| 214 | ImageM ixProxy pr oxy = getP roxy(null) ; | |
| 215 | return getImage( imageUrn, requestFor matQuality List, prox y); | |
| 216 | } | |
| 217 | catc h(IOExcept ion ioX) | |
| 218 | { | |
| 219 | logger .error("Er ror gettin g image", ioX); | |
| 220 | throw new Method RemoteExce ption(ioX) ; | |
| 221 | } | |
| 222 | } | |
| 223 | ||
| 224 | // this is t he common MIX getIma ge client call | |
| 225 | pr ivate Imag eStreamRes ponse getI mage( | |
| 226 | Imag eURN image Urn, | |
| 227 | Imag eFormatQua lityList r equestForm atQualityL ist, | |
| 228 | Imag eMixProxy proxy) | |
| 229 | th rows Metho dException , MIXConne ctionExcep tion, Conn ectionExce ption | |
| 230 | { | |
| 231 | MixD ataSourceC ommon.setD ataSourceM ethodAndVe rsion("get Image", DA TASOURCE_V ERSION); | |
| 232 | Stri ng imageUR N = imageU rn.toStrin g(SERIALIZ ATION_FORM AT.NATIVE) ; | |
| 233 | if(p roxy.getAl ienSiteNum ber() != n ull) | |
| 234 | Transa ctionConte xtFactory. get().addD ebugInform ation("Ret rieving im age from a lien site number [" + proxy.ge tAlienSite Number() + "]"); | |
| 235 | logg er.info("M IX getImag e: Retriev ing image [" + image URN + "] f rom site [ " + getRes olvedArtif actSourceS tring() + "]"); | |
| 236 | // g et desired imageQual ity | |
| 237 | Imag eFormatQua lityList p runedList = pruneReq uestList(r equestForm atQualityL ist); | |
| 238 | if ( prunedList .size()==0 ) | |
| 239 | { | |
| 240 | String msg = "MI X getImage Error: No /Bad Forma tQuality l ist receiv ed for [" + imageUR N + "] fro m site [" + getResol vedArtifac tSourceStr ing() + "] "; | |
| 241 | logger .info(msg) ; | |
| 242 | throw new Method Exception( msg); | |
| 243 | } | |
| 244 | Imag eQuality i Q = pruned List.getFi rstImageQu ality(); | |
| 245 | ||
| 246 | // c ompose URL to client | |
| 247 | Map< String, St ring> urlP arameterKe yValues = new HashMa p<String, String>(); | |
| 248 | // u rlParamete rKeyValues .put("{rou tingToken} ", routing Token.toRo utingToken String()); | |
| 249 | DODI mageURN do dUrn = new DODImageU RN(imageUr n); | |
| 250 | urlP arameterKe yValues.pu t("{studyU id}", dodU rn.getStud yUID()); | |
| 251 | urlP arameterKe yValues.pu t("{series Uid}", dod Urn.getSer iesUID()); | |
| 252 | urlP arameterKe yValues.pu t("{instan ceUid}", d odUrn.getI nstanceUID ()); | |
| 253 | ||
| 254 | Medi aType mT = MediaType .APPLICATI ON_OCTET_S TREAM_TYPE ; // ????? | |
| 255 | ||
| 256 | Stri ng urlPath = MixImag eWADORestU ri.thumbna ilPath; | |
| 257 | if ( iQ == Imag eQuality.R EFERENCE) | |
| 258 | { | |
| 259 | urlPat h = MixIma geWADORest Uri.dicomJ 2KReferenc ePath; | |
| 260 | } | |
| 261 | else if (iQ == ImageQual ity.DIAGNO STIC) | |
| 262 | { | |
| 263 | urlPat h = MixIma geWADORest Uri.dicomJ 2KDiagnost icPath; | |
| 264 | } | |
| 265 | Stri ng url=""; | |
| 266 | try { | |
| 267 | url = amrip.getW ebResource Url(urlPat h, urlPara meterKeyVa lues); | |
| 268 | } | |
| 269 | catc h (Connect ionExcepti on ce) { | |
| 270 | throw new MIXCon nectionExc eption("MI X getImage : Failed t o connect to/compose URL sourc e!" + ce.g etMessage( )); | |
| 271 | } | |
| 272 | // s end reques t to Clien t and chec k response | |
| 273 | MixR estGetClie nt getClie nt = new M ixRestGetC lient(url, mT, mixCo nfiguratio n); | |
| 274 | Imag eStreamRes ponse imag eStreamRes ponse= nul l; | |
| 275 | Clie ntResponse clientRes ponse=null ; | |
| 276 | try{ // *** un sure how t o get the stream!!!! | |
| 277 | client Response = getClient .executeRe quest(Clie ntResponse .class); / / Connecti onExceptio n & Method Exception | |
| 278 | if (cl ientRespon se.getClie ntResponse Status() = = ClientRe sponse.Sta tus.OK) { | |
| 279 | imageStr eamRespons e = new Im ageStreamR esponse((D ataSourceI mageInputS tream)clie ntResponse .getEntity InputStrea m(), iQ); | |
| 280 | imageStr eamRespons e.setMedia Type(mT.to String()); | |
| 281 | } | |
| 282 | } | |
| 283 | catc h (Connect ionExcepti on ce) { | |
| 284 | throw new MIXCon nectionExc eption("MI X getImage : Failed t o connect to Client! "); | |
| 285 | } | |
| 286 | catc h (MethodE xception m e) { | |
| 287 | throw new MIXCon nectionExc eption("MI X getImage : Error ge tting Clie nt respons e!" + me.g etMessage( )); | |
| 288 | } | |
| 289 | re turn image StreamResp onse; | |
| 290 | } | |
| 291 | ||
| 292 | pr ivate MIXS iteConfigu ration get MixSiteCon figuration (String al ienSiteNum ber) | |
| 293 | th rows IOExc eption | |
| 294 | { | |
| 295 | // MIXS iteConfigu ration mix SiteConfig uration = null; | |
| 296 | Stri ng reposit oryId = ge tResolvedA rtifactSou rce().getA rtifactSou rce().getR epositoryI d(); | |
| 297 | Stri ng primary SiteNumber = reposit oryId; | |
| 298 | Stri ng seconda rySiteNumb er = null; | |
| 299 | if(( alienSiteN umber != n ull) && (a lienSiteNu mber.lengt h() > 0)) | |
| 300 | { | |
| 301 | second arySiteNum ber = repo sitoryId; | |
| 302 | primar ySiteNumbe r = alienS iteNumber; | |
| 303 | } | |
| 304 | try | |
| 305 | { | |
| 306 | mixSit eConfigura tion = | |
| 307 | MixDataS ourceProvi der.getMix Configurat ion().getS iteConfigu ration(pri marySiteNu mber, seco ndarySiteN umber); | |
| 308 | } | |
| 309 | catc h(MIXConfi gurationEx ception ec X) | |
| 310 | { | |
| 311 | throw new IOExce ption(ecX) ; | |
| 312 | } | |
| 313 | retu rn mixSite Configurat ion; | |
| 314 | } | |
| 315 | ||
| 316 | /* | |
| 317 | pr ivate Imag eXChangePr oxy getPro xy() | |
| 318 | th rows IOExc eption | |
| 319 | { | |
| 320 | retu rn getProx y(null); | |
| 321 | } | |
| 322 | */ | |
| 323 | ||
| 324 | pr ivate Imag eMixProxy getProxy(I mage image ) | |
| 325 | th rows IOExc eption | |
| 326 | { | |
| 327 | Stri ng alienSi teNumber = null; | |
| 328 | bool ean isAlie nSiteNumbe r = false; | |
| 329 | if(( image != n ull) && (i mage.getAl ienSiteNum ber() != n ull)) | |
| 330 | { | |
| 331 | alienS iteNumber = image.ge tAlienSite Number(); | |
| 332 | if(xch angeProxie s.contains Key(alienS iteNumber) ) | |
| 333 | { | |
| 334 | return x changeProx ies.get(al ienSiteNum ber); | |
| 335 | } | |
| 336 | } | |
| 337 | MIXS iteConfigu ration mix SiteConfig uration = getMixSite Configurat ion(alienS iteNumber) ; | |
| 338 | Stri ng host = mixConnect ion.getURL ().getHost (); | |
| 339 | int port = mix Connection .getURL(). getPort(); | |
| 340 | if(m ixSiteConf iguration. containsHo stAndPort( )) | |
| 341 | { | |
| 342 | host = mixSiteCo nfiguratio n.getHost( ); | |
| 343 | port = mixSiteCo nfiguratio n.getPort( ); | |
| 344 | isAlie nSiteNumbe r = true; | |
| 345 | } | |
| 346 | Imag eMixProxy proxy = Im ageMixProx yFactory.g etSingleto n().get( | |
| 347 | host, | |
| 348 | port, | |
| 349 | mixSiteC onfigurati on, | |
| 350 | isAlienS iteNumber ? alienSit eNumber : null, | |
| 351 | MixDataS ourceProvi der.getMix Configurat ion()); | |
| 352 | ||
| 353 | xcha ngeProxies .put(alien SiteNumber , proxy); | |
| 354 | ||
| 355 | retu rn proxy; | |
| 356 | ||
| 357 | } | |
| 358 | ||
| 359 | @O verride | |
| 360 | pu blic DataS ourceInput Stream get ImageTXTFi le(ImageUR N imageURN ) | |
| 361 | th rows Unsup portedOper ationExcep tion, Meth odExceptio n, | |
| 362 | Conn ectionExce ption, Ima geNotFound Exception, ImageNear LineExcept ion | |
| 363 | { | |
| 364 | retu rn null; | |
| 365 | } | |
| 366 | ||
| 367 | @O verride | |
| 368 | pu blic Strin g getImage Informatio n(Abstract ImagingURN imagingUr n, boolean includeDe letedImage s) | |
| 369 | th rows Unsup portedOper ationExcep tion, Meth odExceptio n, | |
| 370 | Conn ectionExce ption, Ima geNotFound Exception | |
| 371 | { | |
| 372 | thro w new Unsu pportedOpe rationExce ption("The MIX Image DataSource does not support th e getImage Informatio n method." ); | |
| 373 | } | |
| 374 | ||
| 375 | @O verride | |
| 376 | pu blic Strin g getImage SystemGlob alNode(Abs tractImagi ngURN imag ingUrn) | |
| 377 | throws Unsupport edOperatio nException , MethodEx ception, | |
| 378 | Connec tionExcept ion, Image NotFoundEx ception { | |
| 379 | thro w new Unsu pportedOpe rationExce ption("The MIX Image DataSource does not support th e getImage SystemGlob alNode met hod."); | |
| 380 | } | |
| 381 | ||
| 382 | @O verride | |
| 383 | pu blic Strin g getImage DevFields( AbstractIm agingURN i magingUrn, String fl ags) | |
| 384 | th rows Unsup portedOper ationExcep tion, Meth odExceptio n, | |
| 385 | Conn ectionExce ption, Ima geNotFound Exception | |
| 386 | { | |
| 387 | thro w new Unsu pportedOpe rationExce ption("The MIX Image DataSource does not support th e getImage DevFields method."); | |
| 388 | } | |
| 389 | ||
| 390 | /* * | |
| 391 | * This func tion reduc es the req uested for mat list t o a list a cceptable by the DOD . | |
| 392 | * If the re quest incl udes forma ts that th e DOD does not expec t, they wi ll not wor k properly | |
| 393 | * so if the request c ame from t he Clinica l Display client, it must be r educed to eliminate | |
| 394 | * types lik e TGA, J2K , PDF, DOC , etc. | |
| 395 | * / | |
| 396 | pr ivate Imag eFormatQua lityList p runeReques tList(Imag eFormatQua lityList r equestList ) | |
| 397 | { | |
| 398 | Imag eFormatQua lityList p runedList = new Imag eFormatQua lityList() ; | |
| 399 | for( ImageForma tQuality q uality : r equestList ) | |
| 400 | { | |
| 401 | List<I mageFormat > allowabl eFormats = getAccept ableImageF ormatsForQ uality(qua lity.getIm ageQuality ()); | |
| 402 | if(isQ ualityForm atAllowed( quality.ge tImageForm at(), allo wableForma ts)) | |
| 403 | { | |
| 404 | prunedLi st.addUniq ueMime(qua lity); | |
| 405 | } | |
| 406 | } | |
| 407 | retu rn prunedL ist; | |
| 408 | } | |
| 409 | ||
| 410 | pr ivate List <ImageForm at> getAcc eptableIma geFormatsF orQuality( ImageQuali ty quality ) | |
| 411 | { | |
| 412 | if(q uality == ImageQuali ty.REFEREN CE) | |
| 413 | return acceptabl eReference ResponseTy pes; | |
| 414 | else if(qualit y == Image Quality.DI AGNOSTIC) | |
| 415 | return acceptabl eDiagnosti cResponseT ypes; | |
| 416 | // else if(qualit y == Image Quality.DI AGNOSTICUN COMPRESSED ) -- retir ed for MIX ! | |
| 417 | // return acceptabl eDiagnosti cResponseT ypes; | |
| 418 | else // thumbn ail or oth er | |
| 419 | return acceptabl eThumbnail ResponseTy pes; | |
| 420 | } | |
| 421 | ||
| 422 | pr ivate bool ean isQual ityFormatA llowed(Ima geFormat f ormat, Lis t<ImageFor mat> accep tableForma ts) | |
| 423 | { | |
| 424 | for( ImageForma t acceptab leFormat : acceptabl eFormats) | |
| 425 | { | |
| 426 | if((ac ceptableFo rmat == Im ageFormat. ANYTHING) || | |
| 427 | (accepta bleFormat. getMime(). equalsIgno reCase(for mat.getMim e()))) | |
| 428 | { | |
| 429 | return t rue; | |
| 430 | } | |
| 431 | } | |
| 432 | retu rn false; | |
| 433 | } | |
| 434 | ||
| 435 | pr otected St ring getRe solvedArti factSource String() | |
| 436 | { | |
| 437 | Arti factSource artifactS ource = ge tResolvedA rtifactSou rce().getA rtifactSou rce(); | |
| 438 | retu rn artifac tSource.ge tHomeCommu nityId() + ", " + ar tifactSour ce.getRepo sitoryId() ; | |
| 439 | } | |
| 440 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.