Produced by Araxis Merge on 3/25/2019 8:58:00 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 | C:\AraxisMergeCompare\Pri_un\IMAG_Source\VISA\Java\ExchangeDataSource\main\src\java\gov\va\med\imaging\exchangedatasource | ExchangeStudyGraphDataSourceService.java | Mon Mar 18 20:39:06 2019 UTC |
2 | C:\AraxisMergeCompare\Pri_re\IMAG_Source\VISA\Java\ExchangeDataSource\main\src\java\gov\va\med\imaging\exchangedatasource | ExchangeStudyGraphDataSourceService.java | Tue Mar 19 12:03:30 2019 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 3 | 604 |
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 8, 2008 | |
6 | Site Nam e: Washin gton OI Fi eld Office , Silver S pring, MD | |
7 | Developer: DN S WERFEJ | |
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.exc hangedatas ource; | |
27 | ||
28 | import gov .va.med.Gl obalArtifa ctIdentifi er; | |
29 | import gov .va.med.Pa tientIdent ifier; | |
30 | import gov .va.med.Ro utingToken ; | |
31 | import gov .va.med.im aging.arti factsource .ResolvedA rtifactSou rce; | |
32 | import gov .va.med.im aging.core .interface s.exceptio ns.Connect ionExcepti on; | |
33 | import gov .va.med.im aging.core .interface s.exceptio ns.MethodE xception; | |
34 | import gov .va.med.im aging.data source.Abs tractVersi onableData Source; | |
35 | import gov .va.med.im aging.data source.Stu dyGraphDat aSourceSpi ; | |
36 | import gov .va.med.im aging.data source.exc eptions.Un supportedP rotocolExc eption; | |
37 | import gov .va.med.im aging.data source.exc eptions.Un supportedS erviceMeth odExceptio n; | |
38 | import gov .va.med.im aging.exch ange.busin ess.*; | |
39 | import gov .va.med.im aging.exch ange.enums .StudyLoad Level; | |
40 | import gov .va.med.im aging.exch ange.proxy .v1.Exchan geProxyUti lities; | |
41 | import gov .va.med.im aging.exch ange.proxy .v1.ImageX ChangeProx y; | |
42 | import gov .va.med.im aging.exch ange.proxy .v1.ImageX ChangeProx yFactory; | |
43 | import gov .va.med.im aging.exch ange.proxy .v1.StudyR esult; | |
44 | import gov .va.med.im aging.prox y.exchange .StudyPara meters; | |
45 | import gov .va.med.im aging.tran sactioncon text.Trans actionCont extFactory ; | |
46 | import gov .va.med.im aging.url. exchange.E xchangeCon nection; | |
47 | import gov .va.med.im aging.url. exchange.c onfigurati on.Exchang eSiteConfi guration; | |
48 | import gov .va.med.im aging.url. exchange.e xceptions. ExchangeCo nfiguratio nException ; | |
49 | import gov .va.med.im aging.url. exchange.e xceptions. ExchangeCo nnectionEx ception; | |
50 | import gov .va.med.im aging.url. exchange.e xceptions. ExchangeMe thodExcept ion; | |
51 | import gov .va.med.im aging.url. exchange.t ranslator. ExchangeTr anslator; | |
52 | import jav a.beans.XM LEncoder; | |
53 | import jav a.io.Buffe redOutputS tream; | |
54 | import jav a.io.FileN otFoundExc eption; | |
55 | import jav a.io.FileO utputStrea m; | |
56 | import jav a.io.IOExc eption; | |
57 | import jav a.net.URL; | |
58 | import jav a.util.Dat e; | |
59 | import jav a.util.Lis t; | |
60 | ||
61 | import jav ax.xml.rpc .ServiceEx ception; | |
62 | import org .apache.lo gging.log4 j.LogManag er; | |
63 | import org .apache.lo gging.log4 j.Logger; | |
64 | ||
65 | /** | |
66 | * @author DN S WERFEJ | |
67 | * | |
68 | */ | |
69 | public cla ss Exchang eStudyGrap hDataSourc eService | |
70 | extends Ab stractVers ionableDat aSource | |
71 | implements StudyGrap hDataSourc eSpi | |
72 | { | |
73 | pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(Exch angeStudyG raphDataSo urceServic e.class); | |
74 | ||
75 | pr ivate fina l Exchange Connection exchangeC onnection; | |
76 | pr ivate Imag eXChangePr oxy proxy = null; | |
77 | pr otected st atic Excha ngeTransla tor transl ator = new ExchangeT ranslator( ); | |
78 | pr ivate fina l static S tring EXCH ANGE_PROXY _SERVICE_N AME = "Exc hange"; | |
79 | pr ivate fina l static S tring DATA SOURCE_VER SION = "1" ; | |
80 | pr ivate Exch angeSiteCo nfiguratio n exchange Configurat ion = null ; | |
81 | pu blic final static St ring SUPPO RTED_PROTO COL = "exc hange"; | |
82 | ||
83 | /* * | |
84 | * The Provider will use t he create( ) factory method pre ferentiall y | |
85 | * ove r a constr uctor. Th is allows for cachin g of Vista StudyGraph DataSource Service | |
86 | * ins tances acc ording to the criter ia set her e. | |
87 | * | |
88 | * @pa ram url | |
89 | * @pa ram site | |
90 | * @re turn | |
91 | * @th rows Conne ctionExcep tion | |
92 | * @th rows Unsup portedProt ocolExcept ion | |
93 | */ | |
94 | public static Ex changeStud yGraphData SourceServ ice create (ResolvedA rtifactSou rce resolv edArtifact Source, St ring proto col) | |
95 | throws Connectio nException , Unsuppor tedProtoco lException | |
96 | { | |
97 | re turn new E xchangeStu dyGraphDat aSourceSer vice(resol vedArtifac tSource, p rotocol); | |
98 | } | |
99 | ||
100 | pu blic Excha ngeStudyGr aphDataSou rceService (ResolvedA rtifactSou rce resolv edArtifact Source, St ring proto col) | |
101 | th rows Unsup portedProt ocolExcept ion | |
102 | { | |
103 | supe r(resolved ArtifactSo urce, prot ocol); | |
104 | if(! (resolved ArtifactSo urce insta nceof Reso lvedSite) ) | |
105 | 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() + "'."); | |
106 | ||
107 | exch angeConnec tion = new ExchangeC onnection( getMetadat aUrl()); | |
108 | } | |
109 | ||
110 | /* * | |
111 | * The artif act source must be c hecked in the constr uctor to a ssure that it is an instance | |
112 | * of Resolv edSite. | |
113 | * | |
114 | * @return | |
115 | * / | |
116 | pr ivate Reso lvedSite g etResolved Site() | |
117 | { | |
118 | retu rn (Resolv edSite)get ResolvedAr tifactSour ce(); | |
119 | } | |
120 | ||
121 | pr ivate Site getSite() | |
122 | { | |
123 | retu rn getReso lvedSite() .getSite() ; | |
124 | } | |
125 | ||
126 | @O verride | |
127 | pu blic boole an isVersi onCompatib le() { | |
128 | Exch angeSiteCo nfiguratio n siteConf ig = null; | |
129 | try | |
130 | { | |
131 | siteCo nfig = get ExchangeSi teConfigur ation(); | |
132 | } | |
133 | catc h(IOExcept ion ioX) | |
134 | { | |
135 | logger .error("Er ror readin g configur ation for datasource ", ioX); | |
136 | return false; | |
137 | } | |
138 | // i f versioni ng is turn ed on for this site configurat ion | |
139 | if(s iteConfig. isUseVersi oning()) | |
140 | { | |
141 | Exchan geProxyUti lities.isE xchangeSit eServiceAv ailable(ge tSite(), E XCHANGE_PR OXY_SERVIC E_NAME, DA TASOURCE_V ERSION); | |
142 | } | |
143 | retu rn true; | |
144 | } | |
145 | ||
146 | pr ivate Imag eXChangePr oxy getPro xy() | |
147 | th rows IOExc eption | |
148 | { | |
149 | if(p roxy == nu ll) | |
150 | { | |
151 | Exchan geSiteConf iguration exchangeSi teConfigur ation = nu ll; | |
152 | try | |
153 | { | |
154 | exchange SiteConfig uration = | |
155 | ExchangeDa taSourcePr ovider.get ExchangeCo nfiguratio n().getSit eConfigura tion(getSi te().getSi teNumber() , null); | |
156 | } | |
157 | catch( ExchangeCo nfiguratio nException ecX) | |
158 | { | |
159 | throw ne w IOExcept ion(ecX); | |
160 | } | |
161 | proxy = ImageXCh angeProxyF actory.get Singleton( ).get( | |
162 | exchangeCo nnection.g etURL().ge tHost(), | |
163 | exchangeCo nnection.g etURL().ge tPort(), | |
164 | exchangeSi teConfigur ation, nul l, | |
165 | ExchangeDa taSourcePr ovider.get ExchangeCo nfiguratio n()); | |
166 | } | |
167 | retu rn proxy; | |
168 | } | |
169 | ||
170 | ||
171 | ||
172 | /* (non-Java doc) | |
173 | * @see gov. va.med.ima ging.datas ource.Stud yGraphData SourceSpi# getUrl() | |
174 | * / | |
175 | pu blic URL g etUrl() { | |
176 | retu rn exchang eConnectio n.getURL() ; | |
177 | } | |
178 | ||
179 | @S uppressWar nings("box ing") | |
180 | @O verride | |
181 | pu blic Study SetResult getPatient Studies(Ro utingToken globalRou tingToken, | |
182 | Pati entIdentif ier patien tIdentifie r, | |
183 | Stud yFilter fi lter, | |
184 | Stud yLoadLevel studyLoad Level) | |
185 | th rows Unsup portedOper ationExcep tion, Exch angeMethod Exception, Connectio nException | |
186 | { | |
187 | Exch angeDataSo urceCommon .setDataSo urceMethod AndVersion ("getPatie ntStudies" , DATASOUR CE_VERSION ); | |
188 | logg er.info("g etPatientS tudies for patient ( " + patien tIdentifie r + ") Tra nsactionCo ntext (" + Transacti onContextF actory.get ().getDisp layIdentit y() + ")." ); | |
189 | if(p atientIden tifier.get PatientIde ntifierTyp e().isLoca l()) | |
190 | throw new Exchan geMethodEx ception("C annot use local pati ent identi fier to re trieve rem ote patien t informat ion"); | |
191 | Stri ng patient Icn = pati entIdentif ier.getVal ue(); | |
192 | try | |
193 | { | |
194 | exchan geConnecti on.connect (); | |
195 | } | |
196 | catc h(IOExcept ion ioX) | |
197 | { | |
198 | logger .error("Er ror gettin g patient studies", ioX); | |
199 | throw new Exchan geConnecti onExceptio n(ioX); | |
200 | } | |
201 | try | |
202 | { | |
203 | StudyP arameters parameters = | |
204 | new Stud yParameter s( | |
205 | patientIcn , | |
206 | filter == null ? new Date(0l) : filter.g etFromDate (), | |
207 | filter == null ? new Date() : filter.get ToDate(), | |
208 | filter == null ? nul l : filter .getStudyI d() | |
209 | ); | |
210 | StudyR esult stud yResult = getProxy() .getStudie s(paramete rs); | |
211 | gov.va .med.imagi ng.exchang e.webservi ces.soap.t ypes.v1.St udyType[] exchangeSt udies = st udyResult. getStudies (); | |
212 | logger .info("get PatientStu dies got [ " + (excha ngeStudies == null ? "0" : exc hangeStudi es.length) + "] stud ies from s ite [" + g etSite().g etSiteNumb er() + "]" ); | |
213 | if (ex changeStud ies != nul l) | |
214 | { | |
215 | String d umpExchang eGraphs = System.get env("dumpd odexchange graphs"); | |
216 | if (dump ExchangeGr aphs != nu ll && dump ExchangeGr aphs.equal sIgnoreCas e("true")) | |
217 | { | |
218 | dumpDodStu dyGraph(pa tientIcn, exchangeSt udies); | |
219 | } | |
220 | } | |
221 | return StudySetR esult.crea teFullResu lt(transla tor.transf ormStudies (getSite() , exchange Studies, | |
222 | filter, Ex changeData SourceProv ider.getEx changeConf iguration( ).getEmpty StudyModal ities())); | |
223 | } | |
224 | catc h(IOExcept ion ioX) | |
225 | { | |
226 | logger .error("Er ror gettin g patient studies", ioX); | |
227 | throw new Exchan geMethodEx ception(io X); | |
228 | } | |
229 | catc h(ServiceE xception s X) { | |
230 | logger .error("Er ror gettin g patient studies", sX); | |
231 | throw new Exchan geMethodEx ception(sX ); | |
232 | } | |
233 | } | |
234 | ||
235 | pr ivate void dumpDodSt udyGraph(S tring pati entIcn, go v.va.med.i maging.exc hange.webs ervices.so ap.types.v 1.StudyTyp e[] exchan geStudies) | |
236 | { | |
237 | Stri ng vixcach e = System .getenv("v ixcache"); | |
238 | if ( vixcache ! = null) | |
239 | { | |
240 | XMLEnc oder xmlEn coder = nu ll; | |
241 | try | |
242 | { | |
243 | String f ileSpec = vixcache + "/dodexch ange" + pa tientIcn + ".xml"; | |
244 | xmlEncod er = new X MLEncoder( new Buffer edOutputSt ream(new F ileOutputS tream(file Spec))); | |
245 | xmlEncod er.writeOb ject(excha ngeStudies ); | |
246 | } | |
247 | catch (FileNotFo undExcepti on ex) | |
248 | { | |
249 | logger.e rror("Erro r dumping study grap h: " + ex. getMessage ()); | |
250 | } | |
251 | finall y | |
252 | { | |
253 | if (xmlE ncoder != null) | |
254 | { | |
255 | xmlEncoder .close(); | |
256 | } | |
257 | } | |
258 | } | |
259 | } | |
260 | ||
261 | pr ivate Exch angeSiteCo nfiguratio n getExcha ngeSiteCon figuration () | |
262 | th rows IOExc eption | |
263 | { | |
264 | if(e xchangeCon figuration == null) | |
265 | { | |
266 | try | |
267 | { | |
268 | exchange Configurat ion = | |
269 | ExchangeDa taSourcePr ovider.get ExchangeCo nfiguratio n().getSit eConfigura tion(getSi te().getSi teNumber() , null); | |
270 | } | |
271 | catch( ExchangeCo nfiguratio nException ecX) | |
272 | { | |
273 | throw ne w IOExcept ion(ecX); | |
274 | } | |
275 | } | |
276 | retu rn exchang eConfigura tion; | |
277 | } | |
278 | ||
279 | /* (non-Java doc) | |
280 | * @see gov. va.med.ima ging.datas ource.Stud yGraphData SourceSpi# getStudy(j ava.lang.S tring, gov .va.med.Gl obalArtifa ctIdentifi er) | |
281 | * / | |
282 | @O verride | |
283 | pu blic Study getStudy( PatientIde ntifier pa tientIdent ifier, Glo balArtifac tIdentifie r studyId) | |
284 | th rows Metho dException , Connecti onExceptio n | |
285 | { | |
286 | thro w new Unsu pportedSer viceMethod Exception( StudyGraph DataSource Spi.class, "getStudy "); | |
287 | } | |
288 | ||
289 | /* (non-Java doc) | |
290 | * @see gov. va.med.ima ging.datas ource.Stud yGraphData SourceSpi# getStudyRe port(java. lang.Strin g, gov.va. med.Global ArtifactId entifier) | |
291 | * / | |
292 | @O verride | |
293 | pu blic Strin g getStudy Report(Pat ientIdenti fier patie ntIdentifi er, Global ArtifactId entifier s tudyId) | |
294 | th rows Metho dException , Connecti onExceptio n | |
295 | { | |
296 | thro w new Unsu pportedSer viceMethod Exception( StudyGraph DataSource Spi.class, "getStudy Report"); | |
297 | } | |
298 | ||
299 | @O verride | |
300 | pu blic List< StoredStud yFilter> g etStoredFi lters(Rout ingToken g lobalRouti ngToken) | |
301 | th rows Metho dException , Connecti onExceptio n { | |
302 | thro w new Unsu pportedSer viceMethod Exception( StudyGraph DataSource Spi.class, "getStore dFilters") ; | |
303 | } | |
304 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.