1: <?php
2: namespace Azalea\Selenium\EHR\UI\Patients;
3:
4: class PatientSidebar extends \Azalea\Selenium\Core\View
5: {
6: protected static $selector = "#patient{pat_id} .awa-mvc-StructuredView-sidebar";
7:
8: public static $DASHBOARD = "dash";
9: public static $DEMOGRAPHICS = "demog";
10: public static $INSURANCE = "insurance_list";
11: public static $APPOINTMENTS = "appointments";
12: public static $DOCUMENTS = "documents";
13: public static $ASSEMBLY = "assembly";
14: public static $CHARTS = "chart_list";
15:
16: 17: 18:
19: public function __construct($driver, $args)
20: {
21: if (!isset($args['pat_id'])) {
22: throw new \InvalidArgumentException("Required View Arg: pat_id");
23: }
24: return parent::__construct($driver, $args);
25: }
26:
27: public function clickDashboard()
28: {
29: $this->clickItem(self::$DASHBOARD);
30: return new PatientDashboard($this, array("pat_id" => $this->id));
31: }
32:
33: public function clickDemographics()
34: {
35: $this->clickItem(self::$DEMOGRAPHICS);
36: return new PatientDemographics($this, array("pat_id" => $this->id));
37: }
38:
39: public function clickInsurance()
40: {
41: $this->clickItem(self::$INSURANCE);
42: return new PatientInsurance($this, array("pat_id" => $this->id));
43: }
44:
45: public function clickAppointments()
46: {
47: $this->clickItem(self::$APPOINTMENTS);
48: return new PatientAppointments($this, array("pat_id" => $this->id));
49: }
50:
51: public function clickDocuments()
52: {
53: $this->clickItem(self::$DOCUMENTS);
54: return new PatientDocuments($this, array("pat_id" => $this->id));
55: }
56:
57: public function clickAssembly()
58: {
59: $this->clickItem(self::$ASSEMBLY);
60: return new PatientAssembly($this, array("pat_id" => $this->id));
61: }
62:
63: public function clickCharts()
64: {
65: $this->clickItem(self::$CHARTS);
66: return new PatientCharts($this, array("pat_id" => $this->id));
67: }
68:
69: 70: 71: 72:
73: protected function clickItem($item)
74: {
75: $this->clickAndWait($this->byCss($this->getSelector().' li[item="'.$item.'"]'));
76: }
77:
78: 79: 80: 81: 82:
83: public function hasItem($item)
84: {
85: return $this->displayed($this->getSelector().' li[item="'.$item.'"]');
86: }
87:
88: 89: 90: 91: 92:
93: public function getSelector($args = array())
94: {
95: return parent::getSelector(array(
96: "pat_id" => $this->id
97: ));
98: }
99:
100: 101: 102: 103:
104: public function verify($args = array())
105: {
106: $this->id = $args['pat_id'];
107: $this->byCss($this->getSelector());
108: return true;
109: }
110: }