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 ChartProblemHistoryTest 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: public function testAddAndRemoveDiagnosisSyncsProblemHistory()
22: {
23: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
24:
25:
26: $chartView = $app->patients->get(Patients::REECE_CARTWRIGHT)->charts->navigate()->addChart();
27:
28:
29:
30: $chartView->icds->fillQuickSubmit("I10", 1)
31: ->submitQuickSubmit();
32:
33: $chartView->icds->grid->waitFor(".awa-ui-grid-row > .cic_code");
34:
35: 36: 37: 38:
39: $chartView->icds->grid->assertCanSee("I10");
40:
41:
42: $diagnosedDate = $chartView->icds->grid->first()->querySelector(".cic_diagnosed_ts")->text();
43:
44:
45: $chartView->subjective->press("Show All");
46:
47: 48: 49: 50:
51: $this->spinWait(function () use ($chartView, $diagnosedDate) {
52: $chartView->subjective->problems->grid->assertCanSee("I10");
53: $chartView->subjective->problems->grid->assertCanSee($diagnosedDate);
54: return true;
55: });
56:
57:
58:
59: $chartView->icds->grid->first()->querySelector('[data-button-class="Delete"]')->click();
60:
61: 62: 63: 64:
65: $this->spinWait(function () use ($chartView) {
66: $chartView->icds->grid->assertCanNotSee("I10");
67: return true;
68: });
69:
70: 71: 72: 73:
74: $this->spinWait(function () use ($chartView, $diagnosedDate) {
75: $chartView->subjective->problems->grid->assertCanNotSee("I10");
76: $chartView->subjective->problems->grid->assertCanNotSee($diagnosedDate);
77: return true;
78: });
79:
80:
81: $chartView->cancel();
82:
83: $this->assertNoErrorPopups();
84: }
85:
86: 87: 88: 89:
90: public function testAddEditRemoveProblemHistory()
91: {
92: $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
93:
94:
95: $chartView = $app->patients->get(Patients::AARON_CONN_ID)->charts->navigate()->addChart();
96:
97:
98: $chartView->subjective->press("Show All");
99:
100:
101: $chartView->subjective->press("Problem");
102:
103:
104: $chartView->subjective->problems->codeLookup->byICD10()->search("I10");
105:
106:
107: $chartView->subjective->problems->codeLookup->grid->waitForModelId(102782)->click();
108:
109: $diagnosedDate = date("m/d/Y");
110:
111: 112: 113: 114:
115: $this->spinWait(function () use ($chartView, $diagnosedDate) {
116: $chartView->subjective->problems->grid->assertCanSee("I10");
117: $chartView->subjective->problems->grid->assertCanSee("ACUTE");
118: $chartView->subjective->problems->grid->assertCanSee($diagnosedDate);
119: return true;
120: });
121:
122: $firstRow = $chartView->subjective->problems->grid->first();
123:
124:
125: $firstRow->querySelector('[data-button-class="edit"]')->click();
126:
127:
128: $firstRow->select("pip_status", "ACTIVE");
129:
130:
131: $firstRow->querySelector('[data-button-class="awa-cg-edit-submit"]')->click();
132: $this->waitForAjax();
133:
134: 135: 136: 137:
138: $this->spinWait(function () use ($chartView, $diagnosedDate) {
139: $chartView->subjective->problems->grid->assertCanSee("I10");
140: $chartView->subjective->problems->grid->assertCanSee("ACTIVE");
141: $chartView->subjective->problems->grid->assertCanSee($diagnosedDate);
142: return true;
143: });
144:
145:
146: $firstRow->querySelector('[data-button-class="delete"]')->click();
147:
148: 149: 150: 151:
152: $this->spinWait(function () use ($chartView) {
153: $chartView->subjective->problems->grid->assertCanNotSee("I10");
154: return true;
155: });
156:
157:
158: $chartView->cancel();
159:
160: $this->assertNoErrorPopups();
161: }
162: }
163:
164: ?>