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