4780 lines
177 KiB
Plaintext
4780 lines
177 KiB
Plaintext
<?php
|
|
class Generatessfisik extends MY_Controller
|
|
{
|
|
var $db_smartone;
|
|
var $load;
|
|
var $hostname;
|
|
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->db_smartone = $this->load->database("onedev", true);
|
|
$this->hostname = $_SERVER['HTTP_HOST'];;
|
|
}
|
|
public function post($url, $data)
|
|
{
|
|
$ch = curl_init($url);
|
|
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
|
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
|
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
|
|
curl_setopt($ch, CURLOPT_HTTPHEADER, [
|
|
"Content-Type: application/text",
|
|
"Content-Length: " . strlen($data),
|
|
]);
|
|
$result = curl_exec($ch);
|
|
if (curl_error($ch) != "") {
|
|
echo json_encode([
|
|
"status" => "ERR",
|
|
"message" => "Http Error : " . curl_error($ch),
|
|
]);
|
|
curl_close($ch);
|
|
exit();
|
|
}
|
|
curl_close($ch);
|
|
return $result;
|
|
}
|
|
function convertobjtoarr($data)
|
|
{
|
|
|
|
if (is_object($data)) {
|
|
$data = get_object_vars($data);
|
|
}
|
|
|
|
if (is_array($data)) {
|
|
return array_map(__FUNCTION__, $data);
|
|
} else {
|
|
return $data;
|
|
}
|
|
}
|
|
function keluhan_saat_ini($id)
|
|
{
|
|
$prm = $this->sys_input;
|
|
$isApi = false;
|
|
if ($prm['api'] == 'Y') {
|
|
$isApi = true;
|
|
}
|
|
$ret_array = "";
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'KELUHAN SAAT INI'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "";
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
// print_r($d);
|
|
//keluhan saat ini
|
|
$keluhan_saat_ini = "";
|
|
//echo $d["title"];
|
|
if ($d["title"] == "KELUHAN SAAT INI") {
|
|
if ($d["flag_normal"] == "Y") {
|
|
$keluhan_saat_ini = "";
|
|
} else {
|
|
foreach ($d["details"] as $xd) {
|
|
if ($xd["chx"] == "1") {
|
|
if ($keluhan_saat_ini != "") $keluhan_saat_ini .= ", ";
|
|
$keluhan_saat_ini .= $xd["label"];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// print_r($keluhan_saat_ini);
|
|
if ($keluhan_saat_ini == '') {
|
|
$keluhan_saat_ini = '-';
|
|
}
|
|
$ret_array = $keluhan_saat_ini == '' ? $keluhan_saat_ini : "-";
|
|
$rst_xc[] = $keluhan_saat_ini == '' ? $keluhan_saat_ini : "-";
|
|
// print_r($rst_xc);
|
|
// return $rst;
|
|
// print_r($keluhan_saat_ini);
|
|
if ($isApi) {
|
|
echo json_encode($keluhan_saat_ini);
|
|
} else {
|
|
return $keluhan_saat_ini;
|
|
}
|
|
}
|
|
function riwayat_phobia($id)
|
|
{
|
|
$prm = $this->sys_input;
|
|
$isApi = false;
|
|
if ($prm['api'] == 'Y') {
|
|
$isApi = true;
|
|
}
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'RIWAYAT POBIA'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$riwayat_phobia = array();
|
|
|
|
if ($d["title"] == "RIWAYAT POBIA") {
|
|
if ($d["flag_normal"] == "Y") {
|
|
$riwayat_phobia = array();
|
|
} else {
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp["chx"] == 1) {
|
|
$arr_result[] = array($gp["label"], $gp["value"]);
|
|
$riwayat_phobia[] = $gp["label"];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
$rst = array();
|
|
$rst['a1'] = "-";
|
|
if (count($riwayat_phobia) == 0)
|
|
$rst['a2'] = "-";
|
|
else
|
|
$rst['a2'] = join(", ", $riwayat_phobia);
|
|
// print_r($rst);
|
|
if ($isApi) {
|
|
echo json_encode($rst);
|
|
} else {
|
|
return $rst['a2'];
|
|
}
|
|
}
|
|
function riwayat_penyakit($id)
|
|
{
|
|
$prm = $this->sys_input;
|
|
$isApi = false;
|
|
if ($prm['api'] == 'Y') {
|
|
$isApi = true;
|
|
}
|
|
$ret_array = [];
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'RIWAYAT PENYAKIT'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$riwayat_penyakit = array();
|
|
|
|
|
|
if ($d["title"] == "RIWAYAT PENYAKIT") {
|
|
if ($d["flag_normal"] == "Y") {
|
|
$riwayat_penyakit = array();
|
|
//$d["label_flag_normal"];
|
|
// exit;
|
|
} else {
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp['name'] != "Allergi") {
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1) {
|
|
$arr_result[] = array($xd["label"], $xd["value"], $xd["segment_name"], $xd["id"]);
|
|
if (
|
|
$xd["label"] !== "Lain-lain ( Sistem Pencernaan )" &&
|
|
$xd["label"] !== "Lain-lain ( Sistem Pernafasan )" &&
|
|
$xd["label"] !== "Lain-lain ( Sistem Cardiovaskuler )*" &&
|
|
$xd["label"] !== "Lain-lain ( Sistem Syaraf )" &&
|
|
$xd["label"] !== "Lain-lain ( Sistem Penglihatan )" &&
|
|
$xd["label"] !== "Lain-lain ( Sistem Pendengaran/THT )" &&
|
|
$xd["label"] !== "Lain-lain ( Ginjal & Saluran Kemih )" &&
|
|
$xd["label"] !== "Lain-lain ( Tulang, Sendi & Otot )" &&
|
|
$xd["label"] !== "Lain-lain ( Kulit & Sistem Reproduksi )" &&
|
|
$xd["label"] !== "Lain-lain ( Sistem Endokrin )" &&
|
|
$xd["label"] !== "Lain-lain ( Penyakit daerah tropis )" &&
|
|
$xd["label"] !== "Lain-lain ( Penyakit lainnya )"
|
|
) {
|
|
$riwayat_penyakit[] = $xd["label"];
|
|
} else {
|
|
$riwayat_penyakit[] = $xd["label"] . " : " . $xd["value"];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (count($riwayat_penyakit) > 0)
|
|
$ret_array['b2'] = join("\r\n", str_replace("*", "", $riwayat_penyakit));
|
|
else
|
|
$ret_array['b2'] = "-";
|
|
|
|
// print_r('Coba');
|
|
if ($isApi) {
|
|
echo json_encode($ret_array);
|
|
} else {
|
|
return $ret_array['b2'];
|
|
}
|
|
// return $ret_array;
|
|
}
|
|
function alergi($id)
|
|
{
|
|
$prm = $this->sys_input;
|
|
$isApi = false;
|
|
if ($prm['api'] == 'Y') {
|
|
$isApi = true;
|
|
}
|
|
$ret_array = [];
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'RIWAYAT PENYAKIT'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "";
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$riwayat_penyakit = array();
|
|
|
|
|
|
if ($d["title"] == "RIWAYAT PENYAKIT") {
|
|
if ($d["flag_normal"] == "Y") {
|
|
$riwayat_penyakit = array();
|
|
//$d["label_flag_normal"];
|
|
// exit;
|
|
} else {
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp['name'] == "Allergi") {
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1 && $xd['id_code'] != 'fisik_penyakit_64') {
|
|
$arr_result[] = array($xd["label"], $xd["value"], $xd["segment_name"], $xd["id"]);
|
|
$riwayat_penyakit[] = $xd["label"];
|
|
}
|
|
if ($xd["chx"] == 1 && $xd['id_code'] == 'fisik_penyakit_64') {
|
|
//echo $xd['id_code'];
|
|
$arr_result[] = array($xd["label"], $xd["value"], $xd["segment_name"], $xd["id"]);
|
|
$riwayat_penyakit[] = $xd["label"] . " : " . $xd["value"];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (count($riwayat_penyakit) > 0)
|
|
$ret_array = join(", ", $riwayat_penyakit);
|
|
else
|
|
$ret_array = "-";
|
|
if ($isApi) {
|
|
echo json_encode($ret_array);
|
|
} else {
|
|
return $ret_array;
|
|
}
|
|
}
|
|
function riwayat_keluarga($id, $type)
|
|
{
|
|
$prm = $this->sys_input;
|
|
$isApi = false;
|
|
if ($prm['api'] == 'Y') {
|
|
$isApi = true;
|
|
}
|
|
$ret_array = "";
|
|
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'RIWAYAT PENYAKIT KELUARGA'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$riwayat_keluarga = array();
|
|
|
|
|
|
if ($d["title"] == "RIWAYAT PENYAKIT KELUARGA") {
|
|
if ($d["flag_normal"] == "Y") {
|
|
$ret_array = "Normal";
|
|
//$d["label_flag_normal"];
|
|
//exit;
|
|
} else {
|
|
//print_r($d["details"]);
|
|
$ayah = [];
|
|
$ibu = [];
|
|
foreach ($d["details"] as $gp) {
|
|
if (true || $gp["chx"] == 1) {
|
|
//print_r($gp["options"]);
|
|
$arr_result[] = array($gp["label"], $gp["value"], $gp["id"]);
|
|
foreach ($gp["options"] as $k => $gpd) {
|
|
if ($gpd["selected"] == 1) {
|
|
if ($k == 0) {
|
|
$ayah[] = $gp["label"];
|
|
} else {
|
|
$ibu[] = $gp["label"];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
$string_ayah = count($ayah) > 0 ? join(", ", $ayah) : "-";
|
|
$string_ibu = count($ibu) > 0 ? join(", ", $ibu) : "-";
|
|
if ($type == 'ayah')
|
|
$ret_array = $string_ayah;
|
|
else
|
|
$ret_array = $string_ibu;
|
|
}
|
|
}
|
|
if ($isApi) {
|
|
echo json_encode($ret_array);
|
|
} else {
|
|
return $ret_array;
|
|
}
|
|
}
|
|
function merokok($id)
|
|
{
|
|
$prm = $this->sys_input;
|
|
$isApi = false;
|
|
if ($prm['api'] == 'Y') {
|
|
$isApi = true;
|
|
}
|
|
$ret_array = [];
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'RIWAYAT KEBIASAAN HIDUP'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$riwayat_hidup = array();
|
|
|
|
if ($d["title"] == "RIWAYAT KEBIASAAN HIDUP") {
|
|
if ($d["flag_normal"] == "Y") {
|
|
$riwayat_hidup = array();
|
|
//$d["label_flag_normal"];
|
|
//exit;
|
|
} else {
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp['name'] == 'Merokok') {
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1) {
|
|
$arr_result[] = array($xd["segment_name"], $xd["label"], $xd["value"]);
|
|
if ($xd['id_code'] != 'fisik_kebiasaanhidup_4') {
|
|
$riwayat_hidup[] = $xd['label'] . ' ' . $xd["value"];
|
|
} else {
|
|
$riwayat_hidup[] = $xd["label"] . ' ' . $xd["value"] . ' ' . $xd['suffix'];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (count($riwayat_hidup) > 0) {
|
|
$ret_array['a2'] = join(", ", $riwayat_hidup);
|
|
} else {
|
|
$ret_array['a2'] = "-";
|
|
}
|
|
if ($isApi) {
|
|
echo json_encode($ret_array);
|
|
} else {
|
|
return $ret_array['a2'];
|
|
}
|
|
}
|
|
|
|
function alkohol($id)
|
|
{
|
|
$prm = $this->sys_input;
|
|
$isApi = false;
|
|
if ($prm['api'] == 'Y') {
|
|
$isApi = true;
|
|
}
|
|
$ret_array = [];
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'RIWAYAT KEBIASAAN HIDUP'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$riwayat_hidup = array();
|
|
|
|
if ($d["title"] == "RIWAYAT KEBIASAAN HIDUP") {
|
|
if ($d["flag_normal"] == "Y") {
|
|
$riwayat_hidup = array();
|
|
//$d["label_flag_normal"];
|
|
//exit;
|
|
} else {
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp['name'] == 'Minum alkohol') {
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1) {
|
|
$arr_result[] = array($xd["segment_name"], $xd["label"], $xd["value"]);
|
|
if ($xd['id_code'] != 'fisik_kebiasaanhidup_4') {
|
|
$riwayat_hidup[] = $xd['label'] . ' ' . $xd["value"];
|
|
} else {
|
|
$riwayat_hidup[] = $xd["label"] . ' ' . $xd["value"] . ' ' . $xd['suffix'];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (count($riwayat_hidup) > 0) {
|
|
$ret_array['a2'] = join(", ", $riwayat_hidup);
|
|
} else {
|
|
$ret_array['a2'] = "-";
|
|
}
|
|
if ($isApi) {
|
|
echo json_encode($ret_array);
|
|
} else {
|
|
return $ret_array['a2'];
|
|
}
|
|
}
|
|
|
|
function olahraga($id)
|
|
{
|
|
$prm = $this->sys_input;
|
|
$isApi = false;
|
|
if ($prm['api'] == 'Y') {
|
|
$isApi = true;
|
|
}
|
|
$ret_array = [];
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'RIWAYAT KEBIASAAN HIDUP'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$riwayat_hidup = array();
|
|
|
|
if ($d["title"] == "RIWAYAT KEBIASAAN HIDUP") {
|
|
if ($d["flag_normal"] == "Y") {
|
|
$riwayat_hidup = array();
|
|
//$d["label_flag_normal"];
|
|
//exit;
|
|
} else {
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp['name'] == 'Olahraga') {
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1) {
|
|
$arr_result[] = array($xd["segment_name"], $xd["label"], $xd["value"]);
|
|
if ($xd['id_code'] != 'fisik_kebiasaanhidup_4') {
|
|
$riwayat_hidup[] = $xd['label'] . ' ' . $xd["value"];
|
|
} else {
|
|
$riwayat_hidup[] = $xd["label"] . ' ' . $xd["value"] . ' ' . $xd['suffix'];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (count($riwayat_hidup) > 0) {
|
|
$ret_array['a2'] = join(", ", $riwayat_hidup);
|
|
} else {
|
|
$ret_array['a2'] = "-";
|
|
}
|
|
if ($isApi) {
|
|
echo json_encode($ret_array);
|
|
} else {
|
|
return $ret_array['a2'];
|
|
}
|
|
}
|
|
|
|
function riwayat_obat($id)
|
|
{
|
|
$prm = $this->sys_input;
|
|
$isApi = false;
|
|
if ($prm['api'] == 'Y') {
|
|
$isApi = true;
|
|
}
|
|
$ret_array = [];
|
|
$ret_array['a1'] = "-";
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y'
|
|
AND FisikTemplateTitle = 'RIWAYAT KONSUMSI OBAT TERATUR'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$riwayat_obat = array();
|
|
|
|
|
|
if ($d["title"] == "RIWAYAT KONSUMSI OBAT TERATUR") {
|
|
if ($d["flag_normal"] == "Y") {
|
|
$riwayat_obat = array();
|
|
//$d["label_flag_normal"];
|
|
// exit;
|
|
} else {
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp["chx"] == 1) {
|
|
$arr_result[] = array($gp["label"], $gp["value"]);
|
|
$riwayat_obat[] = $gp["label"] . " " . $gp["value"];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
$string_obat = count($riwayat_obat) > 0 ? join(", ", $riwayat_obat) : "-";
|
|
$ret_array['a2'] = $string_obat;
|
|
if ($isApi) {
|
|
echo json_encode($string_obat);
|
|
} else {
|
|
return $string_obat;
|
|
}
|
|
}
|
|
function riwayat_imunisasi($id)
|
|
{
|
|
$prm = $this->sys_input;
|
|
$isApi = false;
|
|
if ($prm['api'] == 'Y') {
|
|
$isApi = true;
|
|
}
|
|
$ret_array = [];
|
|
$ret_array['a1'] = "-";
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'RIWAYAT IMUNISASI'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$riwayat_imunisasi = array();
|
|
|
|
|
|
if ($d["title"] == "RIWAYAT IMUNISASI") {
|
|
if ($d["flag_normal"] == "Y") {
|
|
$riwayat_imunisasi = array();
|
|
//$d["label_flag_normal"];
|
|
|
|
} else {
|
|
foreach ($d["details"] as $gp) {
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1) {
|
|
if ($xd["label"] == 'Pernah')
|
|
$riwayat_imunisasi[] = str_replace(",", " ", $xd["segment_name"]) . ' ' . $xd["value"];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
$string_obat = count($riwayat_imunisasi) > 0 ? join(", ", $riwayat_imunisasi) : "-";
|
|
$ret_array['a2'] = $string_obat;
|
|
if ($isApi) {
|
|
echo $string_obat;
|
|
} else {
|
|
return $string_obat;
|
|
}
|
|
// return [$ret_array];
|
|
}
|
|
//pemeriksaan Fisik
|
|
function tbbbbodyfat($id, $type)
|
|
{
|
|
$ret_array = [];
|
|
$sql = "SELECT *
|
|
FROM so_resultentry
|
|
JOIN t_samplingso_additional_fisik_bbtb ON So_ResultEntryT_OrderHeaderID = T_SamplingAdditionalFisikBBTBT_OrderHeaderID
|
|
WHERE
|
|
So_ResultEntryID = $id LIMIT 1";
|
|
//echo $sql;
|
|
$qry = $this->db_smartone->query($sql);
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
//echo $this->db_smartone->last_query();
|
|
$row_result = $qry->row_array();
|
|
|
|
$status_gizi = array();
|
|
$bb = $row_result["T_SamplingAdditionalFisikBBTBValueBB"];
|
|
$tb = $row_result["T_SamplingAdditionalFisikBBTBValueTB"];
|
|
$bodyfat = $row_result["T_SamplingAdditionalFisikBBTBBodyFat"] == -1 ? "Tidak dilakukan" : $row_result["T_SamplingAdditionalFisikBBTBBodyFat"];
|
|
$standart_bmi = $row_result["T_SamplingAdditionalFisikBBTBStandart"];
|
|
$get_bmi = $this->hitung_bmi($bb, $tb, $standart_bmi);
|
|
$bmi = $get_bmi['bmi'];
|
|
$classification = $get_bmi['class'];
|
|
if ($type == "TB")
|
|
$ret_array['a2'] = $tb . ' cm';
|
|
else if ($type == "BB")
|
|
$ret_array['a2'] = $bb . ' kg';
|
|
else if ($type == "BMI")
|
|
$ret_array['a2'] = $bmi . " " . $classification;
|
|
else
|
|
$ret_array['a2'] = $bodyfat . '%';
|
|
|
|
return $ret_array['a2'];
|
|
}
|
|
function tekanan_darah($id, $type)
|
|
{
|
|
$ret_array = [];
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'TANDA VITAL'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$tanda_vital = array();
|
|
|
|
if ($d["title"] == "TANDA VITAL") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp['id_code'] == 'tanda_vital_5') {
|
|
if ($type == 'sistolik')
|
|
$ret_array['a2'] = $gp['value_x'] . " mmHg";
|
|
else
|
|
$ret_array['a2'] = $gp['value_y'] . " mmHg";
|
|
//$ret_array['a2'] = array("Sistolik" => $gp['value_x']." mmHg","Diastolik" => $gp['value_y']." mmHg");
|
|
}
|
|
}
|
|
}
|
|
//echo json_encode($ret_array['a2']);
|
|
return $ret_array['a2'];
|
|
}
|
|
function klasifikasi_bmi($bmi)
|
|
{
|
|
$standart_bmi = 'asia_pacific';
|
|
$bmi_valuex = number_format($bmi, 2);
|
|
$classs = "Undefined";
|
|
|
|
if ($standart_bmi === 'asia_pacific') {
|
|
if ($bmi_valuex < 18.5)
|
|
$classs = 'Underweight';
|
|
|
|
if ($bmi_valuex >= 18.5 && $bmi_valuex < 23)
|
|
$classs = 'Normal';
|
|
|
|
if ($bmi_valuex >= 23 && $bmi_valuex < 25)
|
|
$classs = 'Overweight';
|
|
|
|
if ($bmi_valuex >= 25 && $bmi_valuex < 30)
|
|
$classs = 'Obese I';
|
|
|
|
if ($bmi_valuex >= 30)
|
|
$classs = 'Obese II';
|
|
}
|
|
|
|
if ($standart_bmi === 'who') {
|
|
if ($bmi_valuex < 18.5)
|
|
$classs = 'Underweight';
|
|
|
|
if ($bmi_valuex >= 18.5 && $bmi_valuex < 25) {
|
|
$classs = 'Normal';
|
|
}
|
|
|
|
if ($bmi_valuex >= 25 && $bmi_valuex < 30) {
|
|
$classs = 'Overweight';
|
|
}
|
|
|
|
if ($bmi_valuex >= 30)
|
|
$classs = 'Obese';
|
|
}
|
|
|
|
if ($standart_bmi === 'kemenkes') {
|
|
if ($bmi_valuex < 18.5)
|
|
$classs = 'Underweight';
|
|
|
|
if ($bmi_valuex >= 18.5 && $bmi_valuex < 25.1)
|
|
$classs = 'Normal';
|
|
|
|
if ($bmi_valuex >= 25.1 && $bmi_valuex < 27)
|
|
$classs = 'Overweight';
|
|
|
|
if ($bmi_valuex >= 27)
|
|
$classs = 'Obese';
|
|
}
|
|
|
|
return $classs;
|
|
}
|
|
function hitung_bmi($bb, $tb, $standart_bmi)
|
|
{
|
|
$tb = $tb / 100;
|
|
$bmi = '';
|
|
$bmi = $bb / ($tb * $tb);
|
|
$bmi_valuex = number_format($bmi, 2);
|
|
$classs = "Undefined";
|
|
|
|
if ($standart_bmi === 'asia_pacific') {
|
|
if ($bmi_valuex < 18.5)
|
|
$classs = 'Underweight';
|
|
|
|
if ($bmi_valuex >= 18.5 && $bmi_valuex < 23)
|
|
$classs = 'Normal';
|
|
|
|
if ($bmi_valuex >= 23 && $bmi_valuex < 25)
|
|
$classs = 'Overweight';
|
|
|
|
if ($bmi_valuex >= 25 && $bmi_valuex < 30)
|
|
$classs = 'Obese I';
|
|
|
|
if ($bmi_valuex >= 30)
|
|
$classs = 'Obese II';
|
|
}
|
|
|
|
if ($standart_bmi === 'who') {
|
|
if ($bmi_valuex < 18.5)
|
|
$classs = 'Underweight';
|
|
|
|
if ($bmi_valuex >= 18.5 && $bmi_valuex < 25) {
|
|
$classs = 'Normal';
|
|
}
|
|
|
|
if ($bmi_valuex >= 25 && $bmi_valuex < 30) {
|
|
$classs = 'Overweight';
|
|
}
|
|
|
|
if ($bmi_valuex >= 30)
|
|
$classs = 'Obese';
|
|
}
|
|
|
|
if ($standart_bmi === 'kemenkes') {
|
|
if ($bmi_valuex < 18.5)
|
|
$classs = 'Underweight';
|
|
|
|
if ($bmi_valuex >= 18.5 && $bmi_valuex < 25.1)
|
|
$classs = 'Normal';
|
|
|
|
if ($bmi_valuex >= 25.1 && $bmi_valuex < 27)
|
|
$classs = 'Overweight';
|
|
|
|
if ($bmi_valuex >= 27)
|
|
$classs = 'Obese';
|
|
}
|
|
|
|
return array(
|
|
'bmi' => $bmi_valuex,
|
|
'class' => $classs
|
|
);
|
|
}
|
|
function frekuensi_nafas($id)
|
|
{
|
|
$ret_array = [];
|
|
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'TANDA VITAL'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$tanda_vital = array();
|
|
|
|
if ($d["title"] == "TANDA VITAL") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp['id_code'] == 'tanda_vital_3') {
|
|
$ret_array['a2'] = $gp['value'] . " " . $gp['unit'];
|
|
//$ret_array['a2'] = array("Sistolik" => $gp['value_x']." mmHg","Diastolik" => $gp['value_y']." mmHg");
|
|
}
|
|
}
|
|
}
|
|
|
|
return $ret_array['a2'];
|
|
}
|
|
function frekuensi_nadi($id)
|
|
{
|
|
$ret_array = [];
|
|
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'TANDA VITAL'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$tanda_vital = array();
|
|
|
|
if ($d["title"] == "TANDA VITAL") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp['id_code'] == 'tanda_vital_1') {
|
|
$ret_array['a2'] = $gp['value'] . " x/menit";
|
|
}
|
|
}
|
|
}
|
|
|
|
return $ret_array['a2'];
|
|
}
|
|
function suhu($id)
|
|
{
|
|
$ret_array = [];
|
|
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'TANDA VITAL'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$tanda_vital = array();
|
|
|
|
if ($d["title"] == "TANDA VITAL") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp['id_code'] == 'tanda_vital_6') {
|
|
if ($gp['chx_x'] == 1)
|
|
$ret_array['a2'] = $gp['label_x'];
|
|
if ($gp['chx_y'] == 1)
|
|
$ret_array['a2'] = $gp['label_y'];
|
|
}
|
|
}
|
|
}
|
|
|
|
return $ret_array['a2'] != null ? $ret_array['a2'] : '';
|
|
}
|
|
function lapang_pandang($id)
|
|
{
|
|
$ret_array = [];
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'LAPANG PANDANG'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$lapang_pandang = array();
|
|
|
|
if ($d["title"] == "LAPANG PANDANG") {
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp["chx_y"] == "1") $value = $gp["label_y"];
|
|
|
|
if ($gp["chx_x"] == "1") $value = $gp["label_x"];
|
|
|
|
$ret_array['a2'] = $value;
|
|
}
|
|
}
|
|
|
|
return $ret_array['a2'] != null ? $ret_array['a2'] : '';
|
|
}
|
|
function keadaan_umum($id)
|
|
{
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'KEADAAN UMUM'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$keadaan_umum = array();
|
|
|
|
if ($d["title"] == "KEADAAN UMUM") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
$value = $gp["value"];
|
|
if ($gp["chx_x"] == "1") $value = $gp["label_x"];
|
|
if ($gp["chx_y"] == "1") $value = $gp["label_y"];
|
|
|
|
$keadaan_umum[] = array(
|
|
"rr1" => $gp["label"],
|
|
"rr2" => $value,
|
|
"rr3" => $gp["unit"],
|
|
);
|
|
}
|
|
}
|
|
$rstKeadaanUmum = "";
|
|
if (count($keadaan_umum) > 0) {
|
|
for ($i = 0; $i < count($keadaan_umum); $i++) {
|
|
$rstKeadaanUmum .= $keadaan_umum[$i]['rr1'] . " :" . $keadaan_umum[$i]['rr2'] . " " . $keadaan_umum[$i]['rr3'] . "\n";
|
|
}
|
|
}
|
|
|
|
return $rstKeadaanUmum;
|
|
}
|
|
function persepsi_warna($id)
|
|
{
|
|
$ret_array = [];
|
|
|
|
$sql = "SELECT IFNULL(T_SamplingAdditionalFisikBWPWValue,'') as result, IFNULL(T_SamplingAdditionalFisikBWPWVAngka,'') as angka
|
|
FROM so_resultentry
|
|
LEFT JOIN t_samplingso_additional_fisik_bw ON T_SamplingAdditionalFisikBWT_OrderHeaderID = So_ResultEntryT_OrderHeaderID
|
|
WHERE
|
|
So_ResultEntryID = ? LIMIT 1 ";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$row_result = $qry->row_array();
|
|
//keluhan saat ini
|
|
$persepsi_warna = array();
|
|
|
|
|
|
$result = "Normal";
|
|
if ($row_result['result'] == 'BW')
|
|
$result = "Red Green Deficiency";
|
|
|
|
$ret_array['a2'] = $result;
|
|
return $ret_array['a2'];
|
|
}
|
|
function tulang_belakang($id)
|
|
{
|
|
$ret_array['a2'] = "-";
|
|
|
|
return $ret_array['a2'];
|
|
}
|
|
function doctor($id)
|
|
{
|
|
$ret_array = [];
|
|
|
|
|
|
$sql = "SELECT concat(if(M_DoctorPrefix is null, '',CONCAT(M_DoctorPrefix,' ')),if(M_DoctorPrefix2 is null, '',CONCAT(M_DoctorPrefix2,' ')),M_DoctorName) as doctor
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN so_resultentry ON So_ResultEntryFisikUmumSo_ResultEntryID = So_ResultEntryID
|
|
JOIN m_doctor ON M_DOctorID = So_ResultEntryM_DoctorID
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'
|
|
LIMIT 1";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
//$d = json_decode($rows[0]["doctor"],true);
|
|
//keluhan saat ini
|
|
//if($ret_array['a1'] == '-' || $ret_array['a1'] == '')
|
|
//$ret_array['a1'] = $rows[0]["doctor"];
|
|
|
|
$ret_array['a2'] = $rows[0]["doctor"];
|
|
return $ret_array['a2'];
|
|
}
|
|
function konjuktiva_sklera($id)
|
|
{
|
|
$ret_array = [];
|
|
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND
|
|
FisikTemplateTitle = 'MATA'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$mata = array();
|
|
|
|
|
|
if ($d["title"] == "MATA") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
//echo $gp["chx"];
|
|
//echo $gp["label"];
|
|
if ($gp["chx"] == 1) {
|
|
$arr_result[] = array($gp["label"], $gp["value"]);
|
|
$mata[] = $gp["label"];
|
|
}
|
|
}
|
|
}
|
|
$string_mata = count($mata) > 0 ? join(", ", $mata) : "-";
|
|
$ret_array['a2'] = $string_mata;
|
|
return $string_mata;
|
|
}
|
|
function telinga($id)
|
|
{
|
|
$ret_array = [];
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'TELINGA'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$telinga = array();
|
|
|
|
|
|
if ($d["title"] == "TELINGA") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp["chx"] == 1) {
|
|
$arr_result[] = array($gp["label"], $gp["value"]);
|
|
$telinga[] = $gp["label"];
|
|
}
|
|
}
|
|
}
|
|
|
|
$string_telinga = count($telinga) > 0 ? join(", ", $telinga) : "-";
|
|
$ret_array['a2'] = $string_telinga;
|
|
|
|
return $string_telinga;
|
|
}
|
|
function visus($id, $type)
|
|
{
|
|
|
|
$ret_array = [];
|
|
$sql = "SELECT *, IFNULL(M_PatientOldPID,'') as M_PatientOldPID
|
|
FROM t_orderheader
|
|
JOIN so_resultentry ON So_ResultEntryT_OrderHeaderID = T_OrderHeaderID AND So_ResultEntryID = ?
|
|
JOIN m_patient ON T_OrderHeaderM_PatientID = M_PatientID";
|
|
// echo $sql;
|
|
$data_patient = $this->db_smartone->query($sql, [$id]);
|
|
if (!$data_patient) {
|
|
$message = $this->db_smartone->error();
|
|
$message['qry'] = $this->db_smartone->last_query();
|
|
$this->sys_error($message);
|
|
exit;
|
|
}
|
|
|
|
if ($data_patient) {
|
|
$data_patient = $data_patient->row_array();
|
|
$sql = "SELECT *
|
|
FROM x_adm_rekap_patient patient
|
|
JOIN x_adm_rekap_fisik_vital vital ON vital.REG_NO = patient.REG_NO
|
|
WHERE
|
|
patient.PATIENT_ID = ? AND
|
|
patient.DOB = ? AND
|
|
patient.PATIENT_NAME = ?";
|
|
//echo $sql;
|
|
$data_tahun_lalu = $this->db_smartone->query($sql, [
|
|
$data_patient['M_PatientOldPID'],
|
|
$data_patient['M_PatientDOB'],
|
|
$data_patient['M_PatientName']
|
|
])->row_array();
|
|
if ($type == 'left')
|
|
$ret_array['a1'] = isset($data_tahun_lalu['Visus_Kiri']) ? $data_tahun_lalu['Visus_Kiri'] : "-";
|
|
|
|
if ($type == 'right')
|
|
$ret_array['a1'] = isset($data_tahun_lalu['Visus_Kanan']) ? $data_tahun_lalu['Visus_Kanan'] : "-";
|
|
} else {
|
|
$ret_array['a1'] = "-";
|
|
}
|
|
$sql = " SELECT * , IFNULL(T_SamplingAdditionalFisikVisusID,0) as visus_id
|
|
FROM so_resultentry
|
|
LEFT JOIN t_samplingso_additional_fisik_visus ON T_SamplingAdditionalFisikVisusT_OrderHeaderID = So_ResultEntryT_OrderHeaderID
|
|
WHERE
|
|
So_ResultEntryID = ? LIMIT 1";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
|
|
$row_result = $qry->row_array();
|
|
|
|
if ($row_result && intval($row_result['visus_id']) > 0) {
|
|
|
|
|
|
|
|
$visus = array();
|
|
$visus_kiri = "";
|
|
$visus_kanan = "";
|
|
$visus_kesimpulan = "";
|
|
$normal = array("20/20", "20/25");
|
|
|
|
|
|
if (($row_result['T_SamplingAdditionalFisikVisusTKODV'] != "" && $row_result['T_SamplingAdditionalFisikVisusTKODV'] != "-") && ($row_result['T_SamplingAdditionalFisikVisusTKOSV'] != "" && $row_result['T_SamplingAdditionalFisikVisusTKOSV'] != "-")) {
|
|
$visus[] = array(
|
|
"xx1" => "Tanpa Kacamata",
|
|
"xx2" => "OD : ",
|
|
"xx3" => $row_result['T_SamplingAdditionalFisikVisusTKODV']
|
|
);
|
|
|
|
$visus[] = array(
|
|
"xx1" => "Tanpa Kacamata",
|
|
"xx2" => "OS",
|
|
"xx3" => $row_result['T_SamplingAdditionalFisikVisusTKOSV']
|
|
);
|
|
|
|
$rst['kelainan'] = "Kelainan refraksi (tanpa kacamata)";
|
|
|
|
if (!in_array($row_result['T_SamplingAdditionalFisikVisusTKODV'], $normal)) {
|
|
$value_koreksi_od = "";
|
|
$od_sph = $row_result['T_SamplingAdditionalFisikVisusODSPH'];
|
|
if ($od_sph != "" && $od_sph != "-" && strtolower($od_sph) != 'plano') {
|
|
if ($visus_kanan != "") $visus_kanan .= ", ";
|
|
$visus_kanan .= $od_sph . " (Miopia)";
|
|
}
|
|
|
|
$od_cyl = $row_result['T_SamplingAdditionalFisikVisusODCYL'];
|
|
if ($od_cyl != "" && $od_cyl != "-") {
|
|
if ($visus_kanan != "") $visus_kanan .= ", ";
|
|
$visus_kanan .= "Cyl " . $od_cyl;
|
|
}
|
|
|
|
|
|
$od_x = $row_result['T_SamplingAdditionalFisikVisusODX'];
|
|
$od_x = str_replace("/", "", $od_x);
|
|
$od_x = trim(str_replace("-", "", $od_x));
|
|
if ($od_x != "" && $od_x != "-" && $od_x != "--" && $od_x != "-/") {
|
|
//if ($visus_kanan != "") $visus_kanan .= ", ";
|
|
$visus_kanan .= " axis " . $od_x . " (Astigmatismus)";
|
|
} else {
|
|
if ($od_cyl != "" && $od_cyl != "-")
|
|
$visus_kanan .= " (Astigmatismus)";
|
|
}
|
|
//$value_koreksi_od .= "X (".$od_x.") ";
|
|
|
|
|
|
|
|
}
|
|
|
|
if (!in_array($row_result['T_SamplingAdditionalFisikVisusTKOSV'], $normal)) {
|
|
$value_koreksi_os = "";
|
|
$os_sph = $row_result['T_SamplingAdditionalFisikVisusOSSPH'];
|
|
if ($os_sph != "" && $os_sph != "-" && strtolower($od_sph) != 'plano') {
|
|
if ($visus_kiri != "") $visus_kiri .= ", ";
|
|
$visus_kiri .= $os_sph . " (Miopia)";
|
|
}
|
|
|
|
|
|
$os_cyl = $row_result['T_SamplingAdditionalFisikVisusOSCYL'];
|
|
if ($os_cyl != "" && $os_cyl != "-") {
|
|
if ($visus_kiri != "") $visus_kiri .= ", ";
|
|
$visus_kiri .= "Cyl " . $os_cyl;
|
|
}
|
|
|
|
|
|
$os_x = $row_result['T_SamplingAdditionalFisikVisusOSX'];
|
|
$os_x = str_replace("/", "", $os_x);
|
|
$os_x = trim(str_replace("-", "", $os_x));
|
|
if ($os_x != "" && $os_x != "-" && $os_x != "--") {
|
|
//if ($visus_kiri != "") $visus_kiri .= ", ";
|
|
$visus_kiri .= " axis " . $os_x . " (Astigmatismus)";
|
|
} else {
|
|
if ($os_cyl != "" && $os_cyl != "-")
|
|
$visus_kiri .= " (Astigmatismus)";
|
|
}
|
|
}
|
|
}
|
|
|
|
if (($row_result['T_SamplingAdditionalFisikVisusDKODV'] != "" && $row_result['T_SamplingAdditionalFisikVisusDKODV'] != "-") && ($row_result['T_SamplingAdditionalFisikVisusDKOSV'] != "" && $row_result['T_SamplingAdditionalFisikVisusDKOSV'] != "-")) {
|
|
$visus[] = array(
|
|
"xx1" => "Dengan Kacamata",
|
|
"xx2" => "OD : ",
|
|
"xx3" => $row_result['T_SamplingAdditionalFisikVisusDKODV']
|
|
);
|
|
|
|
$visus[] = array(
|
|
"xx1" => "Dengan Kacamata",
|
|
"xx2" => "OS",
|
|
"xx3" => $row_result['T_SamplingAdditionalFisikVisusDKOSV']
|
|
);
|
|
|
|
$rst['kelainan'] = "Kelainan refraksi (dengan kacamata)";
|
|
|
|
if (!in_array($row_result['T_SamplingAdditionalFisikVisusDKODV'], $normal)) {
|
|
$value_koreksi_od = "";
|
|
$od_sph = $row_result['T_SamplingAdditionalFisikVisusODSPH'];
|
|
if ($od_sph != "" && $od_sph != "-" && strtolower($od_sph) != 'plano') {
|
|
if ($visus_kanan != "") $visus_kanan .= ", ";
|
|
$visus_kanan .= $od_sph . " (Miopia)";
|
|
}
|
|
|
|
|
|
$od_cyl = $row_result['T_SamplingAdditionalFisikVisusODCYL'];
|
|
if ($od_cyl != "" && $od_cyl != "-") {
|
|
if ($visus_kanan != "") $visus_kanan .= ", ";
|
|
$visus_kanan .= "Cyl " . $od_cyl;
|
|
}
|
|
|
|
|
|
$od_x = $row_result['T_SamplingAdditionalFisikVisusODX'];
|
|
$od_x = str_replace("/", "", $od_x);
|
|
$od_x = trim(str_replace("-", "", $od_x));
|
|
if ($od_x != "" && $od_x != "-" && $od_x != "--" && trim($od_x) != "-/") {
|
|
//if ($visus_kanan != "") $visus_kanan .= ", ";
|
|
$visus_kanan .= " axis " . $os_x . " (Astigmatismus)";
|
|
} else {
|
|
if ($od_cyl != "" && $od_cyl != "-")
|
|
$visus_kanan .= " (Astigmatismus)";
|
|
}
|
|
//$value_koreksi_od .= "X (".$od_x.") ";
|
|
|
|
$od_add = $row_result['T_SamplingAdditionalFisikVisusADD'];
|
|
if ($od_add != "" && $od_add != "-") {
|
|
if ($visus_kanan != "") $visus_kanan .= ", ";
|
|
$visus_kanan .= $od_add . " (Presbiopia)";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$value_koreksi_os = "";
|
|
$os_sph = $row_result['T_SamplingAdditionalFisikVisusOSSPH'];
|
|
if ($os_sph != "" && $os_sph != "-" && strtolower($od_sph) != 'plano') {
|
|
if ($visus_kiri != "") $visus_kiri .= ", ";
|
|
$visus_kiri .= $os_sph . " (Miopia)";
|
|
}
|
|
|
|
$os_cyl = $row_result['T_SamplingAdditionalFisikVisusOSCYL'];
|
|
if ($os_cyl != "" && $os_cyl != "-") {
|
|
if ($visus_kiri != "") $visus_kiri .= ", ";
|
|
$visus_kiri .= "Cyl " . $os_cyl;
|
|
}
|
|
|
|
$os_x = $row_result['T_SamplingAdditionalFisikVisusOSX'];
|
|
$os_x = str_replace("/", "", $os_x);
|
|
$os_x = trim(str_replace("-", "", $os_x));
|
|
//echo $os_x;
|
|
if ($os_x != "" && $os_x != "-" && $os_x != "--" && trim($os_x) != "-/") {
|
|
//if ($visus_kiri != "") $visus_kiri .= ", ";
|
|
$visus_kiri .= " axis " . $os_x . " (Astigmatismus)";
|
|
} else {
|
|
if ($os_cyl != "" && $os_cyl != "-")
|
|
$visus_kiri .= " (Astigmatismus)";
|
|
}
|
|
//$value_koreksi_os .= "X (".$os_x.") ";
|
|
|
|
|
|
}
|
|
|
|
$od_add = $row_result['T_SamplingAdditionalFisikVisusADD'];
|
|
if ($od_add != "" && $od_add != "-") {
|
|
if ($visus_kanan != "") $visus_kanan .= ", ";
|
|
$visus_kanan .= $od_add . " (Presbiopia)";
|
|
|
|
if ($visus_kiri != "") $visus_kiri .= ", ";
|
|
$visus_kiri .= $od_add . " (Presbiopia)";
|
|
}
|
|
|
|
if ($type == 'left')
|
|
$ret_array['a2'] = $visus_kiri == "" ? "Normal" : $visus_kiri;
|
|
|
|
if ($type == 'right')
|
|
$ret_array['a2'] = $visus_kanan == "" ? "Normal" : $visus_kanan;
|
|
} else {
|
|
$ret_array['a2'] = "Bahan belum";
|
|
}
|
|
|
|
return $ret_array['a2'];
|
|
}
|
|
function hidung($id)
|
|
{
|
|
$ret_array = [];
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'HIDUNG'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$hidung = array();
|
|
|
|
|
|
if ($d["title"] == "HIDUNG") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp["chx"] == 1) {
|
|
$arr_result[] = array($gp["label"], $gp["value"]);
|
|
$hidung[] = $gp["label"];
|
|
}
|
|
}
|
|
}
|
|
$string_hidung = count($hidung) > 0 ? join(", ", $hidung) : "-";
|
|
$ret_array['a2'] = $string_hidung;
|
|
return $string_hidung;
|
|
}
|
|
function leher($id)
|
|
{
|
|
$ret_array = [];
|
|
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'LEHER'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$leher = array();
|
|
|
|
|
|
if ($d["title"] == "LEHER") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp["chx"] == 1) {
|
|
$arr_result[] = array($gp["label"], $gp["value"]);
|
|
$leher[] = $gp["label"];
|
|
}
|
|
}
|
|
}
|
|
|
|
$string_leher = count($leher) > 0 ? join(", ", $leher) : "Normal";
|
|
$ret_array['a2'] = $string_leher;
|
|
return $string_leher;
|
|
}
|
|
function thorax($id)
|
|
{
|
|
$ret_array = [];
|
|
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND
|
|
FisikTemplateTitle = 'THORAX / DADA'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$leher = array();
|
|
|
|
|
|
if ($d["title"] == "THORAX / DADA") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp["chx"] == 1) {
|
|
$arr_result[] = array($gp["label"], $gp["value"]);
|
|
$leher[] = $gp["label"];
|
|
}
|
|
}
|
|
}
|
|
|
|
$string_leher = count($leher) > 0 ? join(", ", $leher) : "Normal";
|
|
$ret_array['a2'] = $string_leher;
|
|
return $string_leher;
|
|
}
|
|
function mulut_gigi($id)
|
|
{
|
|
$ret_array = [];
|
|
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'MULUT'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$mulut = array();
|
|
|
|
|
|
if ($d["title"] == "MULUT") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp['name'] == "Mukosa rongga mulut") {
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1 && $xd["label"] != 'Normal') {
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"]);
|
|
$mulut[] = $xd["label"];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'GIGI'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$gigi = array();
|
|
if ($d["title"] == "GIGI") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp["chx"] == 1 && $xd["label"] != 'Normal') {
|
|
$arr_result[] = array($gp["label"], $gp["value"]);
|
|
$gigi[] = $gp["label"];
|
|
}
|
|
}
|
|
}
|
|
if (count($mulut) == 0 && count($gigi) == 0) {
|
|
$ret_array['a2'] = "Normal";
|
|
} else {
|
|
// echo "XX";
|
|
$string_mulut = count($mulut) > 0 ? join(", ", $mulut) : "";
|
|
$string_gigi = count($gigi) > 0 ? join(", ", $gigi) : "";
|
|
$ret_array['a2'] = $string_mulut . $string_gigi;
|
|
}
|
|
|
|
return $ret_array['a2'];
|
|
}
|
|
function tenggorokan($id)
|
|
{
|
|
$ret_array = [];
|
|
|
|
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'MULUT'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$mulut = array();
|
|
|
|
|
|
if ($d["title"] == "MULUT") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp['name'] == "Tenggorokan") {
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1 && $xd["label"] != 'Normal') {
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"]);
|
|
$mulut[] = $xd["label"];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
$string_mulut = count($mulut) > 0 ? join(", ", $mulut) : "Normal";
|
|
$ret_array['a2'] = $string_mulut;
|
|
|
|
return $string_mulut;
|
|
}
|
|
function paru($id)
|
|
{
|
|
$ret_array = [];
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'PARU-PARU'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$paru = array();
|
|
|
|
if ($d["title"] == "PARU-PARU") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp["chx"] == 1) {
|
|
$arr_result[] = array($gp["label"], $gp["value"]);
|
|
$paru[] = $gp["label"];
|
|
}
|
|
}
|
|
}
|
|
$string_paru = count($paru) > 0 ? join(", ", $paru) : "-";
|
|
$ret_array['a2'] = $string_paru;
|
|
return $string_paru;
|
|
}
|
|
function jantung($id)
|
|
{
|
|
$ret_array = [];
|
|
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'JANTUNG'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$jantung = array();
|
|
|
|
|
|
if ($d["title"] == "JANTUNG") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1 && $xd["label"] != 'Normal') {
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"]);
|
|
$jantung[] = $gp["name"] . " " . $xd["label"];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
$string_jantung = count($jantung) > 0 ? join(", ", $jantung) : "Normal";
|
|
$ret_array['a2'] = $string_jantung;
|
|
return $string_jantung;;
|
|
}
|
|
|
|
function anogenital($id)
|
|
{
|
|
$ret_array = [];
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'PERUT / ABDOMEN'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$perut = array();
|
|
|
|
|
|
if ($d["title"] == "PERUT / ABDOMEN") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp["name"] == 'Hemorroid') {
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1) {
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"]);
|
|
$perut[] = $xd["label"];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
$string_perut = count($perut) > 0 ? join(", ", $perut) : "-";
|
|
$ret_array['a2'] = $string_perut;
|
|
return $string_perut;
|
|
}
|
|
function perut($id)
|
|
{
|
|
$ret_array = [];
|
|
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'PERUT / ABDOMEN'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return json_encode(array());
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return json_encode(array());
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$perut = array();
|
|
|
|
|
|
if ($d["title"] == "PERUT / ABDOMEN") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp["name"] != 'Hernia' && $gp["name"] != 'Pengukuran' && $gp["name"] != 'Hemorroid') {
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1 && $xd["label"] != 'Normal' && $xd["id_code"] !== 'perut_3') {
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"]);
|
|
$perut[] = $gp["name"] . " " . $xd["label"];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
$string_perut = "";
|
|
$string_perut = count($perut) > 0 ? join(", ", $perut) : "-";
|
|
$ret_array['a2'] = $string_perut;
|
|
return $string_perut;
|
|
}
|
|
function hernia($id)
|
|
{
|
|
$ret_array = [];
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'PERUT / ABDOMEN'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$perut = "";
|
|
|
|
|
|
if ($d["title"] == "PERUT / ABDOMEN") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp["name"] == 'Hernia') {
|
|
//print_r($gp["details"][1]);
|
|
if ($gp["details"][1]["chx"] == "1") {
|
|
|
|
$perut = $gp["details"][1]["label"];
|
|
}
|
|
if ($gp["details"][0]["chx"] == "1") {
|
|
$perut = $gp["details"][0]["label"];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
$ret_array['a2'] = $perut;
|
|
return $perut;
|
|
}
|
|
function kulit($id)
|
|
{
|
|
$ret_array = [];
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND
|
|
FisikTemplateTitle = 'SISTEM INTEGUMEN'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$perut = array();
|
|
|
|
|
|
if ($d["title"] == "SISTEM INTEGUMEN") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp["name"] == 'Kulit') {
|
|
//echo "kulit";
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1 && $xd["label"] != 'Lain-lain') {
|
|
// echo "IN";
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"]);
|
|
$perut[] = $xd["label"];
|
|
}
|
|
|
|
if ($xd["chx"] == 1 && $xd["label"] == 'Lain-lain') {
|
|
// echo "lain";
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"]);
|
|
$perut[] = $xd["value"];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
$string_perut = count($perut) > 0 ? join(", ", $perut) : "-";
|
|
$ret_array['a2'] = $string_perut;
|
|
return $string_perut;
|
|
}
|
|
function extremitas($id)
|
|
{
|
|
$ret_array = [];
|
|
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND
|
|
FisikTemplateTitle = 'ANGGOTA GERAK'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$perut = array();
|
|
|
|
|
|
if ($d["title"] == "ANGGOTA GERAK") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
|
|
//echo "kulit";
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1 && $xd["label"] != 'Lain-lain' && $xd["label"] != 'Normal') {
|
|
// echo "IN";
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"]);
|
|
$perut[] = $xd["label"];
|
|
}
|
|
|
|
if ($xd["chx"] == 1 && $xd["label"] == 'Lain-lain') {
|
|
// echo "lain";
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"]);
|
|
$perut[] = $xd["value"];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
$string_perut = count($perut) > 0 ? join(", ", $perut) : "Normal";
|
|
$ret_array['a2'] = $string_perut;
|
|
return $string_perut;
|
|
}
|
|
function reflek($id, $type)
|
|
{
|
|
$ret_array = [];
|
|
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND
|
|
FisikTemplateTitle = 'SISTEM PERSYARAFAN'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$fisiologis = array();
|
|
$patologis = array();
|
|
|
|
|
|
if ($d["title"] == "SISTEM PERSYARAFAN") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp['name'] == 'Refleks Fisiologis') {
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1 && $xd["label"] != 'Lain-lain' && $xd["label"] != 'Normal') {
|
|
// echo "IN";
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"]);
|
|
$fisiologis[] = $xd["label"];
|
|
}
|
|
|
|
if ($xd["chx"] == 1 && $xd["label"] == 'Lain-lain') {
|
|
// echo "lain";
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"]);
|
|
$fisiologis[] = $xd["value"];
|
|
}
|
|
}
|
|
//echo "kulit";
|
|
|
|
}
|
|
if ($gp['name'] == 'Refleks Pathologis') {
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1 && $xd["label"] != 'Lain-lain' && $xd["label"] != 'Normal') {
|
|
// echo "IN";
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"]);
|
|
$patologis[] = $xd["label"];
|
|
}
|
|
|
|
if ($xd["chx"] == 1 && $xd["label"] == 'Lain-lain') {
|
|
// echo "lain";
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"]);
|
|
$patologis[] = $xd["value"];
|
|
}
|
|
}
|
|
//echo "kulit";
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
$string_hasil = '';
|
|
if ($type == 'fisiologis') {
|
|
$string_hasil = count($fisiologis) > 0 ? join(", ", $fisiologis) : "Normal";
|
|
}
|
|
|
|
if ($type == 'patologis') {
|
|
$string_hasil = count($patologis) > 0 ? join(", ", $patologis) : "Normal";
|
|
}
|
|
|
|
$ret_array['a2'] = $string_hasil;
|
|
return $string_hasil;
|
|
}
|
|
function genitourinaria($id)
|
|
{
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'GENITOURINARIA'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$genitourinaria = array();
|
|
|
|
|
|
if ($d["title"] == "GENITOURINARIA") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp["chx"] == 1) {
|
|
$arr_result[] = array($gp["label"], $gp["value"]);
|
|
$genitourinaria[] = array(
|
|
"nn1" => $gp["label"],
|
|
"nn2" => $gp["value"],
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
if (empty($genitourinaria)) {
|
|
$genitourinaria[] = array(
|
|
"nn1" => "Tidak diperiksa",
|
|
"nn2" => ""
|
|
);
|
|
}
|
|
$rstGenitourinaria = "";
|
|
if (count($genitourinaria) > 0) {
|
|
for ($i = 0; $i < count($genitourinaria); $i++) {
|
|
if ($genitourinaria[$i]['nn1'] != "") {
|
|
$rstGenitourinaria .= $genitourinaria[$i]['nn1'];
|
|
}
|
|
if ($genitourinaria[$i]['nn2'] != "") {
|
|
$rstGenitourinaria .= " : " . $genitourinaria[$i]['nn2'];
|
|
}
|
|
if ($genitourinaria[$i]['nn3'] != "") {
|
|
$rstGenitourinaria .= $genitourinaria[$i]['nn3'] . "\n";
|
|
} else {
|
|
$rstGenitourinaria .= "\n";
|
|
}
|
|
}
|
|
} else {
|
|
$rstGenitourinaria = 'Tidak Periksa';
|
|
}
|
|
return $rstGenitourinaria;
|
|
}
|
|
function anggota($id)
|
|
{
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'ANGGOTA GERAK'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$anggota = array();
|
|
|
|
|
|
if ($d["title"] == "ANGGOTA GERAK") {
|
|
//WIP
|
|
//echo "<pre>"; print_r($d["details"]);
|
|
foreach ($d["details"] as $gp) {
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1) {
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"]);
|
|
$anggota[] = array(
|
|
"oo1" => $gp["name"],
|
|
"oo2" => $xd["label"],
|
|
"oo3" => $xd["value"]
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (empty($anggota)) {
|
|
$anggota[] = array(
|
|
"oo1" => "Tidak diperiksa",
|
|
"oo2" => "",
|
|
"oo3" => ""
|
|
);
|
|
}
|
|
$rstAnggota = "";
|
|
if (count($anggota) > 0) {
|
|
for ($i = 0; $i < count($anggota); $i++) {
|
|
if ($anggota[$i]['oo1'] != "") {
|
|
$rstAnggota .= $anggota[$i]['oo1'];
|
|
}
|
|
if ($anggota[$i]['oo2'] != "") {
|
|
$rstAnggota .= " : " . $anggota[$i]['oo2'];
|
|
}
|
|
if ($anggota[$i]['oo3'] != "") {
|
|
$rstAnggota .= $anggota[$i]['oo3'] . "\n";
|
|
} else {
|
|
$rstAnggota .= "\n";
|
|
}
|
|
}
|
|
} else {
|
|
$rstAnggota = 'Tidak periksa';
|
|
}
|
|
return $rstAnggota;
|
|
}
|
|
function sistem($id)
|
|
{
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'SISTEM PERSYARAFAN'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$sistem = array();
|
|
|
|
|
|
if ($d["title"] == "SISTEM PERSYARAFAN") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1) {
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"]);
|
|
$sistem[] = array(
|
|
"pp1" => $gp["name"],
|
|
"pp2" => $xd["label"],
|
|
"pp3" => $xd["value"]
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (empty($sistem)) {
|
|
$sistem[] = array(
|
|
"pp1" => "Tidak diperiksa",
|
|
"pp2" => "",
|
|
"pp3" => ""
|
|
);
|
|
}
|
|
$rstSistem = "";
|
|
if (count($sistem) > 0) {
|
|
for ($i = 0; $i < count($sistem); $i++) {
|
|
if ($sistem[$i]['pp1'] != "") {
|
|
$rstSistem .= $sistem[$i]['pp1'];
|
|
}
|
|
if ($sistem[$i]['pp2'] != "") {
|
|
$rstSistem .= " : " . $sistem[$i]['pp2'];
|
|
}
|
|
if ($sistem[$i]['pp3'] != "") {
|
|
$rstSistem .= $sistem[$i]['pp3'] . "\n";
|
|
} else {
|
|
$rstSistem .= "\n";
|
|
}
|
|
}
|
|
} else {
|
|
$rstSistem = "Tidak periksa";
|
|
}
|
|
return $rstSistem;
|
|
}
|
|
function smell($id)
|
|
{
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'SMELL TEST'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$smell = array();
|
|
|
|
|
|
if ($d["title"] == "SMELL TEST") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1) {
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"], $d["inspected"]);
|
|
$smell[] = array(
|
|
"xx1" => $gp["name"],
|
|
"xx2" => $xd["label"],
|
|
"xx3" => $xd["value"],
|
|
"xx4" => $d["is_inspected"]
|
|
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (empty($smell)) {
|
|
$smell[] = array(
|
|
"xx1" => "Tidak periksa",
|
|
"xx2" => "",
|
|
"xx3" => ""
|
|
);
|
|
}
|
|
$rstSmell = "";
|
|
if (count($smell) > 0) {
|
|
for ($i = 0; $i < count($smell); $i++) {
|
|
if ($smell[$i]['xx1'] != "") {
|
|
$rstSmell .= $smell[$i]['xx1'];
|
|
}
|
|
if ($smell[$i]['xx2'] != "") {
|
|
$rstSmell .= " : " . $smell[$i]['xx2'];
|
|
}
|
|
if ($smell[$i]['xx3'] != "") {
|
|
$rstSmell .= $smell[$i]['xx3'] . "\n";
|
|
} else {
|
|
$rstSmell .= "\n";
|
|
}
|
|
}
|
|
} else {
|
|
$rstSmell = 'Tidak periksa';
|
|
}
|
|
return $rstSmell;
|
|
}
|
|
function low($id)
|
|
{
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'LOW BACK PAIN SCREENING TEST'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$low = array();
|
|
|
|
|
|
if ($d["title"] == "LOW BACK PAIN SCREENING TEST") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1) {
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"], $d["is_inspected"]);
|
|
$low[] = array(
|
|
"yy1" => $gp["name"],
|
|
"yy2" => $xd["label"],
|
|
"yy3" => $xd["value"],
|
|
"yy4" => $d["is_inspected"]
|
|
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// label negatif
|
|
|
|
|
|
|
|
$rstLow = "";
|
|
if (count($low) > 0) {
|
|
for ($i = 0; $i < count($low); $i++) {
|
|
if ($low[$i]['label'] != 'Negatif') {
|
|
$rstLow .= $low[$i]['name'] . " : " . $low[$i]['label'] . "\n";
|
|
}
|
|
}
|
|
} else {
|
|
$rstlow = "Tidak periksa";
|
|
}
|
|
|
|
return $rstlow;
|
|
}
|
|
function integumen($id)
|
|
{
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'SISTEM INTEGUMEN'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$integumen = array();
|
|
|
|
|
|
if ($d["title"] == "SISTEM INTEGUMEN") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1) {
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"]);
|
|
$integumen[] = array(
|
|
"pp1" => $gp["name"],
|
|
"pp2" => $xd["label"],
|
|
"pp3" => $xd["value"]
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (empty($integumen)) {
|
|
$integumen[] = array(
|
|
"pp1" => "Tidak periksa",
|
|
"pp2" => "",
|
|
"pp3" => ""
|
|
);
|
|
}
|
|
$rstIntegument = "";
|
|
if (count($integumen) > 0) {
|
|
for ($i = 0; $i < count($integumen); $i++) {
|
|
if ($integumen[$i]['pp1'] != "") {
|
|
$rstIntegument .= $integumen[$i]['pp1'];
|
|
}
|
|
if ($integumen[$i]['pp2'] != "") {
|
|
$rstIntegument .= " : " . $integumen[$i]['pp2'];
|
|
}
|
|
if ($integumen[$i]['pp3'] != "") {
|
|
$rstIntegument .= $integumen[$i]['pp3'] . "\n";
|
|
} else {
|
|
$rstIntegument .= "\n";
|
|
}
|
|
}
|
|
} else {
|
|
$rstIntegument = "Tidak periksa";
|
|
}
|
|
return $rstIntegument;
|
|
}
|
|
function faktor_fisik($id)
|
|
{
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'FAKTOR FISIK'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$faktor_fisik = array();
|
|
|
|
|
|
if ($d["title"] == "FAKTOR FISIK") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
// if ($gp["chx"] == 1 ) {
|
|
$arr_result[] = array($gp["label"], $gp["value_sumber"], $gp["value_lama"], $gp["chx"]);
|
|
$faktor_fisik[] = array(
|
|
"aaa1" => $gp["label"],
|
|
"aaa2" => $gp["value_sumber"],
|
|
"aaa3" => $gp["value_lama"],
|
|
"aaa4" => $gp["chx"]
|
|
);
|
|
// }
|
|
}
|
|
}
|
|
$rstFaktorFisik = "";
|
|
if (count($faktor_fisik) > 0) {
|
|
for ($i = 0; $i < count($faktor_fisik); $i++) {
|
|
if ($faktor_fisik[$i]['aaa4']) {
|
|
$rstFaktorFisik .= $faktor_fisik[$i]['aaa1'] . ', ';
|
|
}
|
|
}
|
|
}
|
|
|
|
return $rstFaktorFisik;
|
|
}
|
|
function faktor_kimia($id)
|
|
{
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'FAKTOR KIMIA'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$faktor_kimia = array();
|
|
|
|
if ($d["title"] == "FAKTOR KIMIA") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
// if ($gp["chx"] == 1 ) {
|
|
$arr_result[] = array($gp["label"], $gp["value_sumber"], $gp["value_lama"], $gp["chx"]);
|
|
$faktor_kimia[] = array(
|
|
"bbb1" => $gp["label"],
|
|
"bbb2" => $gp["value_sumber"],
|
|
"bbb3" => $gp["value_lama"],
|
|
"bbb4" => $gp["chx"]
|
|
|
|
);
|
|
// }
|
|
}
|
|
}
|
|
$rstFaktorKimia = "";
|
|
if (count($faktor_kimia) > 0) {
|
|
for ($i = 0; $i < count($faktor_kimia); $i++) {
|
|
if ($faktor_kimia[$i]['bbb4']) {
|
|
$rstFaktorKimia .= $faktor_kimia[$i]['bbb1'] . ', ';
|
|
}
|
|
}
|
|
}
|
|
|
|
return $rstFaktorKimia;
|
|
}
|
|
function faktor_biologi($id)
|
|
{
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'FAKTOR BIOLOGI'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$faktor_biologi = array();
|
|
|
|
|
|
if ($d["title"] == "FAKTOR BIOLOGI") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
// if ($gp["chx"] == 1 ) {
|
|
$arr_result[] = array($gp["label"], $gp["value_sumber"], $gp["value_lama"], $gp["chx"]);
|
|
$faktor_biologi[] = array(
|
|
"ccc1" => $gp["label"],
|
|
"ccc2" => $gp["value_sumber"],
|
|
"ccc3" => $gp["value_lama"],
|
|
"ccc4" => $gp["chx"]
|
|
|
|
);
|
|
// }
|
|
}
|
|
}
|
|
$rstFaktorbiologi = "";
|
|
if (count($faktor_biologi) > 0) {
|
|
for ($i = 0; $i < count($faktor_biologi); $i++) {
|
|
if ($faktor_biologi[$i]['ccc4']) {
|
|
$rstFaktorbiologi .= $faktor_biologi[$i]['ccc1'] . ', ';
|
|
}
|
|
}
|
|
}
|
|
|
|
return $rstFaktorbiologi;
|
|
}
|
|
function faktor_ergonomi($id)
|
|
{
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'FAKTOR ERGONOMI'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$faktor_ergonomi = array();
|
|
|
|
|
|
if ($d["title"] == "FAKTOR ERGONOMI") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
// if ($gp["chx"] == 1 ) {
|
|
$arr_result[] = array($gp["label"], $gp["value_sumber"], $gp["value_lama"], $gp["chx"]);
|
|
$faktor_ergonomi[] = array(
|
|
"ddd1" => $gp["label"],
|
|
"ddd2" => $gp["value_sumber"],
|
|
"ddd3" => $gp["value_lama"],
|
|
"ddd4" => $gp["chx"]
|
|
|
|
);
|
|
// }
|
|
}
|
|
}
|
|
$rstFaktoergonomi = "";
|
|
if (count($faktor_ergonomi) > 0) {
|
|
for ($i = 0; $i < count($faktor_ergonomi); $i++) {
|
|
if ($faktor_ergonomi[$i]['ddd4']) {
|
|
$rstFaktoergonomi .= $faktor_ergonomi[$i]['ddd1'] . ', ';
|
|
}
|
|
}
|
|
}
|
|
|
|
return $rstFaktoergonomi;
|
|
}
|
|
function faktor_psikologi($id)
|
|
{
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'FAKTOR PSIKOLOGI'
|
|
WHERE
|
|
So_ResultEntryFisikUmumSo_ResultEntryID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return '';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return '';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$faktor_psikologi = array();
|
|
|
|
|
|
if ($d["title"] == "FAKTOR PSIKOLOGI") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
|
|
$arr_result[] = array($gp["label"], $gp["value_sumber"], $gp["value_lama"], $gp["chx"]);
|
|
$faktor_psikologi[] = array(
|
|
"eee1" => $gp["label"],
|
|
"eee2" => $gp["value_sumber"],
|
|
"eee3" => $gp["value_lama"],
|
|
"eee4" => $gp["chx"]
|
|
|
|
);
|
|
}
|
|
}
|
|
$rstFaktorPsikologi = "";
|
|
if (count($faktor_psikologi) > 0) {
|
|
for ($i = 0; $i < count($faktor_psikologi); $i++) {
|
|
if ($faktor_psikologi[$i]['eee4']) {
|
|
$rstFaktorPsikologi .= $faktor_psikologi[$i]['eee1'] . ', ';
|
|
}
|
|
}
|
|
}
|
|
|
|
return $rstFaktorPsikologi;
|
|
}
|
|
function generate($id)
|
|
{
|
|
$urlKeluhanSaatIni = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/keluhan_saat_ini/{$id}";
|
|
$urlRiwayatPenyakit = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/riwayat_penyakit/{$id}";
|
|
$urlRiwayatKeluargaAyah = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/riwayat_keluarga/{$id}/ayah";
|
|
$urlRiwayatKeluargaIbu = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/riwayat_keluarga/{$id}/ibu";
|
|
$urlMeroko = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/merokok/{$id}";
|
|
$urlAlergi = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/alergi/{$id}";
|
|
$urlDoctor = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/doctor/{$id}";
|
|
$urlKonjuktivaSklera = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/konjuktiva_sklera/{$id}";
|
|
$urlLowBackPain = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/low_back_pain/{$id}";
|
|
$urlAnogenital = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/anogenital/{$id}";
|
|
$urlFrekuensiNafas = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/frekuensi_nafas/{$id}";
|
|
$urlTulangBelakang = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/tulang_belakang/{$id}";
|
|
$urlExtremitas = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/extremitas/{$id}";
|
|
$urlKulit = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/kulit/{$id}";
|
|
$urlHernia = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/hernia/{$id}";
|
|
$urlPerut = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/perut/{$id}";
|
|
$urlThorax = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/thorax/{$id}";
|
|
$urlMulutGigi = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/mulut_gigi/{$id}";
|
|
$urlJantung = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/jantung/{$id}";
|
|
$urlParu = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/paru/{$id}";
|
|
$urlTenggorokan = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/tenggorokan/{$id}";
|
|
$urlHidung = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/hidung/{$id}";
|
|
$urlTelinga = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/telinga/{$id}";
|
|
$urlLapangPandang = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/lapang_pandang/{$id}";
|
|
$urlPresepsiWarna = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/persepsi_warna/{$id}";
|
|
$urlFrekuensiNadi = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/frekuensi_nadi/{$id}";
|
|
$urlSuhu = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/suhu/{$id}";
|
|
$urlTekananDarah = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/tekanan_darah/{$id}/sistolik";
|
|
$urlVisusLeft = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/visus/{$id}/left";
|
|
$urlReflekFisiologis = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/reflek/{$id}/fisiologis";
|
|
$urlReflekPatologis = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/reflek/{$id}/patologis";
|
|
$urlVisusRight = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/visus/{$id}/right";
|
|
$urlTekananDarahDiastolik = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/tekanan_darah/{$id}/diastolik";
|
|
$urlTB = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/tbbbbodyfat/{$id}/TB";
|
|
$urlBMI = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/tbbbbodyfat/{$id}/BMI";
|
|
$urlBodyfat = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/tbbbbodyfat/{$id}/BODY";
|
|
$urlBB = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/tbbbbodyfat/{$id}/BB";
|
|
$urlAlkohol = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/alkohol/{$id}";
|
|
$urlOlahraga = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/olahraga/{$id}";
|
|
$urlLeher = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/leher/{$id}";
|
|
$urlRiwayatPhobia = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/riwayat_phobia/{$id}";
|
|
$urlRiwayatObat = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/riwayat_obat/{$id}";
|
|
$urlRiwayatImunisasi = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/riwayat_imunisasi/{$id}";
|
|
$urlKeadaanUmum = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/keadaan_umum/{$id}";
|
|
$urlGenitourinaria = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/genitourinaria/{$id}";
|
|
$urlAnggota = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/anggota/{$id}";
|
|
$urlSistem = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/sistem/{$id}";
|
|
$urlSmell = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/smell/{$id}";
|
|
$urlIntegument = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/integumen/{$id}";
|
|
$urlFaktorFisik = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/faktor_fisik/{$id}";
|
|
$urlFaktorKimia = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/faktor_kimia/{$id}";
|
|
$urlFaktorBiologi = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/faktor_biologi/{$id}";
|
|
$urlFaktorErgonomi = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/faktor_ergonomi/{$id}";
|
|
$urlFaktorPsikologi = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/faktor_psikologi/{$id}";
|
|
|
|
if (!$id) {
|
|
$this->sys_error("Prm id is required");
|
|
exit;
|
|
}
|
|
$sql = "SELECT Ss_FisikID FROM ss_fisik
|
|
WHERE Ss_FisikSo_ResultEntryID = ?
|
|
AND Ss_FisikIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, $id);
|
|
if (!$qry) {
|
|
$message = $this->db_smartone->error();
|
|
$this->sys_error($message);
|
|
exit;
|
|
}
|
|
$idCek = $qry->result_array()[0]['Ss_FisikID'];
|
|
$result = [];
|
|
$getKeluhanSaatIni = json_decode($this->post($urlKeluhanSaatIni, ''), true);
|
|
$result["getKeluhanSaatIni"] = $getKeluhanSaatIni;
|
|
// print_r($getKeluhanSaatIni[0]['a2']);
|
|
// print_r($data);
|
|
$keluhanSaatIni = "";
|
|
if (count($getKeluhanSaatIni) > 0) {
|
|
if (isset($getKeluhanSaatIni[0]['a2'])) {
|
|
$keluhanSaatIni = $getKeluhanSaatIni[0]['a2'];
|
|
}
|
|
}
|
|
// print_r($keluhanSaatIni);
|
|
$getRiwayatPenyakit = json_decode($this->post($urlRiwayatPenyakit, ''), true);
|
|
|
|
$riwayatPenyakit = "";
|
|
if (count($getRiwayatPenyakit) > 0) {
|
|
if (isset($getRiwayatPenyakit[0]['b2'])) {
|
|
$riwayatPenyakit = $getRiwayatPenyakit[0]['b2'];
|
|
}
|
|
}
|
|
$getRiwayatKeluargaAyah = json_decode($this->post($urlRiwayatKeluargaAyah, ''), true);
|
|
$riwayatKeluargaAyah = "";
|
|
if (count($getRiwayatKeluargaAyah) > 0) {
|
|
if (isset($getRiwayatKeluargaAyah[0]['a2'])) {
|
|
$riwayatKeluargaAyah = $getRiwayatKeluargaAyah[0]['a2'];
|
|
}
|
|
}
|
|
$getRiwayatKeluargaIbu = json_decode($this->post($urlRiwayatKeluargaIbu, ''), true);
|
|
$riwayatKeluargaIbu = "";
|
|
if (count($getRiwayatKeluargaIbu) > 0) {
|
|
if (isset($getRiwayatKeluargaIbu[0]['c2'])) {
|
|
$riwayatKeluargaIbu = $getRiwayatKeluargaIbu[0]['c2'];
|
|
}
|
|
}
|
|
$getMerokok = json_decode($this->post($urlMeroko, ''), true);
|
|
$merokok = "";
|
|
if (count($getMerokok) > 0) {
|
|
if (isset($getMerokok[0]['a2'])) {
|
|
$merokok = $getMerokok[0]['a2'];
|
|
}
|
|
}
|
|
$getAlergi = json_decode($this->post($urlAlergi, ''), true);
|
|
$alergi = "";
|
|
if (count($getAlergi) > 0) {
|
|
if (isset($getAlergi[0]['a2'])) {
|
|
$alergi = $getAlergi[0]['a2'];
|
|
}
|
|
}
|
|
$getDoctor = json_decode($this->post($urlDoctor, ''), true);
|
|
$doctor = "";
|
|
if (count($getDoctor) > 0) {
|
|
if (isset($getDoctor[0]['a2'])) {
|
|
$doctor = $getDoctor[0]['a2'];
|
|
}
|
|
}
|
|
$getKonjuktivaSklera = json_decode($this->post($urlKonjuktivaSklera, ''), true);
|
|
$konjuktivaSklera = "";
|
|
if (count($getKonjuktivaSklera) > 0) {
|
|
if (isset($getKonjuktivaSklera[0]['a2'])) {
|
|
$konjuktivaSklera = $getKonjuktivaSklera[0]['a2'];
|
|
}
|
|
}
|
|
$getLowBackPain = json_decode($this->post($urlLowBackPain, ''), true);
|
|
$lowBackPain = "";
|
|
if (count($getLowBackPain) > 0) {
|
|
if (isset($getLowBackPain[0]['a2'])) {
|
|
$lowBackPain = $getLowBackPain[0]['a2'];
|
|
}
|
|
}
|
|
$getAnoGenital = json_decode($this->post($urlAnogenital, ''), true);
|
|
$anoGenital = "";
|
|
if (count($getAnoGenital) > 0) {
|
|
if (isset($getAnoGenital[0]['a2'])) {
|
|
$anoGenital = $getAnoGenital[0]['a2'];
|
|
}
|
|
}
|
|
$getFrekuensiNafas = json_decode($this->post($urlFrekuensiNafas, ''), true);
|
|
$frekuensiNafas = "";
|
|
if (count($getFrekuensiNafas) > 0) {
|
|
if (isset($getFrekuensiNafas[0]['a2'])) {
|
|
$frekuensiNafas = $getFrekuensiNafas[0]['a2'];
|
|
}
|
|
}
|
|
$getTulangBelakang = json_decode($this->post($urlTulangBelakang, ''), true);
|
|
$tulangBelakang = "";
|
|
if (count($getTulangBelakang) > 0) {
|
|
if (isset($getTulangBelakang[0]['a2'])) {
|
|
$tulangBelakang = $getTulangBelakang[0]['a2'];
|
|
}
|
|
}
|
|
$getTulangBelakang = json_decode($this->post($urlTulangBelakang, ''), true);
|
|
$tulangBelakang = "";
|
|
if (count($getTulangBelakang) > 0) {
|
|
if (isset($getTulangBelakang[0]['a2'])) {
|
|
$tulangBelakang = $getTulangBelakang[0]['a2'];
|
|
}
|
|
}
|
|
$getExtremitas = json_decode($this->post($urlExtremitas, ''), true);
|
|
$extremitas = "";
|
|
if (count($getExtremitas) > 0) {
|
|
if (isset($getExtremitas[0]['a2'])) {
|
|
$extremitas = $getExtremitas[0]['a2'];
|
|
}
|
|
}
|
|
$getKulit = json_decode($this->post($urlKulit, ''), true);
|
|
$kulit = "";
|
|
if (count($getKulit) > 0) {
|
|
if (isset($getKulit[0]['a2'])) {
|
|
$kulit = $getKulit[0]['a2'];
|
|
}
|
|
}
|
|
$getHernia = json_decode($this->post($urlHernia, ''), true);
|
|
$hernia = "";
|
|
if (count($getHernia) > 0) {
|
|
if (isset($getHernia[0]['a2'])) {
|
|
$hernia = $getHernia[0]['a2'];
|
|
}
|
|
}
|
|
$getPerut = json_decode($this->post($urlPerut, ''), true);
|
|
$perut = "";
|
|
if (count($getPerut) > 0) {
|
|
if (isset($getPerut[0]['a2'])) {
|
|
$perut = $getPerut[0]['a2'];
|
|
}
|
|
}
|
|
$getThorax = json_decode($this->post($urlThorax, ''), true);
|
|
$thorax = "";
|
|
if (count($getThorax) > 0) {
|
|
if (isset($getThorax[0]['a2'])) {
|
|
$thorax = $getThorax[0]['a2'];
|
|
}
|
|
}
|
|
$getMulutGigi = json_decode($this->post($urlMulutGigi, ''), true);
|
|
$mulutGigi = "";
|
|
if (count($getMulutGigi) > 0) {
|
|
if (isset($getMulutGigi[0]['a2'])) {
|
|
$mulutGigi = $getMulutGigi[0]['a2'];
|
|
}
|
|
}
|
|
$getJantung = json_decode($this->post($urlJantung, ''), true);
|
|
$jantung = "";
|
|
if (count($getJantung) > 0) {
|
|
if (isset($getJantung[0]['a2'])) {
|
|
$jantung = $getJantung[0]['a2'];
|
|
}
|
|
}
|
|
$getParu = json_decode($this->post($urlParu, ''), true);
|
|
$paru = "";
|
|
if (count($getParu) > 0) {
|
|
if (isset($getParu[0]['a2'])) {
|
|
$paru = $getParu[0]['a2'];
|
|
}
|
|
}
|
|
$getTenggorokan = json_decode($this->post($urlTenggorokan, ''), true);
|
|
$tenggorokan = "";
|
|
if (count($getTenggorokan) > 0) {
|
|
if (isset($getTenggorokan[0]['a2'])) {
|
|
$tenggorokan = $getTenggorokan[0]['a2'];
|
|
}
|
|
}
|
|
$getTenggorokan = json_decode($this->post($urlTenggorokan, ''), true);
|
|
$tenggorokan = "";
|
|
if (count($getTenggorokan) > 0) {
|
|
if (isset($getTenggorokan[0]['a2'])) {
|
|
$tenggorokan = $getTenggorokan[0]['a2'];
|
|
}
|
|
}
|
|
$getHidung = json_decode($this->post($urlHidung, ''), true);
|
|
$hidung = "";
|
|
if (count($getHidung) > 0) {
|
|
if (isset($getHidung[0]['a2'])) {
|
|
$hidung = $getHidung[0]['a2'];
|
|
}
|
|
}
|
|
$getHidung = json_decode($this->post($urlHidung, ''), true);
|
|
$hidung = "";
|
|
if (count($getHidung) > 0) {
|
|
if (isset($getHidung[0]['a2'])) {
|
|
$hidung = $getHidung[0]['a2'];
|
|
}
|
|
}
|
|
$getTelinga = json_decode($this->post($urlTelinga, ''), true);
|
|
$telinga = "";
|
|
if (count($getTelinga) > 0) {
|
|
if (isset($getTelinga[0]['a2'])) {
|
|
$telinga = $getTelinga[0]['a2'];
|
|
}
|
|
}
|
|
$getLapangPandang = json_decode($this->post($urlLapangPandang, ''), true);
|
|
$lapangPandang = "";
|
|
if (count($getLapangPandang) > 0) {
|
|
if (isset($getLapangPandang[0]['a2'])) {
|
|
$lapangPandang = $getLapangPandang[0]['a2'];
|
|
}
|
|
}
|
|
$getPresepsiWarna = json_decode($this->post($urlPresepsiWarna, ''), true);
|
|
$presepsiWarna = "";
|
|
if (count($getPresepsiWarna) > 0) {
|
|
if (isset($getPresepsiWarna[0]['a2'])) {
|
|
$presepsiWarna = $getPresepsiWarna[0]['a2'];
|
|
}
|
|
}
|
|
$getFrekuensiNadi = json_decode($this->post($urlFrekuensiNadi, ''), true);
|
|
$frekuensiNadi = "";
|
|
if (count($getFrekuensiNadi) > 0) {
|
|
if (isset($getFrekuensiNadi[0]['a2'])) {
|
|
$frekuensiNadi = $getFrekuensiNadi[0]['a2'];
|
|
}
|
|
}
|
|
$getSuhu = json_decode($this->post($urlSuhu, ''), true);
|
|
$suhu = "";
|
|
if (count($getSuhu) > 0) {
|
|
if (isset($getSuhu[0]['a2'])) {
|
|
$suhu = $getSuhu[0]['a2'];
|
|
}
|
|
}
|
|
$getTekananDarahSistolik = json_decode($this->post($urlTekananDarah, ''), true);
|
|
$TekananDarahSistolik = "";
|
|
if (count($getTekananDarahSistolik) > 0) {
|
|
if (isset($getTekananDarahSistolik[0]['a2'])) {
|
|
$TekananDarahSistolik = $getTekananDarahSistolik[0]['a2'];
|
|
}
|
|
}
|
|
$getVisusLeft = json_decode($this->post($urlVisusLeft, ''), true);
|
|
$visusLeft = "";
|
|
if (count($getVisusLeft) > 0) {
|
|
if (isset($getVisusLeft[0]['a2'])) {
|
|
$visusLeft = $getVisusLeft[0]['a2'];
|
|
}
|
|
}
|
|
$getVisusLeft = json_decode($this->post($urlVisusLeft, ''), true);
|
|
$visusLeft = "";
|
|
if (count($getVisusLeft) > 0) {
|
|
if (isset($getVisusLeft[0]['a2'])) {
|
|
$visusLeft = $getVisusLeft[0]['a2'];
|
|
}
|
|
}
|
|
$getReflekFisiologis = json_decode($this->post($urlReflekFisiologis, ''), true);
|
|
$reflekFisiologis = "";
|
|
if (count($getReflekFisiologis) > 0) {
|
|
if (isset($getReflekFisiologis[0]['a2'])) {
|
|
$reflekFisiologis = $getReflekFisiologis[0]['a2'];
|
|
}
|
|
}
|
|
$getReflekPatologis = json_decode($this->post($urlReflekPatologis, ''), true);
|
|
$reflekPatologis = "";
|
|
if (count($getReflekPatologis) > 0) {
|
|
if (isset($getReflekPatologis[0]['a2'])) {
|
|
$reflekPatologis = $getReflekPatologis[0]['a2'];
|
|
}
|
|
}
|
|
$getVisusRight = json_decode($this->post($urlVisusRight, ''), true);
|
|
$visusRight = "";
|
|
if (count($getVisusRight) > 0) {
|
|
if (isset($getVisusRight[0]['a2'])) {
|
|
$visusRight = $getVisusRight[0]['a2'];
|
|
}
|
|
}
|
|
$getTekananDarahDiastolik = json_decode($this->post($urlTekananDarahDiastolik, ''), true);
|
|
$tekananDarahDiastolik = "";
|
|
if (count($getTekananDarahDiastolik) > 0) {
|
|
if (isset($getTekananDarahDiastolik[0]['a2'])) {
|
|
$tekananDarahDiastolik = $getTekananDarahDiastolik[0]['a2'];
|
|
}
|
|
}
|
|
$getTB = json_decode($this->post($urlTB, ''), true);
|
|
$tb = "";
|
|
if (count($getTB) > 0) {
|
|
if (isset($getTB[0]['a2'])) {
|
|
$tb = $getTB[0]['a2'];
|
|
}
|
|
}
|
|
$getBMI = json_decode($this->post($urlBMI, ''), true);
|
|
$bmi = "";
|
|
if (count($getBMI) > 0) {
|
|
if (isset($getBMI[0]['a2'])) {
|
|
$bmi = $getBMI[0]['a2'];
|
|
}
|
|
}
|
|
$getBodyFat = json_decode($this->post($urlBodyfat, ''), true);
|
|
$bodyFat = "";
|
|
if (count($getBodyFat) > 0) {
|
|
if (isset($getBodyFat[0]['a2'])) {
|
|
$bodyFat = $getBodyFat[0]['a2'];
|
|
}
|
|
}
|
|
$getBodyFat = json_decode($this->post($urlBodyfat, ''), true);
|
|
$bodyFat = "";
|
|
if (count($getBodyFat) > 0) {
|
|
if (isset($getBodyFat[0]['a2'])) {
|
|
$bodyFat = $getBodyFat[0]['a2'];
|
|
}
|
|
}
|
|
$getBB = json_decode($this->post($urlBB, ''), true);
|
|
$bb = "";
|
|
if (count($getBB) > 0) {
|
|
if (isset($getBB[0]['a2'])) {
|
|
$bb = $getBB[0]['a2'];
|
|
}
|
|
}
|
|
$getAlkohol = json_decode($this->post($urlAlkohol, ''), true);
|
|
$alkohol = "";
|
|
if (count($getAlkohol) > 0) {
|
|
if (isset($getAlkohol[0]['a2'])) {
|
|
$alkohol = $getAlkohol[0]['a2'];
|
|
}
|
|
}
|
|
$getOlahraga = json_decode($this->post($urlOlahraga, ''), true);
|
|
$olahraga = "";
|
|
if (count($getOlahraga) > 0) {
|
|
if (isset($getOlahraga[0]['a2'])) {
|
|
$olahraga = $getOlahraga[0]['a2'];
|
|
}
|
|
}
|
|
$getLeher = json_decode($this->post($urlLeher, ''), true);
|
|
$leher = "";
|
|
if (count($getLeher) > 0) {
|
|
if (isset($getLeher[0]['a2'])) {
|
|
$leher = $getLeher[0]['a2'];
|
|
}
|
|
}
|
|
$getRiwayatPhobia = json_decode($this->post($urlRiwayatPhobia, ''), true);
|
|
$riwayatPhobia = "";
|
|
if (count($getRiwayatPhobia) > 0) {
|
|
if (isset($getRiwayatPhobia[0]['a2'])) {
|
|
$riwayatPhobia = $getRiwayatPhobia[0]['a2'];
|
|
}
|
|
}
|
|
$getRiwayatObat = json_decode($this->post($urlRiwayatObat, ''), true);
|
|
$riwayatObat = "";
|
|
if (count($getRiwayatObat) > 0) {
|
|
if (isset($getRiwayatObat[0]['a2'])) {
|
|
$riwayatObat = $getRiwayatObat[0]['a2'];
|
|
}
|
|
}
|
|
$getRiwayatImunisasi = json_decode($this->post($urlRiwayatImunisasi, ''), true);
|
|
$riwayatImunisasi = "";
|
|
if (count($getRiwayatImunisasi) > 0) {
|
|
if (isset($getRiwayatImunisasi[0]['a2'])) {
|
|
$riwayatImunisasi = $getRiwayatImunisasi[0]['a2'];
|
|
}
|
|
}
|
|
$getKeadaanUmum = json_decode($this->post($urlKeadaanUmum, ''), true);
|
|
$keadaanUmum = "";
|
|
if (count($getKeadaanUmum) > 0) {
|
|
for ($i = 0; $i < count($getKeadaanUmum); $i++) {
|
|
$keadaanUmum .= $getKeadaanUmum[$i]['rr1'] . " :" . $getKeadaanUmum[$i]['rr2'] . " " . $getKeadaanUmum[$i]['rr3'] . "\n";
|
|
}
|
|
}
|
|
$getGenitourinaria = json_decode($this->post($urlGenitourinaria, ''), true);
|
|
$genitourinaria = "";
|
|
if (count($getGenitourinaria) > 0) {
|
|
for ($i = 0; $i < count($getGenitourinaria); $i++) {
|
|
if ($getGenitourinaria[$i]['nn1'] != "") {
|
|
$genitourinaria .= $getGenitourinaria[$i]['nn1'];
|
|
}
|
|
if ($getGenitourinaria[$i]['nn2'] != "") {
|
|
$genitourinaria .= " : " . $getGenitourinaria[$i]['nn2'];
|
|
}
|
|
if ($getGenitourinaria[$i]['nn3'] != "") {
|
|
$genitourinaria .= $getGenitourinaria[$i]['nn3'] . "\n";
|
|
} else {
|
|
$genitourinaria .= "\n";
|
|
}
|
|
}
|
|
}
|
|
$getAnggota = json_decode($this->post($urlAnggota, ''), true);
|
|
$anggota = "";
|
|
if (count($getAnggota) > 0) {
|
|
for ($i = 0; $i < count($getAnggota); $i++) {
|
|
if ($getAnggota[$i]['oo1'] != "") {
|
|
$anggota .= $getAnggota[$i]['oo1'];
|
|
}
|
|
if ($getAnggota[$i]['oo2'] != "") {
|
|
$anggota .= " : " . $getAnggota[$i]['oo2'];
|
|
}
|
|
if ($getAnggota[$i]['oo3'] != "") {
|
|
$anggota .= $getAnggota[$i]['oo3'] . "\n";
|
|
} else {
|
|
$anggota .= "\n";
|
|
}
|
|
}
|
|
}
|
|
$getSistem = json_decode($this->post($urlSistem, ''), true);
|
|
$sistem = "";
|
|
if (count($getSistem) > 0) {
|
|
for ($i = 0; $i < count($getSistem); $i++) {
|
|
if ($getSistem[$i]['pp1'] != "") {
|
|
$sistem .= $getSistem[$i]['pp1'];
|
|
}
|
|
if ($getSistem[$i]['pp2'] != "") {
|
|
$sistem .= " : " . $getSistem[$i]['pp2'];
|
|
}
|
|
if ($getSistem[$i]['pp3'] != "") {
|
|
$sistem .= $getSistem[$i]['pp3'] . "\n";
|
|
} else {
|
|
$sistem .= "\n";
|
|
}
|
|
}
|
|
}
|
|
$getSmell = json_decode($this->post($urlSmell, ''), true);
|
|
$smell = "";
|
|
if (count($getSmell) > 0) {
|
|
for ($i = 0; $i < count($getSmell); $i++) {
|
|
if ($getSmell[$i]['xx1'] != "") {
|
|
$smell .= $getSmell[$i]['xx1'];
|
|
}
|
|
if ($getSmell[$i]['xx2'] != "") {
|
|
$smell .= " : " . $getSmell[$i]['xx2'];
|
|
}
|
|
if ($getSmell[$i]['xx3'] != "") {
|
|
$smell .= $getSmell[$i]['xx3'] . "\n";
|
|
} else {
|
|
$smell .= "\n";
|
|
}
|
|
}
|
|
}
|
|
$getIntegument = json_decode($this->post($urlIntegument, ''), true);
|
|
$integument = "";
|
|
if (count($getIntegument) > 0) {
|
|
for ($i = 0; $i < count($getIntegument); $i++) {
|
|
if ($getIntegument[$i]['pp1'] != "") {
|
|
$integument .= $getIntegument[$i]['pp1'];
|
|
}
|
|
if ($getIntegument[$i]['pp2'] != "") {
|
|
$integument .= " : " . $getIntegument[$i]['pp2'];
|
|
}
|
|
if ($getIntegument[$i]['pp3'] != "") {
|
|
$integument .= $getIntegument[$i]['pp3'] . "\n";
|
|
} else {
|
|
$integument .= "\n";
|
|
}
|
|
}
|
|
}
|
|
$getFaktorFisik = json_decode($this->post($urlFaktorFisik, ''), true);
|
|
$faktorFisik = "";
|
|
if (count($getFaktorFisik) > 0) {
|
|
for ($i = 0; $i < count($getFaktorFisik); $i++) {
|
|
if ($getFaktorFisik[$i]['aaa4']) {
|
|
$faktorFisik .= $getFaktorFisik[$i]['aaa1'] . ', ';
|
|
}
|
|
}
|
|
}
|
|
$getFaktorKimia = json_decode($this->post($urlFaktorKimia, ''), true);
|
|
$faktorKimia = "";
|
|
if (count($getFaktorKimia) > 0) {
|
|
for ($i = 0; $i < count($getFaktorKimia); $i++) {
|
|
if ($getFaktorKimia[$i]['bbb4']) {
|
|
$faktorKimia .= $getFaktorKimia[$i]['bbb1'] . ', ';
|
|
}
|
|
}
|
|
}
|
|
$getFaktorBiologi = json_decode($this->post($urlFaktorBiologi, ''), true);
|
|
$faktorBiologi = "";
|
|
if (count($getFaktorBiologi) > 0) {
|
|
for ($i = 0; $i < count($getFaktorBiologi); $i++) {
|
|
if ($getFaktorBiologi[$i]['ccc4']) {
|
|
$faktorBiologi .= $getFaktorBiologi[$i]['ccc1'] . ', ';
|
|
}
|
|
}
|
|
}
|
|
$getFaktorErgonomi = json_decode($this->post($urlFaktorErgonomi, ''), true);
|
|
$faktorErgonomi = "";
|
|
if (count($getFaktorErgonomi) > 0) {
|
|
for ($i = 0; $i < count($getFaktorErgonomi); $i++) {
|
|
if ($getFaktorErgonomi[$i]['ddd4']) {
|
|
$faktorErgonomi .= $getFaktorErgonomi[$i]['ddd1'] . ', ';
|
|
}
|
|
}
|
|
}
|
|
$getFaktorPsikologi = json_decode($this->post($urlFaktorPsikologi, ''), true);
|
|
$faktorPsikologi = "";
|
|
if (count($getFaktorPsikologi) > 0) {
|
|
for ($i = 0; $i < count($getFaktorPsikologi); $i++) {
|
|
if ($getFaktorPsikologi[$i]['eee4']) {
|
|
$faktorPsikologi .= $getFaktorPsikologi[$i]['eee1'] . ', ';
|
|
}
|
|
}
|
|
}
|
|
//get kesimpulan
|
|
$sql = " SELECT
|
|
Mcu_ResumeKesimpulan,
|
|
Mcu_ResumeRekomendasi,
|
|
Mcu_ResumeSaran
|
|
FROM so_resultentry
|
|
JOIN mcu_resume
|
|
ON So_ResultEntryT_OrderHeaderID = Mcu_ResumeT_OrderHeaderID
|
|
AND Mcu_ResumeIsActive = 'Y'
|
|
AND Mcu_ResumeValidation = 'Y'
|
|
WHERE So_ResultEntryID = ?
|
|
AND So_ResultEntryIsActive = 'Y'
|
|
GROUP BY So_ResultEntryT_OrderHeaderID";
|
|
$query = $this->db_smartone->query($sql, [$id]);
|
|
if (!$query) {
|
|
$message = $this->db_smartone->error();
|
|
$message['qry'] = $this->db_smartone->last_query();
|
|
$this->sys_error($message);
|
|
exit;
|
|
}
|
|
$kesimpulan = $query->result_array()[0]['Mcu_ResumeKesimpulan'];
|
|
$saran = $query->result_array()[0]['Mcu_ResumeSaran'];
|
|
$data = [];
|
|
if (count($idCek) == 0) {
|
|
//insert baru
|
|
$data = [
|
|
"Ss_FisikSo_ResultEntryID" => $id,
|
|
"Ss_FisikKeluhanSaatIni" => $keluhanSaatIni,
|
|
"Ss_FisikRiwayatPenyakit" => $riwayatPenyakit,
|
|
"Ss_FisikRiwayatKeluargaAyah" => $riwayatKeluargaAyah,
|
|
"Ss_FisikRiwayatKeluargaIbu" => $riwayatKeluargaIbu,
|
|
"Ss_FisikMerokok" => $merokok,
|
|
"Ss_FisikAlergi" => $alergi,
|
|
"Ss_FisikDoctor" => $doctor,
|
|
"Ss_FisikKonjuktivaSklera" => $konjuktivaSklera,
|
|
"Ss_FisikLowBackPain" => $lowBackPain,
|
|
"Ss_FisikAnogenital" => $anoGenital,
|
|
"Ss_FisikFrekuensiNafas" => $frekuensiNafas,
|
|
"Ss_FisikTulangBelakang" => $tulangBelakang,
|
|
"Ss_FisikExtremitas" => $extremitas,
|
|
"Ss_FisikKulit" => $kulit,
|
|
"Ss_FisikHernia" => $hernia,
|
|
"Ss_FisikPerut" => $perut,
|
|
"Ss_FisikThorax" => $thorax,
|
|
"Ss_FisikMulutGigi" => $mulutGigi,
|
|
"Ss_FisikJantung" => $jantung,
|
|
"Ss_FisikParu" => $paru,
|
|
"Ss_FisikTenggorokan" => $tenggorokan,
|
|
"Ss_FisikHidung" => $hidung,
|
|
"Ss_FisikTelinga" => $telinga,
|
|
"Ss_FisikLapangPandang" => $lapangPandang,
|
|
"Ss_FisikPresepsiWarna" => $presepsiWarna,
|
|
"Ss_FisikFrekuensiNadi" => $frekuensiNadi,
|
|
"Ss_FisikSuhu" => $suhu,
|
|
"Ss_FisikTekananDarahSistolik" => $tekananDarahDiastolik,
|
|
"Ss_FisikVisusLeft" => $visusLeft,
|
|
"Ss_FisikReflekFisiologis" => $reflekFisiologis,
|
|
"Ss_FisikReflekPatologis" => $reflekPatologis,
|
|
"Ss_FisikVisusRight" => $visusRight,
|
|
"Ss_FisikTekananDarahDiastolik" => $tekananDarahDiastolik,
|
|
"Ss_FisikTB" => $tb,
|
|
"Ss_FisikBMI" => $bmi,
|
|
"Ss_FisikBodyFat" => $bodyFat,
|
|
"Ss_FisikBB" => $bb,
|
|
"Ss_FisikAlkohol" => $alkohol,
|
|
"Ss_FisikOlahraga" => $olahraga,
|
|
"Ss_FisikLeher" => $leher,
|
|
"Ss_FisikRiwayatPhobia" => $riwayatPhobia,
|
|
"Ss_FisikRiwayatObat" => $riwayatObat,
|
|
"Ss_FisikKeadaanUmum" => $keadaanUmum,
|
|
"Ss_FisikRiwayatImunisasi" => $riwayatImunisasi,
|
|
"Ss_FisikGenitourinaria" => $genitourinaria,
|
|
"Ss_FisikAnggota" => $anggota,
|
|
"Ss_FisikSistem" => $sistem,
|
|
"Ss_FisikSmell" => $smell,
|
|
"Ss_FisikIntegument" => $integument,
|
|
"Ss_FisikFaktorFisik" => $faktorFisik,
|
|
"Ss_FisikFaktorKimia" => $faktorKimia,
|
|
"Ss_FisikFaktorBiologis" => $faktorBiologi,
|
|
"Ss_FisikFaktorErgonomi" => $faktorErgonomi,
|
|
"Ss_FisikFaktorPsikologi" => $faktorPsikologi,
|
|
"Ss_FisikKesimpulan" => $kesimpulan,
|
|
"Ss_FisikSaran" => $saran,
|
|
"Ss_FisikCreated" => date('Y-m-d H:i:s'),
|
|
"Ss_FisikCreatedUserID" => 0
|
|
];
|
|
$qry = $this->db_smartone->insert('ss_fisik', $data);
|
|
if (!$qry) {
|
|
$message = $this->db_smartone->error();
|
|
$this->sys_error($message);
|
|
exit;
|
|
}
|
|
} else {
|
|
//Update baru
|
|
$data = [
|
|
"Ss_FisikKeluhanSaatIni" => $keluhanSaatIni,
|
|
"Ss_FisikRiwayatPenyakit" => $riwayatPenyakit,
|
|
"Ss_FisikRiwayatKeluargaAyah" => $riwayatKeluargaAyah,
|
|
"Ss_FisikRiwayatKeluargaIbu" => $riwayatKeluargaIbu,
|
|
"Ss_FisikMerokok" => $merokok,
|
|
"Ss_FisikAlergi" => $alergi,
|
|
"Ss_FisikDoctor" => $doctor,
|
|
"Ss_FisikKonjuktivaSklera" => $konjuktivaSklera,
|
|
"Ss_FisikLowBackPain" => $lowBackPain,
|
|
"Ss_FisikAnogenital" => $anoGenital,
|
|
"Ss_FisikFrekuensiNafas" => $frekuensiNafas,
|
|
"Ss_FisikTulangBelakang" => $tulangBelakang,
|
|
"Ss_FisikExtremitas" => $extremitas,
|
|
"Ss_FisikKulit" => $kulit,
|
|
"Ss_FisikHernia" => $hernia,
|
|
"Ss_FisikPerut" => $perut,
|
|
"Ss_FisikThorax" => $thorax,
|
|
"Ss_FisikMulutGigi" => $mulutGigi,
|
|
"Ss_FisikJantung" => $jantung,
|
|
"Ss_FisikParu" => $paru,
|
|
"Ss_FisikTenggorokan" => $tenggorokan,
|
|
"Ss_FisikHidung" => $hidung,
|
|
"Ss_FisikTelinga" => $telinga,
|
|
"Ss_FisikLapangPandang" => $lapangPandang,
|
|
"Ss_FisikPresepsiWarna" => $presepsiWarna,
|
|
"Ss_FisikFrekuensiNadi" => $frekuensiNadi,
|
|
"Ss_FisikSuhu" => $suhu,
|
|
"Ss_FisikTekananDarahSistolik" => $tekananDarahDiastolik,
|
|
"Ss_FisikVisusLeft" => $visusLeft,
|
|
"Ss_FisikReflekFisiologis" => $reflekFisiologis,
|
|
"Ss_FisikReflekPatologis" => $reflekPatologis,
|
|
"Ss_FisikVisusRight" => $visusRight,
|
|
"Ss_FisikTekananDarahDiastolik" => $tekananDarahDiastolik,
|
|
"Ss_FisikTB" => $tb,
|
|
"Ss_FisikBMI" => $bmi,
|
|
"Ss_FisikBodyFat" => $bodyFat,
|
|
"Ss_FisikBB" => $bb,
|
|
"Ss_FisikAlkohol" => $alkohol,
|
|
"Ss_FisikOlahraga" => $olahraga,
|
|
"Ss_FisikLeher" => $leher,
|
|
"Ss_FisikRiwayatPhobia" => $riwayatPhobia,
|
|
"Ss_FisikRiwayatObat" => $riwayatObat,
|
|
"Ss_FisikKeadaanUmum" => $keadaanUmum,
|
|
"Ss_FisikRiwayatImunisasi" => $riwayatImunisasi,
|
|
"Ss_FisikGenitourinaria" => $genitourinaria,
|
|
"Ss_FisikAnggota" => $anggota,
|
|
"Ss_FisikSistem" => $sistem,
|
|
"Ss_FisikSmell" => $smell,
|
|
"Ss_FisikIntegument" => $integument,
|
|
"Ss_FisikFaktorFisik" => $faktorFisik,
|
|
"Ss_FisikFaktorKimia" => $faktorKimia,
|
|
"Ss_FisikFaktorBiologis" => $faktorBiologi,
|
|
"Ss_FisikFaktorErgonomi" => $faktorErgonomi,
|
|
"Ss_FisikFaktorPsikologi" => $faktorPsikologi,
|
|
"Ss_FisikKesimpulan" => $kesimpulan,
|
|
"Ss_FisikSaran" => $saran,
|
|
"Ss_FisikUpdatedUserID" => 0,
|
|
"Ss_FisikLastUpdated" => date('Y-m-d H:i:s'),
|
|
];
|
|
// "Ss_FisikSo_ResultEntryID" => $id,
|
|
$this->db_smartone->where('Ss_FisikID', $idCek);
|
|
$qry = $this->db_smartone->update('ss_fisik', $data);
|
|
if (!$qry) {
|
|
$message = $this->db_smartone->error();
|
|
$this->sys_error($message);
|
|
exit;
|
|
}
|
|
}
|
|
|
|
$this->sys_ok($data);
|
|
}
|
|
function generatev2($id)
|
|
{
|
|
$prm = $this->sys_input;
|
|
|
|
if (!$id) {
|
|
$this->sys_error("Prm id is required");
|
|
exit;
|
|
}
|
|
$sql = "SELECT Ss_FisikID FROM ss_fisik
|
|
WHERE Ss_FisikSo_ResultEntryID = ?
|
|
AND Ss_FisikIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, $id);
|
|
if (!$qry) {
|
|
$message = $this->db_smartone->error();
|
|
$this->sys_error($message);
|
|
exit;
|
|
}
|
|
$idCek = $qry->result_array()[0]['Ss_FisikID'];
|
|
$getKeluhanSaatIni = $this->keluhan_saat_ini($id);
|
|
$keluhanSaatIni = $getKeluhanSaatIni;
|
|
|
|
$getRiwayatPenyakit = $this->riwayat_penyakit($id);
|
|
$riwayatPenyakit = $getRiwayatPenyakit;
|
|
|
|
$getRiwayatKeluargaAyah = $this->riwayat_keluarga($id, 'ayah');
|
|
$riwayatKeluargaAyah = $getRiwayatKeluargaAyah;
|
|
|
|
$getRiwayatKeluargaIbu = $this->riwayat_keluarga($id, 'ibu');
|
|
$riwayatKeluargaIbu = $getRiwayatKeluargaIbu;
|
|
|
|
$getMerokok = $this->merokok($id);
|
|
$merokok = $getMerokok;
|
|
|
|
$getAlergi = $this->alergi($id);
|
|
$alergi = $getAlergi;
|
|
|
|
$getDoctor = $this->doctor($id);
|
|
$doctor = $getDoctor;
|
|
|
|
$getKonjuktivaSklera = $this->konjuktiva_sklera($id);
|
|
$konjuktivaSklera = $getKonjuktivaSklera;
|
|
|
|
$getLowBackPain = $this->low($id);
|
|
$lowBackPain = $getLowBackPain;
|
|
|
|
$getAnoGenital = $this->anogenital($id);
|
|
$anoGenital = $getAnoGenital;
|
|
|
|
$getFrekuensiNafas = $this->frekuensi_nafas($id);
|
|
$frekuensiNafas = $getFrekuensiNafas;
|
|
|
|
$getTulangBelakang = $this->tulang_belakang($id);
|
|
$tulangBelakang = $getTulangBelakang;
|
|
|
|
$getExtremitas = $this->extremitas($id);
|
|
$extremitas = $getExtremitas;
|
|
|
|
$getKulit = $this->kulit($id);
|
|
$kulit = $getKulit;
|
|
|
|
$getHernia = $this->hernia($id);
|
|
$hernia = $getHernia;
|
|
|
|
$getPerut = $this->perut($id);
|
|
$perut = $getPerut;
|
|
|
|
$getThorax = $this->thorax($id);
|
|
$thorax = $getThorax;
|
|
|
|
$getMulutGigi = $this->mulut_gigi($id);
|
|
$mulutGigi = $getMulutGigi;
|
|
|
|
$getJantung = $this->jantung($id);
|
|
$jantung = $getJantung;
|
|
|
|
$getParu = $this->paru($id);
|
|
$paru = $getParu;
|
|
|
|
$getTenggorokan = $this->tenggorokan($id);
|
|
$tenggorokan = $getTenggorokan;
|
|
|
|
$getHidung = $this->hidung($id);
|
|
$hidung = $getHidung;
|
|
|
|
$getTelinga = $this->telinga($id);
|
|
$telinga = $getTelinga;
|
|
|
|
$getLapangPandang = $this->lapang_pandang($id);
|
|
$lapangPandang = $getLapangPandang;
|
|
|
|
$getPresepsiWarna = $this->persepsi_warna($id);
|
|
$presepsiWarna = $getPresepsiWarna;
|
|
|
|
$getFrekuensiNadi = $this->frekuensi_nadi($id);
|
|
$frekuensiNadi = $getFrekuensiNadi;
|
|
|
|
$getSuhu = $this->suhu($id);
|
|
$suhu = $getSuhu;
|
|
|
|
$getTekananDarahSistolik = $this->tekanan_darah($id, 'sistolik');
|
|
$TekananDarahSistolik = $getTekananDarahSistolik;
|
|
|
|
$getVisusLeft = $this->visus($id, 'left');
|
|
$visusLeft = $getVisusLeft;
|
|
|
|
|
|
$getReflekFisiologis = $this->reflek($id, 'fisiologis');
|
|
$reflekFisiologis = $getReflekFisiologis;
|
|
|
|
$getReflekPatologis = $this->reflek($id, 'patologis');
|
|
$reflekPatologis = $getReflekPatologis;
|
|
|
|
$getVisusRight = $this->visus($id, 'right');
|
|
$visusRight = $getVisusRight;
|
|
|
|
$getTekananDarahDiastolik = $this->tekanan_darah($id, 'diastolik');
|
|
$tekananDarahDiastolik = $getTekananDarahDiastolik;
|
|
|
|
$getTB = $this->tbbbbodyfat($id, 'TB');
|
|
$tb = $getTB;
|
|
|
|
$getBMI = $this->tbbbbodyfat($id, 'BMI');
|
|
$bmi = $getBMI;
|
|
|
|
$getBodyFat = $this->tbbbbodyfat($id, 'BODY');
|
|
$bodyFat = $getBodyFat;
|
|
|
|
$getBB = $this->tbbbbodyfat($id, 'BB');
|
|
$bb = $getBB;
|
|
|
|
$getAlkohol = $this->alkohol($id);
|
|
$alkohol = $getAlkohol;
|
|
|
|
$getOlahraga = $this->olahraga($id);
|
|
$olahraga = $getOlahraga;
|
|
|
|
$getLeher = $this->leher($id);
|
|
$leher = $getLeher;
|
|
|
|
$getRiwayatPhobia = $this->riwayat_phobia($id);
|
|
$riwayatPhobia = $getRiwayatPhobia;
|
|
|
|
$getRiwayatObat = $this->riwayat_obat($id);
|
|
$riwayatObat = $getRiwayatObat;
|
|
|
|
$getRiwayatImunisasi = $this->riwayat_imunisasi($id);
|
|
$riwayatImunisasi = $getRiwayatImunisasi;
|
|
|
|
$getKeadaanUmum = $this->keadaan_umum($id);
|
|
$keadaanUmum = $getKeadaanUmum;
|
|
|
|
$getGenitourinaria = $this->genitourinaria($id);
|
|
$genitourinaria = $getGenitourinaria;
|
|
|
|
$getAnggota = $this->anggota($id);
|
|
$anggota = $getAnggota;
|
|
|
|
$getSistem = $this->sistem($id);
|
|
$sistem = $getSistem;
|
|
|
|
$getSmell = $this->smell($id);
|
|
$smell = $getSmell;
|
|
|
|
$getIntegument = $this->integumen($id);
|
|
$integument = $getIntegument;
|
|
|
|
$getFaktorFisik = $this->faktor_fisik($id);
|
|
$faktorFisik = $getFaktorFisik;
|
|
|
|
$getFaktorKimia = $this->faktor_kimia($id);
|
|
$faktorKimia = $getFaktorKimia;
|
|
|
|
$getFaktorBiologi = $this->faktor_biologi($id);
|
|
$faktorBiologi = $getFaktorKimia;
|
|
|
|
$getFaktorErgonomi = $this->faktor_ergonomi($id);
|
|
$faktorErgonomi = $getFaktorErgonomi;
|
|
|
|
$getFaktorPsikologi = $this->faktor_psikologi($id);
|
|
$faktorPsikologi = $getFaktorBiologi;
|
|
|
|
//get kesimpulan
|
|
$sql = " SELECT
|
|
Mcu_ResumeKesimpulan,
|
|
Mcu_ResumeRekomendasi,
|
|
Mcu_ResumeSaran
|
|
FROM so_resultentry
|
|
JOIN mcu_resume
|
|
ON So_ResultEntryT_OrderHeaderID = Mcu_ResumeT_OrderHeaderID
|
|
AND Mcu_ResumeIsActive = 'Y'
|
|
AND Mcu_ResumeValidation = 'Y'
|
|
WHERE So_ResultEntryID = ?
|
|
AND So_ResultEntryIsActive = 'Y'
|
|
GROUP BY So_ResultEntryT_OrderHeaderID";
|
|
$query = $this->db_smartone->query($sql, [$id]);
|
|
if (!$query) {
|
|
$message = $this->db_smartone->error();
|
|
$message['qry'] = $this->db_smartone->last_query();
|
|
$this->sys_error($message);
|
|
exit;
|
|
}
|
|
$kesimpulan = $query->result_array()[0]['Mcu_ResumeKesimpulan'];
|
|
$saran = $query->result_array()[0]['Mcu_ResumeSaran'];
|
|
$data = [];
|
|
if (count($idCek) == 0) {
|
|
//insert baru
|
|
$data = [
|
|
"Ss_FisikSo_ResultEntryID" => $id,
|
|
"Ss_FisikKeluhanSaatIni" => $keluhanSaatIni,
|
|
"Ss_FisikRiwayatPenyakit" => $riwayatPenyakit,
|
|
"Ss_FisikRiwayatKeluargaAyah" => $riwayatKeluargaAyah,
|
|
"Ss_FisikRiwayatKeluargaIbu" => $riwayatKeluargaIbu,
|
|
"Ss_FisikMerokok" => $merokok,
|
|
"Ss_FisikAlergi" => $alergi,
|
|
"Ss_FisikDoctor" => $doctor,
|
|
"Ss_FisikKonjuktivaSklera" => $konjuktivaSklera,
|
|
"Ss_FisikLowBackPain" => $lowBackPain,
|
|
"Ss_FisikAnogenital" => $anoGenital,
|
|
"Ss_FisikFrekuensiNafas" => $frekuensiNafas,
|
|
"Ss_FisikTulangBelakang" => $tulangBelakang,
|
|
"Ss_FisikExtremitas" => $extremitas,
|
|
"Ss_FisikKulit" => $kulit,
|
|
"Ss_FisikHernia" => $hernia,
|
|
"Ss_FisikPerut" => $perut,
|
|
"Ss_FisikThorax" => $thorax,
|
|
"Ss_FisikMulutGigi" => $mulutGigi,
|
|
"Ss_FisikJantung" => $jantung,
|
|
"Ss_FisikParu" => $paru,
|
|
"Ss_FisikTenggorokan" => $tenggorokan,
|
|
"Ss_FisikHidung" => $hidung,
|
|
"Ss_FisikTelinga" => $telinga,
|
|
"Ss_FisikLapangPandang" => $lapangPandang,
|
|
"Ss_FisikPresepsiWarna" => $presepsiWarna,
|
|
"Ss_FisikFrekuensiNadi" => $frekuensiNadi,
|
|
"Ss_FisikSuhu" => $suhu,
|
|
"Ss_FisikTekananDarahSistolik" => $TekananDarahSistolik,
|
|
"Ss_FisikVisusLeft" => $visusLeft,
|
|
"Ss_FisikReflekFisiologis" => $reflekFisiologis,
|
|
"Ss_FisikReflekPatologis" => $reflekPatologis,
|
|
"Ss_FisikVisusRight" => $visusRight,
|
|
"Ss_FisikTekananDarahDiastolik" => $tekananDarahDiastolik,
|
|
"Ss_FisikTB" => $tb,
|
|
"Ss_FisikBMI" => $bmi,
|
|
"Ss_FisikBodyFat" => $bodyFat,
|
|
"Ss_FisikBB" => $bb,
|
|
"Ss_FisikAlkohol" => $alkohol,
|
|
"Ss_FisikOlahraga" => $olahraga,
|
|
"Ss_FisikLeher" => $leher,
|
|
"Ss_FisikRiwayatPhobia" => $riwayatPhobia,
|
|
"Ss_FisikRiwayatObat" => $riwayatObat,
|
|
"Ss_FisikKeadaanUmum" => $keadaanUmum,
|
|
"Ss_FisikRiwayatImunisasi" => $riwayatImunisasi,
|
|
"Ss_FisikGenitourinaria" => $genitourinaria,
|
|
"Ss_FisikAnggota" => $anggota,
|
|
"Ss_FisikSistem" => $sistem,
|
|
"Ss_FisikSmell" => $smell,
|
|
"Ss_FisikIntegument" => $integument,
|
|
"Ss_FisikFaktorFisik" => $faktorFisik,
|
|
"Ss_FisikFaktorKimia" => $faktorKimia,
|
|
"Ss_FisikFaktorBiologis" => $faktorBiologi,
|
|
"Ss_FisikFaktorErgonomi" => $faktorErgonomi,
|
|
"Ss_FisikFaktorPsikologi" => $faktorPsikologi,
|
|
"Ss_FisikKesimpulan" => $kesimpulan,
|
|
"Ss_FisikSaran" => $saran,
|
|
"Ss_FisikCreated" => date('Y-m-d H:i:s'),
|
|
"Ss_FisikCreatedUserID" => 0
|
|
];
|
|
$qry = $this->db_smartone->insert('ss_fisik', $data);
|
|
if (!$qry) {
|
|
$message = $this->db_smartone->error();
|
|
$this->sys_error($message);
|
|
exit;
|
|
}
|
|
} else {
|
|
//Update baru
|
|
$data = [
|
|
"Ss_FisikKeluhanSaatIni" => $keluhanSaatIni,
|
|
"Ss_FisikRiwayatPenyakit" => $riwayatPenyakit,
|
|
"Ss_FisikRiwayatKeluargaAyah" => $riwayatKeluargaAyah,
|
|
"Ss_FisikRiwayatKeluargaIbu" => $riwayatKeluargaIbu,
|
|
"Ss_FisikMerokok" => $merokok,
|
|
"Ss_FisikAlergi" => $alergi,
|
|
"Ss_FisikDoctor" => $doctor,
|
|
"Ss_FisikKonjuktivaSklera" => $konjuktivaSklera,
|
|
"Ss_FisikLowBackPain" => $lowBackPain,
|
|
"Ss_FisikAnogenital" => $anoGenital,
|
|
"Ss_FisikFrekuensiNafas" => $frekuensiNafas,
|
|
"Ss_FisikTulangBelakang" => $tulangBelakang,
|
|
"Ss_FisikExtremitas" => $extremitas,
|
|
"Ss_FisikKulit" => $kulit,
|
|
"Ss_FisikHernia" => $hernia,
|
|
"Ss_FisikPerut" => $perut,
|
|
"Ss_FisikThorax" => $thorax,
|
|
"Ss_FisikMulutGigi" => $mulutGigi,
|
|
"Ss_FisikJantung" => $jantung,
|
|
"Ss_FisikParu" => $paru,
|
|
"Ss_FisikTenggorokan" => $tenggorokan,
|
|
"Ss_FisikHidung" => $hidung,
|
|
"Ss_FisikTelinga" => $telinga,
|
|
"Ss_FisikLapangPandang" => $lapangPandang,
|
|
"Ss_FisikPresepsiWarna" => $presepsiWarna,
|
|
"Ss_FisikFrekuensiNadi" => $frekuensiNadi,
|
|
"Ss_FisikSuhu" => $suhu,
|
|
"Ss_FisikTekananDarahSistolik" => $TekananDarahSistolik,
|
|
"Ss_FisikVisusLeft" => $visusLeft,
|
|
"Ss_FisikReflekFisiologis" => $reflekFisiologis,
|
|
"Ss_FisikReflekPatologis" => $reflekPatologis,
|
|
"Ss_FisikVisusRight" => $visusRight,
|
|
"Ss_FisikTekananDarahDiastolik" => $tekananDarahDiastolik,
|
|
"Ss_FisikTB" => $tb,
|
|
"Ss_FisikBMI" => $bmi,
|
|
"Ss_FisikBodyFat" => $bodyFat,
|
|
"Ss_FisikBB" => $bb,
|
|
"Ss_FisikAlkohol" => $alkohol,
|
|
"Ss_FisikOlahraga" => $olahraga,
|
|
"Ss_FisikLeher" => $leher,
|
|
"Ss_FisikRiwayatPhobia" => $riwayatPhobia,
|
|
"Ss_FisikRiwayatObat" => $riwayatObat,
|
|
"Ss_FisikKeadaanUmum" => $keadaanUmum,
|
|
"Ss_FisikRiwayatImunisasi" => $riwayatImunisasi,
|
|
"Ss_FisikGenitourinaria" => $genitourinaria,
|
|
"Ss_FisikAnggota" => $anggota,
|
|
"Ss_FisikSistem" => $sistem,
|
|
"Ss_FisikSmell" => $smell,
|
|
"Ss_FisikIntegument" => $integument,
|
|
"Ss_FisikFaktorFisik" => $faktorFisik,
|
|
"Ss_FisikFaktorKimia" => $faktorKimia,
|
|
"Ss_FisikFaktorBiologis" => $faktorBiologi,
|
|
"Ss_FisikFaktorErgonomi" => $faktorErgonomi,
|
|
"Ss_FisikFaktorPsikologi" => $faktorPsikologi,
|
|
"Ss_FisikKesimpulan" => $kesimpulan,
|
|
"Ss_FisikSaran" => $saran,
|
|
"Ss_FisikUpdatedUserID" => 0,
|
|
"Ss_FisikLastUpdated" => date('Y-m-d H:i:s'),
|
|
];
|
|
// "Ss_FisikSo_ResultEntryID" => $id,
|
|
$this->db_smartone->where('Ss_FisikID', $idCek);
|
|
$qry = $this->db_smartone->update('ss_fisik', $data);
|
|
if (!$qry) {
|
|
$message = $this->db_smartone->error();
|
|
$this->sys_error($message);
|
|
exit;
|
|
}
|
|
}
|
|
|
|
|
|
$this->sys_ok($data);
|
|
}
|
|
function generateperiode($startDate, $endDate)
|
|
{
|
|
if (!$startDate) {
|
|
$this->sys_error("Prm startdate is required");
|
|
exit;
|
|
}
|
|
if (!$endDate) {
|
|
$this->sys_error("Prm enddate is required");
|
|
exit;
|
|
}
|
|
$sql = "SELECT
|
|
So_ResultEntryID,
|
|
Mcu_ResumeID
|
|
FROM so_resultentry
|
|
JOIN mcu_resume
|
|
ON So_ResultEntryT_OrderHeaderID = Mcu_ResumeT_OrderHeaderID
|
|
AND Mcu_ResumeIsActive = 'Y'
|
|
AND Mcu_ResumeValidation = 'Y'
|
|
WHERE DATE(So_ResultEntryCreated) BETWEEN '{$startDate}' AND '{$endDate}'
|
|
AND So_ResultEntryIsActive = 'Y'
|
|
";
|
|
$query = $this->db_smartone->query($sql);
|
|
if (!$query) {
|
|
$message = $this->db_smartone->error();
|
|
$message['qry'] = $this->db_smartone->last_query();
|
|
$this->sys_error($message);
|
|
exit;
|
|
}
|
|
$data = $query->result_array();
|
|
// print_r($data);
|
|
// exit;
|
|
for ($k = 0; $k < count($data); $k++) {
|
|
$id = $data[$k]["So_ResultEntryID"];
|
|
|
|
$urlKeluhanSaatIni = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/keluhan_saat_ini/{$id}";
|
|
$urlRiwayatPenyakit = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/riwayat_penyakit/{$id}";
|
|
$urlRiwayatKeluargaAyah = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/riwayat_keluarga/{$id}/ayah";
|
|
$urlRiwayatKeluargaIbu = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/riwayat_keluarga/{$id}/ibu";
|
|
$urlMeroko = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/merokok/{$id}";
|
|
$urlAlergi = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/alergi/{$id}";
|
|
$urlDoctor = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/doctor/{$id}";
|
|
$urlKonjuktivaSklera = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/konjuktiva_sklera/{$id}";
|
|
$urlLowBackPain = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/low_back_pain/{$id}";
|
|
$urlAnogenital = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/anogenital/{$id}";
|
|
$urlFrekuensiNafas = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/frekuensi_nafas/{$id}";
|
|
$urlTulangBelakang = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/tulang_belakang/{$id}";
|
|
$urlExtremitas = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/extremitas/{$id}";
|
|
$urlKulit = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/kulit/{$id}";
|
|
$urlHernia = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/hernia/{$id}";
|
|
$urlPerut = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/perut/{$id}";
|
|
$urlThorax = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/thorax/{$id}";
|
|
$urlMulutGigi = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/mulut_gigi/{$id}";
|
|
$urlJantung = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/jantung/{$id}";
|
|
$urlParu = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/paru/{$id}";
|
|
$urlTenggorokan = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/tenggorokan/{$id}";
|
|
$urlHidung = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/hidung/{$id}";
|
|
$urlTelinga = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/telinga/{$id}";
|
|
$urlLapangPandang = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/lapang_pandang/{$id}";
|
|
$urlPresepsiWarna = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/persepsi_warna/{$id}";
|
|
$urlFrekuensiNadi = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/frekuensi_nadi/{$id}";
|
|
$urlSuhu = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/suhu/{$id}";
|
|
$urlTekananDarah = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/tekanan_darah/{$id}/sistolik";
|
|
$urlVisusLeft = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/visus/{$id}/left";
|
|
$urlReflekFisiologis = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/reflek/{$id}/fisiologis";
|
|
$urlReflekPatologis = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/reflek/{$id}/patologis";
|
|
$urlVisusRight = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/visus/{$id}/right";
|
|
$urlTekananDarahDiastolik = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/tekanan_darah/{$id}/diastolik";
|
|
$urlTB = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/tbbbbodyfat/{$id}/TB";
|
|
$urlBMI = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/tbbbbodyfat/{$id}/BMI";
|
|
$urlBodyfat = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/tbbbbodyfat/{$id}/BODY";
|
|
$urlBB = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/tbbbbodyfat/{$id}/BB";
|
|
$urlAlkohol = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/alkohol/{$id}";
|
|
$urlOlahraga = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/olahraga/{$id}";
|
|
$urlLeher = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/leher/{$id}";
|
|
$urlRiwayatPhobia = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/riwayat_phobia/{$id}";
|
|
$urlRiwayatObat = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/riwayat_obat/{$id}";
|
|
$urlRiwayatImunisasi = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/riwayat_imunisasi/{$id}";
|
|
$urlKeadaanUmum = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/keadaan_umum/{$id}";
|
|
$urlGenitourinaria = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/genitourinaria/{$id}";
|
|
$urlAnggota = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/anggota/{$id}";
|
|
$urlSistem = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/sistem/{$id}";
|
|
$urlSmell = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/smell/{$id}";
|
|
$urlIntegument = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/integumen/{$id}";
|
|
$urlFaktorFisik = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/faktor_fisik/{$id}";
|
|
$urlFaktorKimia = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/faktor_kimia/{$id}";
|
|
$urlFaktorBiologi = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/faktor_biologi/{$id}";
|
|
$urlFaktorErgonomi = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/faktor_ergonomi/{$id}";
|
|
$urlFaktorPsikologi = "https://" . $this->hostname . "/one-api/v1/report_duatahun/fisik/faktor_psikologi/{$id}";
|
|
|
|
|
|
$sql = "SELECT Ss_FisikID FROM ss_fisik
|
|
WHERE Ss_FisikSo_ResultEntryID = ?
|
|
AND Ss_FisikIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, $id);
|
|
if (!$qry) {
|
|
$message = $this->db_smartone->error();
|
|
$this->sys_error($message);
|
|
exit;
|
|
}
|
|
$idCek = $qry->result_array()[0]['Ss_FisikID'];
|
|
$result = [];
|
|
$getKeluhanSaatIni = json_decode($this->post($urlKeluhanSaatIni, ''), true);
|
|
$result["getKeluhanSaatIni"] = $getKeluhanSaatIni;
|
|
// print_r($getKeluhanSaatIni[0]['a2']);
|
|
// print_r($data);
|
|
$keluhanSaatIni = "";
|
|
if (count($getKeluhanSaatIni) > 0) {
|
|
if (isset($getKeluhanSaatIni[0]['a2'])) {
|
|
$keluhanSaatIni = $getKeluhanSaatIni[0]['a2'];
|
|
}
|
|
}
|
|
// print_r($keluhanSaatIni);
|
|
$getRiwayatPenyakit = json_decode($this->post($urlRiwayatPenyakit, ''), true);
|
|
|
|
$riwayatPenyakit = "";
|
|
if (count($getRiwayatPenyakit) > 0) {
|
|
if (isset($getRiwayatPenyakit[0]['b2'])) {
|
|
$riwayatPenyakit = $getRiwayatPenyakit[0]['b2'];
|
|
}
|
|
}
|
|
$getRiwayatKeluargaAyah = json_decode($this->post($urlRiwayatKeluargaAyah, ''), true);
|
|
$riwayatKeluargaAyah = "";
|
|
if (count($getRiwayatKeluargaAyah) > 0) {
|
|
if (isset($getRiwayatKeluargaAyah[0]['a2'])) {
|
|
$riwayatKeluargaAyah = $getRiwayatKeluargaAyah[0]['a2'];
|
|
}
|
|
}
|
|
$getRiwayatKeluargaIbu = json_decode($this->post($urlRiwayatKeluargaIbu, ''), true);
|
|
$riwayatKeluargaIbu = "";
|
|
if (count($getRiwayatKeluargaIbu) > 0) {
|
|
if (isset($getRiwayatKeluargaIbu[0]['c2'])) {
|
|
$riwayatKeluargaIbu = $getRiwayatKeluargaIbu[0]['c2'];
|
|
}
|
|
}
|
|
$getMerokok = json_decode($this->post($urlMeroko, ''), true);
|
|
$merokok = "";
|
|
if (count($getMerokok) > 0) {
|
|
if (isset($getMerokok[0]['a2'])) {
|
|
$merokok = $getMerokok[0]['a2'];
|
|
}
|
|
}
|
|
$getAlergi = json_decode($this->post($urlAlergi, ''), true);
|
|
$alergi = "";
|
|
if (count($getAlergi) > 0) {
|
|
if (isset($getAlergi[0]['a2'])) {
|
|
$alergi = $getAlergi[0]['a2'];
|
|
}
|
|
}
|
|
$getDoctor = json_decode($this->post($urlDoctor, ''), true);
|
|
$doctor = "";
|
|
if (count($getDoctor) > 0) {
|
|
if (isset($getDoctor[0]['a2'])) {
|
|
$doctor = $getDoctor[0]['a2'];
|
|
}
|
|
}
|
|
$getKonjuktivaSklera = json_decode($this->post($urlKonjuktivaSklera, ''), true);
|
|
$konjuktivaSklera = "";
|
|
if (count($getKonjuktivaSklera) > 0) {
|
|
if (isset($getKonjuktivaSklera[0]['a2'])) {
|
|
$konjuktivaSklera = $getKonjuktivaSklera[0]['a2'];
|
|
}
|
|
}
|
|
$getLowBackPain = json_decode($this->post($urlLowBackPain, ''), true);
|
|
$lowBackPain = "";
|
|
if (count($getLowBackPain) > 0) {
|
|
if (isset($getLowBackPain[0]['a2'])) {
|
|
$lowBackPain = $getLowBackPain[0]['a2'];
|
|
}
|
|
}
|
|
$getAnoGenital = json_decode($this->post($urlAnogenital, ''), true);
|
|
$anoGenital = "";
|
|
if (count($getAnoGenital) > 0) {
|
|
if (isset($getAnoGenital[0]['a2'])) {
|
|
$anoGenital = $getAnoGenital[0]['a2'];
|
|
}
|
|
}
|
|
$getFrekuensiNafas = json_decode($this->post($urlFrekuensiNafas, ''), true);
|
|
$frekuensiNafas = "";
|
|
if (count($getFrekuensiNafas) > 0) {
|
|
if (isset($getFrekuensiNafas[0]['a2'])) {
|
|
$frekuensiNafas = $getFrekuensiNafas[0]['a2'];
|
|
}
|
|
}
|
|
$getTulangBelakang = json_decode($this->post($urlTulangBelakang, ''), true);
|
|
$tulangBelakang = "";
|
|
if (count($getTulangBelakang) > 0) {
|
|
if (isset($getTulangBelakang[0]['a2'])) {
|
|
$tulangBelakang = $getTulangBelakang[0]['a2'];
|
|
}
|
|
}
|
|
$getTulangBelakang = json_decode($this->post($urlTulangBelakang, ''), true);
|
|
$tulangBelakang = "";
|
|
if (count($getTulangBelakang) > 0) {
|
|
if (isset($getTulangBelakang[0]['a2'])) {
|
|
$tulangBelakang = $getTulangBelakang[0]['a2'];
|
|
}
|
|
}
|
|
$getExtremitas = json_decode($this->post($urlExtremitas, ''), true);
|
|
$extremitas = "";
|
|
if (count($getExtremitas) > 0) {
|
|
if (isset($getExtremitas[0]['a2'])) {
|
|
$extremitas = $getExtremitas[0]['a2'];
|
|
}
|
|
}
|
|
$getKulit = json_decode($this->post($urlKulit, ''), true);
|
|
$kulit = "";
|
|
if (count($getKulit) > 0) {
|
|
if (isset($getKulit[0]['a2'])) {
|
|
$kulit = $getKulit[0]['a2'];
|
|
}
|
|
}
|
|
$getHernia = json_decode($this->post($urlHernia, ''), true);
|
|
$hernia = "";
|
|
if (count($getHernia) > 0) {
|
|
if (isset($getHernia[0]['a2'])) {
|
|
$hernia = $getHernia[0]['a2'];
|
|
}
|
|
}
|
|
$getPerut = json_decode($this->post($urlPerut, ''), true);
|
|
$perut = "";
|
|
if (count($getPerut) > 0) {
|
|
if (isset($getPerut[0]['a2'])) {
|
|
$perut = $getPerut[0]['a2'];
|
|
}
|
|
}
|
|
$getThorax = json_decode($this->post($urlThorax, ''), true);
|
|
$thorax = "";
|
|
if (count($getThorax) > 0) {
|
|
if (isset($getThorax[0]['a2'])) {
|
|
$thorax = $getThorax[0]['a2'];
|
|
}
|
|
}
|
|
$getMulutGigi = json_decode($this->post($urlMulutGigi, ''), true);
|
|
$mulutGigi = "";
|
|
if (count($getMulutGigi) > 0) {
|
|
if (isset($getMulutGigi[0]['a2'])) {
|
|
$mulutGigi = $getMulutGigi[0]['a2'];
|
|
}
|
|
}
|
|
$getJantung = json_decode($this->post($urlJantung, ''), true);
|
|
$jantung = "";
|
|
if (count($getJantung) > 0) {
|
|
if (isset($getJantung[0]['a2'])) {
|
|
$jantung = $getJantung[0]['a2'];
|
|
}
|
|
}
|
|
$getParu = json_decode($this->post($urlParu, ''), true);
|
|
$paru = "";
|
|
if (count($getParu) > 0) {
|
|
if (isset($getParu[0]['a2'])) {
|
|
$paru = $getParu[0]['a2'];
|
|
}
|
|
}
|
|
$getTenggorokan = json_decode($this->post($urlTenggorokan, ''), true);
|
|
$tenggorokan = "";
|
|
if (count($getTenggorokan) > 0) {
|
|
if (isset($getTenggorokan[0]['a2'])) {
|
|
$tenggorokan = $getTenggorokan[0]['a2'];
|
|
}
|
|
}
|
|
$getTenggorokan = json_decode($this->post($urlTenggorokan, ''), true);
|
|
$tenggorokan = "";
|
|
if (count($getTenggorokan) > 0) {
|
|
if (isset($getTenggorokan[0]['a2'])) {
|
|
$tenggorokan = $getTenggorokan[0]['a2'];
|
|
}
|
|
}
|
|
$getHidung = json_decode($this->post($urlHidung, ''), true);
|
|
$hidung = "";
|
|
if (count($getHidung) > 0) {
|
|
if (isset($getHidung[0]['a2'])) {
|
|
$hidung = $getHidung[0]['a2'];
|
|
}
|
|
}
|
|
$getHidung = json_decode($this->post($urlHidung, ''), true);
|
|
$hidung = "";
|
|
if (count($getHidung) > 0) {
|
|
if (isset($getHidung[0]['a2'])) {
|
|
$hidung = $getHidung[0]['a2'];
|
|
}
|
|
}
|
|
$getTelinga = json_decode($this->post($urlTelinga, ''), true);
|
|
$telinga = "";
|
|
if (count($getTelinga) > 0) {
|
|
if (isset($getTelinga[0]['a2'])) {
|
|
$telinga = $getTelinga[0]['a2'];
|
|
}
|
|
}
|
|
$getLapangPandang = json_decode($this->post($urlLapangPandang, ''), true);
|
|
$lapangPandang = "";
|
|
if (count($getLapangPandang) > 0) {
|
|
if (isset($getLapangPandang[0]['a2'])) {
|
|
$lapangPandang = $getLapangPandang[0]['a2'];
|
|
}
|
|
}
|
|
$getPresepsiWarna = json_decode($this->post($urlPresepsiWarna, ''), true);
|
|
$presepsiWarna = "";
|
|
if (count($getPresepsiWarna) > 0) {
|
|
if (isset($getPresepsiWarna[0]['a2'])) {
|
|
$presepsiWarna = $getPresepsiWarna[0]['a2'];
|
|
}
|
|
}
|
|
$getFrekuensiNadi = json_decode($this->post($urlFrekuensiNadi, ''), true);
|
|
$frekuensiNadi = "";
|
|
if (count($getFrekuensiNadi) > 0) {
|
|
if (isset($getFrekuensiNadi[0]['a2'])) {
|
|
$frekuensiNadi = $getFrekuensiNadi[0]['a2'];
|
|
}
|
|
}
|
|
$getSuhu = json_decode($this->post($urlSuhu, ''), true);
|
|
$suhu = "";
|
|
if (count($getSuhu) > 0) {
|
|
if (isset($getSuhu[0]['a2'])) {
|
|
$suhu = $getSuhu[0]['a2'];
|
|
}
|
|
}
|
|
$getTekananDarahSistolik = json_decode($this->post($urlTekananDarah, ''), true);
|
|
$TekananDarahSistolik = "";
|
|
if (count($getTekananDarahSistolik) > 0) {
|
|
if (isset($getTekananDarahSistolik[0]['a2'])) {
|
|
$TekananDarahSistolik = $getTekananDarahSistolik[0]['a2'];
|
|
}
|
|
}
|
|
$getVisusLeft = json_decode($this->post($urlVisusLeft, ''), true);
|
|
$visusLeft = "";
|
|
if (count($getVisusLeft) > 0) {
|
|
if (isset($getVisusLeft[0]['a2'])) {
|
|
$visusLeft = $getVisusLeft[0]['a2'];
|
|
}
|
|
}
|
|
$getVisusLeft = json_decode($this->post($urlVisusLeft, ''), true);
|
|
$visusLeft = "";
|
|
if (count($getVisusLeft) > 0) {
|
|
if (isset($getVisusLeft[0]['a2'])) {
|
|
$visusLeft = $getVisusLeft[0]['a2'];
|
|
}
|
|
}
|
|
$getReflekFisiologis = json_decode($this->post($urlReflekFisiologis, ''), true);
|
|
$reflekFisiologis = "";
|
|
if (count($getReflekFisiologis) > 0) {
|
|
if (isset($getReflekFisiologis[0]['a2'])) {
|
|
$reflekFisiologis = $getReflekFisiologis[0]['a2'];
|
|
}
|
|
}
|
|
$getReflekPatologis = json_decode($this->post($urlReflekPatologis, ''), true);
|
|
$reflekPatologis = "";
|
|
if (count($getReflekPatologis) > 0) {
|
|
if (isset($getReflekPatologis[0]['a2'])) {
|
|
$reflekPatologis = $getReflekPatologis[0]['a2'];
|
|
}
|
|
}
|
|
$getVisusRight = json_decode($this->post($urlVisusRight, ''), true);
|
|
$visusRight = "";
|
|
if (count($getVisusRight) > 0) {
|
|
if (isset($getVisusRight[0]['a2'])) {
|
|
$visusRight = $getVisusRight[0]['a2'];
|
|
}
|
|
}
|
|
$getTekananDarahDiastolik = json_decode($this->post($urlTekananDarahDiastolik, ''), true);
|
|
$tekananDarahDiastolik = "";
|
|
if (count($getTekananDarahDiastolik) > 0) {
|
|
if (isset($getTekananDarahDiastolik[0]['a2'])) {
|
|
$tekananDarahDiastolik = $getTekananDarahDiastolik[0]['a2'];
|
|
}
|
|
}
|
|
$getTB = json_decode($this->post($urlTB, ''), true);
|
|
$tb = "";
|
|
if (count($getTB) > 0) {
|
|
if (isset($getTB[0]['a2'])) {
|
|
$tb = $getTB[0]['a2'];
|
|
}
|
|
}
|
|
$getBMI = json_decode($this->post($urlBMI, ''), true);
|
|
$bmi = "";
|
|
if (count($getBMI) > 0) {
|
|
if (isset($getBMI[0]['a2'])) {
|
|
$bmi = $getBMI[0]['a2'];
|
|
}
|
|
}
|
|
$getBodyFat = json_decode($this->post($urlBodyfat, ''), true);
|
|
$bodyFat = "";
|
|
if (count($getBodyFat) > 0) {
|
|
if (isset($getBodyFat[0]['a2'])) {
|
|
$bodyFat = $getBodyFat[0]['a2'];
|
|
}
|
|
}
|
|
$getBodyFat = json_decode($this->post($urlBodyfat, ''), true);
|
|
$bodyFat = "";
|
|
if (count($getBodyFat) > 0) {
|
|
if (isset($getBodyFat[0]['a2'])) {
|
|
$bodyFat = $getBodyFat[0]['a2'];
|
|
}
|
|
}
|
|
$getBB = json_decode($this->post($urlBB, ''), true);
|
|
$bb = "";
|
|
if (count($getBB) > 0) {
|
|
if (isset($getBB[0]['a2'])) {
|
|
$bb = $getBB[0]['a2'];
|
|
}
|
|
}
|
|
$getAlkohol = json_decode($this->post($urlAlkohol, ''), true);
|
|
$alkohol = "";
|
|
if (count($getAlkohol) > 0) {
|
|
if (isset($getAlkohol[0]['a2'])) {
|
|
$alkohol = $getAlkohol[0]['a2'];
|
|
}
|
|
}
|
|
$getOlahraga = json_decode($this->post($urlOlahraga, ''), true);
|
|
$olahraga = "";
|
|
if (count($getOlahraga) > 0) {
|
|
if (isset($getOlahraga[0]['a2'])) {
|
|
$olahraga = $getOlahraga[0]['a2'];
|
|
}
|
|
}
|
|
$getLeher = json_decode($this->post($urlLeher, ''), true);
|
|
$leher = "";
|
|
if (count($getLeher) > 0) {
|
|
if (isset($getLeher[0]['a2'])) {
|
|
$leher = $getLeher[0]['a2'];
|
|
}
|
|
}
|
|
$getRiwayatPhobia = json_decode($this->post($urlRiwayatPhobia, ''), true);
|
|
$riwayatPhobia = "";
|
|
if (count($getRiwayatPhobia) > 0) {
|
|
if (isset($getRiwayatPhobia[0]['a2'])) {
|
|
$riwayatPhobia = $getRiwayatPhobia[0]['a2'];
|
|
}
|
|
}
|
|
$getRiwayatObat = json_decode($this->post($urlRiwayatObat, ''), true);
|
|
$riwayatObat = "";
|
|
if (count($getRiwayatObat) > 0) {
|
|
if (isset($getRiwayatObat[0]['a2'])) {
|
|
$riwayatObat = $getRiwayatObat[0]['a2'];
|
|
}
|
|
}
|
|
$getRiwayatImunisasi = json_decode($this->post($urlRiwayatImunisasi, ''), true);
|
|
$riwayatImunisasi = "";
|
|
if (count($getRiwayatImunisasi) > 0) {
|
|
if (isset($getRiwayatImunisasi[0]['a2'])) {
|
|
$riwayatImunisasi = $getRiwayatImunisasi[0]['a2'];
|
|
}
|
|
}
|
|
$getKeadaanUmum = json_decode($this->post($urlKeadaanUmum, ''), true);
|
|
$keadaanUmum = "";
|
|
if (count($getKeadaanUmum) > 0) {
|
|
for ($i = 0; $i < count($getKeadaanUmum); $i++) {
|
|
$keadaanUmum .= $getKeadaanUmum[$i]['rr1'] . " :" . $getKeadaanUmum[$i]['rr2'] . " " . $getKeadaanUmum[$i]['rr3'] . "\n";
|
|
}
|
|
}
|
|
$getGenitourinaria = json_decode($this->post($urlGenitourinaria, ''), true);
|
|
$genitourinaria = "";
|
|
if (count($getGenitourinaria) > 0) {
|
|
for ($i = 0; $i < count($getGenitourinaria); $i++) {
|
|
if ($getGenitourinaria[$i]['nn1'] != "") {
|
|
$genitourinaria .= $getGenitourinaria[$i]['nn1'];
|
|
}
|
|
if ($getGenitourinaria[$i]['nn2'] != "") {
|
|
$genitourinaria .= " : " . $getGenitourinaria[$i]['nn2'];
|
|
}
|
|
if ($getGenitourinaria[$i]['nn3'] != "") {
|
|
$genitourinaria .= $getGenitourinaria[$i]['nn3'] . "\n";
|
|
} else {
|
|
$genitourinaria .= "\n";
|
|
}
|
|
}
|
|
}
|
|
$getAnggota = json_decode($this->post($urlAnggota, ''), true);
|
|
$anggota = "";
|
|
if (count($getAnggota) > 0) {
|
|
for ($i = 0; $i < count($getAnggota); $i++) {
|
|
if ($getAnggota[$i]['oo1'] != "") {
|
|
$anggota .= $getAnggota[$i]['oo1'];
|
|
}
|
|
if ($getAnggota[$i]['oo2'] != "") {
|
|
$anggota .= " : " . $getAnggota[$i]['oo2'];
|
|
}
|
|
if ($getAnggota[$i]['oo3'] != "") {
|
|
$anggota .= $getAnggota[$i]['oo3'] . "\n";
|
|
} else {
|
|
$anggota .= "\n";
|
|
}
|
|
}
|
|
}
|
|
$getSistem = json_decode($this->post($urlSistem, ''), true);
|
|
$sistem = "";
|
|
if (count($getSistem) > 0) {
|
|
for ($i = 0; $i < count($getSistem); $i++) {
|
|
if ($getSistem[$i]['pp1'] != "") {
|
|
$sistem .= $getSistem[$i]['pp1'];
|
|
}
|
|
if ($getSistem[$i]['pp2'] != "") {
|
|
$sistem .= " : " . $getSistem[$i]['pp2'];
|
|
}
|
|
if ($getSistem[$i]['pp3'] != "") {
|
|
$sistem .= $getSistem[$i]['pp3'] . "\n";
|
|
} else {
|
|
$sistem .= "\n";
|
|
}
|
|
}
|
|
}
|
|
$getSmell = json_decode($this->post($urlSmell, ''), true);
|
|
$smell = "";
|
|
if (count($getSmell) > 0) {
|
|
for ($i = 0; $i < count($getSmell); $i++) {
|
|
if ($getSmell[$i]['xx1'] != "") {
|
|
$smell .= $getSmell[$i]['xx1'];
|
|
}
|
|
if ($getSmell[$i]['xx2'] != "") {
|
|
$smell .= " : " . $getSmell[$i]['xx2'];
|
|
}
|
|
if ($getSmell[$i]['xx3'] != "") {
|
|
$smell .= $getSmell[$i]['xx3'] . "\n";
|
|
} else {
|
|
$smell .= "\n";
|
|
}
|
|
}
|
|
}
|
|
$getIntegument = json_decode($this->post($urlIntegument, ''), true);
|
|
$integument = "";
|
|
if (count($getIntegument) > 0) {
|
|
for ($i = 0; $i < count($getIntegument); $i++) {
|
|
if ($getIntegument[$i]['pp1'] != "") {
|
|
$integument .= $getIntegument[$i]['pp1'];
|
|
}
|
|
if ($getIntegument[$i]['pp2'] != "") {
|
|
$integument .= " : " . $getIntegument[$i]['pp2'];
|
|
}
|
|
if ($getIntegument[$i]['pp3'] != "") {
|
|
$integument .= $getIntegument[$i]['pp3'] . "\n";
|
|
} else {
|
|
$integument .= "\n";
|
|
}
|
|
}
|
|
}
|
|
$getFaktorFisik = json_decode($this->post($urlFaktorFisik, ''), true);
|
|
$faktorFisik = "";
|
|
if (count($getFaktorFisik) > 0) {
|
|
for ($i = 0; $i < count($getFaktorFisik); $i++) {
|
|
if ($getFaktorFisik[$i]['aaa4']) {
|
|
$faktorFisik .= $getFaktorFisik[$i]['aaa1'] . ', ';
|
|
}
|
|
}
|
|
}
|
|
$getFaktorKimia = json_decode($this->post($urlFaktorKimia, ''), true);
|
|
$faktorKimia = "";
|
|
if (count($getFaktorKimia) > 0) {
|
|
for ($i = 0; $i < count($getFaktorKimia); $i++) {
|
|
if ($getFaktorKimia[$i]['bbb4']) {
|
|
$faktorKimia .= $getFaktorKimia[$i]['bbb1'] . ', ';
|
|
}
|
|
}
|
|
}
|
|
$getFaktorBiologi = json_decode($this->post($urlFaktorBiologi, ''), true);
|
|
$faktorBiologi = "";
|
|
if (count($getFaktorBiologi) > 0) {
|
|
for ($i = 0; $i < count($getFaktorBiologi); $i++) {
|
|
if ($getFaktorBiologi[$i]['ccc4']) {
|
|
$faktorBiologi .= $getFaktorBiologi[$i]['ccc1'] . ', ';
|
|
}
|
|
}
|
|
}
|
|
$getFaktorErgonomi = json_decode($this->post($urlFaktorErgonomi, ''), true);
|
|
$faktorErgonomi = "";
|
|
if (count($getFaktorErgonomi) > 0) {
|
|
for ($i = 0; $i < count($getFaktorErgonomi); $i++) {
|
|
if ($getFaktorErgonomi[$i]['ddd4']) {
|
|
$faktorErgonomi .= $getFaktorErgonomi[$i]['ddd1'] . ', ';
|
|
}
|
|
}
|
|
}
|
|
$getFaktorPsikologi = json_decode($this->post($urlFaktorPsikologi, ''), true);
|
|
$faktorPsikologi = "";
|
|
if (count($getFaktorPsikologi) > 0) {
|
|
for ($i = 0; $i < count($getFaktorPsikologi); $i++) {
|
|
if ($getFaktorPsikologi[$i]['eee4']) {
|
|
$faktorPsikologi .= $getFaktorPsikologi[$i]['eee1'] . ', ';
|
|
}
|
|
}
|
|
}
|
|
//get kesimpulan
|
|
$sql = " SELECT
|
|
Mcu_ResumeKesimpulan,
|
|
Mcu_ResumeRekomendasi,
|
|
Mcu_ResumeSaran
|
|
FROM so_resultentry
|
|
JOIN mcu_resume
|
|
ON So_ResultEntryT_OrderHeaderID = Mcu_ResumeT_OrderHeaderID
|
|
AND Mcu_ResumeIsActive = 'Y'
|
|
AND Mcu_ResumeValidation = 'Y'
|
|
WHERE So_ResultEntryID = ?
|
|
AND So_ResultEntryIsActive = 'Y'
|
|
GROUP BY So_ResultEntryT_OrderHeaderID";
|
|
$query = $this->db_smartone->query($sql, [$id]);
|
|
if (!$query) {
|
|
$message = $this->db_smartone->error();
|
|
$message['qry'] = $this->db_smartone->last_query();
|
|
$this->sys_error($message);
|
|
exit;
|
|
}
|
|
// print_r($this->db_smartone->last_query());
|
|
$kesimpulan = $query->result_array()[0]['Mcu_ResumeKesimpulan'];
|
|
$saran = $query->result_array()[0]['Mcu_ResumeSaran'];
|
|
if (count($idCek) == 0) {
|
|
//insert baru
|
|
if ($id == null) {
|
|
continue;
|
|
}
|
|
$data = [
|
|
"Ss_FisikSo_ResultEntryID" => $id,
|
|
"Ss_FisikKeluhanSaatIni" => $keluhanSaatIni,
|
|
"Ss_FisikRiwayatPenyakit" => $riwayatPenyakit,
|
|
"Ss_FisikRiwayatKeluargaAyah" => $riwayatKeluargaAyah,
|
|
"Ss_FisikRiwayatKeluargaIbu" => $riwayatKeluargaIbu,
|
|
"Ss_FisikMerokok" => $merokok,
|
|
"Ss_FisikAlergi" => $alergi,
|
|
"Ss_FisikDoctor" => $doctor,
|
|
"Ss_FisikKonjuktivaSklera" => $konjuktivaSklera,
|
|
"Ss_FisikLowBackPain" => $lowBackPain,
|
|
"Ss_FisikAnogenital" => $anoGenital,
|
|
"Ss_FisikFrekuensiNafas" => $frekuensiNafas,
|
|
"Ss_FisikTulangBelakang" => $tulangBelakang,
|
|
"Ss_FisikExtremitas" => $extremitas,
|
|
"Ss_FisikKulit" => $kulit,
|
|
"Ss_FisikHernia" => $hernia,
|
|
"Ss_FisikPerut" => $perut,
|
|
"Ss_FisikThorax" => $thorax,
|
|
"Ss_FisikMulutGigi" => $mulutGigi,
|
|
"Ss_FisikJantung" => $jantung,
|
|
"Ss_FisikParu" => $paru,
|
|
"Ss_FisikTenggorokan" => $tenggorokan,
|
|
"Ss_FisikHidung" => $hidung,
|
|
"Ss_FisikTelinga" => $telinga,
|
|
"Ss_FisikLapangPandang" => $lapangPandang,
|
|
"Ss_FisikPresepsiWarna" => $presepsiWarna,
|
|
"Ss_FisikFrekuensiNadi" => $frekuensiNadi,
|
|
"Ss_FisikSuhu" => $suhu,
|
|
"Ss_FisikTekananDarahSistolik" => $tekananDarahSistolik,
|
|
"Ss_FisikVisusLeft" => $visusLeft,
|
|
"Ss_FisikReflekFisiologis" => $reflekFisiologis,
|
|
"Ss_FisikReflekPatologis" => $reflekPatologis,
|
|
"Ss_FisikVisusRight" => $visusRight,
|
|
"Ss_FisikTekananDarahDiastolik" => $tekananDarahDiastolik,
|
|
"Ss_FisikTB" => $tb,
|
|
"Ss_FisikBMI" => $bmi,
|
|
"Ss_FisikBodyFat" => $bodyFat,
|
|
"Ss_FisikBB" => $bb,
|
|
"Ss_FisikAlkohol" => $alkohol,
|
|
"Ss_FisikOlahraga" => $olahraga,
|
|
"Ss_FisikLeher" => $leher,
|
|
"Ss_FisikRiwayatPhobia" => $riwayatPhobia,
|
|
"Ss_FisikRiwayatObat" => $riwayatObat,
|
|
"Ss_FisikKeadaanUmum" => $keadaanUmum,
|
|
"Ss_FisikRiwayatImunisasi" => $riwayatImunisasi,
|
|
"Ss_FisikGenitourinaria" => $genitourinaria,
|
|
"Ss_FisikAnggota" => $anggota,
|
|
"Ss_FisikSistem" => $sistem,
|
|
"Ss_FisikSmell" => $smell,
|
|
"Ss_FisikIntegument" => $integument,
|
|
"Ss_FisikFaktorFisik" => $faktorFisik,
|
|
"Ss_FisikFaktorKimia" => $faktorKimia,
|
|
"Ss_FisikFaktorBiologis" => $faktorBiologi,
|
|
"Ss_FisikFaktorErgonomi" => $faktorErgonomi,
|
|
"Ss_FisikFaktorPsikologi" => $faktorPsikologi,
|
|
"Ss_FisikKesimpulan" => $kesimpulan,
|
|
"Ss_FisikSaran" => $saran,
|
|
"Ss_FisikCreated" => date('Y-m-d H:i:s'),
|
|
"Ss_FisikCreatedUserID" => 0
|
|
];
|
|
$qry = $this->db_smartone->insert('ss_fisik', $data);
|
|
if (!$qry) {
|
|
$message = $this->db_smartone->error();
|
|
$message['qry'] = $this->db_smartone->last_query();
|
|
$this->sys_error($message);
|
|
exit;
|
|
}
|
|
} else {
|
|
if ($id == null) {
|
|
continue;
|
|
}
|
|
//Update baru
|
|
$data = [
|
|
"Ss_FisikKeluhanSaatIni" => $keluhanSaatIni,
|
|
"Ss_FisikRiwayatPenyakit" => $riwayatPenyakit,
|
|
"Ss_FisikRiwayatKeluargaAyah" => $riwayatKeluargaAyah,
|
|
"Ss_FisikRiwayatKeluargaIbu" => $riwayatKeluargaIbu,
|
|
"Ss_FisikMerokok" => $merokok,
|
|
"Ss_FisikAlergi" => $alergi,
|
|
"Ss_FisikDoctor" => $doctor,
|
|
"Ss_FisikKonjuktivaSklera" => $konjuktivaSklera,
|
|
"Ss_FisikLowBackPain" => $lowBackPain,
|
|
"Ss_FisikAnogenital" => $anoGenital,
|
|
"Ss_FisikFrekuensiNafas" => $frekuensiNafas,
|
|
"Ss_FisikTulangBelakang" => $tulangBelakang,
|
|
"Ss_FisikExtremitas" => $extremitas,
|
|
"Ss_FisikKulit" => $kulit,
|
|
"Ss_FisikHernia" => $hernia,
|
|
"Ss_FisikPerut" => $perut,
|
|
"Ss_FisikThorax" => $thorax,
|
|
"Ss_FisikMulutGigi" => $mulutGigi,
|
|
"Ss_FisikJantung" => $jantung,
|
|
"Ss_FisikParu" => $paru,
|
|
"Ss_FisikTenggorokan" => $tenggorokan,
|
|
"Ss_FisikHidung" => $hidung,
|
|
"Ss_FisikTelinga" => $telinga,
|
|
"Ss_FisikLapangPandang" => $lapangPandang,
|
|
"Ss_FisikPresepsiWarna" => $presepsiWarna,
|
|
"Ss_FisikFrekuensiNadi" => $frekuensiNadi,
|
|
"Ss_FisikSuhu" => $suhu,
|
|
"Ss_FisikTekananDarahSistolik" => $tekananDarahSistolik,
|
|
"Ss_FisikVisusLeft" => $visusLeft,
|
|
"Ss_FisikReflekFisiologis" => $reflekFisiologis,
|
|
"Ss_FisikReflekPatologis" => $reflekPatologis,
|
|
"Ss_FisikVisusRight" => $visusRight,
|
|
"Ss_FisikTekananDarahDiastolik" => $tekananDarahDiastolik,
|
|
"Ss_FisikTB" => $tb,
|
|
"Ss_FisikBMI" => $bmi,
|
|
"Ss_FisikBodyFat" => $bodyFat,
|
|
"Ss_FisikBB" => $bb,
|
|
"Ss_FisikAlkohol" => $alkohol,
|
|
"Ss_FisikOlahraga" => $olahraga,
|
|
"Ss_FisikLeher" => $leher,
|
|
"Ss_FisikRiwayatPhobia" => $riwayatPhobia,
|
|
"Ss_FisikRiwayatObat" => $riwayatObat,
|
|
"Ss_FisikKeadaanUmum" => $keadaanUmum,
|
|
"Ss_FisikRiwayatImunisasi" => $riwayatImunisasi,
|
|
"Ss_FisikGenitourinaria" => $genitourinaria,
|
|
"Ss_FisikAnggota" => $anggota,
|
|
"Ss_FisikSistem" => $sistem,
|
|
"Ss_FisikSmell" => $smell,
|
|
"Ss_FisikIntegument" => $integument,
|
|
"Ss_FisikFaktorFisik" => $faktorFisik,
|
|
"Ss_FisikFaktorKimia" => $faktorKimia,
|
|
"Ss_FisikFaktorBiologis" => $faktorBiologi,
|
|
"Ss_FisikFaktorErgonomi" => $faktorErgonomi,
|
|
"Ss_FisikFaktorPsikologi" => $faktorPsikologi,
|
|
"Ss_FisikKesimpulan" => $kesimpulan,
|
|
"Ss_FisikSaran" => $saran,
|
|
"Ss_FisikUpdatedUserID" => 0,
|
|
"Ss_FisikLastUpdated" => date('Y-m-d H:i:s'),
|
|
];
|
|
// "Ss_FisikSo_ResultEntryID" => $id,
|
|
$this->db_smartone->where('Ss_FisikID', $idCek);
|
|
$qry = $this->db_smartone->update('ss_fisik', $data);
|
|
if (!$qry) {
|
|
$message = $this->db_smartone->error();
|
|
$this->sys_error($message);
|
|
exit;
|
|
}
|
|
}
|
|
}
|
|
$this->sys_ok($data);
|
|
}
|
|
function generateperiodev2($startDate = "", $endDate = "")
|
|
{
|
|
$prm = $this->sys_input;
|
|
// $startDate = $prm['sd'];
|
|
// if (!isset($startDate) || $prm['sd'] == '') {
|
|
// $startDate = date('Y-m-d');
|
|
// }
|
|
// $endDate = $prm['ed'];
|
|
// if (!isset($endDate) || $prm['ed'] == '') {
|
|
// $endDate = date('Y-m-d');
|
|
// }
|
|
|
|
if ($startDate == "") {
|
|
$startDate = date('Y-m-d');
|
|
}
|
|
|
|
if ($startDate == "") {
|
|
$endDate = date('Y-m-d');
|
|
}
|
|
// if (!$startDate) {
|
|
// $this->sys_error("Prm startdate is required");
|
|
// exit;
|
|
// }
|
|
// if (!$endDate) {
|
|
// $this->sys_error("Prm enddate is required");
|
|
// exit;
|
|
// }
|
|
// print_r($startDate);
|
|
// print_r("-");
|
|
// print_r($endDate);
|
|
// exit;
|
|
$sql = "SELECT
|
|
So_ResultEntryID,
|
|
Mcu_ResumeID,
|
|
T_OrderHeaderDate,
|
|
Mcu_ResumeValidationDateTime
|
|
FROM so_resultentry
|
|
JOIN mcu_resume
|
|
ON So_ResultEntryT_OrderHeaderID = Mcu_ResumeT_OrderHeaderID
|
|
JOIN t_orderheader
|
|
ON So_ResultEntryT_OrderHeaderID = T_OrderHeaderID
|
|
AND DATE(Mcu_ResumeValidationDateTime) BETWEEN '{$startDate}' AND '{$endDate}'
|
|
AND T_OrderHeaderIsActive = 'Y'
|
|
AND Mcu_ResumeIsActive = 'Y'
|
|
AND Mcu_ResumeValidation = 'Y'
|
|
WHERE So_ResultEntryNonlab_TemplateID = '27'
|
|
AND So_ResultEntryIsActive = 'Y'
|
|
";
|
|
// AND DATE(T_OrderHeaderDate) BETWEEN '{$startDate}' AND '{$endDate}'
|
|
// print_r($sql);
|
|
$query = $this->db_smartone->query($sql);
|
|
if (!$query) {
|
|
$message = $this->db_smartone->error();
|
|
$message['qry'] = $this->db_smartone->last_query();
|
|
$this->sys_error($message);
|
|
exit;
|
|
}
|
|
$dataPeriode = $query->result_array();
|
|
// print_r($data);
|
|
// exit;
|
|
for ($k = 0; $k < count($dataPeriode); $k++) {
|
|
$id = $dataPeriode[$k]["So_ResultEntryID"];
|
|
$sql = "SELECT Ss_FisikID FROM ss_fisik
|
|
WHERE Ss_FisikSo_ResultEntryID = ?
|
|
AND Ss_FisikIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, $id);
|
|
if (!$qry) {
|
|
$message = $this->db_smartone->error();
|
|
$this->sys_error($message);
|
|
exit;
|
|
}
|
|
$idCek = $qry->result_array()[0]['Ss_FisikID'];
|
|
$getKeluhanSaatIni = $this->keluhan_saat_ini($id);
|
|
$keluhanSaatIni = $getKeluhanSaatIni;
|
|
|
|
$getRiwayatPenyakit = $this->riwayat_penyakit($id);
|
|
$riwayatPenyakit = $getRiwayatPenyakit;
|
|
|
|
$getRiwayatKeluargaAyah = $this->riwayat_keluarga($id, 'ayah');
|
|
$riwayatKeluargaAyah = $getRiwayatKeluargaAyah;
|
|
|
|
$getRiwayatKeluargaIbu = $this->riwayat_keluarga($id, 'ibu');
|
|
$riwayatKeluargaIbu = $getRiwayatKeluargaIbu;
|
|
|
|
$getMerokok = $this->merokok($id);
|
|
$merokok = $getMerokok;
|
|
|
|
$getAlergi = $this->alergi($id);
|
|
$alergi = $getAlergi;
|
|
|
|
$getDoctor = $this->doctor($id);
|
|
$doctor = $getDoctor;
|
|
|
|
$getKonjuktivaSklera = $this->konjuktiva_sklera($id);
|
|
$konjuktivaSklera = $getKonjuktivaSklera;
|
|
|
|
$getLowBackPain = $this->low($id);
|
|
$lowBackPain = $getLowBackPain;
|
|
|
|
$getAnoGenital = $this->anogenital($id);
|
|
$anoGenital = $getAnoGenital;
|
|
|
|
$getFrekuensiNafas = $this->frekuensi_nafas($id);
|
|
$frekuensiNafas = $getFrekuensiNafas;
|
|
|
|
$getTulangBelakang = $this->tulang_belakang($id);
|
|
$tulangBelakang = $getTulangBelakang;
|
|
|
|
$getExtremitas = $this->extremitas($id);
|
|
$extremitas = $getExtremitas;
|
|
|
|
$getKulit = $this->kulit($id);
|
|
$kulit = $getKulit;
|
|
|
|
$getHernia = $this->hernia($id);
|
|
$hernia = $getHernia;
|
|
|
|
$getPerut = $this->perut($id);
|
|
$perut = $getPerut;
|
|
|
|
$getThorax = $this->thorax($id);
|
|
$thorax = $getThorax;
|
|
|
|
$getMulutGigi = $this->mulut_gigi($id);
|
|
$mulutGigi = $getMulutGigi;
|
|
|
|
$getJantung = $this->jantung($id);
|
|
$jantung = $getJantung;
|
|
|
|
$getParu = $this->paru($id);
|
|
$paru = $getParu;
|
|
|
|
$getTenggorokan = $this->tenggorokan($id);
|
|
$tenggorokan = $getTenggorokan;
|
|
|
|
$getHidung = $this->hidung($id);
|
|
$hidung = $getHidung;
|
|
|
|
$getTelinga = $this->telinga($id);
|
|
$telinga = $getTelinga;
|
|
|
|
$getLapangPandang = $this->lapang_pandang($id);
|
|
$lapangPandang = $getLapangPandang;
|
|
|
|
$getPresepsiWarna = $this->persepsi_warna($id);
|
|
$presepsiWarna = $getPresepsiWarna;
|
|
|
|
$getFrekuensiNadi = $this->frekuensi_nadi($id);
|
|
$frekuensiNadi = $getFrekuensiNadi;
|
|
|
|
$getSuhu = $this->suhu($id);
|
|
$suhu = $getSuhu;
|
|
|
|
$getTekananDarahSistolik = $this->tekanan_darah($id, 'sistolik');
|
|
$TekananDarahSistolik = $getTekananDarahSistolik;
|
|
|
|
$getVisusLeft = $this->visus($id, 'left');
|
|
$visusLeft = $getVisusLeft;
|
|
|
|
|
|
$getReflekFisiologis = $this->reflek($id, 'fisiologis');
|
|
$reflekFisiologis = $getReflekFisiologis;
|
|
|
|
$getReflekPatologis = $this->reflek($id, 'patologis');
|
|
$reflekPatologis = $getReflekPatologis;
|
|
|
|
$getVisusRight = $this->visus($id, 'right');
|
|
$visusRight = $getVisusRight;
|
|
|
|
$getTekananDarahDiastolik = $this->tekanan_darah($id, 'diastolik');
|
|
$tekananDarahDiastolik = $getTekananDarahDiastolik;
|
|
|
|
$getTB = $this->tbbbbodyfat($id, 'TB');
|
|
$tb = $getTB;
|
|
|
|
$getBMI = $this->tbbbbodyfat($id, 'BMI');
|
|
$bmi = $getBMI;
|
|
|
|
$getBodyFat = $this->tbbbbodyfat($id, 'BODY');
|
|
$bodyFat = $getBodyFat;
|
|
|
|
$getBB = $this->tbbbbodyfat($id, 'BB');
|
|
$bb = $getBB;
|
|
|
|
$getAlkohol = $this->alkohol($id);
|
|
$alkohol = $getAlkohol;
|
|
|
|
$getOlahraga = $this->olahraga($id);
|
|
$olahraga = $getOlahraga;
|
|
|
|
$getLeher = $this->leher($id);
|
|
$leher = $getLeher;
|
|
|
|
$getRiwayatPhobia = $this->riwayat_phobia($id);
|
|
$riwayatPhobia = $getRiwayatPhobia;
|
|
|
|
$getRiwayatObat = $this->riwayat_obat($id);
|
|
$riwayatObat = $getRiwayatObat;
|
|
|
|
$getRiwayatImunisasi = $this->riwayat_imunisasi($id);
|
|
$riwayatImunisasi = $getRiwayatImunisasi;
|
|
|
|
$getKeadaanUmum = $this->keadaan_umum($id);
|
|
$keadaanUmum = $getKeadaanUmum;
|
|
|
|
$getGenitourinaria = $this->genitourinaria($id);
|
|
$genitourinaria = $getGenitourinaria;
|
|
|
|
$getAnggota = $this->anggota($id);
|
|
$anggota = $getAnggota;
|
|
|
|
$getSistem = $this->sistem($id);
|
|
$sistem = $getSistem;
|
|
|
|
$getSmell = $this->smell($id);
|
|
$smell = $getSmell;
|
|
|
|
$getIntegument = $this->integumen($id);
|
|
$integument = $getIntegument;
|
|
|
|
$getFaktorFisik = $this->faktor_fisik($id);
|
|
$faktorFisik = $getFaktorFisik;
|
|
|
|
$getFaktorKimia = $this->faktor_kimia($id);
|
|
$faktorKimia = $getFaktorKimia;
|
|
|
|
$getFaktorBiologi = $this->faktor_biologi($id);
|
|
$faktorBiologi = $getFaktorKimia;
|
|
|
|
$getFaktorErgonomi = $this->faktor_ergonomi($id);
|
|
$faktorErgonomi = $getFaktorErgonomi;
|
|
|
|
$getFaktorPsikologi = $this->faktor_psikologi($id);
|
|
$faktorPsikologi = $getFaktorBiologi;
|
|
|
|
//get kesimpulan
|
|
$sql = " SELECT
|
|
Mcu_ResumeKesimpulan,
|
|
Mcu_ResumeRekomendasi,
|
|
Mcu_ResumeSaran
|
|
FROM so_resultentry
|
|
JOIN mcu_resume
|
|
ON So_ResultEntryT_OrderHeaderID = Mcu_ResumeT_OrderHeaderID
|
|
AND Mcu_ResumeIsActive = 'Y'
|
|
AND Mcu_ResumeValidation = 'Y'
|
|
WHERE So_ResultEntryID = ?
|
|
AND So_ResultEntryIsActive = 'Y'
|
|
GROUP BY So_ResultEntryT_OrderHeaderID";
|
|
$query = $this->db_smartone->query($sql, [$id]);
|
|
if (!$query) {
|
|
$message = $this->db_smartone->error();
|
|
$message['qry'] = $this->db_smartone->last_query();
|
|
$this->sys_error($message);
|
|
exit;
|
|
}
|
|
$kesimpulan = $query->result_array()[0]['Mcu_ResumeKesimpulan'];
|
|
$saran = $query->result_array()[0]['Mcu_ResumeSaran'];
|
|
if ($kesimpulan == null) {
|
|
$kesimpulan = '';
|
|
}
|
|
if ($saran == null) {
|
|
$saran = '';
|
|
}
|
|
|
|
if (count($idCek) == 0) {
|
|
//insert baru
|
|
$data = [
|
|
"Ss_FisikSo_ResultEntryID" => $id,
|
|
"Ss_FisikKeluhanSaatIni" => $keluhanSaatIni,
|
|
"Ss_FisikRiwayatPenyakit" => $riwayatPenyakit,
|
|
"Ss_FisikRiwayatKeluargaAyah" => $riwayatKeluargaAyah,
|
|
"Ss_FisikRiwayatKeluargaIbu" => $riwayatKeluargaIbu,
|
|
"Ss_FisikMerokok" => $merokok,
|
|
"Ss_FisikAlergi" => $alergi,
|
|
"Ss_FisikDoctor" => $doctor,
|
|
"Ss_FisikKonjuktivaSklera" => $konjuktivaSklera,
|
|
"Ss_FisikLowBackPain" => $lowBackPain,
|
|
"Ss_FisikAnogenital" => $anoGenital,
|
|
"Ss_FisikFrekuensiNafas" => $frekuensiNafas,
|
|
"Ss_FisikTulangBelakang" => $tulangBelakang,
|
|
"Ss_FisikExtremitas" => $extremitas,
|
|
"Ss_FisikKulit" => $kulit,
|
|
"Ss_FisikHernia" => $hernia,
|
|
"Ss_FisikPerut" => $perut,
|
|
"Ss_FisikThorax" => $thorax,
|
|
"Ss_FisikMulutGigi" => $mulutGigi,
|
|
"Ss_FisikJantung" => $jantung,
|
|
"Ss_FisikParu" => $paru,
|
|
"Ss_FisikTenggorokan" => $tenggorokan,
|
|
"Ss_FisikHidung" => $hidung,
|
|
"Ss_FisikTelinga" => $telinga,
|
|
"Ss_FisikLapangPandang" => $lapangPandang,
|
|
"Ss_FisikPresepsiWarna" => $presepsiWarna,
|
|
"Ss_FisikFrekuensiNadi" => $frekuensiNadi,
|
|
"Ss_FisikSuhu" => $suhu,
|
|
"Ss_FisikTekananDarahSistolik" => $TekananDarahSistolik,
|
|
"Ss_FisikVisusLeft" => $visusLeft,
|
|
"Ss_FisikReflekFisiologis" => $reflekFisiologis,
|
|
"Ss_FisikReflekPatologis" => $reflekPatologis,
|
|
"Ss_FisikVisusRight" => $visusRight,
|
|
"Ss_FisikTekananDarahDiastolik" => $tekananDarahDiastolik,
|
|
"Ss_FisikTB" => $tb,
|
|
"Ss_FisikBMI" => $bmi,
|
|
"Ss_FisikBodyFat" => $bodyFat,
|
|
"Ss_FisikBB" => $bb,
|
|
"Ss_FisikAlkohol" => $alkohol,
|
|
"Ss_FisikOlahraga" => $olahraga,
|
|
"Ss_FisikLeher" => $leher,
|
|
"Ss_FisikRiwayatPhobia" => $riwayatPhobia,
|
|
"Ss_FisikRiwayatObat" => $riwayatObat,
|
|
"Ss_FisikKeadaanUmum" => $keadaanUmum,
|
|
"Ss_FisikRiwayatImunisasi" => $riwayatImunisasi,
|
|
"Ss_FisikGenitourinaria" => $genitourinaria,
|
|
"Ss_FisikAnggota" => $anggota,
|
|
"Ss_FisikSistem" => $sistem,
|
|
"Ss_FisikSmell" => $smell,
|
|
"Ss_FisikIntegument" => $integument,
|
|
"Ss_FisikFaktorFisik" => $faktorFisik,
|
|
"Ss_FisikFaktorKimia" => $faktorKimia,
|
|
"Ss_FisikFaktorBiologis" => $faktorBiologi,
|
|
"Ss_FisikFaktorErgonomi" => $faktorErgonomi,
|
|
"Ss_FisikFaktorPsikologi" => $faktorPsikologi,
|
|
"Ss_FisikKesimpulan" => $kesimpulan,
|
|
"Ss_FisikSaran" => $saran,
|
|
"Ss_FisikCreated" => date('Y-m-d H:i:s'),
|
|
"Ss_FisikCreatedUserID" => 0
|
|
];
|
|
$qry = $this->db_smartone->insert('ss_fisik', $data);
|
|
if (!$qry) {
|
|
$message = $this->db_smartone->error();
|
|
$message['qry'] = $this->db_smartone->last_query();
|
|
$this->sys_error($message);
|
|
exit;
|
|
}
|
|
} else {
|
|
//Update baru
|
|
$data = [
|
|
"Ss_FisikKeluhanSaatIni" => $keluhanSaatIni,
|
|
"Ss_FisikRiwayatPenyakit" => $riwayatPenyakit,
|
|
"Ss_FisikRiwayatKeluargaAyah" => $riwayatKeluargaAyah,
|
|
"Ss_FisikRiwayatKeluargaIbu" => $riwayatKeluargaIbu,
|
|
"Ss_FisikMerokok" => $merokok,
|
|
"Ss_FisikAlergi" => $alergi,
|
|
"Ss_FisikDoctor" => $doctor,
|
|
"Ss_FisikKonjuktivaSklera" => $konjuktivaSklera,
|
|
"Ss_FisikLowBackPain" => $lowBackPain,
|
|
"Ss_FisikAnogenital" => $anoGenital,
|
|
"Ss_FisikFrekuensiNafas" => $frekuensiNafas,
|
|
"Ss_FisikTulangBelakang" => $tulangBelakang,
|
|
"Ss_FisikExtremitas" => $extremitas,
|
|
"Ss_FisikKulit" => $kulit,
|
|
"Ss_FisikHernia" => $hernia,
|
|
"Ss_FisikPerut" => $perut,
|
|
"Ss_FisikThorax" => $thorax,
|
|
"Ss_FisikMulutGigi" => $mulutGigi,
|
|
"Ss_FisikJantung" => $jantung,
|
|
"Ss_FisikParu" => $paru,
|
|
"Ss_FisikTenggorokan" => $tenggorokan,
|
|
"Ss_FisikHidung" => $hidung,
|
|
"Ss_FisikTelinga" => $telinga,
|
|
"Ss_FisikLapangPandang" => $lapangPandang,
|
|
"Ss_FisikPresepsiWarna" => $presepsiWarna,
|
|
"Ss_FisikFrekuensiNadi" => $frekuensiNadi,
|
|
"Ss_FisikSuhu" => $suhu,
|
|
"Ss_FisikTekananDarahSistolik" => $TekananDarahSistolik,
|
|
"Ss_FisikVisusLeft" => $visusLeft,
|
|
"Ss_FisikReflekFisiologis" => $reflekFisiologis,
|
|
"Ss_FisikReflekPatologis" => $reflekPatologis,
|
|
"Ss_FisikVisusRight" => $visusRight,
|
|
"Ss_FisikTekananDarahDiastolik" => $tekananDarahDiastolik,
|
|
"Ss_FisikTB" => $tb,
|
|
"Ss_FisikBMI" => $bmi,
|
|
"Ss_FisikBodyFat" => $bodyFat,
|
|
"Ss_FisikBB" => $bb,
|
|
"Ss_FisikAlkohol" => $alkohol,
|
|
"Ss_FisikOlahraga" => $olahraga,
|
|
"Ss_FisikLeher" => $leher,
|
|
"Ss_FisikRiwayatPhobia" => $riwayatPhobia,
|
|
"Ss_FisikRiwayatObat" => $riwayatObat,
|
|
"Ss_FisikKeadaanUmum" => $keadaanUmum,
|
|
"Ss_FisikRiwayatImunisasi" => $riwayatImunisasi,
|
|
"Ss_FisikGenitourinaria" => $genitourinaria,
|
|
"Ss_FisikAnggota" => $anggota,
|
|
"Ss_FisikSistem" => $sistem,
|
|
"Ss_FisikSmell" => $smell,
|
|
"Ss_FisikIntegument" => $integument,
|
|
"Ss_FisikFaktorFisik" => $faktorFisik,
|
|
"Ss_FisikFaktorKimia" => $faktorKimia,
|
|
"Ss_FisikFaktorBiologis" => $faktorBiologi,
|
|
"Ss_FisikFaktorErgonomi" => $faktorErgonomi,
|
|
"Ss_FisikFaktorPsikologi" => $faktorPsikologi,
|
|
"Ss_FisikKesimpulan" => $kesimpulan,
|
|
"Ss_FisikSaran" => $saran,
|
|
"Ss_FisikUpdatedUserID" => 0,
|
|
"Ss_FisikLastUpdated" => date('Y-m-d H:i:s'),
|
|
];
|
|
// "Ss_FisikSo_ResultEntryID" => $id,
|
|
$this->db_smartone->where('Ss_FisikID', $idCek);
|
|
$qry = $this->db_smartone->update('ss_fisik', $data);
|
|
if (!$qry) {
|
|
$message = $this->db_smartone->error();
|
|
$message['qry'] = $this->db_smartone->last_query();
|
|
$this->sys_error($message);
|
|
exit;
|
|
}
|
|
}
|
|
}
|
|
|
|
$this->sys_ok($dataPeriode);
|
|
}
|
|
}
|