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