1: <?php
2: namespace Azalea\Selenium\App\Charts;
3:
4: use Azalea\Selenium\Toolkit\View;
5:
6: class Chart extends View
7: {
8: 9: 10:
11: public function goToEncounter()
12: {
13: $this->driver->waitFor(".charts-ChartControlsView .btn_billing")->click();
14: return $this;
15: }
16:
17: 18: 19:
20: public function edit()
21: {
22: $this->driver->waitFor(".charts-ChartControlsView .btn_edit_encounter")->click();
23: $this->driver->wait(1);
24: $this->waitFor('.charts-ChartView select[name="enc_phy_id"]');
25:
26: $this->driver->waitFor(".chart-controls-edit #btn_jump_cc")->click();
27: }
28:
29: 30: 31:
32: public function save()
33: {
34: $self = $this;
35:
36: $this->driver->waitFor(".charts-ChartControlsView");
37: $this->driver->filter(".charts-ChartControlsView")->press("Save");
38:
39:
40: $this->driver->getApp()->popup->confirmYes();
41:
42: $this->spinWait(function () use ($self) {
43: return (!$self->canSeeElement('.charts-ChartView select[name="enc_phy_id"]'));
44: });
45:
46: $this->waitForAjax();
47:
48: $this->verifyAndWait();
49:
50:
51: $this->driver->waitFor(".chart-controls-details #btn_jump_cc")->click();
52:
53: $this->clearCache();
54:
55: return $this;
56: }
57:
58: 59: 60:
61: public function sign()
62: {
63: $self = $this;
64:
65: $this->driver->waitFor(".charts-ChartControlsView #btn_soap_sign")->click();
66: $this->waitForAjax();
67:
68:
69: $this->driver->getApp()->popup->confirmYes();
70:
71: $this->spinWait(function () use ($self) {
72: return (!$self->canSeeElement('.charts-ChartView select[name="enc_phy_id"]'));
73: });
74:
75: $this->waitForAjax();
76: $this->clearCache();
77:
78: $this->driver->spinWait(function () use ($self) {
79: $self->driver->assertElementExists("#print_chart_preview");
80: return true;
81: });
82:
83: return $this;
84: }
85:
86: 87: 88:
89: public function amend()
90: {
91: $self = $this;
92:
93: $this->driver->waitFor(".charts-ChartControlsView .btn_amend_encounter")->click();
94: $this->waitForAjax();
95:
96:
97: $this->driver->getApp()->popup->confirmYes();
98:
99:
100: $this->waitForAjax();
101: $this->clearCache();
102:
103: return $this->verifyAndWait();
104: }
105:
106: 107: 108: 109: 110:
111: public function canSign()
112: {
113: return $this->driver->canSeeElement(".charts-ChartControlsView #btn_soap_sign");
114: }
115:
116: 117: 118: 119: 120:
121: public function canAmend()
122: {
123: return $this->driver->canSeeElement(".charts-ChartControlsView .btn_amend_encounter");
124: }
125:
126: 127: 128:
129: public function cancel()
130: {
131:
132:
133: $this->driver->getFirstVisible("#enc_more_actions")->click();
134: $this->driver->getFirstVisible(".encounter-action-cancel > a")->click();
135: $this->driver->getApp()->popup->confirmYes();
136: }
137:
138: 139: 140:
141: public function setDateOfService($value)
142: {
143: $this->querySelector('[data-model-attr-target="enc_date_of_service"]')->value($value);
144: $this->tab();
145: return $this;
146: }
147: }
148:
149: ?>