62 lines
1.7 KiB
PHP
62 lines
1.7 KiB
PHP
<?php
|
|
class Test extends MY_Controller {
|
|
function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
/*
|
|
gql : type , name , param, variable , return
|
|
*/
|
|
function search_person($query) {
|
|
$this->load->library("his/simrs");
|
|
$token = $this->simrs->get_token();
|
|
list($is_ok, $resp) = $this->simrs->gql(
|
|
"query",
|
|
"personSearch",
|
|
["keywords" => "String!"],
|
|
["keywords" => $query],
|
|
"personID personName salutation prefix suffix birthDatetime birthPlace gender isPatient isPractitioner patientMRN bpjs nik nrp mrn alamat",
|
|
$token,
|
|
""
|
|
);
|
|
if (!$is_ok) {
|
|
$this->sys_error("Error GQL Creation " , print_r($resp,true));
|
|
exit;
|
|
}
|
|
$result = [];
|
|
foreach($resp as $r) {
|
|
if($r["isPatient"]) {
|
|
$result[] = $r;
|
|
}
|
|
}
|
|
$this->sys_ok($result);
|
|
}
|
|
|
|
function person_detail($personID) {
|
|
$this->load->library("his/simrs");
|
|
$token = $this->simrs->get_token();
|
|
list($is_ok, $resp) = $this->simrs->gql(
|
|
"query",
|
|
"personGet",
|
|
["personID" => "ID!"],
|
|
["personID" => $personID],
|
|
"personID personName salutation prefix suffix birthDatetime birthPlace gender bloodType { codingCode codingSystem codingDisplay }
|
|
bloodRhesus { codingCode codingSystem codingDisplay }
|
|
personIdentifier { identifier{ identifierType{codingCode codingSystem codingDisplay} identifierValue } } ",
|
|
$token,
|
|
"x"
|
|
);
|
|
if (!$is_ok) {
|
|
$this->sys_error("Error GQL Creation " , print_r($resp,true));
|
|
exit;
|
|
}
|
|
$result = [];
|
|
foreach($resp as $r) {
|
|
if($r["isPatient"]) {
|
|
$result[] = $r;
|
|
}
|
|
}
|
|
$this->sys_ok($result);
|
|
}
|
|
}
|