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 ChartEncounterProceduresTest extends ApplicationTestCase
8: {
9: public function supportsCustomer($cus_id)
10: {
11:
12: return (Customers::isEhrCustomer($cus_id));
13: }
14:
15: 16: 17: 18: 19:
20: public function testAddChartProcedureAndInsertIntoEncounter()
21: {
22: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
23:
24:
25: $chartView = $app->patients->get(Patients::CAMILA_FISHER_ID)->charts->navigate()->addChart();
26:
27:
28: $chartView->setDateOfService(date("Ymd", time()))
29: ->select("enc_spl_id", "9")
30: ->tab();
31:
32:
33:
34: $chartView->procedures->fillQuickSubmit("99214")->submitQuickSubmit();
35: $chartView->procedures->grid->waitForRowCount(1);
36:
37:
38: $chartView->icds->fillQuickSubmit("I10")->submitQuickSubmit();
39: $chartView->icds->grid->waitForRowCount(1);
40:
41: 42: 43: 44:
45: $chartView->procedures->grid->assertCanSee("99214");
46:
47:
48: $chartView->goToEncounter();
49:
50:
51: $encView = $app->encounters->getFromHash();
52:
53: 54: 55: 56: 57:
58: $this->spinWait(function () use ($encView) {
59: $encView->procedures->grid->assertCanSee("99214");
60: $encView->procedures->grid->assertCanSee("I10");
61: return true;
62: });
63:
64:
65: $encView->edit();
66:
67:
68: $encView->procedures->grid->waitForRowElementAt(0, '.delete')->click();
69:
70:
71: $app->popup->confirmYes();
72:
73:
74: $encView->cancel();
75:
76: $this->assertNoErrorPopups();
77: }
78:
79: 80: 81: 82: 83:
84: public function testDeleteOrderChartEncounter()
85: {
86: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
87:
88:
89: $chartView = $app->patients->get(Patients::CAMILA_FISHER_ID)->charts->navigate()->addChart();
90:
91:
92: $chartView->setDateOfService(date("Ymd", time()))
93: ->select("enc_spl_id", "9")
94: ->tab();
95:
96:
97: $chartView->procedures->fillQuickSubmit("99212")->submitQuickSubmit();
98: $chartView->procedures->grid->waitForRowCount(1);
99:
100:
101: $chartView->procedures->grid->first()->querySelector('[data-button-class="delete"]')->click();
102: $chartView->procedures->grid->waitForEmpty();
103:
104:
105: $chartView->goToEncounter();
106:
107:
108: $encView = $app->encounters->getFromHash()->verifyAndWait();
109:
110: 111: 112: 113:
114: $this->spinWait(function () use ($encView) {
115: $encView->procedures->grid->assertCanNotSee("99212");
116: return true;
117: });
118:
119:
120: $encView->cancel();
121:
122: $this->assertNoErrorPopups();
123: }
124:
125: 126: 127: 128: 129:
130: public function testDeleteOrderEncounterChart()
131: {
132: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
133:
134:
135: $chartView = $app->patients->get(Patients::CAMILA_FISHER_ID)->charts->navigate()->addChart();
136:
137:
138: $chartView->setDateOfService(date("Ymd", time()))
139: ->select("enc_spl_id", "9")
140: ->tab();
141:
142:
143: $chartView->procedures->fillQuickSubmit("99212")->submitQuickSubmit();
144:
145:
146: $chartView->goToEncounter();
147:
148:
149: $encView = $app->encounters->getFromHash()->edit();
150:
151:
152: $encView->procedures->grid->waitForRowElementAt(0, '.delete')->click();
153:
154:
155: $app->popup->confirmYes();
156:
157: 158: 159: 160:
161: $this->spinWait(function () use ($encView) {
162: $encView->procedures->grid->assertCanNotSee("99212");
163: return true;
164: });
165:
166:
167:
168: $encView->goToChart();
169:
170:
171: $chartView->verifyAndWait()->edit();
172:
173:
174: $chartView->procedures->removeAll();
175: $this->assertNoErrorPopups();
176:
177:
178: $chartView->cancel();
179:
180: $this->assertNoErrorPopups();
181: }
182: }
183:
184: ?>