1: <?php
2: namespace Azalea\Selenium\EHR\UI\Patients;
3: require_once('PatientLabOrdersAddView.php');
4:
5: 6: 7:
8:
9: class PatientLabOrders extends PatientSection
10: {
11:
12: protected static $hash = "/patients/p/{pat_id}/order_list";
13: protected static $selectorSection = ".cpoe-LabOrdersListView";
14:
15: 16: 17: 18: 19:
20: protected static $BUTTON_REFRESH = '#btn_refresh';
21: protected static $BUTTON_ORDER_NEW = '#btn_new_order';
22: protected static $SELECT_ACTIONS = '#orders_actions';
23: protected static $SEARCH_BAR = '.cpoe-LabOrdersListView .search';
24: protected static $GRID = '.cpoe-LabOrdersListView .awa-ui-grid';
25:
26: 27: 28: 29: 30:
31: public function clickRefreshButton()
32: {
33: $this->byCss(self::$BUTTON_REFRESH)->click();
34: }
35:
36: public function clickNewOrderButton()
37: {
38: $this->clickAndWait($this->byCss(self::$BUTTON_ORDER_NEW), 2);
39: return new PatientLabOrdersAddView($this, array("pat_id" => $this->getPatientId()));
40: }
41:
42: public function clickDeleteOrderAtIndex($index)
43: {
44: $this->byCss(self::$GRID.' tr[data-grid-row="'.$index.'"] button[data-button-class="lab_remove"]')->click();
45: return new \Azalea\Selenium\EHR\UI\PopupConfirm($this);
46: }
47:
48: public function setTextSearchBar($text='')
49: {
50: $this->byCss(self::$SEARCH_BAR)->value($text);
51: }
52:
53:
54: public function deleteOrderAtIndex($index=0)
55: {
56: $popupConfirm = $this->clickDeleteOrderAtIndex($index);
57: $popupConfirm->confirm();
58: }
59:
60: public function verify($args = array())
61: {
62: if (parent::verify($args)) {
63: $this->byCss($this->getSelectorSection());
64: return true;
65: }
66: return false;
67: }
68: }