Produced by Araxis Merge on 6/5/2018 10:24:11 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\ImagingTestResources\main\src\java\gov\va\med\imaging\translator\test | TranslatorTestBusinessObjectBuilder.java | Wed May 30 14:35:26 2018 UTC |
2 | patch_205_build_9.zip\Java\ImagingTestResources\main\src\java\gov\va\med\imaging\translator\test | TranslatorTestBusinessObjectBuilder.java | Mon Jun 4 15:49:09 2018 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 3 | 484 |
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: Mar 20, 2008 | |
6 | Site Nam e: Washin gton OI Fi eld Office , Silver S pring, MD | |
7 | Developer: PI I
|
|
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.tra nslator.te st; | |
27 | ||
28 | import gov .va.med.Pa tientIdent ifier; | |
29 | import gov .va.med.im aging.P34I mageURN; | |
30 | import gov .va.med.im aging.busi ness.TestS ite; | |
31 | import gov .va.med.im aging.exce ptions.URN FormatExce ption; | |
32 | import gov .va.med.im aging.exch ange.Image AccessLogE vent; | |
33 | import gov .va.med.im aging.exch ange.Image AccessLogE vent.Image AccessLogE ventType; | |
34 | import gov .va.med.im aging.exch ange.busin ess.Image; | |
35 | import gov .va.med.im aging.exch ange.busin ess.Patien t; | |
36 | import gov .va.med.im aging.exch ange.busin ess.Series ; | |
37 | import gov .va.med.im aging.exch ange.busin ess.Site; | |
38 | import gov .va.med.im aging.exch ange.busin ess.Study; | |
39 | import gov .va.med.im aging.exch ange.busin ess.Patien t.PatientS ex; | |
40 | import gov .va.med.im aging.exch ange.enums .ObjectOri gin; | |
41 | import gov .va.med.im aging.exch ange.enums .StudyDele tedImageSt ate; | |
42 | import gov .va.med.im aging.exch ange.enums .StudyLoad Level; | |
43 | ||
44 | import jav a.util.Dat e; | |
45 | import jav a.util.Ran dom; | |
46 | ||
47 | /** | |
48 | * This to ol creates test busi ness objec ts for use in unit t ests. This should NO T be used | |
49 | * in any production code | |
50 | * | |
51 | * @author PI I
|
|
52 | * | |
53 | */ | |
54 | public cla ss Transla torTestBus inessObjec tBuilder | |
55 | { | |
56 | ||
57 | pr ivate fina l static R andom rand omGenerato r = new Ra ndom(Syste m.currentT imeMillis( )); | |
58 | ||
59 | // identifie r values u sed to cre ate consis tent fake data | |
60 | pr ivate fina l static S tring STUD Y_IEN = "4 2"; | |
61 | pr ivate fina l static S tring PATI ENT_ICN = "655321"; | |
62 | pr ivate fina l static S tring PATI ENT_DFN = "123556"; | |
63 | pr ivate fina l static i nt SERIES_ IEN_START = 100; | |
64 | pr ivate fina l static i nt SERIES_ COUNT = 3; | |
65 | pr ivate fina l static i nt SERIES_ NUMBER_STA RT = 1; | |
66 | pr ivate fina l static i nt IMAGE_C OUNT = 50; | |
67 | pr ivate fina l static i nt IMAGE_I EN_START = 1000; | |
68 | pr ivate fina l static i nt IMAGE_U ID_START = 2000; | |
69 | pr ivate fina l static i nt IMAGE_D ISPLAY_STA RT = 1; | |
70 | ||
71 | pr ivate stat ic int ser iesIen = S ERIES_IEN_ START; | |
72 | pr ivate stat ic String getNextSer iesIen(){r eturn "" + seriesIen ++;} | |
73 | pr ivate stat ic int ser iesNumber = SERIES_N UMBER_STAR T; | |
74 | pr ivate stat ic String getNextSer iesNumber( ){return " " + series Number++;} | |
75 | pr ivate stat ic int ima geIen = IM AGE_IEN_ST ART; | |
76 | pr ivate stat ic String getNextIma geIen(){re turn "" + imageIen++ ;} | |
77 | pr ivate stat ic int ima geUid = IM AGE_UID_ST ART; | |
78 | pr ivate stat ic String getNextIma geUid(){re turn "" + imageUid++ ;} | |
79 | pr ivate stat ic int get ImageType( ){return 4 2;} | |
80 | pr ivate stat ic int dic omImageFor Display = IMAGE_DISP LAY_START; | |
81 | pr ivate stat ic String getNextDic omImageFor Display(){ return "" + dicomIma geForDispl ay++;} | |
82 | ||
83 | pu blic stati c Site cre ateSite() | |
84 | { | |
85 | retu rn new Tes tSite("Tes t Site Nam e", "123", "Abbr"); | |
86 | } | |
87 | ||
88 | pu blic stati c Study cr eateStudy( Site site) | |
89 | th rows URNFo rmatExcept ion | |
90 | { | |
91 | retu rn createS tudy(site, null); | |
92 | } | |
93 | ||
94 | @S uppressWar nings("dep recation") | |
95 | pu blic stati c Study cr eateStudy( Site site, String co nsolidated SiteNumber ) | |
96 | th rows URNFo rmatExcept ion | |
97 | { | |
98 | Stud y study = Study.crea te(ObjectO rigin.DOD, site.getS iteNumber( ), | |
99 | STUDY_ IEN, Patie ntIdentifi er.icnPati entIdentif ier(PATIEN T_ICN), St udyLoadLev el.FULL, | |
100 | StudyD eletedImag eState.can notInclude DeletedIma ges); | |
101 | stud y.setCaptu reBy("Capt uredBy"); | |
102 | stud y.setCaptu reDate("20 0701141825 "); | |
103 | stud y.setDescr iption("[1 10201223] Descriptio n"); | |
104 | stud y.setEvent ("Event"); | |
105 | stud y.setImage Package("i mage packa ge"); | |
106 | stud y.setImage Type("Imag e type"); | |
107 | stud y.setNoteT itle("Note title"); | |
108 | stud y.setOrigi n("DOD"); | |
109 | //st udy.setPat ientIcn(ge tPositiveR andomNumbe r() + ""); | |
110 | stud y.setPatie ntName("Pa tient name "); | |
111 | stud y.setProce dure("Proc edure"); | |
112 | stud y.setProce dureDate(n ew Date()) ; | |
113 | stud y.setRadio logyReport ("Report") ; | |
114 | stud y.setRpcRe sponseMsg( "rpc respo nse"); | |
115 | stud y.setSiteA bbr(site.g etSiteAbbr ()); | |
116 | stud y.setSiteN ame(site.g etSiteName ()); | |
117 | stud y.setSpeci alty("Spec ialty"); | |
118 | stud y.setStudy Class("stu dy class") ; | |
119 | stud y.setStudy Uid("uid.1 23.study.4 56"); | |
120 | stud y.addModal ity("CR"); | |
121 | stud y.addModal ity("MR"); | |
122 | stud y.setAlter nateExamNu mber("1102 01223"); | |
123 | ||
124 | if(c onsolidate dSiteNumbe r != null) | |
125 | study. setConsoli datedSiteN umber(cons olidatedSi teNumber); | |
126 | ||
127 | Imag e firstIma ge = null; | |
128 | int seriesCoun t = SERIES _COUNT; | |
129 | for( int i = 0; i < serie sCount; i+ +) | |
130 | { | |
131 | Series series = createSeri es(study, site, cons olidatedSi teNumber); | |
132 | study. addSeries( series); | |
133 | study. setImageCo unt(study. getImageCo unt() + se ries.getIm ageCount() ); | |
134 | if(fir stImage == null) | |
135 | { | |
136 | if(serie s.getImage Count() > 0) | |
137 | { | |
138 | firstImage = getFirs tImage(ser ies); | |
139 | } | |
140 | } | |
141 | } | |
142 | if(f irstImage != null) | |
143 | { | |
144 | study. setFirstIm ageIen(fir stImage.ge tIen()); | |
145 | study. setFirstIm age(firstI mage); | |
146 | } | |
147 | retu rn study; | |
148 | } | |
149 | ||
150 | pu blic stati c Series c reateSerie s(Study st udy, Site site) | |
151 | th rows URNFo rmatExcept ion | |
152 | { | |
153 | retu rn createS eries(stud y, site, n ull); | |
154 | } | |
155 | ||
156 | pu blic stati c Series c reateSerie s(Study st udy, Site site, Stri ng consoli datedSiteN umber) | |
157 | th rows URNFo rmatExcept ion | |
158 | { | |
159 | Seri es series = Series.c reate(Obje ctOrigin.D OD, getNex tSeriesIen (), getNex tSeriesNum ber()); | |
160 | seri es.setModa lity("CR") ; | |
161 | seri es.setSeri esUid("uid .series.12 3.456"); | |
162 | //Sy stem.out.p rintln("cr eated seri es with nu mber [" + series.get SeriesNumb er() + "]" ); | |
163 | int imgCount = IMAGE_COU NT; | |
164 | for( int i = 0; i < imgCo unt; i++) | |
165 | { | |
166 | Image image = cr eateImage( study, sit e, series, consolida tedSiteNum ber); | |
167 | series .addImage( image); | |
168 | } | |
169 | retu rn series; | |
170 | } | |
171 | ||
172 | pu blic stati c Image cr eateImage( Study stud y, Site si te, Series series) | |
173 | th rows URNFo rmatExcept ion | |
174 | { | |
175 | retu rn createI mage(study , site, se ries, null ); | |
176 | } | |
177 | ||
178 | pu blic stati c Image cr eateImage( Study stud y, Site si te, Series series, | |
179 | String consolida tedSiteNum ber) | |
180 | th rows URNFo rmatExcept ion | |
181 | { | |
182 | Imag e image = Image.crea te(site.ge tSiteNumbe r(), getNe xtImageIen (), study. getStudyIe n(), | |
183 | PatientI dentifier. icnPatient Identifier (PATIENT_I CN), serie s.getModal ity()); | |
184 | imag e.setAbsFi lename("\\ \\server\\ share\\fil e.abs"); | |
185 | imag e.setAbsLo cation("A" ); | |
186 | imag e.setBigFi lename("\\ \\server\\ share\\fil e.big"); | |
187 | imag e.setDescr iption("[1 10201223] Image desc ription"); | |
188 | imag e.setDicom ImageNumbe rForDispla y(getNextD icomImageF orDisplay( )); | |
189 | //im age.setDic omSequence NumberForD isplay(get PositiveRa ndomNumber () + ""); | |
190 | imag e.setDicom SequenceNu mberForDis play(serie s.getSerie sNumber()) ; | |
191 | imag e.setFullF ilename("\ \\\server\ \share\\fi le.tga"); | |
192 | imag e.setFullL ocation("M "); | |
193 | //im age.setGro upIen(seri es.getSeri esIen()); | |
194 | imag e.setImage Class("ima ge class") ; | |
195 | //im age.setIma geModality ("CR"); | |
196 | imag e.setImage Number(ima ge.getDico mImageNumb erForDispl ay()); | |
197 | imag e.setImage Uid(getNex tImageUid( )); | |
198 | imag e.setImgTy pe(getImag eType()); | |
199 | imag e.setObjec tOrigin(Ob jectOrigin .DOD); | |
200 | imag e.setPatie ntDFN(PATI ENT_DFN); | |
201 | imag e.setPatie ntName("Pa tient name "); | |
202 | imag e.setProce dure("Proc edure"); | |
203 | imag e.setProce dureDate(n ew Date()) ; | |
204 | imag e.setQaMes sage("qa m essage"); | |
205 | imag e.setSiteA bbr(site.g etSiteAbbr ()); | |
206 | imag e.setAlter nateExamNu mber("1102 01223"); | |
207 | imag e.setAbsDi skVolumeIe n("AbsDisk VolumeIen" ); | |
208 | imag e.setFullD iskVolumeI en("FullDi skVolumeIe n"); | |
209 | imag e.setFullA rtifactIen ("FullArti factIen"); | |
210 | imag e.setAbsAr tifactIen( "AbsArtifa ctIen"); | |
211 | ||
212 | //im age.setSit eNumber(si te.getSite Number()); | |
213 | if(c onsolidate dSiteNumbe r != null) | |
214 | image. setConsoli datedSiteN umber(cons olidatedSi teNumber); | |
215 | retu rn image; | |
216 | } | |
217 | ||
218 | pr ivate stat ic Image g etFirstIma ge(Series series) | |
219 | { | |
220 | if(s eries.getI mageCount( ) <= 0) | |
221 | return null; | |
222 | for( Image imag e : series ) | |
223 | { | |
224 | return image; | |
225 | } | |
226 | retu rn null; | |
227 | } | |
228 | ||
229 | pu blic stati c Patient createPati ent() | |
230 | { | |
231 | retu rn new Pat ient("patN ame", "icn ", "retire d", | |
232 | PatientS ex.Male, n ew Date(), "12345678 9", null, null); | |
233 | } | |
234 | ||
235 | pu blic stati c ImageAcc essLogEven t createIm ageAccessL ogEvent() | |
236 | { | |
237 | Imag eAccessLog Event imag eAccessLog Event = | |
238 | new Im ageAccessL ogEvent("i mageIen", "dfn", "ic n", "siteN umber", | |
239 | System.cur rentTimeMi llis(), "r eason", "d escription ", | |
240 | ImageAcces sLogEventT ype.IMAGE_ COPY, fals e, "660"); | |
241 | ||
242 | retu rn imageAc cessLogEve nt; | |
243 | } | |
244 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.