Produced by Araxis Merge on 10/18/2018 2:02:20 PM 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 | VIX_SIV_v3_0_patch_201_build_8.zip\v3.0_patch_201_build_8\VISA\Java\ImagingDicomRouter\main\src\java\gov\va\med\imaging\core\router\commands | ProcessCFindResultsCommandImpl.java | Thu Oct 11 13:30:16 2018 UTC |
2 | VIX_SIV_v3_0_patch_201_build_8.zip\v3.0_patch_201_build_8\VISA\Java\ImagingDicomRouter\main\src\java\gov\va\med\imaging\core\router\commands | ProcessCFindResultsCommandImpl.java | Wed Oct 17 18:55:21 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 3 | 326 |
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: | |
6 | Site Nam e: Washin gton OI Fi eld Office , Silver S pring, MD | |
7 | Developer: PII | |
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 | ||
27 | package go v.va.med.i maging.cor e.router.c ommands; | |
28 | ||
29 | import gov .va.med.im aging.core .interface s.exceptio ns.Connect ionExcepti on; | |
30 | import gov .va.med.im aging.core .interface s.exceptio ns.MethodE xception; | |
31 | import gov .va.med.im aging.core .router.Ab stractComm andImpl; | |
32 | import gov .va.med.im aging.dico m.common.i nterfaces. IDicomData Set; | |
33 | import gov .va.med.im aging.dico m.common.i nterfaces. IFindSCPRe sponseCall back; | |
34 | import gov .va.med.im aging.dico m.common.s pring.Spri ngContext; | |
35 | import gov .va.med.im aging.dico m.dcftoolk it.common. utilities. DCFConstan ts; | |
36 | import gov .va.med.im aging.dico m.router.f acade.Inte rnalDicomC ontext; | |
37 | import gov .va.med.im aging.dico m.router.f acade.Inte rnalDicomR outer; | |
38 | import gov .va.med.im aging.exch ange.busin ess.dicom. CFindResul ts; | |
39 | import gov .va.med.im aging.exch ange.busin ess.dicom. DicomAE; | |
40 | import gov .va.med.im aging.exch ange.busin ess.dicom. DicomMap; | |
41 | ||
42 | import jav a.util.Has hSet; | |
43 | import jav a.util.con current.Li nkedBlocki ngQueue; | |
44 | ||
45 | import org .apache.lo gging.log4 j.LogManag er; | |
46 | import org .apache.lo gging.log4 j.Logger; | |
47 | ||
48 | /** | |
49 | * This Ro uter comma nd control the creat ion and tr ansmission of C-Find Results t o the DICO M | |
50 | * device as C-Find Responses. | |
51 | * | |
52 | * @author PII | |
53 | * | |
54 | */ | |
55 | public cla ss Process CFindResul tsCommandI mpl extend s | |
56 | Abst ractComman dImpl<Bool ean> { | |
57 | ||
58 | pr ivate stat ic final l ong serial VersionUID = -386257 0755582559 64L; | |
59 | privat e static f inal int M AX_QUEUE_C APACITY = 16; | |
60 | privat e CFindRes ults resul ts = null; | |
61 | privat e DicomAE dicomAE; | |
62 | privat e HashSet< DicomMap> mappingSet = null; | |
63 | privat e IFindSCP ResponseCa llback cFi ndCallback = null; | |
64 | privat e LinkedBl ockingQueu e<IDicomDa taSet> res ponseQueue = null; | |
65 | ||
66 | privat e IDicomDa taSet LAST BAG = null ; | |
67 | ||
68 | pr ivate Logg er logger = LogManag er.getLogg er(Process CFindResul tsCommandI mpl.class) ; | |
69 | privat e static L ogger summ aryLogger = LogManag er.getLogg er("Summar y"); | |
70 | ||
71 | pu blic Proce ssCFindRes ultsComman dImpl(CFin dResults r esults, Di comAE dico mAE, | |
72 | IFindSCP ResponseCa llback cFi ndCallback ) { | |
73 | this .results = results; | |
74 | this .dicomAE = dicomAE; | |
75 | this .mappingSe t = result s.getReque stMappingS et(); | |
76 | this .cFindCall back = cFi ndCallback ; | |
77 | LAST BAG = (IDi comDataSet )SpringCon text.getCo ntext().ge tBean("Dic omDataSet" ); | |
78 | } | |
79 | ||
80 | @O verride | |
81 | pu blic Boole an callSyn chronously InTransact ionContext () | |
82 | throws Met hodExcepti on, Connec tionExcept ion { | |
83 | ||
84 | this .responseQ ueue = new LinkedBlo ckingQueue <IDicomDat aSet>(MAX_ QUEUE_CAPA CITY); | |
85 | In ternalDico mRouter ro uter = Int ernalDicom Context.ge tRouter(); | |
86 | ||
87 | ro uter.postC FindResult s(this.res ults, this .dicomAE, this.mappi ngSet, res ponseQueue , LASTBAG) ; | |
88 | ||
89 | // Perform th e sending from this router com mand. | |
90 | in t objectRe sultStatus = 0; | |
91 | in t simpleCo unter = 1; | |
92 | bo olean loop Done = fal se; | |
93 | ||
94 | lo gger.info( this.getCl ass().getN ame()+": D icom Toolk it layer: " + | |
95 | ". ..returnin g C-Find R esponses t o C-Find S CU."); | |
96 | tr y{ | |
97 | //wh ile loop. | |
98 | whil e (!loopDo ne){ | |
99 | IDicomData Set ddsImp l; | |
100 | ||
101 | //The resp onse list should be a collecti on of Dico mDataSet o bjects. | |
102 | //Get the next dicom dataset ob ject from the collec tion. | |
103 | ||
104 | ddsImpl = this.respo nseQueue.t ake(); | |
105 | if(ddsImpl == LASTBA G){ | |
106 | //this .responseQ ueue.put(d dsImpl); | |
107 | loopDo ne = true; | |
108 | } | |
109 | else{ | |
110 | //Send the Dicom DataSet ob ject to th e SCU via | |
111 | //the DicomDataS erviceList ener. | |
112 | ||
113 | object ResultStat us = this. cFindCallb ack.cFindR esponseRes ult(DCFCon stants.DIM SE_STATUS_ PENDING, d dsImpl); | |
114 | logger .debug("Th e returned Status fr om the Ass ociation H andler is: "+ | |
115 | objectRe sultStatus ); | |
116 | logger .info("C-F ind Respon se Number: "+simpleC ounter); | |
117 | simple Counter++; | |
118 | ||
119 | if(obj ectResultS tatus == D CFConstant s.DIMSE_ST ATUS_CANCE L){ | |
120 | // send a Can celled Dim se Message to SCU. | |
121 | lo gger.info( "...Object Result St atus is CA NCEL."); | |
122 | lo gger.warn( "Received C-Find-Can cel from S CU."); | |
123 | lo gger.warn( this.getCl ass().getN ame()+": D icom Toolk it Layer: " | |
124 | +"Ca ncel sendi ng C-Find Responses. "); | |
125 | th is.cFindCa llback.cFi ndResponse Complete(D CFConstant s.DIMSE_ST ATUS_CANCE L, null); | |
126 | re turn true; | |
127 | } | |
128 | ||
129 | if(obj ectResultS tatus != D CFConstant s.DIMSE_ST ATUS_SUCCE SS){ | |
130 | lo gger.info( "...Object Result St atus is ER ROR."); | |
131 | // REMINDER C ommented t his method at one ti me. I bel ieve when I throw an exception to the DC F | |
132 | // Toolkit, t he Toolkit itself ha ndles the release of the assoc iation. | |
133 | // I'm puttin g it back into play because ot her except ions calls this meth od. | |
134 | th is.cFindCa llback.cFi ndResponse Complete(D CFConstant s.DIMSE_ST ATUS_OUT_O F_RESOURCE S, null); | |
135 | re turn true; | |
136 | } | |
137 | } | |
138 | //not sure if I have to null d ds before reassignin g to new r eference. | |
139 | //ddsImpl = null; | |
140 | } | |
141 | } | |
142 | ca tch(Interr uptedExcep tion iX){ | |
143 | logger.e rror(this. getClass() .getName() +": Except ion thrown during C- Find Respo nses."); | |
144 | summaryL ogger.erro r("Failed to transmi t C-Find R esponse to the C-Fin d SCU. Th e result i s all Resp onses may not have b een sent t o the C-Fi nd SCU.\n" + | |
145 | "Refer to other logs for m ore detail ."); | |
146 | this.cFi ndCallback .cFindResp onseComple te(DCFCons tants.DIMS E_STATUS_O UT_OF_RESO URCES, nul l); | |
147 | throw ne w MethodEx ception("E xception t hrown duri ng C-Find Responses. "); | |
148 | } | |
149 | ||
150 | lo gger.info( "Returning CFind Com plete Resp onse."); | |
151 | th is.cFindCa llback.cFi ndResponse Complete(D CFConstant s.DIMSE_ST ATUS_SUCCE SS, null); | |
152 | re turn true; | |
153 | } | |
154 | ||
155 | ||
156 | @O verride | |
157 | pu blic boole an equals( Object obj ) { | |
158 | retu rn false; | |
159 | } | |
160 | ||
161 | @O verride | |
162 | pr otected St ring param eterToStri ng() { | |
163 | retu rn ""; | |
164 | } | |
165 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.