1: <?php
2: namespace Azalea\Selenium\EHR\UI\Patients;
3:
4: 5: 6:
7:
8: require_once ('PatientAllergySearchPopup.php');
9:
10: class PatientAllergies extends PatientSection
11: {
12:
13: protected static $hash = '/patients/p/{pat_id}/allergy_list';
14: protected static $selectorSection = '.medical-PatientsAllergiesListView';
15:
16: 17: 18: 19: 20:
21: protected static $ALLERGY_BUTTON_NEW = 'button[data-events="click:onNewAllergy"]';
22: protected static $ALLERGY_SEARCH = '.medical-PatientsAllergiesListView .search';
23: protected static $ALLERGY_GRID = '.medical-PatientsAllergiesListView .gridHolder';
24:
25: 26: 27: 28: 29:
30: public function clickButtonNewAllergy()
31: {
32: $this->byCss(self::$ALLERGY_BUTTON_NEW)->click();
33: return new PatientAllergySearchPopup($this);
34: }
35:
36: public function getAllergyNameAtGridIndex($index=0)
37: {
38: return $this->byCss(self::$ALLERGY_GRID.' tr[data-grid-row="'.$index.'"]')->text();
39: }
40:
41: public function setTextAllergySearch($text='')
42: {
43: $this->byCss(self::$ALLERGY_SEARCH)->value($text);
44: }
45:
46: public function verify($args = array())
47: {
48: if (parent::verify($args)) {
49: $this->byCss($this->getSelectorSection());
50: return true;
51: }
52: return false;
53: }
54: }