3 * clientController class
6 * @link http://www.open-emr.org
7 * @author Jerry Padgett <sjpadgett@gmail.com>
8 * @copyright Copyright (c) 2018 Jerry Padgett <sjpadgett@gmail.com>
9 * @license https://www.gnu.org/licenses/agpl-3.0.en.html GNU Affero General Public License 3
12 require_once("oeDispatcher.php");
14 use oeFHIR\oeFHIRHttpClient
;
15 use oeFHIR\oeFHIRResource
;
17 class clientController
extends oeDispatchController
19 public function __construct()
21 parent
::__construct();
24 public function indexAction()
26 if (!$this->getSession('pid', '')) {
27 $pid = $this->getRequest('patient_id');
28 $this->setSession('pid', $pid);
30 $pid = $this->getSession('pid', '');
36 public function createAction()
38 $pid = $this->getRequest(pid
);
39 $type = $this->getRequest(type
);
40 $client = new oeFHIRHttpClient();
42 $rs = new oeFHIRResource();
43 $r = $rs->createPatientResource($pid);
44 $pt = $client->sendResource($type, $id, $r);
49 public function historyAction()
51 $pid = $this->getRequest(pid
);
52 $type = $this->getRequest(type
);
53 $client = new oeFHIRHttpClient();
55 $pt = $client->requestResource($type, $id, 'history');
59 public function readAction()
61 $pid = $this->getRequest(pid
);
62 $type = $this->getRequest(type
);
63 $client = new oeFHIRHttpClient();
65 $pt = $client->requestResource($type, $id, ''); // gets latest version.
69 public function searchAction()
71 $pid = $this->getRequest(pid
);
72 $type = $this->getRequest(type
);
73 $client = new oeFHIRHttpClient();
75 $pt = $client->requestResource($type, $id, 'search'); // gets latest version.