Produced by Araxis Merge on 12/5/2017 12:06:41 PM Central Standard 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 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\FederationWebApp\main\src\java\gov\va\med\imaging\federation\webservices\translator | FederationWebAppTranslator.java | Mon Dec 4 21:35:22 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\FederationWebApp\main\src\java\gov\va\med\imaging\federation\webservices\translator | FederationWebAppTranslator.java | Mon Dec 4 22:00:44 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 1006 |
| 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 4, 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.fed eration.we bservices. translator ; | |
| 27 | ||
| 28 | import gov .va.med.Gl obalArtifa ctIdentifi er; | |
| 29 | import gov .va.med.Gl obalArtifa ctIdentifi erFactory; | |
| 30 | import gov .va.med.ex ceptions.G lobalArtif actIdentif ierFormatE xception; | |
| 31 | import gov .va.med.im aging.Dico mDateForma t; | |
| 32 | import gov .va.med.im aging.exce ptions.URN FormatExce ption; | |
| 33 | import gov .va.med.im aging.exch ange.Image AccessLogE vent; | |
| 34 | import gov .va.med.im aging.exch ange.Image AccessLogE vent.Image AccessLogE ventType; | |
| 35 | import gov .va.med.im aging.exch ange.busin ess.Image; | |
| 36 | import gov .va.med.im aging.exch ange.busin ess.Patien t; | |
| 37 | import gov .va.med.im aging.exch ange.busin ess.Series ; | |
| 38 | import gov .va.med.im aging.exch ange.busin ess.Study; | |
| 39 | import gov .va.med.im aging.exch ange.busin ess.StudyF ilter; | |
| 40 | import gov .va.med.im aging.exch ange.busin ess.Patien t.PatientS ex; | |
| 41 | import gov .va.med.im aging.exch ange.enums .ObjectOri gin; | |
| 42 | import gov .va.med.im aging.exch ange.enums .PatientSe nsitivityL evel; | |
| 43 | ||
| 44 | import jav a.math.Big Integer; | |
| 45 | import jav a.text.Dat eFormat; | |
| 46 | import jav a.text.Par seExceptio n; | |
| 47 | import jav a.text.Sim pleDateFor mat; | |
| 48 | import jav a.util.Arr ayList; | |
| 49 | import jav a.util.Dat e; | |
| 50 | import jav a.util.Lis t; | |
| 51 | import jav a.util.Loc ale; | |
| 52 | import jav a.util.Set ; | |
| 53 | ||
| 54 | import org .apache.lo gging.log4 j.LogManag er; | |
| 55 | import org .apache.lo gging.log4 j.Logger; | |
| 56 | ||
| 57 | /** | |
| 58 | * @author
|
|
| 59 | * | |
| 60 | */ | |
| 61 | public cla ss Federat ionWebAppT ranslator | |
| 62 | extends Ab stractFede rationWebA ppTranslat or | |
| 63 | { | |
| 64 | pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(Fede rationWebA ppTranslat or.class); | |
| 65 | pr ivate fina l static S tring fede rationWebs erviceLong DateFormat = "MM/dd/ yyyy HH:mm "; | |
| 66 | ||
| 67 | ||
| 68 | pu blic Feder ationWebAp pTranslato r() | |
| 69 | { | |
| 70 | supe r(); | |
| 71 | } | |
| 72 | ||
| 73 | pr ivate Date Format get Federation Webservice LongDateFo rmat() | |
| 74 | { | |
| 75 | retu rn new Sim pleDateFor mat(federa tionWebser viceLongDa teFormat); | |
| 76 | } | |
| 77 | ||
| 78 | /* * | |
| 79 | * Transform a clinica l display webservice FilterTyp e to an in ternal Fil ter instan ce. | |
| 80 | * @throws G lobalArtif actIdentif ierFormatE xception | |
| 81 | * | |
| 82 | * / | |
| 83 | pu blic Study Filter tra nsformFilt er( | |
| 84 | gov. va.med.ima ging.feder ation.webs ervices.ty pes.Federa tionFilter Type filte rType) | |
| 85 | th rows Globa lArtifactI dentifierF ormatExcep tion | |
| 86 | { | |
| 87 | Stud yFilter fi lter = new StudyFilt er(); | |
| 88 | // d efault to the same l evel that was previo usly allow ed. | |
| 89 | filt er.setMaxi mumAllowed Level(Pati entSensiti vityLevel. DISPLAY_WA RNING_REQU IRE_OK); | |
| 90 | if(f ilterType != null) | |
| 91 | { | |
| 92 | DateFo rmat df = getFederat ionWebserv iceShortDa teFormat() ; | |
| 93 | ||
| 94 | Date f romDate = null; | |
| 95 | try | |
| 96 | { | |
| 97 | fromDate = filterT ype.getFro mDate() == null || filterType .getFromDa te().lengt h() == 0 ? null : df .parse(fil terType.ge tFromDate( )); | |
| 98 | } | |
| 99 | catch (ParseExce ption x) | |
| 100 | { | |
| 101 | logger.e rror("Pars eException convertin g webservi ce format string fro m-date '" + filterT ype.getFro mDate() + "' to inte rnal Date" , x); | |
| 102 | fromDate = null; | |
| 103 | } | |
| 104 | ||
| 105 | Date t oDate = nu ll; | |
| 106 | try | |
| 107 | { | |
| 108 | toDate = filterTyp e.getToDat e() == nul l || filte rType.getT oDate().le ngth() == 0 ? null : df.parse( filterType .getToDate ()); | |
| 109 | } | |
| 110 | catch (ParseExce ption x) | |
| 111 | { | |
| 112 | logger.e rror("Pars eException convertin g webservi ce format string to- date '" + filterTyp e.getToDat e() + "' t o internal Date", x) ; | |
| 113 | fromDate = null; | |
| 114 | } | |
| 115 | ||
| 116 | // som e business rules for the filte r dates | |
| 117 | if (fr omDate != null && to Date == nu ll) | |
| 118 | { | |
| 119 | // defau lt toDate to today | |
| 120 | toDate = new Date( ); | |
| 121 | } | |
| 122 | else i f (fromDat e == null && toDate != null) | |
| 123 | { | |
| 124 | // defau lt to unfi ltered | |
| 125 | toDate = null; | |
| 126 | } | |
| 127 | ||
| 128 | filter .setFromDa te(fromDat e); | |
| 129 | filter .setToDate (toDate); | |
| 130 | ||
| 131 | filter .setStudy_ class(filt erType.get _class() = = null ? " " : filter Type.get_c lass()); | |
| 132 | filter .setStudy_ event(filt erType.get Event() == null ? "" : filterT ype.getEve nt()); | |
| 133 | filter .setStudy_ package(fi lterType.g et_package () == null ? "" : fi lterType.g et_package ()); | |
| 134 | filter .setStudy_ specialty( filterType .getSpecia lty() == n ull ? "" : filterTyp e.getSpeci alty()); | |
| 135 | filter .setStudy_ type(filte rType.getT ypes() == null ? "" : filterTy pe.getType s()); | |
| 136 | filter .setStudyI d( filterT ype.getStu dyId() == null ? nul l : Global ArtifactId entifierFa ctory.crea te(filterT ype.getStu dyId()) ); | |
| 137 | if(fil terType.ge tOrigin() == null) { | |
| 138 | filter.s etOrigin(" "); | |
| 139 | } | |
| 140 | else { | |
| 141 | if("UNSP ECIFIED".e quals(filt erType.get Origin().g etValue()) ) { | |
| 142 | filter.set Origin("") ; | |
| 143 | } | |
| 144 | else { | |
| 145 | filter.set Origin(fil terType.ge tOrigin(). getValue() ); | |
| 146 | } | |
| 147 | } | |
| 148 | // don 't have a study id u sed here | |
| 149 | } | |
| 150 | retu rn filter; | |
| 151 | } | |
| 152 | ||
| 153 | pu blic gov.v a.med.imag ing.federa tion.webse rvices.typ es.Federat ionStudyTy pe[] trans formStudie s(List<Stu dy> studie s) | |
| 154 | th rows Parse Exception | |
| 155 | { | |
| 156 | if(s tudies == null || st udies.size () == 0) | |
| 157 | return null; | |
| 158 | gov. va.med.ima ging.feder ation.webs ervices.ty pes.Federa tionStudyT ype[] resu lt = new g ov.va.med. imaging.fe deration.w ebservices .types.Fed erationStu dyType[stu dies.size( )]; | |
| 159 | ||
| 160 | ||
| 161 | for( int i = 0; i < studi es.size(); i++) | |
| 162 | { | |
| 163 | result [i] = tran sformStudy (studies.g et(i)); | |
| 164 | } | |
| 165 | retu rn result; | |
| 166 | } | |
| 167 | ||
| 168 | pu blic gov.v a.med.imag ing.federa tion.webse rvices.typ es.Federat ionStudyTy pe transfo rmStudy(St udy study) | |
| 169 | th rows Parse Exception | |
| 170 | { | |
| 171 | if(s tudy == nu ll) | |
| 172 | return null; | |
| 173 | gov. va.med.ima ging.feder ation.webs ervices.ty pes.Federa tionStudyT ype result = | |
| 174 | new go v.va.med.i maging.fed eration.we bservices. types.Fede rationStud yType(); | |
| 175 | ||
| 176 | resu lt.setDesc ription(st udy.getDes cription() ); | |
| 177 | ||
| 178 | resu lt.setEven t(study.ge tEvent()); | |
| 179 | resu lt.setImag eCount(stu dy.getImag eCount()); | |
| 180 | resu lt.setImag ePackage(s tudy.getIm agePackage ()); | |
| 181 | resu lt.setImag eType(stud y.getImage Type()); | |
| 182 | resu lt.setNote Title(stud y.getNoteT itle()); | |
| 183 | resu lt.setOrig in(study.g etOrigin() ); | |
| 184 | resu lt.setPati entIcn(stu dy.getPati entId()); | |
| 185 | resu lt.setPati entName(st udy.getPat ientName() ); | |
| 186 | resu lt.setProc edureDescr iption(stu dy.getProc edure()); | |
| 187 | resu lt.setRadi ologyRepor t(study.ge tRadiology Report()); | |
| 188 | resu lt.setSite Number(stu dy.getSite Number()); | |
| 189 | resu lt.setSite Name(study .getSiteNa me()); | |
| 190 | resu lt.setSite Abbreviati on(study.g etSiteAbbr ()); | |
| 191 | resu lt.setSpec ialtyDescr iption(stu dy.getSpec ialty()); | |
| 192 | resu lt.setProc edureDate( translateP rocedureDa teToDicom( study.getP rocedureDa te())); | |
| 193 | ||
| 194 | resu lt.setStud yPackage(s tudy.getIm agePackage ()); | |
| 195 | resu lt.setStud yClass(stu dy.getStud yClass() = = null ? " " : study. getStudyCl ass()); | |
| 196 | resu lt.setStud yType(stud y.getImage Type()); | |
| 197 | resu lt.setCapt ureDate(st udy.getCap tureDate() ); | |
| 198 | resu lt.setCapt uredBy(stu dy.getCapt ureBy()); | |
| 199 | resu lt.setRpcR esponseMsg (study.get RpcRespons eMsg()); | |
| 200 | resu lt.setErro rMessage(s tudy.getEr rorMessage () == null ? "" : st udy.getErr orMessage( )); | |
| 201 | // r eturn null for the U ID instead of the em pty string to be con sistent wi th the WSD L - DKB | |
| 202 | if ( study.getS tudyUid() != null && study.get StudyUid() .trim().le ngth() > 0 ) | |
| 203 | { | |
| 204 | result .setDicomU id(study.g etStudyUid ()); | |
| 205 | } | |
| 206 | else | |
| 207 | { | |
| 208 | result .setDicomU id(null); | |
| 209 | } | |
| 210 | ||
| 211 | resu lt.setStud yId(study. getStudyIe n()); | |
| 212 | ||
| 213 | gov. va.med.ima ging.feder ation.webs ervices.ty pes.Federa tionSeries Type [] se ries = tra nsformSeri eses(study ); | |
| 214 | resu lt.setComp onentSerie s(series); | |
| 215 | if(s eries != n ull) | |
| 216 | { | |
| 217 | result .setSeries Count(seri es.length) ; | |
| 218 | } | |
| 219 | else | |
| 220 | { | |
| 221 | result .setSeries Count(0); | |
| 222 | } | |
| 223 | ||
| 224 | gov. va.med.ima ging.feder ation.webs ervices.ty pes.Federa tionInstan ceType fir stImage = transformI mage(study .getFirstI mage()); | |
| 225 | resu lt.setFirs tImage(fir stImage); | |
| 226 | resu lt.setFirs tImageIen( firstImage .getImageI d()); | |
| 227 | resu lt.setObje ctOrigin(t ransformOb jectOrigin (study.get ObjectOrig in())); | |
| 228 | resu lt.setStud yModalitie s(study.ge tModalitie s().toArra y(new Stri ng[study.g etModaliti es().size( )])); | |
| 229 | ||
| 230 | ||
| 231 | retu rn result; | |
| 232 | } | |
| 233 | ||
| 234 | pu blic gov.v a.med.imag ing.federa tion.webse rvices.typ es.Federat ionSeriesT ype[] tran sformSerie ses(Study study) | |
| 235 | th rows Parse Exception | |
| 236 | { | |
| 237 | Set< Series> se riesSet = study.getS eries(); | |
| 238 | if(s eriesSet = = null || seriesSet. size() == 0) | |
| 239 | return null; | |
| 240 | Arra yList<gov. va.med.ima ging.feder ation.webs ervices.ty pes.Federa tionSeries Type> seri eses = new ArrayList <gov.va.me d.imaging. federation .webservic es.types.F ederationS eriesType> (); | |
| 241 | ||
| 242 | for( Series ser ies : seri esSet) | |
| 243 | { | |
| 244 | // Fil ter series with no i mages from the resul t set - DK B | |
| 245 | if(ser ies.getIma geCount() > 0) | |
| 246 | { | |
| 247 | serieses .add(trans formSeries (series, s tudy.getDe scription( ))); | |
| 248 | } | |
| 249 | } | |
| 250 | ||
| 251 | retu rn seriese s.toArray( new gov.va .med.imagi ng.federat ion.webser vices.type s.Federati onSeriesTy pe[seriese s.size()]) ; | |
| 252 | } | |
| 253 | pu blic gov.v a.med.imag ing.federa tion.webse rvices.typ es.Federat ionSeriesT ype transf ormSeries( Series ser ies, Strin g seriesDe scription) | |
| 254 | th rows Parse Exception | |
| 255 | { | |
| 256 | if(s eries == n ull) | |
| 257 | return null; | |
| 258 | ||
| 259 | gov. va.med.ima ging.feder ation.webs ervices.ty pes.Federa tionSeries Type resul t = | |
| 260 | new go v.va.med.i maging.fed eration.we bservices. types.Fede rationSeri esType(); | |
| 261 | gov. va.med.ima ging.feder ation.webs ervices.ty pes.Federa tionInstan ceType[] i nstances = new gov.v a.med.imag ing.federa tion.webse rvices.typ es.Federat ionInstanc eType[seri es.getImag eCount()]; | |
| 262 | ||
| 263 | int index=0; | |
| 264 | for( Image imag e : series ) | |
| 265 | { | |
| 266 | instan ces[index] = transfo rmImage(im age); | |
| 267 | index+ +; | |
| 268 | } | |
| 269 | ||
| 270 | ||
| 271 | //TO DO: retrie ve series through Vi stA if pos sible (ava ilable in DICOM txt files) | |
| 272 | resu lt.setDesc ription(se riesDescri ption); | |
| 273 | ||
| 274 | // r eturn null for the U ID instead of the em pty string to be con sistent wi th the WSD L - DKB | |
| 275 | if ( series.get SeriesUid( ) != null && series. getSeriesU id().trim( ).length() > 0) | |
| 276 | { | |
| 277 | result .setDicomU id(series. getSeriesU id()); | |
| 278 | } | |
| 279 | ||
| 280 | if(! "".equals( series.get SeriesNumb er())) { | |
| 281 | int se rNum = Int eger.parse Int(series .getSeries Number()); | |
| 282 | result .setDicomS eriesNumbe r(serNum); | |
| 283 | } | |
| 284 | //TO DO: do we want to ha ve a serie s URN or s hould we j ust use th e series I EN from Vi stA? | |
| 285 | resu lt.setSeri esId(serie s.getSerie sIen()); | |
| 286 | resu lt.setImag eCount(ins tances.len gth); | |
| 287 | resu lt.setComp onentInsta nces(insta nces); | |
| 288 | resu lt.setSeri esModality (series.ge tModality( )); | |
| 289 | resu lt.setObje ctOrigin(t ransformOb jectOrigin (series.ge tObjectOri gin())); | |
| 290 | ||
| 291 | retu rn result; | |
| 292 | } | |
| 293 | ||
| 294 | pu blic gov.v a.med.imag ing.federa tion.webse rvices.typ es.Federat ionInstanc eType tran sformImage (Image ima ge) | |
| 295 | th rows Parse Exception | |
| 296 | { | |
| 297 | if(i mage == nu ll) | |
| 298 | return null; | |
| 299 | ||
| 300 | gov. va.med.ima ging.feder ation.webs ervices.ty pes.Federa tionInstan ceType ins tanceType = | |
| 301 | new go v.va.med.i maging.fed eration.we bservices. types.Fede rationInst anceType() ; | |
| 302 | ||
| 303 | inst anceType.s etImageId( image.getI en()); | |
| 304 | ||
| 305 | // E xchange fi elds | |
| 306 | // r eturn null for the U ID instead of the em pty string to be con sistent wi th the WSD L - DKB | |
| 307 | if ( image.getI mageUid()! = null && image.getI mageUid(). trim().len gth() > 0) | |
| 308 | { | |
| 309 | instan ceType.set DicomUid(i mage.getIm ageUid().t rim()); | |
| 310 | } | |
| 311 | ||
| 312 | ||
| 313 | if ( image.getI mageNumber () != null && image. getImageNu mber().tri m().length () > 0) | |
| 314 | { | |
| 315 | try | |
| 316 | { | |
| 317 | Integer imageNumbe r = new In teger(imag e.getImage Number()); | |
| 318 | instance Type.setIm ageNumber( imageNumbe r); | |
| 319 | } | |
| 320 | catch (NumberFor matExcepti on ex) | |
| 321 | { | |
| 322 | // not a number - return nul l | |
| 323 | instance Type.setIm ageNumber( null); | |
| 324 | } | |
| 325 | } | |
| 326 | else | |
| 327 | { | |
| 328 | instan ceType.set ImageNumbe r(null); | |
| 329 | } | |
| 330 | ||
| 331 | // C linical Di splay fiel ds | |
| 332 | inst anceType.s etDescript ion(image. getDescrip tion()); | |
| 333 | inst anceType.s etDicomIma geNumberFo rDisplay(i mage.getDi comImageNu mberForDis play()); | |
| 334 | inst anceType.s etDicomSeq uenceNumbe rForDispla y(image.ge tDicomSequ enceNumber ForDisplay ()); | |
| 335 | inst anceType.s etPatientI cn(image.g etPatientI d()); | |
| 336 | inst anceType.s etPatientN ame(image. getPatient Name()); | |
| 337 | inst anceType.s etProcedur e(image.ge tProcedure ()); | |
| 338 | if(i mage.getPr ocedureDat e() == nul l) | |
| 339 | { | |
| 340 | logger .warn("Set ting null procedure date for i mage"); | |
| 341 | instan ceType.set ProcedureD ate(""); | |
| 342 | } | |
| 343 | else | |
| 344 | { | |
| 345 | /* | |
| 346 | // if the hour a nd minute are not 0, then like ly they co ntain real values fo r hour and minute (n ot 00:00) | |
| 347 | // thi s leaves o pen the po ssibility of invalid data, if the real d ate was at 00:00 the n this wou ld not sho w that tim e. | |
| 348 | // we would then omit data , not show invalid d ata | |
| 349 | if((im age.getPro cedureDate ().getHour s() > 0) & & (image.g etProcedur eDate().ge tMinutes() > 0)) | |
| 350 | { | |
| 351 | instance Type.setPr ocedureDat e(getFeder ationWebse rviceLongD ateFormat( ).format(i mage.getPr ocedureDat e())); | |
| 352 | } | |
| 353 | else | |
| 354 | { | |
| 355 | instance Type.setPr ocedureDat e(getFeder ationWebse rviceShort DateFormat ().format( image.getP rocedureDa te())); | |
| 356 | } | |
| 357 | */ | |
| 358 | instan ceType.set ProcedureD ate(transl ateProcedu reDateToDi com(image. getProcedu reDate())) ; | |
| 359 | } | |
| 360 | inst anceType.s etSiteNumb er(image.g etSiteNumb er()); | |
| 361 | inst anceType.s etSiteAbbr (image.get SiteAbbr() ); | |
| 362 | inst anceType.s etImageCla ss(image.g etImageCla ss()); | |
| 363 | inst anceType.s etAbsLocat ion(image. getAbsLoca tion()); | |
| 364 | inst anceType.s etFullLoca tion(image .getFullLo cation()); | |
| 365 | ||
| 366 | inst anceType.s etQaMessag e(image.ge tQaMessage ()); | |
| 367 | inst anceType.s etImageTyp e(BigInteg er.valueOf (image.get ImgType()) ); | |
| 368 | inst anceType.s etFullImag eFilename( image.getF ullFilenam e()); | |
| 369 | inst anceType.s etAbsImage Filename(i mage.getAb sFilename( )); | |
| 370 | inst anceType.s etBigImage Filename(i mage.getBi gFilename( )); | |
| 371 | ||
| 372 | // n ot sure if that is c orrect or if that sh ould be ma de into a URN... - I think URN ? | |
| 373 | //TO DO: should this be t he IEN fro m the stud y or conve rted to a URN? | |
| 374 | ||
| 375 | inst anceType.s etStudyId( image.getS tudyIen()) ; | |
| 376 | //in stanceType .setStudyI d(image.ge tStudyIen( )); | |
| 377 | //in stanceType .setGroupI d(image.ge tGroupIen( )); | |
| 378 | ||
| 379 | inst anceType.s etImageMod ality(imag e.getImage Modality() ); | |
| 380 | inst anceType.s etObjectOr igin(trans formObject Origin(ima ge.getObje ctOrigin() )); | |
| 381 | inst anceType.s etErrorMes sage(image .getErrorM essage() = = null ? " " : image. getErrorMe ssage()); | |
| 382 | retu rn instanc eType; | |
| 383 | } | |
| 384 | ||
| 385 | pr ivate Stri ng getPare ntIen(Imag e image) | |
| 386 | { | |
| 387 | retu rn image.g etStudyIen (); | |
| 388 | } | |
| 389 | ||
| 390 | pr ivate Stri ng transla teProcedur eDateToDic om(Date pr ocedureDat e) | |
| 391 | th rows Parse Exception | |
| 392 | { | |
| 393 | Stri ng procedu reDateStri ngAsDicom = ""; | |
| 394 | if(p rocedureDa te != null ) | |
| 395 | { | |
| 396 | DateFo rmat dicom DateFormat = new Dic omDateForm at(); | |
| 397 | proced ureDateStr ingAsDicom = dicomDa teFormat.f ormat(proc edureDate) ; | |
| 398 | } | |
| 399 | retu rn procedu reDateStri ngAsDicom; | |
| 400 | } | |
| 401 | ||
| 402 | pr ivate gov. va.med.ima ging.feder ation.webs ervices.ty pes.Object OriginType transform ObjectOrig in(ObjectO rigin orig in) | |
| 403 | { | |
| 404 | if(o rigin == O bjectOrigi n.VA) | |
| 405 | { | |
| 406 | return gov.va.me d.imaging. federation .webservic es.types.O bjectOrigi nType.VA; | |
| 407 | } | |
| 408 | else if(origin == Object Origin.DOD ) | |
| 409 | { | |
| 410 | return gov.va.me d.imaging. federation .webservic es.types.O bjectOrigi nType.DOD; | |
| 411 | } | |
| 412 | else | |
| 413 | return gov.va.me d.imaging. federation .webservic es.types.O bjectOrigi nType.OTHE R; | |
| 414 | } | |
| 415 | ||
| 416 | pu blic Image AccessLogE vent trans formLogEve nt( | |
| 417 | gov.va .med.imagi ng.federat ion.webser vices.type s.Federati onImageAcc essLogEven tType logE ventType) | |
| 418 | th rows URNFo rmatExcept ion | |
| 419 | { | |
| 420 | if(l ogEventTyp e == null) | |
| 421 | return null; | |
| 422 | ||
| 423 | Imag eAccessLog EventType imageAcces sLogEventT ype = tran sformLogEv entType(lo gEventType .getEventT ype()); | |
| 424 | Imag eAccessLog Event resu lt = | |
| 425 | new Im ageAccessL ogEvent(lo gEventType .getImageI d(), "", l ogEventTyp e.getPatie ntIcn(), | |
| 426 | logEventTy pe.getSite Number(), System.cur rentTimeMi llis(), | |
| 427 | logEventTy pe.getReas on(), "", imageAcces sLogEventT ype, logEv entType.ge tUserSiteN umber()); | |
| 428 | ||
| 429 | retu rn result; | |
| 430 | } | |
| 431 | ||
| 432 | pu blic Image AccessLogE ventType t ransformLo gEventType (gov.va.me d.imaging. federation .webservic es.types.F ederationI mageAccess LogEventTy peEventTyp e eventTyp e) { | |
| 433 | Imag eAccessLog EventType result;// = new gov. va.med.ima ging.excha nge.enums. ImageAcces sLogEventT ype(); | |
| 434 | if(e ventType = = gov.va.m ed.imaging .federatio n.webservi ces.types. Federation ImageAcces sLogEventT ypeEventTy pe.IMAGE_C OPY) { | |
| 435 | result = ImageAc cessLogEve ntType.IMA GE_COPY; | |
| 436 | } | |
| 437 | else if(eventT ype == gov .va.med.im aging.fede ration.web services.t ypes.Feder ationImage AccessLogE ventTypeEv entType.IM AGE_PRINT) { | |
| 438 | result = ImageAc cessLogEve ntType.IMA GE_PRINT; | |
| 439 | } | |
| 440 | else if(eventT ype == gov .va.med.im aging.fede ration.web services.t ypes.Feder ationImage AccessLogE ventTypeEv entType.PA TIENT_ID_M ISMATCH) { | |
| 441 | result = ImageAc cessLogEve ntType.PAT IENT_ID_MI SMATCH; | |
| 442 | } | |
| 443 | else | |
| 444 | { | |
| 445 | result = ImageAc cessLogEve ntType.IMA GE_ACCESS; | |
| 446 | } | |
| 447 | retu rn result; | |
| 448 | } | |
| 449 | ||
| 450 | pu blic gov.v a.med.imag ing.federa tion.webse rvices.typ es.Patient Type [] tr ansformPat ients(List <Patient> patients) | |
| 451 | { | |
| 452 | if(p atients == null) | |
| 453 | return null; | |
| 454 | gov. va.med.ima ging.feder ation.webs ervices.ty pes.Patien tType [] r esult = | |
| 455 | new go v.va.med.i maging.fed eration.we bservices. types.Pati entType[pa tients.siz e()]; | |
| 456 | for( int i = 0; i < patie nts.size() ; i++) | |
| 457 | { | |
| 458 | try | |
| 459 | { | |
| 460 | result[i ] = transf ormPatient (patients. get(i)); | |
| 461 | } | |
| 462 | catch( ParseExcep tion pX) | |
| 463 | { | |
| 464 | logger.e rror("Erro r parsing patient", pX); | |
| 465 | } | |
| 466 | } | |
| 467 | retu rn result; | |
| 468 | } | |
| 469 | ||
| 470 | pu blic gov.v a.med.imag ing.federa tion.webse rvices.typ es.Patient Type trans formPatien t(Patient patient) | |
| 471 | th rows Parse Exception | |
| 472 | { | |
| 473 | if(p atient == null) | |
| 474 | return null; | |
| 475 | gov. va.med.ima ging.feder ation.webs ervices.ty pes.Patien tType resu lt = | |
| 476 | new go v.va.med.i maging.fed eration.we bservices. types.Pati entType(); | |
| 477 | resu lt.setPati entDob(con vertPatien tDobToStri ng(patient .getDob()) ); | |
| 478 | resu lt.setPati entIcn(pat ient.getPa tientIcn() ); | |
| 479 | resu lt.setPati entName(pa tient.getP atientName ()); | |
| 480 | resu lt.setPati entSex(tra nsformPati entSex(pat ient.getPa tientSex() )); | |
| 481 | resu lt.setVete ranStatus( patient.ge tVeteranSt atus()); | |
| 482 | retu rn result; | |
| 483 | } | |
| 484 | ||
| 485 | pr ivate Stri ng convert PatientDob ToString(D ate dob) | |
| 486 | throws ParseExce ption | |
| 487 | { | |
| 488 | Si mpleDateFo rmat sdf = new Simpl eDateForma t("MM/dd/y y", Locale .US); | |
| 489 | re turn sdf.f ormat(dob) ; | |
| 490 | } | |
| 491 | ||
| 492 | pr ivate gov. va.med.ima ging.feder ation.webs ervices.ty pes.Federa tionPatien tSexType t ransformPa tientSex(P atientSex patientSex ) | |
| 493 | { | |
| 494 | gov. va.med.ima ging.feder ation.webs ervices.ty pes.Federa tionPatien tSexType r esult = nu ll; | |
| 495 | if(p atientSex == Patient Sex.Male) | |
| 496 | result = gov.va. med.imagin g.federati on.webserv ices.types .Federatio nPatientSe xType.MALE ; | |
| 497 | else if(patien tSex == Pa tientSex.F emale) | |
| 498 | result = gov.va. med.imagin g.federati on.webserv ices.types .Federatio nPatientSe xType.FEMA LE; | |
| 499 | else | |
| 500 | result = gov.va. med.imagin g.federati on.webserv ices.types .Federatio nPatientSe xType.UNKN OWN; | |
| 501 | retu rn result; | |
| 502 | } | |
| 503 | ||
| 504 | ||
| 505 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.