1: <?php
2: namespace Azalea\Selenium\EHR\UI\Patients;
3: require_once('PatientVitalsAddPopup.php');
4:
5: 6: 7:
8:
9: class PatientVitals extends PatientSection
10: {
11:
12: protected static $hash = "/patients/p/{pat_id}/vitals";
13:
14: protected static $selectorSection = ".medical-PatientsVitalsListView";
15:
16: 17: 18: 19: 20:
21: protected static $REFRESH_BUTTON = 'button[data-events="click:onRefresh"]';
22: protected static $ADD_BUTTON = 'button[data-events="click:onNewVitals"]';
23: protected static $PRINT_BUTTON = 'button[data-events="click:onPrintVitals"]';
24: protected static $GROWTH_CHART_BUTTON = 'button[data-events="click:onGrowthCharts"]';
25: protected static $VITALS_GRID = '.medical-PatientsVitalsListView .awa-ui-CollectionGrid';
26:
27: 28: 29: 30: 31:
32: public function clickRefreshButton()
33: {
34: $this->byCss(self::$REFRESH_BUTTON)->click();
35: }
36:
37: public function clickPrintButton()
38: {
39: $this->byCss(self::$PRINT_BUTTON)->click();
40: }
41:
42: public function clickAddButton()
43: {
44: $this->byCss(self::$ADD_BUTTON)->click();
45: return new PatientVitalsAddPopup($this);
46: }
47:
48: public function clickGrowthChartButton()
49: {
50: $this->byCss(self::$GROWTH_CHART_BUTTON)->click();
51: }
52:
53:
54: public function clickDeleteVitalAtIndex($index=0)
55: {
56: $this->clickAndWait($this->byCss(self::$VITALS_GRID.' tr[data-grid-row="'.$index.'"] button[data-button-class="delete"]'), 2);
57: return new \Azalea\Selenium\EHR\UI\PopupConfirm($this);
58: }
59:
60:
61: public function deleteVitalAtIndex($index=0)
62: {
63: $popupConfirm = $this->clickDeleteVitalAtIndex($index);
64: $popupConfirm->confirm();
65: }
66:
67: public function verify($args = array())
68: {
69: if (parent::verify($args)) {
70: $this->byCss($this->getSelectorSection());
71: return true;
72: }
73: return false;
74: }
75: }