1: <?php
2: use Azalea\Selenium\App\ApplicationTestCase;
3: use Azalea\Selenium\App\Customers;
4: use Azalea\Selenium\App\Patients;
5: use Azalea\Selenium\App\Users;
6:
7: class EncounterProceduresTest extends ApplicationTestCase
8: {
9: public function supportsCustomer($cus_id)
10: {
11:
12: return (Customers::isEhrCustomer($cus_id) || Customers::isPmCustomer($cus_id));
13: }
14:
15: 16: 17: 18: 19:
20: public function testAddAndRemove()
21: {
22: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
23:
24:
25: $encounterView = $app->patients->get(Patients::CAMILA_FISHER_ID)
26: ->encounters
27: ->navigate()
28: ->addEncounter();
29:
30:
31:
32: $encounterView->setDateOfService(date("m/d/Y", time()))
33: ->select("enc_spl_id", "9")
34: ->select("enc_loc_id", "401")
35: ->tab();
36:
37:
38:
39: $encounterView->procedures->fillQuickSubmit("99214", 1)
40: ->fillQuickSubmit("81003", 2)
41: ->fillQuickSubmit("83036", 3)
42: ->fillQuickSubmit("10060", 4)
43: ->tab();
44: $encounterView->procedures->submitQuickSubmit();
45: $encounterView->procedures->grid->waitForRowCount(4);
46:
47: 48: 49: 50:
51: $encounterView->procedures->grid->assertCanSee("99214");
52: $encounterView->procedures->grid->assertCanSee("81003");
53: $encounterView->procedures->grid->assertCanSee("83036");
54: $encounterView->procedures->grid->assertCanSee("10060");
55:
56:
57: $encounterView->procedures->grid->first()->querySelector('.delete')->click();
58:
59:
60: $app->popup->confirmYes();
61:
62: 63: 64: 65:
66: $this->spinWait(function () use ($encounterView) {
67: $encounterView->procedures->grid->assertCanNotSee("99214");
68: return true;
69: });
70:
71:
72: $encounterView->procedures->waitFor(
73: $encounterView->procedures->selectors->addProcedureButton
74: )->click();
75:
76: $encounterView->popups->procedureSearch->verifyAndWait();
77: $encounterView->popups->procedureSearch->grid->waitForRowAt(0);
78:
79:
80: $encounterView->popups->procedureSearch->type("autoselect_search", "99214");
81: $encounterView->popups->procedureSearch->grid->waitForRowTextAt(0, "99214");
82:
83:
84: $encounterView->popups->procedureSearch->grid->waitForRowAt(0)->click();
85:
86:
87: $app->popup->first()->press("Select");
88:
89: 90: 91: 92:
93: $this->spinWait(function () use ($encounterView) {
94: $encounterView->procedures->grid->assertCanSee("99214");
95: return true;
96: });
97:
98:
99: $encounterView->procedures->removeAll();
100:
101:
102: $encounterView->cancel();
103:
104: $this->assertNoErrorPopups();
105: }
106:
107: 108: 109: 110: 111: 112:
113: public function testAddAndRemoveDxPointers()
114: {
115: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
116:
117:
118: $encounterView = $app->patients->get(Patients::CAMILA_FISHER_ID)
119: ->encounters
120: ->navigate()
121: ->addEncounter();
122:
123:
124:
125: $encounterView->setDateOfService(date("m/d/Y", time()))
126: ->select("enc_spl_id", "9")
127: ->select("enc_loc_id", "401")
128: ->tab();
129:
130:
131:
132: $encounterView->icds->fillQuickSubmit("I10", 1)->tab();
133: $encounterView->icds->submitQuickSubmit();
134: $encounterView->icds->grid->waitForRowCount(1);
135:
136:
137:
138: $encounterView->procedures->fillQuickSubmit("99214", 1)
139: ->submitQuickSubmit();
140: $encounterView->procedures->grid->waitForRowCount(1);
141:
142: 143: 144: 145: 146:
147: $encounterView->procedures->grid->assertCanSee("99214");
148: $encounterView->procedures->grid->assertCanSee("I10");
149:
150:
151: $encounterView->icds->grid->first()->querySelector('[data-button-class="delete"]')->click();
152:
153:
154: $app->popup->confirmYes();
155:
156: 157: 158: 159:
160: $this->spinWait(function () use ($encounterView) {
161: $encounterView->procedures->grid->assertCanNotSee("I10");
162: return true;
163: });
164:
165:
166: $encounterView->procedures->removeAll();
167:
168:
169: $encounterView->cancel();
170:
171: $this->assertNoErrorPopups();
172: }
173:
174: 175: 176: 177: 178: 179:
180: public function testApplyNewDxToAllProcedureCodes()
181: {
182: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
183:
184:
185: $encounterView = $app->patients->get(Patients::CAMILA_FISHER_ID)
186: ->encounters
187: ->navigate()
188: ->addEncounter();
189:
190:
191:
192: $encounterView->setDateOfService(date("m/d/Y", time()))
193: ->select("enc_spl_id", "9")
194: ->select("enc_loc_id", "401")
195: ->tab();
196:
197:
198:
199: $encounterView->procedures->fillQuickSubmit("99214", 1)
200: ->submitQuickSubmit();
201: $encounterView->procedures->grid->waitForRowCount(1);
202:
203:
204: $encounterView->icds->check(
205: $encounterView->icds->selectors->applyDxToAll
206: );
207:
208:
209:
210: $encounterView->icds->fillQuickSubmit("I10", 1)->tab();
211: $encounterView->icds->submitQuickSubmit();
212: $encounterView->icds->grid->waitForRowCount(1);
213:
214: 215: 216: 217: 218:
219: $this->waitForAjax();
220: $encounterView->procedures->grid->assertCanSee("99214");
221: $encounterView->procedures->grid->assertCanSee("I10");
222:
223:
224: $encounterView->icds->uncheck(
225: $encounterView->icds->selectors->applyDxToAll
226: );
227:
228:
229:
230: $encounterView->icds->fillQuickSubmit("F32.9", 1)
231: ->submitQuickSubmit();
232: $encounterView->icds->grid->waitForRowCount(2);
233:
234: 235: 236: 237: 238:
239: $this->waitForAjax();
240: $this->wait(1);
241: $this->spinWait(function () use ($encounterView) {
242: $encounterView->procedures->grid->assertCanNotSee("F32.9");
243: return true;
244: });
245:
246:
247: $encounterView->procedures->removeAll();
248:
249:
250: $encounterView->cancel();
251:
252: $this->assertNoErrorPopups();
253: }
254:
255: 256: 257: 258: 259:
260: public function testClearAllDxPointers()
261: {
262: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
263:
264:
265: $encounterView = $app->patients->get(Patients::CAMILA_FISHER_ID)
266: ->encounters
267: ->navigate()
268: ->addEncounter();
269:
270:
271:
272: $encounterView->setDateOfService(date("m/d/Y", time()))
273: ->select("enc_spl_id", "9")
274: ->select("enc_loc_id", "401")
275: ->tab();
276:
277:
278:
279:
280: $encounterView->icds->fillQuickSubmit("H35.029", 1)
281: ->fillQuickSubmit("S72.123F", 2)
282: ->fillQuickSubmit("T23.011S", 3)
283: ->fillQuickSubmit("Y37.110S", 4)
284: ->tab();
285: $encounterView->icds->submitQuickSubmit();
286: $encounterView->icds->grid->waitForRowCount(4);
287:
288:
289:
290: $encounterView->procedures->fillQuickSubmit("99214", 1)
291: ->fillQuickSubmit("81003", 2)
292: ->fillQuickSubmit("83036", 3)
293: ->fillQuickSubmit("10060", 4)
294: ->submitQuickSubmit();
295: $encounterView->procedures->grid->waitForRowCount(4);
296:
297: 298: 299: 300: 301:
302: $encounterView->procedures->grid->assertCanSee("H35.029");
303: $encounterView->procedures->grid->assertCanSee("S72.123F");
304: $encounterView->procedures->grid->assertCanSee("T23.011S");
305: $encounterView->procedures->grid->assertCanSee("Y37.110S");
306:
307:
308: $encounterView->procedures->querySelector(
309: $encounterView->procedures->selectors->clearAllDxPointersButton
310: )->click();
311:
312:
313: $app->popup->confirmYes();
314:
315: 316: 317: 318: 319:
320: $this->spinWait(function () use ($encounterView) {
321: $encounterView->procedures->grid->assertCanNotSee("H35.029");
322: $encounterView->procedures->grid->assertCanNotSee("S72.123F");
323: $encounterView->procedures->grid->assertCanNotSee("T23.011S");
324: $encounterView->procedures->grid->assertCanNotSee("Y37.110S");
325: return true;
326: });
327:
328:
329: $encounterView->procedures->removeAll();
330:
331:
332: $encounterView->cancel();
333:
334: $this->assertNoErrorPopups();
335: }
336:
337: 338: 339: 340: 341:
342: public function testApplyDxPointerToProcedures()
343: {
344: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
345:
346:
347: $encounterView = $app->patients->get(Patients::CAMILA_FISHER_ID)
348: ->encounters
349: ->navigate()
350: ->addEncounter();
351:
352:
353:
354: $encounterView->setDateOfService(date("m/d/Y", time()))
355: ->select("enc_spl_id", "9")
356: ->select("enc_loc_id", "401")
357: ->tab();
358:
359:
360:
361:
362: $encounterView->icds->fillQuickSubmit("I10", 1)->tab();
363: $encounterView->icds->submitQuickSubmit();
364: $encounterView->icds->grid->waitForRowCount(1);
365:
366:
367:
368: $encounterView->procedures->fillQuickSubmit("99214", 1)
369: ->fillQuickSubmit("81003", 2)
370: ->fillQuickSubmit("83036", 3)
371: ->fillQuickSubmit("10060", 4)
372: ->submitQuickSubmit();
373: $encounterView->procedures->grid->waitForRowCount(4);
374:
375:
376: $encounterView->procedures->querySelector(
377: $encounterView->procedures->selectors->clearAllDxPointersButton
378: )->click();
379:
380:
381: $app->popup->confirmYes();
382:
383: $this->waitForAjax();
384: $this->spinWait(function () use ($encounterView) {
385: $encounterView->procedures->grid->assertCanNotSee("I10");
386: return true;
387: });
388:
389:
390: $encounterView->icds->grid->first()->querySelector('[data-button-class="apply"]')->click();
391:
392: 393: 394: 395: 396:
397: $this->spinWait(function () use ($encounterView) {
398: $encounterView->procedures->grid->assertCanSee("I10");
399: return true;
400: });
401:
402:
403: $encounterView->procedures->removeAll();
404:
405:
406: $encounterView->cancel();
407:
408: $this->assertNoErrorPopups();
409: }
410: }
411:
412: ?>