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