Produced by Araxis Merge on 12/5/2017 12:06:40 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\ExchangeWebApp\main\src\java\gov\va\med\imaging\exchange\webservices | ExchangeWebservices.java | Mon Dec 4 21:34:56 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ExchangeWebApp\main\src\java\gov\va\med\imaging\exchange\webservices | ExchangeWebservices.java | Mon Dec 4 22:00:20 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 424 |
| 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: Jan 30, 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.exc hange.webs ervices; | |
| 27 | ||
| 28 | import gov .va.med.Pa tientIdent ifier; | |
| 29 | import gov .va.med.ex ceptions.R outingToke nFormatExc eption; | |
| 30 | import gov .va.med.im aging.exch ange.Routi ngTokenHel per; | |
| 31 | import gov .va.med.im aging.core .interface s.exceptio ns.Connect ionExcepti on; | |
| 32 | import gov .va.med.im aging.core .interface s.exceptio ns.Insuffi cientPatie ntSensitiv ityExcepti on; | |
| 33 | import gov .va.med.im aging.core .interface s.exceptio ns.MethodE xception; | |
| 34 | import gov .va.med.im aging.exce ptions.URN FormatExce ption; | |
| 35 | import gov .va.med.im aging.exch ange.Excha ngeRouter; | |
| 36 | import gov .va.med.im aging.exch ange.Imagi ngExchange Context; | |
| 37 | import gov .va.med.im aging.exch ange.busin ess.Study; | |
| 38 | import gov .va.med.im aging.exch ange.busin ess.StudyF ilter; | |
| 39 | import gov .va.med.im aging.exch ange.webse rvices.soa p.types.v1 .FilterTyp e; | |
| 40 | import gov .va.med.im aging.exch ange.webse rvices.soa p.types.v1 .Requestor Type; | |
| 41 | import gov .va.med.im aging.exch ange.webse rvices.soa p.types.v1 .StudyType ; | |
| 42 | import gov .va.med.im aging.exch ange.webse rvices.tra nslator.v1 .ExchangeT ranslator; | |
| 43 | import gov .va.med.im aging.tran sactioncon text.Trans actionCont ext; | |
| 44 | import gov .va.med.im aging.tran sactioncon text.Trans actionCont extFactory ; | |
| 45 | ||
| 46 | import jav a.beans.XM LEncoder; | |
| 47 | import jav a.io.Buffe redOutputS tream; | |
| 48 | import jav a.io.FileN otFoundExc eption; | |
| 49 | import jav a.io.FileO utputStrea m; | |
| 50 | import jav a.rmi.Remo teExceptio n; | |
| 51 | import jav a.text.Par seExceptio n; | |
| 52 | import jav a.util.Lis t; | |
| 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 Exchang eWebservic es | |
| 62 | implements gov.va.me d.imaging. exchange.w ebservices .soap.v1.I mageMetada ta | |
| 63 | { | |
| 64 | pr ivate Exch angeTransl ator excha ngeTransla tor = new ExchangeTr anslator() ; | |
| 65 | pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(Exch angeWebser vices.clas s); | |
| 66 | ||
| 67 | @O verride | |
| 68 | pu blic Study Type[] get PatientStu dyList(Str ing dataso urce, | |
| 69 | Reques torType re questor, F ilterType filter, St ring patie ntId, | |
| 70 | String transacti onId) | |
| 71 | th rows Remot eException | |
| 72 | { | |
| 73 | setT ransaction Context(re questor, t ransaction Id); | |
| 74 | Long startTime = System. currentTim eMillis(); | |
| 75 | logg er.info("s tart getPa tientStudy List trans action(" + transacti onId + ")" ); | |
| 76 | Exch angeRouter router = ImagingExc hangeConte xt.getExch angeRouter (); | |
| 77 | if(r outer == n ull) | |
| 78 | throw new Remote Exception( "Internal error, una ble to ret rieve pati ent studie s"); | |
| 79 | ||
| 80 | Stud yFilter st udyFilter = exchange Translator .transform Filter(fil ter); | |
| 81 | ||
| 82 | Tran sactionCon text trans actionCont ext = Tran sactionCon textFactor y.get(); | |
| 83 | tran sactionCon text.setRe questType( "Exchange WebApp get StudyList" ); | |
| 84 | //TO DO: look a t requesti ng site nu mber and s etRequesti ngSource | |
| 85 | tran sactionCon text.setRe questingSo urce("unkn own"); | |
| 86 | tran sactionCon text.setPa tientID(pa tientId); | |
| 87 | tran sactionCon text.setQu eryFilter( Transactio nContextFa ctory.getF ilterDateR ange(study Filter.get FromDate() , studyFil ter.getToD ate())); | |
| 88 | tran sactionCon text.setQu ality("n/a "); | |
| 89 | tran sactionCon text.setUr n("n/a"); | |
| 90 | ||
| 91 | //TO DO: get th e site num ber from t he request (somewher e). if non e is speci fied then get the si te | |
| 92 | // n umber from appConfig and go ag ainst the local site | |
| 93 | Stri ng siteNum ber = Imag ingExchang eContext.g etAppConfi guration() .getLocalS iteNumber( );// "660" ; | |
| 94 | try | |
| 95 | { | |
| 96 | List<S tudy> stud ies = rout er.getPati entStudyLi st(Routing TokenHelpe r.createSi teAppropri ateRouting Token(site Number), | |
| 97 | PatientIde ntifier.ic nPatientId entifier(p atientId), studyFilt er); | |
| 98 | ||
| 99 | gov.va .med.imagi ng.exchang e.webservi ces.soap.t ypes.v1.St udyType[] studyTypes = | |
| 100 | exchange Translator .transform Studies(st udies); | |
| 101 | logger .info("Con verted [" + (studies == null ? 0 : studi es.size()) + "] busi ness studi es into [" + (studyT ypes == nu ll ? 0 : s tudyTypes. length) + "] studies to return "); | |
| 102 | transa ctionConte xt.setEntr iesReturne d( studyTy pes == nul l ? 0 : st udyTypes.l ength ); | |
| 103 | if (st udyTypes ! = null) | |
| 104 | { | |
| 105 | String d umpExchang eGraphs = System.get env("dumpv aexchangeg raphs"); | |
| 106 | if (dump ExchangeGr aphs != nu ll && dump ExchangeGr aphs.equal sIgnoreCas e("true")) | |
| 107 | { | |
| 108 | dumpVaStud yGraph(pat ientId, st udyTypes); | |
| 109 | } | |
| 110 | } | |
| 111 | logger .info("SUC CESS getPa tientStudy List trans action(" + transacti onId + ") in " + | |
| 112 | (System.cu rrentTimeM illis() - startTime) + " ms)" ); | |
| 113 | return studyType s; | |
| 114 | } | |
| 115 | catc h(Insuffic ientPatien tSensitivi tyExceptio n ipsX) | |
| 116 | { | |
| 117 | logger .info("Ins ufficient patient se nsitivity to view sp ecified pa tient, ret urning emp ty study l ist for no w... This is not bei ng logged as an exce ption", ip sX); | |
| 118 | transa ctionConte xt.setEntr iesReturne d(0); | |
| 119 | logger .info("SUC CESS getPa tientStudy List trans action(" + transacti onId + ") in " + | |
| 120 | (System.cu rrentTimeM illis() - startTime) + " ms, return ed no stud ies)" ); | |
| 121 | return new gov.v a.med.imag ing.exchan ge.webserv ices.soap. types.v1.S tudyType[0 ]; | |
| 122 | } | |
| 123 | catc h(ParseExc eption pX) | |
| 124 | { | |
| 125 | transa ctionConte xt.setErro rMessage(p X.getMessa ge()); | |
| 126 | transa ctionConte xt.setExce ptionClass Name(pX.ge tClass().g etSimpleNa me()); | |
| 127 | throw new Remote Exception( "Internal error, una ble to tra nslate stu dy procedu re date", pX); | |
| 128 | } | |
| 129 | catc h(URNForma tException iurnfX) | |
| 130 | { | |
| 131 | transa ctionConte xt.setErro rMessage(i urnfX.getM essage()); | |
| 132 | transa ctionConte xt.setExce ptionClass Name(iurnf X.getClass ().getSimp leName()); | |
| 133 | throw new Remote Exception( "Internal error, una ble to tra nslate stu dy metadat a", iurnfX ); | |
| 134 | } | |
| 135 | catc h(MethodEx ception mX ) | |
| 136 | { | |
| 137 | transa ctionConte xt.setErro rMessage(m X.getMessa ge()); | |
| 138 | transa ctionConte xt.setExce ptionClass Name(mX.ge tClass().g etSimpleNa me()); | |
| 139 | throw new Remote Exception( "Internal error, una ble to tra nslate stu dy metadat a", mX); | |
| 140 | } | |
| 141 | catc h(Connecti onExceptio n cX) | |
| 142 | { | |
| 143 | transa ctionConte xt.setErro rMessage(c X.getMessa ge()); | |
| 144 | transa ctionConte xt.setExce ptionClass Name(cX.ge tClass().g etSimpleNa me()); | |
| 145 | throw new Remote Exception( "Internal error, una ble to tra nslate stu dy metadat a", cX); | |
| 146 | } | |
| 147 | catc h (Routing TokenForma tException rtfX) | |
| 148 | { | |
| 149 | transa ctionConte xt.setErro rMessage(r tfX.getMes sage()); | |
| 150 | transa ctionConte xt.setExce ptionClass Name(rtfX. getClass() .getSimple Name()); | |
| 151 | throw new Remote Exception( "Internal error, una ble to tra nslate stu dy metadat a", rtfX); | |
| 152 | } | |
| 153 | } | |
| 154 | ||
| 155 | /* * | |
| 156 | * Set the t ransaction context p roperties that are p assed in t he webserv ices. | |
| 157 | * @param re questor | |
| 158 | * @param tr ansactionI d | |
| 159 | * / | |
| 160 | pr ivate void setTransa ctionConte xt( | |
| 161 | gov. va.med.ima ging.excha nge.webser vices.soap .types.v1. RequestorT ype reques tor, | |
| 162 | java .lang.Stri ng transac tionId) | |
| 163 | { | |
| 164 | logg er.info( | |
| 165 | "setTran sactionCon text, id=' " + transa ctionId + | |
| 166 | "', user name='" + requestor == null || requestor .getUserna me() == nu ll ? "null " : reques tor.getUse rname() + | |
| 167 | "'."); | |
| 168 | Tran sactionCon text trans actionCont ext = Tran sactionCon textFactor y.get(); | |
| 169 | ||
| 170 | if(t ransaction Id != null ) | |
| 171 | transa ctionConte xt.setTran sactionId( transactio nId); | |
| 172 | ||
| 173 | if(r equestor ! = null) | |
| 174 | { | |
| 175 | if( re questor.ge tUsername( ) != null ) | |
| 176 | transact ionContext .setFullNa me(request or.getUser name()); | |
| 177 | if( re questor.ge tFacilityI d() != nul l ) | |
| 178 | transact ionContext .setSiteNu mber(reque stor.getFa cilityId() ); | |
| 179 | if( re questor.ge tFacilityN ame() != n ull ) | |
| 180 | transact ionContext .setSiteNa me(request or.getFaci lityName() ); | |
| 181 | if( re questor.ge tPurposeOf Use() != n ull ) | |
| 182 | transact ionContext .setPurpos eOfUse(req uestor.get PurposeOfU se().toStr ing()); | |
| 183 | if( re questor.ge tSsn() != null ) | |
| 184 | transact ionContext .setSsn(re questor.ge tSsn()); | |
| 185 | } | |
| 186 | } | |
| 187 | ||
| 188 | pr ivate void dumpVaStu dyGraph(St ring patie ntIcn, gov .va.med.im aging.exch ange.webse rvices.soa p.types.v1 .StudyType [] exchang eStudies) | |
| 189 | { | |
| 190 | Stri ng vixcach e = System .getenv("v ixcache"); | |
| 191 | if ( vixcache ! = null) | |
| 192 | { | |
| 193 | XMLEnc oder xmlEn coder = nu ll; | |
| 194 | try | |
| 195 | { | |
| 196 | String f ileSpec = vixcache + "/vaexcha nge" + pat ientIcn + ".xml"; | |
| 197 | xmlEncod er = new X MLEncoder( new Buffer edOutputSt ream(new F ileOutputS tream(file Spec))); | |
| 198 | xmlEncod er.writeOb ject(excha ngeStudies ); | |
| 199 | } | |
| 200 | catch (FileNotFo undExcepti on ex) | |
| 201 | { | |
| 202 | logger.e rror("Erro r dumping study grap h: " + ex. getMessage ()); | |
| 203 | } | |
| 204 | finall y | |
| 205 | { | |
| 206 | if (xmlE ncoder != null) | |
| 207 | { | |
| 208 | xmlEncoder .close(); | |
| 209 | } | |
| 210 | } | |
| 211 | } | |
| 212 | } | |
| 213 | ||
| 214 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.