1: <?php
2: namespace Azalea\Selenium\EHR\UI\Patients;
3:
4: 5: 6:
7:
8: class PatientEncounters extends PatientSection
9: {
10:
11: protected static $hash = "/patients/p/{pat_id}/encounters";
12:
13: protected static $selectorSection = "#encounters_select";
14:
15: 16: 17: 18: 19:
20: protected static $BUTTON_REFRESH = '.btn_refresh';
21: protected static $BUTTON_NEW_ENCOUNTER = '.btn_new_encounter';
22: protected static $INPUT_SEARCH_ENCOUNTER = '#autoselect_search';
23: protected static $GRID_ENCOUNTERS = '#patient_encounters';
24:
25: 26: 27: 28: 29:
30: public function clickNewEncounterButton()
31: {
32: $this->byCss(self::$BUTTON_NEW_ENCOUNTER)->click();
33: $this->wait(2);
34: return new PatientEncountersAddPopup($this);
35: }
36:
37: public function clickRefreshButton()
38: {
39: $this->byCss(self::$BUTTON_REFRESH)->click();
40: }
41:
42: public function setTextEncountersSearch($text='')
43: {
44: $this->byCss(self::$INPUT_SEARCH_ENCOUNTER)->value($text);
45: }
46:
47: public function deleteEncounterAtIndex($index=0)
48: {
49: $this->clickDeleteAtIndex($index)->confirm();
50: }
51:
52: public function viewAtIndex($index=0)
53: {
54: $this->byCss(self::$GRID_ENCOUNTERS.' tr[data-grid-row="'.$index.'"] .view')->click();
55: }
56:
57: public function editAtIndex($index=0)
58: {
59: $this->byCss(self::$GRID_ENCOUNTERS.' tr[data-grid-row="'.$index.'"] .edit')->click();
60: }
61:
62: public function clickDeleteAtIndex($index=0)
63: {
64: $this->byCss(self::$GRID_ENCOUNTERS.' tr[data-grid-row="'.$index.'"] .delete')->click();
65: return new \Azalea\Selenium\EHR\UI\PopupConfirm($this);
66: }
67:
68: public function verify($args = array())
69: {
70: if (parent::verify($args)) {
71: $this->byCss($this->getSelectorSection());
72: return true;
73: }
74: return false;
75: }
76: }