Produced by Araxis Merge on 8/1/2019 1:42:44 PM Eastern 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 | JLV_2_8_0_0_0_July_2019.zip\JLV_2_8_0_0_0_July_2019\jMeadows\src\test\integration\java\gov\va\med\jmeadows\dao\patient | DaoBaseTest.java | Mon Jul 8 19:18:50 2019 UTC |
2 | JLV_2_8_0_0_0_July_2019.zip\JLV_2_8_0_0_0_July_2019\jMeadows\src\test\integration\java\gov\va\med\jmeadows\dao\patient | DaoBaseTest.java | Wed Jul 31 18:41:37 2019 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 468 |
Changed | 1 | 2 |
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 | * Janus 4 .0 (c) | |
3 | * Copyrig ht (c) 201 1 Hawaii R esource Gr oup LLC. A ll Rights Reserved. | |
4 | * Develop ed for the Pacific T elehealth & Technolo gy Hui and the Pacif ic Joint I nformation Technolog y Center | |
5 | * Contrib utors: | |
6 | * Hon orable Sen ator Danie l K. Inouy e | |
7 | * VA Pacific Is lands Heal th Care Sy stem | |
8 | * Tri pler Army Medical Ce nter | |
9 | */ | |
10 | ||
11 | ||
12 | package go v.va.med.j meadows.da o.patient; | |
13 | ||
14 | import gov .va.med.fo undations. utilities. VistaKerne lHash; | |
15 | import gov .va.med.jm eadows.com mon.AppCon fig; | |
16 | import gov .va.med.jm eadows.com mon.JMeado wsExceptio n; | |
17 | import gov .va.med.jm eadows.dao .TestConfi g; | |
18 | import gov .va.med.jm eadows.dao .beans.*; | |
19 | import gov .va.med.vd s.webservi ce.DataBea n; | |
20 | import gov .va.med.vd s.webservi ce.Patient ; | |
21 | import gov .va.med.vd s.webservi ce.User; | |
22 | import gov .va.med.vh ahon.commo n.Utils; | |
23 | import org .apache.lo g4j.Level; | |
24 | import org .apache.lo g4j.LogMan ager; | |
25 | import org .junit.Aft er; | |
26 | import org .junit.Aft erClass; | |
27 | import org .junit.Bef ore; | |
28 | import org .junit.Bef oreClass; | |
29 | import org .slf4j.Log ger; | |
30 | import org .slf4j.Log gerFactory ; | |
31 | ||
32 | import jav a.util.Cal endar; | |
33 | import jav a.util.Lis t; | |
34 | ||
35 | import sta tic org.ju nit.Assert .assertTru e; | |
36 | import sta tic org.ju nit.Assert .fail; | |
37 | ||
38 | /** | |
39 | * | |
40 | * @author DNS | |
41 | */ | |
42 | public cla ss DaoBase Test | |
43 | { | |
44 | protec ted static final Log ger logger = LoggerF actory.get Logger(Dao BaseTest.c lass); | |
45 | ||
46 | protec ted static final App Config APP _CONFIG = AppConfig. getInstanc e(); | |
47 | ||
48 | protec ted User u ser; | |
49 | protec ted Patien t patient; | |
50 | protec ted Calend ar startDa te; | |
51 | protec ted Calend ar endDate ; | |
52 | ||
53 | protec ted String ERROR_MSG _CONNECTIO N_UNAVAILA BLE = "Con nection Un available" ; | |
54 | ||
55 | @Befor eClass | |
56 | public static vo id setUpCl ass() | |
57 | { | |
58 | ||
59 | } | |
60 | ||
61 | @After Class | |
62 | public static vo id tearDow nClass() | |
63 | { | |
64 | } | |
65 | ||
66 | @Befor e | |
67 | public void setU p() | |
68 | { | |
69 | Lo gManager.g etRootLogg er().setLe vel(Level. DEBUG); | |
70 | ||
71 | tr y | |
72 | { | |
73 | ||
74 | UserDao userDao = new UserDa o(); | |
75 | List<Aud itEntry> loginInfo = userDao. getLoginIn fo("999999 ", ""); | |
76 | ||
77 | //select test pati ent | |
78 | PatientD ao patient Service = new Patien tDao(); | |
79 | JMeadows Query quer yBean = ne w JMeadows Query(); | |
80 | queryBea n.setReque stingApp(" jmeadows_u nittest"); | |
81 | ||
82 | startDat e = Calend ar.getInst ance(); | |
83 | endDate = Calendar .getInstan ce(); | |
84 | startDat e.set(1990 , 0, 1); | |
85 | ||
86 | user = l oginTestPr ovider(); | |
87 | user.set UserId("12 3"); | |
88 | ||
89 | PDWSQuer yBean pdws QueryBean = new PDWS QueryBean( ); | |
90 | pdwsQuer yBean.setU ser( user ); | |
91 | pdwsQuer yBean.setP atientId( TestConfig .get(TestC onfig.PATI ENT_SSN) ) ; | |
92 | pdwsQuer yBean.setP atientIdTy pe( "SSN") ; | |
93 | pdwsQuer yBean.setF irstName( TestConfig .get(TestC onfig.PATI ENT_NAME_F IRST) ); | |
94 | pdwsQuer yBean.setL astName( T estConfig. get(TestCo nfig.PATIE NT_NAME_LA ST)); | |
95 | pdwsQuer yBean.setR equestingA pp("jMeaod ws_unit_te st" ); | |
96 | pdwsQuer yBean.setI nquiryType ("PS"); | |
97 | Response PatientQue ry respons ePatientQu ery = pati entService .lookupPat ientPDWS(p dwsQueryBe an); | |
98 | ||
99 | for(Pati ent p : re sponsePati entQuery.g etPatients ()) | |
100 | { | |
101 | // St ring nm = TestConfi g.get(Test Config.PAT IENT_NAME_ LAST) + ", " + TestCo nfig.get(T estConfig. PATIENT_NA ME_FIRST); | |
102 | // if (p.getNam e().equals IgnoreCase (nm)) | |
103 | // { | |
104 | this.patie nt = p; | |
105 | break; | |
106 | // } | |
107 | } | |
108 | ||
109 | JMeadows Query qb = new JMead owsQuery() ; | |
110 | ||
111 | qb.setUs er(user); | |
112 | qb.setIt emId(this. patient.ge tEDIPI()); | |
113 | qb.setSt atus("EDIP I"); | |
114 | ||
115 | qb.setIn cludeDoDDa ta(true); | |
116 | qb.setIn cludeVADat a(true); | |
117 | ||
118 | Response PatientSel ect respon sePatientS elect = pa tientServi ce.selectP atientMVI( qb); | |
119 | this.pat ient = res ponsePatie ntSelect.g etPatient( ); | |
120 | ||
121 | //settin g AHLTA Un itNumber t o blank, b ecause our mock serv ice doesn' t support it | |
122 | //this.p atient.set AhltaUnitN umber(""); | |
123 | } | |
124 | ca tch (JMead owsExcepti on ex) | |
125 | { | |
126 | fail(ex. getMessage ()); | |
127 | } | |
128 | } | |
129 | ||
130 | protec ted User l oginTestPr ovider() t hrows JMea dowsExcept ion { | |
131 | tr y | |
132 | { | |
133 | String a ccessCode = TestConf ig.get(Tes tConfig.PR OVIDER_ACC ESS_CODE); | |
134 | String v erifyCode = TestConf ig.get(Tes tConfig.PR OVIDER_VER IFY_CODE); | |
135 | String s iteCode = TestConfig .get(TestC onfig.PROV IDER_SITE_ CODE); | |
136 | UserDao userDao = new UserDa o(); | |
137 | ||
138 | User use r; | |
139 | ||
140 | user = u serDao.log in(siteCod e, VistaKe rnelHash.e ncrypt(acc essCode, f alse), Vis taKernelHa sh.encrypt (verifyCod e, false), "jmeadows _unittest" ); | |
141 | ||
142 | if (user == null | | user.get UserIen(). contains(" ^")) | |
143 | thro w new Runt imeExcepti on("Invali d User"); | |
144 | ||
145 | return u ser; | |
146 | } | |
147 | ca tch (Excep tion e) | |
148 | { | |
149 | throw ne w JMeadows Exception( e); | |
150 | } | |
151 | } | |
152 | ||
153 | @After | |
154 | public void tear Down() | |
155 | { | |
156 | ||
157 | } | |
158 | ||
159 | protec ted JMeado wsQuery se tupQuery(U ser user, Patient pa tient, Cal endar star tDate, Cal endar endD ate) | |
160 | { | |
161 | JM eadowsQuer y qb = new JMeadowsQ uery(); | |
162 | qb .setUser(u ser); | |
163 | qb .setPatien t(patient) ; | |
164 | qb .setStartD ate(Utils. getCalenda r(startDat e.getTime( ))); | |
165 | qb .setEndDat e(Utils.ge tCalendar( endDate.ge tTime())); | |
166 | qb .setMax(99 9); | |
167 | qb .setActive (0); | |
168 | qb .setInclud eVAData(tr ue); | |
169 | qb .setInclud eDoDData(t rue); | |
170 | re turn qb; | |
171 | } | |
172 | ||
173 | protec ted void t estForBean Meta(List beans) | |
174 | { | |
175 | te stForBeanM eta(beans, true); | |
176 | } | |
177 | ||
178 | protec ted void t estForBean Meta(List beans, boo lean patie ntBasedQue ry) | |
179 | { | |
180 | fo r(Object b ean : bean s) | |
181 | { | |
182 | DataBean dataBean = (DataBea n) bean; | |
183 | ||
184 | assertTr ue(dataBea n.getSite( ) != null) ; | |
185 | /*if(pat ientBasedQ uery) | |
186 | { | |
187 | asse rtTrue(dat aBean.getP atientId() != null & & dataBean .getPatien tId().leng th() > 0); | |
188 | }*/ | |
189 | } | |
190 | } | |
191 | ||
192 | protec ted void t estForProv iderBeanMe ta(List be ans) | |
193 | { | |
194 | te stForBeanM eta(beans, false); | |
195 | } | |
196 | ||
197 | /** | |
198 | * Hel per functi on which p ermits the testing o f non matc hing provi ders. | |
199 | * @pa ram p the user objec t which st ores locat ion id map pings | |
200 | * @pa ram vistaI en the new ien of th e vista us er or null if none | |
201 | * @pa ram chcsIe n the ien of the chc s user or null if no ne | |
202 | */ | |
203 | protec ted void m ockProvide rBasedQuer y(User p, String vis taIen, Str ing chcsIe n) | |
204 | { | |
205 | // List<KeyVa luePair> l ocationIdM appings = p.getLocat ionIdMappi ngs(); | |
206 | // locationId Mappings.c lear(); | |
207 | // if(vistaIe n != null) | |
208 | // { | |
209 | // KeyVal uePair kvp = new Key ValuePair( ); | |
210 | // kvp.se tKey("459" ); | |
211 | // kvp.se tValue(vis taIen); | |
212 | // locati onIdMappin gs.add(kvp ); | |
213 | // } | |
214 | // if(chcsIen != null) | |
215 | // { | |
216 | // KeyVal uePair kvp = new Key ValuePair( ); | |
217 | // kvp.se tKey("A010 1"); | |
218 | // kvp.se tValue(chc sIen); | |
219 | // locati onIdMappin gs.add(kvp ); | |
220 | // } | |
221 | } | |
222 | ||
223 | // prot ected void mockPatie ntBasedQue ry(Patient p, String newPatien tIen) | |
224 | // { | |
225 | // if(p == nu ll) | |
226 | // { | |
227 | // throw new Illega lArgumentE xception(" Patient ca nnot be nu ll"); | |
228 | // } | |
229 | // if(newPati entIen == null) | |
230 | // { | |
231 | // throw new Illega lArgumentE xception(" newPatient Ien cannot be null") ; | |
232 | // } | |
233 | // p.setPatie ntId(newPa tientIen); | |
234 | // } | |
235 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.