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 ChartProceduresTest extends ApplicationTestCase
8: {
9: public function supportsCustomer($cus_id)
10: {
11:
12: return (Customers::isEhrCustomer($cus_id) || Customers::isEmrCustomer($cus_id));
13: }
14:
15: 16: 17: 18: 19: 20: 21:
22: public function testDosAndPosRequirement()
23: {
24: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
25:
26:
27: $chartView = $app->patients->get(Patients::CAMILA_FISHER_ID)->charts->navigate()->addChart();
28:
29:
30: $chartView->setDateOfService("")
31: ->select("enc_spl_id", "")
32: ->tab();
33:
34: 35: 36: 37: 38:
39: $chartView->assertCanSee("Date of Service and Place of Service are required before adding a Procedure")
40: ->assertElementNotVisible(".charts-ChartsProceduresView .pc_quicksubmit");
41:
42:
43: $chartView->setDateOfService(date("Ymd", time()))
44: ->select("enc_spl_id", "9")
45: ->tab();
46:
47: 48: 49: 50:
51: $chartView->procedures->waitFor(".pc_quicksubmit");
52: $chartView->procedures->assertElementNotVisible(".warning");
53:
54:
55: $chartView->setDateOfService("")
56: ->select("enc_spl_id", "")
57: ->tab();
58:
59: 60: 61: 62: 63:
64: $chartView->assertCanSee("Date of Service and Place of Service are required before adding a Procedure")
65: ->assertElementNotVisible(".charts-ChartsProceduresView .pc_quicksubmit");
66:
67:
68: $chartView->cancel();
69:
70: $this->assertNoErrorPopups();
71: }
72:
73: 74: 75: 76: 77:
78: public function testAddAndRemove()
79: {
80: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
81:
82:
83: $chartView = $app->patients->get(Patients::CAMILA_FISHER_ID)->charts->navigate()->addChart();
84:
85:
86: $chartView->setDateOfService(date("Ymd", time()))
87: ->select("enc_spl_id", "9")
88: ->tab();
89:
90:
91:
92: $chartView->procedures->fillQuickSubmit("99214", 1)
93: ->fillQuickSubmit("81003", 2)
94: ->fillQuickSubmit("83036", 3)
95: ->fillQuickSubmit("10060", 4)
96: ->submitQuickSubmit();
97:
98: $chartView->procedures->grid->waitFor(".awa-ui-grid-row > .cp_code");
99:
100: 101: 102: 103:
104: $chartView->procedures->grid->assertCanSee("99214");
105: $chartView->procedures->grid->assertCanSee("81003");
106: $chartView->procedures->grid->assertCanSee("83036");
107: $chartView->procedures->grid->assertCanSee("10060");
108:
109:
110: $chartView->procedures->grid->first()->querySelector('[data-button-class="delete"]')->click();
111:
112: 113: 114: 115:
116: $this->spinWait(function () use ($chartView) {
117: $chartView->procedures->grid->assertCanNotSee("99214");
118: return true;
119: });
120:
121:
122: $chartView->procedures->search();
123:
124: $chartView->procedures->codeLookup->byCPT()->search("99214");
125:
126:
127: $chartView->procedures->codeLookup->grid->waitFor('[data-model-id="49314"] .awa-ui-grid-checkbox')->click();
128: $chartView->procedures->codeLookup->saveSelected();
129:
130: 131: 132: 133:
134: $this->spinWait(function () use ($chartView) {
135: $chartView->procedures->grid->assertCanSee("99214");
136: return true;
137: });
138:
139:
140: $chartView->procedures->removeAll();
141:
142:
143: $chartView->cancel();
144:
145: $this->assertNoErrorPopups();
146: }
147: }
148:
149: ?>