Produced by Araxis Merge on 3/25/2019 8:58:04 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\ViewerImagingDataSourceProvider\main\src\java\gov\va\med\imaging\viewer\datasource | ViewerImagingTranslator.java | Mon Mar 18 20:39:10 2019 UTC |
2 | C:\AraxisMergeCompare\Pri_re\IMAG_Source\VISA\Java\ViewerImagingDataSourceProvider\main\src\java\gov\va\med\imaging\viewer\datasource | ViewerImagingTranslator.java | Tue Mar 19 12:04:08 2019 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 3 | 836 |
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 | * Date Cr eated: Apr 26, 2017 | |
4 | * Develop er: DNS tjahjb | |
5 | */ | |
6 | package go v.va.med.i maging.vie wer.dataso urce; | |
7 | ||
8 | ||
9 | import jav a.text.Dat eFormat; | |
10 | import jav a.text.Sim pleDateFor mat; | |
11 | import jav a.util.Arr ayList; | |
12 | import jav a.util.Dat e; | |
13 | import jav a.util.Has hSet; | |
14 | import jav a.util.Lis t; | |
15 | import jav a.util.Map ; | |
16 | ||
17 | import org .apache.lo gging.log4 j.LogManag er; | |
18 | import org .apache.lo gging.log4 j.Logger; | |
19 | ||
20 | import gov .va.med.UR NFactory; | |
21 | import gov .va.med.im aging.Imag eURN; | |
22 | import gov .va.med.im aging.core .interface s.exceptio ns.MethodE xception; | |
23 | import gov .va.med.im aging.exce ptions.URN FormatExce ption; | |
24 | import gov .va.med.im aging.url. vista.Stri ngUtils; | |
25 | import gov .va.med.im aging.view er.busines s.CaptureU serResult; | |
26 | import gov .va.med.im aging.view er.busines s.DeleteIm ageUrnResu lt; | |
27 | import gov .va.med.im aging.view er.busines s.FlagSens itiveImage UrnResult; | |
28 | import gov .va.med.im aging.view er.busines s.ImageFil terFieldVa lue; | |
29 | import gov .va.med.im aging.view er.busines s.ImageFil terResult; | |
30 | import gov .va.med.im aging.view er.busines s.ImagePro perty; | |
31 | import gov .va.med.im aging.view er.busines s.LogAcces sImageUrnR esult; | |
32 | import gov .va.med.im aging.view er.busines s.QAReview ReportResu lt; | |
33 | import gov .va.med.im aging.view er.busines s.Treating FacilityRe sult; | |
34 | ||
35 | /** | |
36 | * @author DNS tjahjb | |
37 | * | |
38 | */ | |
39 | public cla ss ViewerI magingTran slator | |
40 | { | |
41 | pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(View erImagingT ranslator. class); | |
42 | ||
43 | pu blic stati c List<Del eteImageUr nResult> t ranslateDe leteImages Result( | |
44 | String deleteIma gesResult, | |
45 | Map<St ring, Stri ng> imageU rnMap) | |
46 | { | |
47 | List <DeleteIma geUrnResul t> rows = new ArrayL ist<Delete ImageUrnRe sult>(); | |
48 | ||
49 | Stri ng [] line s = String Utils.Spli t(deleteIm agesResult , StringUt ils.NEW_LI NE); | |
50 | ||
51 | for( int i = 0; i < lines .length; i ++) | |
52 | { | |
53 | Delete ImageUrnRe sult delet eResult = new Delete ImageUrnRe sult( | |
54 | imageUrnMa p.get(Stri ngUtils.Ma gPiece(lin es[i].trim (), String Utils.CARE T, 1)), | |
55 | StringUtil s.MagPiece (lines[i]. trim(), St ringUtils. CARET, 2), | |
56 | StringUtil s.MagPiece (lines[i]. trim(), St ringUtils. CARET, 3) | |
57 | ); | |
58 | rows.a dd(deleteR esult); | |
59 | } | |
60 | ||
61 | retu rn rows; | |
62 | ||
63 | } | |
64 | ||
65 | pu blic stati c String g etImageIen (String im ageUrn) | |
66 | { | |
67 | Imag eURN urn; | |
68 | try { | |
69 | urn = URNFactory .create(im ageUrn, Im ageURN.cla ss); | |
70 | if ((u rn.getImag eId() == n ull) || (u rn.getImag eId().isEm pty())) | |
71 | { | |
72 | return i mageUrn; | |
73 | } | |
74 | else | |
75 | { | |
76 | return u rn.getImag eId(); | |
77 | } | |
78 | } ca tch (URNFo rmatExcept ion e) { | |
79 | return imageUrn; | |
80 | } | |
81 | } | |
82 | ||
83 | pu blic stati c List<Fla gSensitive ImageUrnRe sult> tran slateFlagS ensitiveIm agesResult ( | |
84 | String flagSensi tiveImages Result, | |
85 | Map<St ring, Stri ng> imageU rnMap) | |
86 | { | |
87 | List <FlagSensi tiveImageU rnResult> rows = new ArrayList <FlagSensi tiveImageU rnResult>( ); | |
88 | ||
89 | Stri ng [] line s = String Utils.Spli t(flagSens itiveImage sResult, S tringUtils .NEW_LINE) ; | |
90 | ||
91 | for( int i = 0; i < lines .length; i ++) | |
92 | { | |
93 | FlagSe nsitiveIma geUrnResul t flagResu lt = new F lagSensiti veImageUrn Result( | |
94 | imageUrnMa p.get(Stri ngUtils.Ma gPiece(lin es[i].trim (), String Utils.CARE T, 1)), | |
95 | StringUtil s.MagPiece (lines[i]. trim(), St ringUtils. CARET, 2), | |
96 | StringUtil s.MagPiece (lines[i]. trim(), St ringUtils. CARET, 3) | |
97 | ); | |
98 | rows.a dd(flagRes ult); | |
99 | } | |
100 | ||
101 | retu rn rows; | |
102 | ||
103 | } | |
104 | ||
105 | pu blic stati c List<Log AccessImag eUrnResult > translat eLogAccess ImagesResu lt( | |
106 | String logAccess ImagesResu lt, | |
107 | Map<St ring, Stri ng> imageU rnMap) | |
108 | { | |
109 | List <LogAccess ImageUrnRe sult> rows = new Arr ayList<Log AccessImag eUrnResult >(); | |
110 | ||
111 | Stri ng [] line s = String Utils.Spli t(logAcces sImagesRes ult, Strin gUtils.NEW _LINE); | |
112 | ||
113 | for( int i = 0; i < lines .length; i ++) | |
114 | { | |
115 | LogAcc essImageUr nResult lo gAccessRes ult = new LogAccessI mageUrnRes ult( | |
116 | imageUrnMa p.get(Stri ngUtils.Ma gPiece(lin es[i].trim (), String Utils.CARE T, 1)), | |
117 | StringUtil s.MagPiece (lines[i]. trim(), St ringUtils. CARET, 2), | |
118 | StringUtil s.MagPiece (lines[i]. trim(), St ringUtils. CARET, 3) | |
119 | ); | |
120 | rows.a dd(logAcce ssResult); | |
121 | } | |
122 | ||
123 | retu rn rows; | |
124 | ||
125 | } | |
126 | ||
127 | pu blic stati c List<Del eteImageUr nResult> m ergeDelete ImagesErro rResult( | |
128 | List<D eleteImage UrnResult> deletedLi st, List<S tring> p34 ImageUrns) | |
129 | { | |
130 | if ( deletedLis t == null) | |
131 | { | |
132 | delete dList = ne w ArrayLis t<DeleteIm ageUrnResu lt>(); | |
133 | } | |
134 | ||
135 | for (String p3 4ImageUrn: p34ImageU rns) | |
136 | { | |
137 | Delete ImageUrnRe sult delet eResult = new Delete ImageUrnRe sult( | |
138 | p34Image Urn, | |
139 | "ERROR", | |
140 | "Deletin g this URN type has not been i mplemented "); | |
141 | delete dList.add( deleteResu lt); | |
142 | } | |
143 | ||
144 | retu rn deleted List; | |
145 | ||
146 | } | |
147 | ||
148 | pu blic stati c List<Log AccessImag eUrnResult > mergeLog AccessErro rResult( | |
149 | List<L ogAccessIm ageUrnResu lt> logAcc essList, L ist<String > p34Image Urns) | |
150 | { | |
151 | if ( logAccessL ist == nul l) | |
152 | { | |
153 | logAcc essList = new ArrayL ist<LogAcc essImageUr nResult>() ; | |
154 | } | |
155 | ||
156 | for (String p3 4ImageUrn: p34ImageU rns) | |
157 | { | |
158 | ||
159 | LogAcc essImageUr nResult lo gAccessRes ult = new LogAccessI mageUrnRes ult( | |
160 | p34Image Urn, | |
161 | "ERROR", | |
162 | "Logging Access of this URN type has n ot been im plemented" ); | |
163 | logAcc essList.ad d(logAcces sResult); | |
164 | } | |
165 | ||
166 | retu rn logAcce ssList; | |
167 | ||
168 | } | |
169 | ||
170 | pu blic stati c List<Fla gSensitive ImageUrnRe sult> merg eFlagSensi tiveErrorR esult( | |
171 | List<F lagSensiti veImageUrn Result> fl agSensitiv eList, Lis t<String> p34ImageUr ns) | |
172 | { | |
173 | if ( flagSensit iveList == null) | |
174 | { | |
175 | flagSe nsitiveLis t = new Ar rayList<Fl agSensitiv eImageUrnR esult>(); | |
176 | } | |
177 | ||
178 | for (String p3 4ImageUrn: p34ImageU rns) | |
179 | { | |
180 | FlagSe nsitiveIma geUrnResul t flagResu lt = new F lagSensiti veImageUrn Result( | |
181 | p34Image Urn, | |
182 | "ERROR", | |
183 | "Marking this URN type as se nsitive ha s not been implement ed"); | |
184 | flagSe nsitiveLis t.add(flag Result); | |
185 | } | |
186 | ||
187 | retu rn flagSen sitiveList ; | |
188 | ||
189 | } | |
190 | ||
191 | ||
192 | pu blic stati c List<Tre atingFacil ityResult> convertTr eatingFaci lities( | |
193 | String vistaResu lt) | |
194 | { | |
195 | List <TreatingF acilityRes ult> resul t = new Ar rayList<Tr eatingFaci lityResult >(); | |
196 | ||
197 | if(v istaResult != null) | |
198 | { | |
199 | String [] lines = StringUt ils.Split( vistaResul t.trim(), StringUtil s.NEW_LINE ); | |
200 | if(lin es.length <= 0) | |
201 | { | |
202 | logger.w arn("Got e mpty strin g results from VistA for treat ing sites, this shou ldn't happ en!"); | |
203 | } | |
204 | else i f(lines.le ngth > 0) | |
205 | { | |
206 | for(int i = 0; i < lines.len gth; i++) | |
207 | { | |
208 | String [] pieces = S tringUtils .Split(lin es[i], Str ingUtils.C ARET); | |
209 | String vis itDate = v istaDate2N ormalDate( pieces[2]) ; | |
210 | TreatingFa cilityResu lt res = n ew Treatin gFacilityR esult( | |
211 | p ieces[0], | |
212 | p ieces[1], | |
213 | v isitDate, | |
214 | p ieces[4]); | |
215 | result.add (res); | |
216 | } | |
217 | } | |
218 | } | |
219 | retu rn result; | |
220 | } | |
221 | ||
222 | pr ivate stat ic String vistaDate2 NormalDate (String vi staDate) | |
223 | { | |
224 | Stri ng result = ""; | |
225 | ||
226 | if ( !vistaDate .isEmpty() ) | |
227 | { | |
228 | String [] vistaDa teTime = v istaDate.s plit("\\." ); | |
229 | String yyyymmdd = Integer. toString(I nteger.par seInt(vist aDateTime[ 0]) + 1700 0000); | |
230 | ||
231 | String yyyy = yy yymmdd.sub string(0,4 ); | |
232 | String mm = yyyy mmdd.subst ring(4,6); | |
233 | String dd = yyyy mmdd.subst ring(6,8); | |
234 | ||
235 | if (vi staDateTim e.length > 1) | |
236 | { | |
237 | String V istaTime = vistaTime 2NormalTim e(vistaDat eTime[1]); | |
238 | String v istaTimeHo ur = Vista Time.subst ring(0,2); | |
239 | String v istaTimeMi n = VistaT ime.substr ing(2,4); | |
240 | String v istaTimeSe c = VistaT ime.substr ing(4,6); | |
241 | ||
242 | result = mm + "/" + dd + "/" + yyyy + " " + | |
243 | vi staTimeHou r + ":" + | |
244 | vi staTimeMin + ":" + | |
245 | vi staTimeSec ; | |
246 | } | |
247 | else | |
248 | { | |
249 | result = mm + "/" + dd + "/" + yyyy; | |
250 | } | |
251 | } | |
252 | retu rn result; | |
253 | } | |
254 | ||
255 | pr ivate stat ic String vistaTime2 NormalTime (String vi staTime) | |
256 | { | |
257 | Stri ng result = vistaTim e; | |
258 | int add = 6 - vistaTime. length(); | |
259 | for (int i = 0 ; i < add; i++) | |
260 | { | |
261 | result += "0"; | |
262 | } | |
263 | retu rn result; | |
264 | } | |
265 | ||
266 | ||
267 | pu blic stati c List<Cap tureUserRe sult> conv ertCapture Users( | |
268 | String vistaResu lt) | |
269 | { | |
270 | List <CaptureUs erResult> result = n ew ArrayLi st<Capture UserResult >(); | |
271 | ||
272 | if(v istaResult != null) | |
273 | { | |
274 | String [] lines = StringUt ils.Split( vistaResul t.trim(), StringUtil s.CRLF); | |
275 | if(lin es.length <= 0) | |
276 | { | |
277 | CaptureU serResult res = new CaptureUse rResult( | |
278 | " 0", | |
279 | " Got empty string res ults from VistA call ing MAGG C APTURE USE RS" | |
280 | ); | |
281 | result.a dd(res); | |
282 | } | |
283 | else i f (lines[0 ].startsWi th("0")) | |
284 | { | |
285 | if (!lin es[0].cont ains("No u sers found .")) | |
286 | { | |
287 | CaptureUse rResult re s = new Ca ptureUserR esult( | |
288 | "0" , | |
289 | Str ingUtils.P iece(lines [0], Strin gUtils.CAR ET, 2) | |
290 | ); | |
291 | result.add (res); | |
292 | } | |
293 | } | |
294 | else | |
295 | { | |
296 | for(int i = 1; i < lines.len gth; i++) | |
297 | { | |
298 | String [] pieces = S tringUtils .Split(lin es[i], Str ingUtils.C ARET); | |
299 | CaptureUse rResult re s = new Ca ptureUserR esult( | |
300 | p ieces[1], | |
301 | p ieces[0]); | |
302 | result.add (res); | |
303 | } | |
304 | } | |
305 | } | |
306 | retu rn result; | |
307 | } | |
308 | ||
309 | pu blic stati c List<Ima geFilterRe sult> conv ertImageFi lters( | |
310 | String imageFilt ers) | |
311 | { | |
312 | List <ImageFilt erResult> rows = new ArrayList <ImageFilt erResult>( ); | |
313 | ||
314 | Stri ng [] line s = String Utils.Spli t(imageFil ters, Stri ngUtils.NE W_LINE); | |
315 | ||
316 | for( int i = 0; i < lines .length; i ++) | |
317 | { | |
318 | ImageF ilterResul t imageFil ter = new ImageFilte rResult( | |
319 | StringUtil s.MagPiece (lines[i]. trim(), St ringUtils. CARET, 1), | |
320 | StringUtil s.MagPiece (lines[i]. trim(), St ringUtils. CARET, 2), | |
321 | StringUtil s.MagPiece (lines[i]. trim(), St ringUtils. CARET, 3) | |
322 | ); | |
323 | rows.a dd(imageFi lter); | |
324 | } | |
325 | ||
326 | retu rn rows; | |
327 | ||
328 | } | |
329 | ||
330 | pu blic stati c List<Ima geFilterFi eldValue> convertIma geFilterDe tail( | |
331 | String imageFilt erDetail) | |
332 | { | |
333 | List <ImageFilt erFieldVal ue> rows = new Array List<Image FilterFiel dValue>(); | |
334 | ||
335 | Stri ng [] line s = String Utils.Spli t(imageFil terDetail, StringUti ls.NEW_LIN E); | |
336 | if ( lines.leng th < 2) | |
337 | return null; | |
338 | ||
339 | Stri ng [] fiel dValues = StringUtil s.Split(li nes[1], St ringUtils. CARET); | |
340 | ||
341 | for( int i = 0; i < field Values.len gth; i++) | |
342 | { | |
343 | if (!f ieldValues [i].isEmpt y()) | |
344 | { | |
345 | String f ieldNumber = Integer .toString( i); | |
346 | if (i == 1) | |
347 | { | |
348 | fieldNumbe r = ".01"; | |
349 | } | |
350 | else if (i > 1) | |
351 | { | |
352 | fieldNumbe r = Intege r.toString (i-1); | |
353 | } | |
354 | ||
355 | ImageFil terFieldVa lue filter FieldValue = new Ima geFilterFi eldValue(f ieldNumber , fieldVal ues[i]); | |
356 | rows.add (filterFie ldValue); | |
357 | } | |
358 | } | |
359 | ||
360 | retu rn rows; | |
361 | ||
362 | } | |
363 | ||
364 | pu blic stati c List<QAR eviewRepor tResult> c onvertQARe viewReport s(String q aReviewRep orts) | |
365 | { | |
366 | List <QAReviewR eportResul t> rows = new ArrayL ist<QARevi ewReportRe sult>(); | |
367 | ||
368 | Stri ng [] line s = String Utils.Spli t(qaReview Reports, S tringUtils .NEW_LINE) ; | |
369 | if ( lines.leng th < 2) | |
370 | return null; | |
371 | ||
372 | for( int i = 1; i < lines .length; i ++) | |
373 | { | |
374 | String line = li nes[i]; | |
375 | String flag = St ringUtils. Piece(line , StringUt ils.CARET, 1); | |
376 | String fromDate = StringUt ils.Piece( line, Stri ngUtils.CA RET, 2); | |
377 | String throughDa te = Strin gUtils.Pie ce(line, S tringUtils .CARET, 3) ; | |
378 | String reportSta rtDateTime = StringU tils.Piece (line, Str ingUtils.C ARET, 4); | |
379 | String reportCom pletedDate Time = Str ingUtils.P iece(line, StringUti ls.CARET, 5); | |
380 | ||
381 | QARevi ewReportRe sult rpt = new QARev iewReportR esult(flag , fromDate , throughD ate, | |
382 | reportStar tDateTime, reportCom pletedDate Time); | |
383 | ||
384 | rows.a dd(rpt); | |
385 | } | |
386 | ||
387 | retu rn rows; | |
388 | } | |
389 | ||
390 | pu blic stati c List<Ima geProperty > convertI mageProper ties(Strin g rtn) | |
391 | { | |
392 | List <ImageProp erty> rows = new Arr ayList<Ima geProperty >(); | |
393 | ||
394 | Stri ng [] line s = String Utils.Spli t(rtn, Str ingUtils.C RLF); | |
395 | if ( lines.leng th == 1) | |
396 | return null; | |
397 | ||
398 | if ( !lines[0]. startsWith ("1")) | |
399 | { | |
400 | ImageP roperty pr op = new I mageProper ty("ERROR" ,rtn); | |
401 | rows.a dd(prop); | |
402 | return rows; | |
403 | } | |
404 | ||
405 | for( int i = 1; i < lines .length; i ++) | |
406 | { | |
407 | String line = li nes[i]; | |
408 | String propName = StringUt ils.Piece( line, Stri ngUtils.CA RET, 1); | |
409 | String internalV alue = Str ingUtils.P iece(line, StringUti ls.CARET, 3); | |
410 | String externalV alue = Str ingUtils.P iece(line, StringUti ls.CARET, 4); | |
411 | ||
412 | ImageP roperty pr op = new I mageProper ty(propNam e,internal Value + St ringUtils. CARET + ex ternalValu e); | |
413 | rows.a dd(prop); | |
414 | } | |
415 | ||
416 | retu rn rows; | |
417 | } | |
418 | ||
419 | ||
420 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.