1: <?php
2: namespace Azalea\Selenium\EHR\UI\Patients;
3:
4: class PatientsList extends \Azalea\Selenium\EHR\UI\Grid
5: {
6: protected static $selector = "#patient-list-tab .awa-ui-grid";
7:
8: 9: 10: 11:
12: public function getFirst()
13: {
14: return new PatientsListRow($this->getDriver(), $this->getRowByIndex(0));
15: }
16:
17: 18: 19: 20:
21: public function getAt($index)
22: {
23: return new PatientsListRow($this->getDriver(), $this->getRowByIndex($index));
24: }
25:
26: 27: 28: 29: 30:
31: public function getFirstPatientWithInsurance()
32: {
33: $elements = $this->getElementsByCss(static::$selector." [data-grid-row]");
34: foreach($elements as $i => $row) {
35: if ($this->exists(static::$selector.' [data-grid-row="'.$i.'"] .ins_name > a')) {
36: return new PatientsListRow($this->getDriver(), $this->byCss(
37: static::$selector.' [data-grid-row="'.$i.'"]'
38: ));
39: }
40: }
41:
42: throw new \RuntimeException("No Patient Row with Insurance Found in the Grid");
43: }
44: }