1: <?php
2: namespace Azalea\Selenium\EHR\UI\Patients;
3:
4: class PatientDashboard extends PatientSection
5: {
6:
7: protected static $hash = "/patients/p/{pat_id}/dash";
8:
9: protected static $selectorSection = ".patients-PatientDashboardView";
10:
11: 12: 13:
14: public function expandAll()
15: {
16: $this->byCss($this->getSelectorControls()." button > .expand16")->click();
17: $this->spinWait(array($this, "isHazeScreenNotVisible"), 15);
18: }
19:
20: 21: 22: 23:
24: public function hasClinicalSummary($opened = false)
25: {
26: return $this->hasSection("Clinical Summary", $opened);
27: }
28:
29: 30: 31: 32:
33: public function hasAccountSummary($opened = false)
34: {
35: return $this->hasSection("Account Summary", $opened);
36: }
37:
38: 39: 40: 41:
42: public function hasAppointmentSummary($opened = false)
43: {
44: return $this->hasSection("Appointment Summary", $opened);
45: }
46:
47: 48: 49: 50:
51: public function hasInsuranceSummary($opened = false)
52: {
53: return $this->hasSection("Insurance Summary", $opened);
54: }
55:
56: 57: 58: 59:
60: public function hasLinkedPatients($opened = false)
61: {
62: return $this->hasSection("Linked Patients", $opened);
63: }
64:
65: 66: 67: 68:
69: public function hasComments($opened = false)
70: {
71: return $this->hasSection("Comments", $opened);
72: }
73:
74: 75: 76: 77:
78: public function hasPopupComments($opened = false)
79: {
80: return $this->hasSection("Pop up Comments", $opened);
81: }
82:
83: 84: 85: 86:
87: public function hasHIPAALog($opened = false)
88: {
89: return $this->hasSection("HIPAA Log", $opened);
90: }
91:
92: 93: 94: 95:
96: public function isPatientSelfPay()
97: {
98: $xpath = '//*[@id="pat_dash_demog_details"]/tbody/tr[3]/td';
99: return (stripos($this->byXPath($xpath)->text(), "SELF PAY") !== false);
100: }
101:
102: 103: 104: 105: 106: 107:
108: protected function hasSection($label, $opened = false)
109: {
110: $elements = $this->elements(
111: $this->using('css selector')->value(
112: $this->getSelectorSection().' .awa-section-label'.($opened ? '.opened' : '').' .form_header'
113: )
114: );
115: if (count($elements)) {
116: foreach($elements as $element) {
117: if ($element->text() == $label) {
118: return true;
119: }
120: }
121: }
122: return false;
123: }
124:
125: 126: 127: 128:
129: public function verify($args = array())
130: {
131: if (parent::verify($args)) {
132: $this->byCss($this->getSelectorSection());
133: return true;
134: }
135:
136: return false;
137: }
138: }