Produced by Araxis Merge on 6/5/2018 10:24:09 AM Central Daylight 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 | patch_205_build_9.zip\Java\ExchangeDataSource\main\src\java\gov\va\med\imaging\exchange\proxy\v1 | ImageXChangeProxy.java | Wed May 30 14:35:28 2018 UTC |
2 | patch_205_build_9.zip\Java\ExchangeDataSource\main\src\java\gov\va\med\imaging\exchange\proxy\v1 | ImageXChangeProxy.java | Fri Jun 1 19:35:51 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 510 |
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 | package go v.va.med.i maging.exc hange.prox y.v1; | |
2 | ||
3 | import gov .va.med.SE RIALIZATIO N_FORMAT; | |
4 | import gov .va.med.im aging.Date Util; | |
5 | import gov .va.med.im aging.Size dInputStre am; | |
6 | import gov .va.med.im aging.Stud yURN; | |
7 | import gov .va.med.im aging.core .interface s.exceptio ns.Connect ionExcepti on; | |
8 | import gov .va.med.im aging.core .interface s.exceptio ns.ImageCo nversionEx ception; | |
9 | import gov .va.med.im aging.core .interface s.exceptio ns.ImageNe arLineExce ption; | |
10 | import gov .va.med.im aging.core .interface s.exceptio ns.ImageNo tFoundExce ption; | |
11 | import gov .va.med.im aging.core .interface s.exceptio ns.MethodE xception; | |
12 | import gov .va.med.im aging.core .interface s.exceptio ns.Securit yCredentia lsExpiredE xception; | |
13 | import gov .va.med.im aging.exch ange.busin ess.ImageF ormatQuali tyList; | |
14 | import gov .va.med.im aging.exch ange.busin ess.Reques tor; | |
15 | import gov .va.med.im aging.exch ange.busin ess.StudyF ilter; | |
16 | import gov .va.med.im aging.exch ange.proxy .ExchangeP roxy; | |
17 | import gov .va.med.im aging.exch ange.webse rvices.soa p.v1.Image Metadata; | |
18 | import gov .va.med.im aging.exch ange.webse rvices.soa p.v1.Image MetadataSe rviceLocat or; | |
19 | import gov .va.med.im aging.exch ange.webse rvices.soa p.types.v1 .FilterTyp e; | |
20 | import gov .va.med.im aging.exch ange.webse rvices.soa p.types.v1 .Requestor Type; | |
21 | import gov .va.med.im aging.exch ange.webse rvices.soa p.types.v1 .Requestor TypePurpos eOfUse; | |
22 | import gov .va.med.im aging.exch ange.webse rvices.soa p.types.v1 .StudyType ; | |
23 | import gov .va.med.im aging.prox y.ImageXCh angeHttpCo mmonsSende r; | |
24 | import gov .va.med.im aging.prox y.ImagingP roxy; | |
25 | import gov .va.med.im aging.prox y.exceptio ns.ProxySe rviceNotFo undExcepti on; | |
26 | import gov .va.med.im aging.prox y.exchange .StudyPara meters; | |
27 | import gov .va.med.im aging.prox y.services .ProxyServ ice; | |
28 | import gov .va.med.im aging.prox y.services .ProxyServ iceType; | |
29 | import gov .va.med.im aging.prox y.services .ProxyServ ices; | |
30 | import gov .va.med.im aging.tran sactioncon text.Trans actionCont ext; | |
31 | import gov .va.med.im aging.tran sactioncon text.Trans actionCont extFactory ; | |
32 | import gov .va.med.im aging.url. exchange.c onfigurati on.Exchang eConfigura tion; | |
33 | ||
34 | import jav a.net.Malf ormedURLEx ception; | |
35 | import jav a.net.URL; | |
36 | import jav a.rmi.Remo teExceptio n; | |
37 | import jav a.util.zip .Checksum; | |
38 | ||
39 | import jav ax.xml.rpc .ServiceEx ception; | |
40 | import jav ax.xml.rpc .Stub; | |
41 | ||
42 | import org .apache.co mmons.http client.met hods.GetMe thod; | |
43 | ||
44 | /** | |
45 | * The pro xy that ta lks to the XChange i nterface o f the ViXS server an d the BHIE Image Ada pter. | |
46 | * @author PII | |
47 | * | |
48 | */ | |
49 | public cla ss ImageXC hangeProxy | |
50 | extends Im agingProxy | |
51 | implements ExchangeP roxy | |
52 | { | |
53 | pu blic final static St ring defau ltImagePro tocol = "h ttp"; | |
54 | pr ivate Stri ng alienSi teNumber; | |
55 | pr otected fi nal Exchan geConfigur ation exch angeConfig uration; | |
56 | ||
57 | ||
58 | pu blic Image XChangePro xy(ProxySe rvices pro xyServices , String a lienSiteNu mber, | |
59 | Exchan geConfigur ation exch angeConfig uration) | |
60 | { | |
61 | supe r(proxySer vices, tru e); | |
62 | this .alienSite Number = a lienSiteNu mber; | |
63 | this .exchangeC onfigurati on = excha ngeConfigu ration; | |
64 | } | |
65 | ||
66 | pr ivate Imag eMetadata getImageMe tadataServ ice() | |
67 | th rows Malfo rmedURLExc eption, Se rviceExcep tion, Prox yServiceNo tFoundExce ption | |
68 | { | |
69 | URL localTestU rl = new U RL(proxySe rvices.get ProxyServi ce(ProxySe rviceType. metadata). getConnect ionURL()); | |
70 | Imag eMetadataS erviceLoca tor locato r = new Im ageMetadat aServiceLo cator(); | |
71 | Imag eMetadata imageMetad ata = loca tor.getIma geMetadata V1(localTe stUrl); | |
72 | ||
73 | retu rn imageMe tadata; | |
74 | } | |
75 | ||
76 | /* * | |
77 | * | |
78 | * @deprecat ed use get Studies(St udyParamet ers parame ters) | |
79 | * | |
80 | * @param re questor | |
81 | * @param fi lter | |
82 | * @param pa tientIdent ification | |
83 | * @param se ndSecurity Context | |
84 | * @return | |
85 | * @throws M alformedUR LException | |
86 | * @throws S erviceExce ption | |
87 | * @throws R emoteExcep tion | |
88 | * / | |
89 | /* | |
90 | pu blic Study Result get Studies( | |
91 | StudyF ilter filt er, | |
92 | String patientId entificati on) | |
93 | th rows Malfo rmedURLExc eption, Se rviceExcep tion, Remo teExceptio n | |
94 | { | |
95 | //Da teFormat d f = new Si mpleDateFo rmat("yyyy MMddhhmmss .SSSSSSZ") ; | |
96 | Stud yParameter s paramete rs; | |
97 | para meters = n ew StudyPa rameters( | |
98 | patientI dentificat ion, | |
99 | filter.g etFromDate (), | |
100 | filter.g etToDate() , | |
101 | filter.g etStudyId( ) ); | |
102 | ||
103 | retu rn getStud ies(parame ters); | |
104 | }* / | |
105 | ||
106 | /* * | |
107 | * | |
108 | * / | |
109 | pr ivate void setMetada taCredenti als(ImageM etadata im ageMetadat a) | |
110 | { | |
111 | try | |
112 | { | |
113 | ProxyS ervice met adataServi ce = proxy Services.g etProxySer vice(Proxy ServiceTyp e.metadata ); | |
114 | ||
115 | System .out.print ln("Metada ta paramet ers is " + (metadata Service == null ? "N ULL" : "NO T NULL") ) ; | |
116 | ||
117 | System .out.print ln("UID = '" + metad ataService .getUid() + "'."); | |
118 | System .out.print ln("PWD = '" + metad ataService .getCreden tials() + "'."); | |
119 | ||
120 | if(met adataServi ce.getUid( ) != null) | |
121 | ((Stub)i mageMetada ta)._setPr operty(Stu b.USERNAME _PROPERTY, metadataS ervice.get Uid()); | |
122 | ||
123 | if(met adataServi ce.getCred entials() != null) | |
124 | ((Stub)i mageMetada ta)._setPr operty(Stu b.PASSWORD _PROPERTY, metadataS ervice.get Credential s()); | |
125 | ||
126 | } | |
127 | catc h(ProxySer viceNotFou ndExceptio n psnfX) | |
128 | { | |
129 | logger .error(psn fX); | |
130 | } | |
131 | } | |
132 | ||
133 | /* * | |
134 | * Make a we bservice c all to get the studi es that me et the fil ter criter ia | |
135 | * | |
136 | * @param re questor | |
137 | * @param fi lter | |
138 | * @param pa tientIdent ification | |
139 | * @return | |
140 | * @throws M alformedUR LException | |
141 | * @throws S erviceExce ption | |
142 | * @throws R emoteExcep tion | |
143 | * / | |
144 | pu blic Study Result get Studies(St udyParamet ers parame ters) | |
145 | th rows Malfo rmedURLExc eption, Se rviceExcep tion, Remo teExceptio n, Connect ionExcepti on | |
146 | { | |
147 | Tran sactionCon text trans actionCont ext = Tran sactionCon textFactor y.get(); | |
148 | ||
149 | logg er.info("T ransaction [" + tran sactionCon text.getTr ansactionI d() + "] i nitiated " ); | |
150 | Imag eMetadata imageMetad ata = getI mageMetada taService( ); | |
151 | ||
152 | // i f the meta data conne ction para meters are not null and the me tadata con nection pa rameters | |
153 | // s pecifies a user ID t hen set th e UID/PWD parameters as XML pa rameters, which shou ld | |
154 | // e nd up as a BASIC aut h paramete r in the H TTP header | |
155 | setM etadataCre dentials(i mageMetada ta); | |
156 | ||
157 | // J MW 8/13/08 - set the connectio n socket t imeout to 30 seconds (default of 600 sec onds) | |
158 | ((or g.apache.a xis.client .Stub)imag eMetadata) .setTimeou t(exchange Configurat ion.getMet adataTimeo ut()); | |
159 | ||
160 | Requ estor requ estor = pa rameters.g etRequesto r(); | |
161 | Requ estorType rt = reque stor == nu ll ? | |
162 | new Requ estorType( ) : | |
163 | new Requ estorType( | |
164 | requesto r.getUsern ame(), | |
165 | requesto r.getSsn() , | |
166 | requesto r.getFacil ityId(), | |
167 | requesto r.getFacil ityName(), | |
168 | Requesto rTypePurpo seOfUse.va lue1); | |
169 | ||
170 | Stud yFilter fi lter = par ameters.ge tFilter(); | |
171 | Stud yURN study Urn = (Stu dyURN)filt er.getStud yId(); | |
172 | Filt erType ft = filter = = null ? | |
173 | new Fi lterType() : | |
174 | new Fi lterType( | |
175 | filter.g etFromDate () == null ? null : DateUtil.g etDicomDat eFormat(). format(fil ter.getFro mDate()), | |
176 | filter.g etToDate() == null ? null : Da teUtil.get DicomDateF ormat().fo rmat(filte r.getToDat e()), | |
177 | studyUrn == null ? null : st udyUrn.toS tring(SERI ALIZATION_ FORMAT.CDT P)); | |
178 | ||
179 | Stri ng datasou rce = para meters.get Datasource (); | |
180 | Clas sLoader lo ader = Thr ead.curren tThread(). getContext ClassLoade r(); | |
181 | Thre ad.current Thread().s etContextC lassLoader (ImageXCha ngeHttpCom monsSender .class.get ClassLoade r()); | |
182 | Stud yType[] st udies = im ageMetadat a.getPatie ntStudyLis t( | |
183 | datasour ce, | |
184 | rt, | |
185 | ft, | |
186 | paramete rs.getPati entId(), | |
187 | transact ionContext .getTransa ctionId() | |
188 | ); | |
189 | Thre ad.current Thread().s etContextC lassLoader (loader); | |
190 | logg er.info("T ransaction [" + tran sactionCon text.getTr ansactionI d() + "] r eturned " + | |
191 | (studies == null ? 0 : studi es.length) + | |
192 | " studie s"); | |
193 | ||
194 | retu rn new Stu dyResult(t ransaction Context.ge tTransacti onId(), st udies); | |
195 | } | |
196 | ||
197 | /* * | |
198 | * Override the getIns tance meth ods to ins truct the real getIn stance met hods not t o | |
199 | * include t he securit y context informatio n | |
200 | * @throws P roxyExcept ion | |
201 | * / | |
202 | pu blic Sized InputStrea m getInsta nce(String imageUrn, ImageForm atQualityL ist reques tFormatQua lityList) | |
203 | th rows Image NearLineEx ception, I mageNotFou ndExceptio n, | |
204 | Se curityCred entialsExp iredExcept ion, Image Conversion Exception, Connectio nException , MethodEx ception | |
205 | { | |
206 | retu rn super.g etInstance (imageUrn, requestFo rmatQualit yList, fal se); | |
207 | } | |
208 | ||
209 | /* * | |
210 | * Override the getIns tance meth ods to ins truct the real getIn stance met hods not t o | |
211 | * include t he securit y context informatio n | |
212 | * @throws P roxyExcept ion | |
213 | * / | |
214 | pu blic Sized InputStrea m getInsta nce(String imageUrn, ImageForm atQualityL ist reques tFormatQua lityList, Checksum c hecksum) | |
215 | th rows Image NearLineEx ception, I mageNotFou ndExceptio n, | |
216 | Se curityCred entialsExp iredExcept ion, Image Conversion Exception, Connectio nException , MethodEx ception | |
217 | { | |
218 | retu rn super.g etInstance (imageUrn, requestFo rmatQualit yList, che cksum, fal se); | |
219 | } | |
220 | ||
221 | /* (non-Java doc) | |
222 | * @see gov. va.med.ima ging.proxy .ImagingPr oxy#addOpt ionalGetIn stanceHead ers(org.ap ache.commo ns.httpcli ent.method s.GetMetho d) | |
223 | * / | |
224 | @O verride | |
225 | pr otected vo id addOpti onalGetIns tanceHeade rs(GetMeth od getMeth od) | |
226 | { | |
227 | // n ot needed here | |
228 | } | |
229 | ||
230 | /* (non-Java doc) | |
231 | * @see gov. va.med.ima ging.proxy .ImagingPr oxy#getIns tanceReque stProxySer viceType() | |
232 | * / | |
233 | @O verride | |
234 | pr otected Pr oxyService Type getIn stanceRequ estProxySe rviceType( ) | |
235 | { | |
236 | retu rn ProxySe rviceType. image; | |
237 | } | |
238 | ||
239 | /* (non-Java doc) | |
240 | * @see gov. va.med.ima ging.proxy .ImagingPr oxy#getTex tFileReque stProxySer viceType() | |
241 | * / | |
242 | @O verride | |
243 | pr otected Pr oxyService Type getTe xtFileRequ estProxySe rviceType( ) | |
244 | { | |
245 | retu rn ProxySe rviceType. text; | |
246 | } | |
247 | ||
248 | @O verride | |
249 | pu blic Strin g getAlien SiteNumber () | |
250 | { | |
251 | retu rn alienSi teNumber; | |
252 | } | |
253 | ||
254 | ||
255 | } | |
256 |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.