1: <?php
2: namespace Azalea\Selenium\App\Patients;
3:
4: use Azalea\Selenium\Toolkit\View;
5:
6: class Patients extends View
7: {
8: 9: 10: 11: 12: 13: 14:
15: public function getIdFromHash($timeout = 30)
16: {
17:
18: $matches = null;
19: $regex = "/#\/patients\/p\/(\d+)[\/\w+]*/";
20: $this->driver->waitForHash($regex);
21: preg_match($regex, $this->getCurrentHash(), $matches);
22: $pat_id = $matches[1];
23: return $pat_id;
24: }
25:
26: 27: 28: 29: 30: 31: 32: 33:
34: public function open($pat_id, $section = "dash")
35: {
36: $this->updateHash("/patients/p/".$pat_id."/".$section);
37: return $this->driver->assertView("patients/patient.json", array("pat_id" => $pat_id));
38: }
39:
40: 41: 42: 43: 44: 45: 46:
47: public function get($pat_id)
48: {
49: return $this->driver->getView("patients/patient.json", array("pat_id" => $pat_id));
50: }
51: }
52:
53: ?>
54: