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 EncounterDiagnosisTest 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 testMasterDxCodeSet()
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: 33:
34: $this->assertTrue($encounterView->querySelector(".enc_diag_cs_id_icd10_radio")->selected());
35:
36:
37: $encounterView->icds->search();
38:
39: $this->waitForAjax();
40:
41: 42: 43: 44:
45: $this->spinWait(function () use ($encounterView) {
46: $encounterView->icds->codeLookup->assertCanSee("Select ICD10");
47: return true;
48: });
49:
50:
51: $encounterView->cancel();
52:
53: $this->assertNoErrorPopups();
54: }
55:
56: 57: 58: 59: 60:
61: public function testAddAndRemove()
62: {
63: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
64:
65:
66: $encounterView = $app->patients->get(Patients::CAMILA_FISHER_ID)
67: ->encounters
68: ->navigate()
69: ->addEncounter();
70:
71:
72:
73: $encounterView->setDateOfService(date("m/d/Y", time()))
74: ->select("enc_spl_id", "9")
75: ->select("enc_loc_id", "401")
76: ->tab();
77:
78:
79:
80:
81: $encounterView->icds->fillQuickSubmit("H35.029", 1)
82: ->fillQuickSubmit("S72.123F", 2)
83: ->fillQuickSubmit("T23.011S", 3)
84: ->fillQuickSubmit("Y37.110S", 4)
85: ->tab();
86: $encounterView->icds->submitQuickSubmit();
87: $encounterView->icds->grid->waitForRowCount(4);
88:
89: 90: 91: 92: 93:
94: $encounterView->icds->grid->assertCanSee("#1 - H35.029");
95: $encounterView->icds->grid->assertCanSee("#2 - S72.123F");
96: $encounterView->icds->grid->assertCanSee("#3 - T23.011S");
97: $encounterView->icds->grid->assertCanSee("#4 - Y37.110S");
98:
99:
100: $encounterView->icds->search();
101:
102:
103: $encounterView->icds->codeLookup->byICD10()->search("I10");
104:
105:
106: $encounterView->icds->codeLookup->grid->waitForModelId(102782)->click();
107:
108: 109: 110: 111:
112: $this->spinWait(function () use ($encounterView) {
113: $encounterView->icds->grid->assertCanSee("#5 - I10");
114: return true;
115: });
116:
117:
118: $encounterView->icds->grid->first()->querySelector('[data-button-class="delete"]')->click();
119:
120:
121: $app->popup->confirmYes();
122:
123: 124: 125: 126: 127:
128: $this->spinWait(function () use ($encounterView) {
129: $encounterView->icds->grid->assertCanNotSee("H35.029");
130: $encounterView->icds->grid->assertCanSee("#1 - S72.123F");
131: $encounterView->icds->grid->assertCanSee("#2 - T23.011S");
132: $encounterView->icds->grid->assertCanSee("#3 - Y37.110S");
133: $encounterView->icds->grid->assertCanSee("#4 - I10");
134: return true;
135: });
136:
137:
138: $encounterView->cancel();
139:
140: $this->assertNoErrorPopups();
141: }
142: }
143:
144: ?>