1: <?php
2: namespace Azalea\Selenium\EHR\UI\Patients;
3:
4: 5: 6:
7:
8: class PatientLabOrdersAddView extends PatientSection
9: {
10:
11: protected static $hash = "/patients/p/{pat_id}/orders/0/edit";
12: protected static $selectorSection = ".cpoe-LabOrderEditView";
13:
14: 15: 16: 17: 18:
19:
20: protected static $BUTTON_SAVE = 'button[data-events="click:onSave"]';
21: protected static $BUTTON_CANCEL = 'button[data-events="click:onCancel"]';
22: protected static $BUTTON_SAVE_NO_SEND = 'button[data-events="click:onSaveNoSend"]';
23: protected static $BUTTON_COLLECTED_DATE_NOW = '.now_ts_btn';
24:
25:
26: protected static $TEXT_INITIALS = 'input[name="ord_collectors_initials"]';
27: protected static $TEXT_ORDER_NOTES = 'textarea[name="ord_notes"]';
28: protected static $TEXT_ROOM_NUMBER = 'input[name="ord_room_num"]';
29: protected static $TEXT_PATIENT_NOTES = 'textarea[name="ord_pat_notes"]';
30: protected static $TEXT_INTERVAL_START_DATE = '#ost input[data-model-attr-target="ost_start_date"]';
31: protected static $TEXT_INTERVAL_END_DATE = '#ost input[data-model-attr-target="ost_end_date"]';
32:
33:
34: protected static $SELECT_LAB = 'div[data-model-attr-field="ord_lab_combo_id"]';
35: protected static $SELECT_INTERVAL = 'div[data-model-attr-field="ost_repeats"]';
36: protected static $SELECT_BILL_TYPE = 'div[data-model-attr-field="ord_bill_type"]';
37: protected static $SELECT_ORDER_STATUS = 'div[data-model-attr-field="ord_status"]';
38: protected static $SELECT_PRIMARY_INSURANCE = 'div[data-model-attr-field="ord_ins1_id"]';
39: protected static $SELECT_RENDERING_PROVIDER = 'div[data-model-attr-field="ord_phy_id"]';
40:
41:
42: protected static $CHECK_SEND_PATIENT_PSC = 'input[name="ord_psc"]';
43:
44:
45: protected static $BUTTON_ADD_DIAGNOSES = '.add_icd9';
46: protected static $BUTTON_ADD_TEST_CODE = '.add_test_code';
47: protected static $TEST_CODE_VOLUME = 'input[name="ord_volume"]';
48: protected static $TEST_CODE_FASTING = 'input[name="ord_fasting"]';
49: protected static $TEST_CODE_DURATION = 'input[name="ord_duration"]';
50: protected static $TEST_CODE_SOURCE = 'input[name="ord_source"]';
51: protected static $TEST_CODE_GRID = '#ord_test_codes #codes_grid';
52: protected static $DIAGNOSES_GRID = '#ord_icd9s #codes_grid';
53:
54: 55: 56: 57: 58:
59:
60: 61: 62: 63: 64:
65: public function clickSaveButton()
66: {
67: $this->byCss(self::$BUTTON_SAVE)->click();
68: }
69:
70: public function clickCancelButton()
71: {
72: $this->byCss(self::$BUTTON_CANCEL)->click();
73: }
74:
75: public function clickSaveNoSendButton()
76: {
77: $this->byCss(self::$BUTTON_SAVE_NO_SEND)->click();
78: }
79:
80: public function clickButtonCollectedDateNow()
81: {
82: $this->byCss(self::$BUTTON_COLLECTED_DATE_NOW)->click();
83: }
84:
85: public function clickCheckSendPatientPSC()
86: {
87: $this->byCss(self::$CHECK_SEND_PATIENT_PSC)->click();
88: }
89:
90: public function clickAddDiagnosesButton()
91: {
92: $selector = self::$BUTTON_ADD_DIAGNOSES;
93: if($this->displayed($selector))
94: {
95: $this->byCss($selector)->click();
96: }
97: }
98:
99: public function clickAddTestCodesButton()
100: {
101: $selector = self::$BUTTON_ADD_TEST_CODE;
102: if($this->displayed($selector))
103: {
104: $this->byCss($selector)->click();
105: }
106: }
107:
108: 109: 110: 111: 112:
113: public function selectLab($index=0)
114: {
115: $this->clickSelectLab();
116: $this->clickLabOptionByIndex($index);
117: }
118:
119: public function selectInterval($index=0)
120: {
121:
122: if($this->displayed(self::$SELECT_INTERVAL))
123: {
124: $this->clickSelectInterval();
125: $this->clickIntervalOptionByIndex($index);
126: }
127: }
128:
129: public function selectBillType($index=0)
130: {
131: $this->clickSelectBillType();
132: $this->clickBillTypeOptionByIndex($index);
133: }
134:
135: public function selectOrderStatus($index=0)
136: {
137: $this->clickSelectOrderStatus();
138: $this->clickOrderStatusOptionByIndex($index);
139: }
140:
141: public function selectPrimaryInsurance($index=0)
142: {
143:
144: if($this->displayed(self::$SELECT_PRIMARY_INSURANCE))
145: {
146: $this->clickSelectPrimaryInsurance();
147: $this->clickPrimaryInsuranceOptionByIndex($index);
148: }
149: }
150:
151: public function selectRenderingProvider($index=0)
152: {
153: $this->clickSelectRenderingProvider();
154: $this->clickRenderingProviderOptionByIndex($index);
155: }
156:
157: 158: 159: 160: 161: 162:
163: public function clickSelectLab()
164: {
165: $this->byCss(self::$SELECT_LAB.' .awa-ui-searchable-select-overlay')->click();
166: }
167:
168: public function clickSelectInterval()
169: {
170: $this->byCss(self::$SELECT_INTERVAL.' .awa-ui-searchable-select-overlay')->click();
171: }
172:
173: public function clickSelectBillType()
174: {
175: $this->byCss(self::$SELECT_BILL_TYPE.' .awa-ui-searchable-select-overlay')->click();
176: }
177:
178: public function clickSelectOrderStatus()
179: {
180: $this->byCss(self::$SELECT_ORDER_STATUS.' .awa-ui-searchable-select-overlay')->click();
181: }
182:
183: public function clickSelectPrimaryInsurance()
184: {
185: $this->byCss(self::$SELECT_PRIMARY_INSURANCE.' .awa-ui-searchable-select-overlay')->click();
186: }
187:
188: public function clickSelectRenderingProvider()
189: {
190: $this->byCss(self::$SELECT_RENDERING_PROVIDER.' .awa-ui-searchable-select-overlay')->click();
191: }
192:
193: 194: 195: 196: 197: 198:
199: public function clickLabOptionByIndex($index=0)
200: {
201: $index++;
202: $this->byCss(self::$SELECT_LAB.' ul li:nth-child('.$index.') > button')->click();
203: }
204:
205: public function clickIntervalOptionByIndex($index=0)
206: {
207: $index++;
208: $this->byCss(self::$SELECT_INTERVAL.' ul li:nth-child('.$index.') > button')->click();
209: }
210:
211: public function clickBillTypeOptionByIndex($index=0)
212: {
213: $index++;
214: $this->byCss(self::$SELECT_BILL_TYPE.' ul li:nth-child('.$index.') > button')->click();
215: }
216:
217: public function clickOrderStatusOptionByIndex($index=0)
218: {
219: $index++;
220: $this->byCss(self::$SELECT_ORDER_STATUS.' ul li:nth-child('.$index.') > button')->click();
221: }
222:
223: public function clickPrimaryInsuranceOptionByIndex($index=0)
224: {
225: $index++;
226: $this->byCss(self::$SELECT_PRIMARY_INSURANCE.' ul li:nth-child('.$index.') > button')->click();
227: }
228:
229: public function clickRenderingProviderOptionByIndex($index=0)
230: {
231: $index++;
232: $this->byCss(self::$SELECT_RENDERING_PROVIDER.' ul li:nth-child('.$index.') > button')->click();
233: }
234:
235: 236: 237: 238: 239:
240: public function setTextInitials($text='')
241: {
242: $this->byCss(self::$TEXT_INITIALS)->value($text);
243: }
244:
245: public function setTextOrderNotes($text='')
246: {
247: $this->byCss(self::$TEXT_ORDER_NOTES)->value($text);
248: }
249:
250: public function setTextRoomNumber($text='')
251: {
252: $this->byCss(self::$TEXT_ROOM_NUMBER)->value($text);
253: }
254:
255: public function setTextPatientNotes($text='')
256: {
257: $this->byCss(self::$TEXT_PATIENT_NOTES)->value($text);
258: }
259:
260: public function setTextVolume($text='')
261: {
262: $selector = self::$TEST_CODE_VOLUME;
263: if($this->displayed($selector))
264: {
265: $this->byCss($selector)->value($text);
266: }
267: }
268:
269: public function setTextDuration($text='')
270: {
271: $selector = self::$TEST_CODE_DURATION;
272: if($this->displayed($selector))
273: {
274: $this->byCss($selector)->value($text);
275: }
276: }
277:
278: public function setTextFasting($text='')
279: {
280: $selector = self::$TEST_CODE_FASTING;
281: if($this->displayed($selector))
282: {
283: $this->byCss($selector)->value($text);
284: }
285: }
286:
287: public function setTextSource($text='')
288: {
289: $selector = self::$TEST_CODE_SOURCE;
290: if($this->displayed($selector))
291: {
292: $this->byCss($selector)->value($text);
293: }
294: }
295:
296: public function setTextIntervalStartDate($text='')
297: {
298: $selector = self::$TEXT_INTERVAL_START_DATE;
299: if($this->displayed($selector))
300: {
301: $this->byCss($selector)->value($text);
302: }
303: }
304:
305: public function setTextIntervalEndDate($text='')
306: {
307: $selector = self::$TEXT_INTERVAL_END_DATE;
308: if($this->displayed($selector))
309: {
310: $this->byCss($selector)->value($text);
311: }
312: }
313:
314: 315: 316: 317: 318:
319: public function clickDiagnoseByIndex($index=0)
320: {
321: $index++;
322: $this->byCss(self::$DIAGNOSES_GRID.' tr[data-grid-row="'.$index.'"]')->click();
323: }
324:
325: public function clickTestCodeByIndex($index=0)
326: {
327: $index++;
328: $this->byCss(self::$TEST_CODE_GRID.' tr[data-grid-row="'.$index.'"]')->click();
329: }
330:
331: public function verify($args = array())
332: {
333: if (parent::verify($args)) {
334: $this->byCss($this->getSelectorSection());
335: return true;
336: }
337: return false;
338: }
339: }