4254 lines
162 KiB
PHP
4254 lines
162 KiB
PHP
<?php
|
|
defined("BASEPATH") or exit("No direct script access allowed");
|
|
/**testing up genfisik 2*/
|
|
class Genresultfisik
|
|
{
|
|
/** @var object CodeIgniter DB instance (public agar bisa di-inject dari controller) */
|
|
public $db_smartone;
|
|
/** @var object CodeIgniter DB instance internal */
|
|
public $db_onedev;
|
|
|
|
function __construct()
|
|
{
|
|
$CI = &get_instance();
|
|
$this->db_smartone = $CI->load->database("default", true);
|
|
$this->db_onedev = $CI->load->database("default", true);
|
|
}
|
|
|
|
function clean_mysqli_connection($dbc)
|
|
{
|
|
while (mysqli_more_results($dbc)) {
|
|
if (mysqli_next_result($dbc)) {
|
|
$result = mysqli_use_result($dbc);
|
|
|
|
if (get_class($result) == 'mysqli_stmt') {
|
|
mysqli_stmt_free_result($result);
|
|
} else {
|
|
unset($result);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function pribadi($id)
|
|
{
|
|
//$id = So_ResultEntryID
|
|
$sql = "select
|
|
DATE_FORMAT(T_OrderHeaderDate, '%d-%m-%Y') as T_OrderHeaderDate ,
|
|
T_OrderHeaderLabNumber ,
|
|
concat(M_TitleName ,'. ' , M_PatientName) as M_PatientName,
|
|
M_SexName as Gender,
|
|
M_PatientNoReg,
|
|
M_PatientDOB,
|
|
T_OrderHeaderM_PatientAge,
|
|
M_CompanyName as CorporateName,
|
|
(SELECT concat(M_PatientAddressDescription, ' ' , M_DistrictName, ' ' ,M_CityName) from m_patientaddress AS p
|
|
left join m_kelurahan on p.M_PatientAddressM_KelurahanID = M_KelurahanID
|
|
left join m_district on M_KelurahanM_DistrictID = M_DistrictID
|
|
left join m_city on M_DistrictM_CityID = M_CityID
|
|
|
|
WHERE M_PatientAddressM_PatientID = M_PatientID
|
|
ORDER BY M_PatientAddressM_PatientID
|
|
LIMIT 1) as M_PatientAddress,
|
|
M_PatientHp ,
|
|
M_PatientEmail,
|
|
'' as M_PatientAddressCity,
|
|
'' as M_PatientAddressState,
|
|
M_CompanyAddress as CorporateAddress,
|
|
M_CompanyEmail as CorporateEmail ,
|
|
M_CompanyPhone CorporatePhone,
|
|
'' as CorporateAddressCity,
|
|
'' as CorporateAddressState,
|
|
CONCAT(ifnull(M_DoctorPrefix,''),' ',ifnull(M_DoctorPrefix2,''),' ',M_DoctorName,' ',ifnull(M_DoctorSufix,''),' ',ifnull(M_DoctorSufix2,'') ) AS M_DoctorName ,
|
|
CONCAT(DATE_FORMAT(M_PatientDOB, '%d-%m-%Y') ,' / ',T_OrderHeaderM_PatientAge) AS Umur,
|
|
NOW() as tanggalsekarang,
|
|
concat(M_PatientDepartement ,' - ' ,M_PatientNIP ) as M_PatientDepartement
|
|
|
|
from so_resultentry
|
|
join t_orderheader on So_ResultEntryT_OrderHeaderID = T_OrderHeaderID
|
|
left join m_patient ON T_OrderHeaderM_PatientID = M_PatientID AND M_PatientIsActive = 'Y'
|
|
left join m_title ON M_PatientM_TitleID = M_TitleID AND M_TitleIsActive = 'Y'
|
|
left join m_company ON T_OrderHeaderM_CompanyID = M_CompanyID and M_CompanyIsActive = 'Y'
|
|
left join m_doctorpj ON T_OrderHeaderPjM_DoctorID = M_DoctorPjID and M_DoctorPjIsDefaultPJ = 'Y'
|
|
left join m_doctor ON So_ResultEntryM_DoctorID = M_DoctorID AND M_DoctorIsActive = 'Y'
|
|
left join m_sex ON M_PatientM_SexID = M_SexID
|
|
where
|
|
So_ResultEntryID = ?
|
|
and T_OrderHeaderIsActive = 'Y' group by T_OrderHeaderID";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if ($qry) {
|
|
$rows = $qry->result_array();
|
|
|
|
//Baru
|
|
// $langid = 1;
|
|
|
|
// foreach($rows as $idx => $r ) {
|
|
// $rows[$idx]["kesimpulan"] = $this->kesimpulanv4($id,$langid);
|
|
|
|
// }
|
|
|
|
echo json_encode($rows);
|
|
}
|
|
else {
|
|
echo json_encode(array());
|
|
}
|
|
}
|
|
|
|
function translate_word($word, $langid = 1)
|
|
{
|
|
if ($langid == 1) {
|
|
return $word;
|
|
}
|
|
else {
|
|
$sql = "SELECT * FROM translate_word WHERE Translate_WordIsActive = 'Y' AND Translate_WordFrom = '{$word}'";
|
|
//echo $sql;
|
|
$qry = $this->db_smartone->query($sql);
|
|
if (!$qry) {
|
|
return $word;
|
|
}
|
|
|
|
$rows = $qry->result_array();
|
|
if (count($rows) > 0) {
|
|
return $rows[0]["Translate_WordTo"];
|
|
}
|
|
else {
|
|
return $word;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
function keluhan_saat_ini($id, $langid = 1)
|
|
{
|
|
$return_data = "Err";
|
|
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'KELUHAN SAAT INI'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y' AND So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if(count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
if (count($rows) > 0) {
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
|
|
$keluhan_saat_ini = "";
|
|
$arr_keluhan = [];
|
|
if ($d["title"] == "KELUHAN SAAT INI") {
|
|
if ($d["flag_normal"] == "Y") {
|
|
$keluhan_saat_ini = "";
|
|
}
|
|
else {
|
|
foreach ($d["details"] as $xd) {
|
|
if ($xd["chx"] == "1") {
|
|
$arr_keluhan[] = $this->translate_word($xd["label"], $langid) . " " . $this->translate_word($xd["value"], $langid);
|
|
if ($keluhan_saat_ini != "")
|
|
$keluhan_saat_ini .= ", ";
|
|
$keluhan_saat_ini .= $this->translate_word($xd["label"], $langid);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
$return_data = $keluhan_saat_ini;
|
|
}else{
|
|
$return_data = 'NaN';
|
|
}
|
|
|
|
|
|
return $return_data ;
|
|
}
|
|
|
|
function riwayat_phobia($id, $langid = 1)
|
|
{
|
|
$return_data = "Err";
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'RIWAYAT POBIA'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if(count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
if (count($rows) > 0) {
|
|
$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[] = $this->translate_word($gp["label"], $langid);
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
$return_data = join(", ", $riwayat_phobia);
|
|
if($return_data == ""){
|
|
$return_data = "Tidak ada";
|
|
}
|
|
}
|
|
else {
|
|
$return_data = 'NaN';
|
|
}
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function etnis($id, $langid = 1)
|
|
{
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
$return_data = "Err";
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'ETNIS'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if(count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
if (count($rows) > 0) {
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$etnis = array();
|
|
|
|
//echo $d["title"];
|
|
if ($d["title"] == "ETNIS") {
|
|
if ($d["flag_normal"] == "Y") {
|
|
$etnis = array();
|
|
}
|
|
else {
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp["chx"] == 1) {
|
|
$return_data = $this->translate_word($gp["label"], $langid) . " " . $this->translate_word($gp["value"], $langid) . "";
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
$return_data = 'NaN';
|
|
}
|
|
return $return_data;
|
|
}
|
|
|
|
|
|
function bodyfatmonitoring($id, $langid = 1, $type = "fisik")
|
|
{
|
|
$return_data = "Err";
|
|
$sql = " SELECT *
|
|
FROM t_samplingso_additional_fisik_bbtb
|
|
WHERE
|
|
T_SamplingAdditionalFisikBBTBT_OrderHeaderID = ?
|
|
AND T_SamplingAdditionalFisikBBTBIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
$return_data = 'Err';
|
|
//$return_data = $this->db_smartone->last_query();
|
|
return $return_data;
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
$return_data = 'Err';
|
|
|
|
return $return_data;
|
|
}
|
|
$d = $rows[0]["T_SamplingAdditionalFisikBBTBBodyFat"];
|
|
$return_data = $d . "%";
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function riwayat_penyakit($id, $langid = 1)
|
|
{
|
|
$return_data = "Err";
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'RIWAYAT PENYAKIT'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
$return_data = 'Err';
|
|
return $return_data;
|
|
}
|
|
$rows = $qry->result_array();
|
|
if(count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
if (count($rows) > 0) {
|
|
$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();
|
|
}
|
|
else {
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp['name'] != "Allergi") {
|
|
foreach ($gp["details"] as $xd) {
|
|
|
|
if ($xd["chx"] == 1) {
|
|
//print_r($xd);
|
|
$hasil = str_replace("Militus", "Melitus", $xd["label"]);
|
|
$hasil = $this->translate_word($hasil, $langid);
|
|
if ($xd["value"] != ''){
|
|
$special_labels = [
|
|
"Lain-lain ( Penyakit lainnya )",
|
|
"Epilepsi (ayan), kejang, pingsan",
|
|
"Kecelakaan / cidera / trauma / luka parah",
|
|
"Lain-lain ( Kulit & Sistem Reproduksi )"
|
|
];
|
|
|
|
if (in_array($xd["label"], $special_labels)) {
|
|
$hasil = $this->translate_word($xd["value"], $langid);
|
|
}
|
|
else {
|
|
$hasil = $this->translate_word($xd["label"], $langid) . " " . $this->translate_word($xd["value"], $langid) . "";
|
|
}
|
|
;
|
|
}
|
|
|
|
$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[] = $hasil;
|
|
}
|
|
else {
|
|
$riwayat_penyakit[] = $hasil;
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
if (count($riwayat_penyakit) > 0)
|
|
$return_data = join("\r\n", str_replace("*", "", $riwayat_penyakit));
|
|
else
|
|
$return_data = "-";
|
|
}
|
|
else {
|
|
$return_data = 'NaN';
|
|
}
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
|
|
|
|
function alergi($id, $langid = 1)
|
|
{
|
|
$ret_array = [];
|
|
$return_data = "Err";
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'RIWAYAT PENYAKIT'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
$return_data = 'Err';
|
|
return $return_data;
|
|
}
|
|
$rows = $qry->result_array();
|
|
if(count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
if (count($rows) > 0) {
|
|
$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"]);
|
|
$hasil = $this->translate_word($xd["label"], $langid);
|
|
if ($xd['value'] != '')
|
|
$hasil = $this->translate_word($xd["label"], $langid) . " (" . $xd["value"] . ")";
|
|
|
|
$riwayat_penyakit[] = $hasil;
|
|
}
|
|
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"]);
|
|
$hasil = $this->translate_word($xd["label"], $langid);
|
|
if ($xd['value'] != '')
|
|
$hasil = $this->translate_word($xd["label"], $langid) . " (" . $this->translate_word($xd["value"], $langid) . ")";
|
|
$riwayat_penyakit[] = $hasil;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
if (count($riwayat_penyakit) > 0)
|
|
$return_data = join(", ", $riwayat_penyakit);
|
|
else
|
|
$return_data = "-";
|
|
}
|
|
else {
|
|
$return_data = 'NaN';
|
|
}
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function riwayat_keluarga($id, $langid = 1)
|
|
{
|
|
$ret_array = [
|
|
'ayah' => '',
|
|
'ibu' => ''
|
|
];
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'RIWAYAT PENYAKIT KELUARGA'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$riwayat_keluarga = array();
|
|
$ayah = [];
|
|
$ibu = [];
|
|
|
|
if ($d["title"] == "RIWAYAT PENYAKIT KELUARGA") {
|
|
if ($d["flag_normal"] == "Y") {
|
|
|
|
$string_ayah = count($ayah) > 0 ? join(", ", $ayah) : "-";
|
|
$string_ibu = count($ibu) > 0 ? join(", ", $ibu) : "-";
|
|
if ($string_ibu == '')
|
|
$string_ibu = "-";
|
|
|
|
if ($string_ayah == '')
|
|
$string_ayah = "-";
|
|
|
|
$ret_array['ayah'] = $string_ayah;
|
|
$ret_array['ibu'] = $string_ibu;
|
|
}
|
|
else {
|
|
//print_r($d["details"]);
|
|
|
|
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) {
|
|
$label = $gp["label"];
|
|
if ($label == "Diabetes Millitus") {
|
|
$label = "Diabetes Melitus";
|
|
}
|
|
if ($label == "Hypertensi") {
|
|
$label = "Hipertensi";
|
|
}
|
|
$label = $this->translate_word($label, $langid);
|
|
if ($k == 0) {
|
|
$ayah[] = $label;
|
|
}
|
|
else {
|
|
$ibu[] = $label;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//echo count($ibu);
|
|
$string_ayah = count($ayah) > 0 ? join(", ", $ayah) : "-";
|
|
$string_ibu = count($ibu) > 0 ? join(", ", $ibu) : "-";
|
|
if ($string_ibu == '')
|
|
$string_ibu = "-";
|
|
|
|
if ($string_ayah == '')
|
|
$string_ayah = "-";
|
|
//echo $string_ibu;
|
|
$ret_array['ayah'] = $string_ayah;
|
|
$ret_array['ibu'] = $string_ibu;
|
|
}
|
|
}
|
|
|
|
return count($ret_array) > 0 ? $ret_array : "Err";
|
|
}
|
|
|
|
function merokok($id, $langid = 1)
|
|
{
|
|
$ret_array = [];
|
|
$return_data = "Err";
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$orderid = $id;
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'RIWAYAT KEBIASAAN HIDUP'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
$return_data = 'Err';
|
|
return $return_data;
|
|
}
|
|
$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") {
|
|
$return_data = "-";
|
|
}
|
|
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') {
|
|
$hasil = $this->translate_word($xd['label'], $langid);
|
|
if ($xd['value'] != '')
|
|
$hasil = $this->translate_word($xd['label'], $langid) . ', ' . $this->translate_word($xd["value"], $langid);
|
|
$riwayat_hidup[] = $hasil;
|
|
}
|
|
else {
|
|
$hasil = $this->translate_word($xd["label"], $langid);
|
|
if ($xd['value'] != '')
|
|
$hasil = $this->translate_word($xd['label'], $langid) . ', ' . $this->translate_word($xd["value"], $langid);
|
|
if ($xd['suffix'] != '')
|
|
$hasil = $hasil . ' ' . $this->translate_word($xd['suffix'], $langid);
|
|
$riwayat_hidup[] = $hasil;
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
if (count($riwayat_hidup) > 0) {
|
|
$return_data = join(", ", $riwayat_hidup);
|
|
}
|
|
else {
|
|
$return_data = "-";
|
|
}
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function alkohol($id, $langid = 1)
|
|
{
|
|
$ret_array = [];
|
|
$return_data = "Err";
|
|
|
|
$orderid = $id;
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'RIWAYAT KEBIASAAN HIDUP'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
$return_data = 'Err';
|
|
return $return_data;
|
|
}
|
|
$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") {
|
|
$return_data = "-";
|
|
}
|
|
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') {
|
|
$hasil = $this->translate_word($xd['label'], $langid);
|
|
if ($xd['value'] != '')
|
|
$hasil = $this->translate_word($xd['label'], $langid) . ', ' . $this->translate_word($xd["value"], $langid);
|
|
$riwayat_hidup[] = $hasil;
|
|
}
|
|
else {
|
|
$hasil = $this->translate_word($xd["label"], $langid);
|
|
if ($xd['value'] != '')
|
|
$hasil = $this->translate_word($xd['label'], $langid) . ', ' . $this->translate_word($xd["value"], $langid);
|
|
if ($xd['suffix'] != '')
|
|
$hasil = $hasil . ' ' . $this->translate_word($xd['suffix'], $langid);
|
|
$riwayat_hidup[] = $hasil;
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
if (count($riwayat_hidup) > 0) {
|
|
$return_data = join(", ", $riwayat_hidup);
|
|
}
|
|
else {
|
|
$return_data = "-";
|
|
}
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function olahraga($id, $langid = 1)
|
|
{
|
|
$ret_array = [];
|
|
$return_data = "Err";
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'RIWAYAT KEBIASAAN HIDUP'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
$return_data = 'Err';
|
|
return $return_data;
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
$return_data = 'Err';
|
|
return $return_data;
|
|
}
|
|
$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') {
|
|
$hasil = $this->translate_word($xd['label'], $langid);
|
|
if ($xd['value'] != '')
|
|
$hasil = $this->translate_word($xd['label'], $langid) . ', ' . $this->translate_word($xd["value"], $langid);
|
|
$riwayat_hidup[] = $hasil;
|
|
}
|
|
else {
|
|
$jumlah_olahraga = "";
|
|
if ($xd["value"] != '')
|
|
$jumlah_olahraga = $this->translate_word($xd["value"], $langid) . ' ' . $this->translate_word($xd['suffix'], $langid);
|
|
|
|
$hasil = $this->translate_word($xd["label"], $langid);
|
|
if ($xd['value'] != '')
|
|
$hasil = $this->translate_word($xd['label'], $langid) . ', ' . $this->translate_word($xd["value"], $langid);
|
|
if ($xd['suffix'] != '')
|
|
$hasil = $hasil . ' ' . $this->translate_word($xd['suffix'], $langid);
|
|
$riwayat_hidup[] = $hasil;
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
if (count($riwayat_hidup) > 0) {
|
|
$return_data = join(", ", $riwayat_hidup);
|
|
}
|
|
else {
|
|
$return_data = "-";
|
|
}
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function riwayat_obat($id, $langid = 1)
|
|
{
|
|
$ret_array = [];
|
|
$return_data = "Err";
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y'
|
|
AND FisikTemplateTitle = 'RIWAYAT KONSUMSI OBAT TERATUR'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
$return_data = 'NaN';
|
|
return $return_data;
|
|
}
|
|
$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"]);
|
|
$hasil = $this->translate_word($gp["label"], $langid);
|
|
if ($gp["value"] != '')
|
|
$hasil = $this->translate_word($gp["label"], $langid) . " : " . $this->translate_word($gp["value"], $langid);
|
|
$riwayat_obat[] = $hasil;
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
$string_obat = count($riwayat_obat) > 0 ? join(", ", $riwayat_obat) : "-";
|
|
$return_data = $string_obat;
|
|
return $return_data;
|
|
}
|
|
|
|
|
|
|
|
function riwayat_imunisasi($id, $langid = 1)
|
|
{
|
|
|
|
$return_data = "Err";
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'RIWAYAT IMUNISASI'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
$return_data = 'Err';
|
|
//$return_data = $this->db_smartone->last_query();
|
|
return $return_data;
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
$return_data = 'Err';
|
|
|
|
return $return_data;
|
|
}
|
|
$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(",", " ", $this->translate_word($xd["segment_name"], $langid)) . ' ' . $this->translate_word($xd["value"], $langid);
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
$string_obat = count($riwayat_imunisasi) > 0 ? join(", ", $riwayat_imunisasi) : "-";
|
|
$return_data = $string_obat;
|
|
return $return_data;
|
|
}
|
|
|
|
|
|
|
|
|
|
//pemeriksaan Fisik
|
|
function tanda_vital_xxx($id, $langid = 1, $type = "fisik")
|
|
{
|
|
$tanda_vital = array();
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'TANDA VITAL'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
|
|
|
|
if ($d["title"] == "TANDA VITAL") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp['id_code'] != 'tanda_vital_5') {
|
|
$value = $gp["value"] . ' ' . $gp["unit"];
|
|
if ($gp["chx_y"] == "1")
|
|
$value = $gp["label_y"];
|
|
|
|
if ($gp["chx_x"] == "1")
|
|
$value = $gp["label_x"] . ' ' . $gp["value"] . ' ' . $gp["unit"];
|
|
|
|
|
|
if($gp["value_x"] != '')
|
|
$value = $value . ' ( ' . ucwords(strtolower($gp["value_x"])).' )';
|
|
$tanda_vital[] = array(
|
|
"label" => $this->translate_word($gp["label"], $langid),
|
|
"value" => $value
|
|
);
|
|
}
|
|
else {
|
|
$kesimpulan = str_replace("Stadium", "Stage", $gp["value"]);
|
|
$value = $gp["value_x"] . '/' . $gp["value_y"] . ' ' . $gp["unit"];
|
|
|
|
$kesimpulan = ucwords(strtolower($this->translate_word($kesimpulan, $langid)));
|
|
if($kesimpulan != '')
|
|
$value = $value . ' ( ' . $kesimpulan.' )';
|
|
$tanda_vital[] = array(
|
|
"label" => $this->translate_word($gp["label"], $langid),
|
|
"value" => $value
|
|
);
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
return count($tanda_vital) > 0 ? $tanda_vital : "Err";
|
|
}
|
|
|
|
function tbbbbodyfat($id, $type, $langid = 1)
|
|
{
|
|
$ret_array = [];
|
|
$sql = "SELECT *
|
|
FROM t_samplingso_additional_fisik_bbtb
|
|
WHERE
|
|
T_SamplingAdditionalFisikBBTBT_OrderHeaderID = $id AND
|
|
T_SamplingAdditionalFisikBBTBIsActive = 'Y'
|
|
LIMIT 1";
|
|
//echo $sql;
|
|
$qry = $this->db_smartone->query($sql);
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
//echo $this->db_smartone->last_query();
|
|
$row_s = $qry->result_array();
|
|
if(count($row_s) == 0) {
|
|
return "Err";
|
|
}
|
|
$row_result = $row_s[0];
|
|
|
|
$bb = $row_result["T_SamplingAdditionalFisikBBTBValueBB"] == 0 ? "NaN" : $row_result["T_SamplingAdditionalFisikBBTBValueBB"];
|
|
$tb = $row_result["T_SamplingAdditionalFisikBBTBValueTB"] == 0 ? "NaN" : $row_result["T_SamplingAdditionalFisikBBTBValueTB"];
|
|
$bodyfat = $row_result["T_SamplingAdditionalFisikBBTBBodyFat"] == 0 ? "NaN" : $row_result["T_SamplingAdditionalFisikBBTBBodyFat"] . "%";
|
|
$standart_bmi = $row_result["T_SamplingAdditionalFisikBBTBStandart"];
|
|
if($bb != "NaN" && $tb != "NaN") {
|
|
$get_bmi = $this->hitung_bmi($bb, $tb, $standart_bmi);
|
|
$bmi = $get_bmi['bmi'];
|
|
$standart_text = "Standart " . ucwords(str_replace("_", " ", $standart_bmi));
|
|
$show_standart = $row_result["Mgm_McuShowStandartBMI"];
|
|
$classification = $get_bmi['class'];
|
|
$ret_array['BMI'] = $bmi . " " . $classification;
|
|
}
|
|
|
|
|
|
$ret_array['TB'] = $tb != "NaN" ? $tb . " cm" : "NaN";
|
|
$ret_array['BB'] = $bb != "NaN" ? $bb . " kg" : "NaN";
|
|
$ret_array['BodyFat'] = $bodyfat != "NaN" ? $bodyfat : "NaN";
|
|
|
|
return count($ret_array) > 0 ? $ret_array : "Err";
|
|
}
|
|
|
|
function tekanan_darah($id,$langid = 1)
|
|
{
|
|
|
|
$return_data = [];
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND ( FisikTemplateTitle = 'TEKANAN DARAH' OR FisikTemplateTitle = 'TANDA VITAL' )
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
//echo $this->db_smartone->last_query();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//print_r($d);
|
|
//keluhan saat ini
|
|
$tanda_vital = array();
|
|
|
|
if ($d["title"] == "TEKANAN DARAH" || $d["title"] == "TANDA VITAL") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp['id_code'] == 'tanda_vital_5') {
|
|
$return_data[$gp['label_x']] = $gp['value_x'] . " mmHg";
|
|
$return_data[$gp['label_y']] = $gp['value_y'] . " mmHg";
|
|
$return_data['standart_tensi'] = $gp['standart'];
|
|
$return_data['conclusion_tensi'] = $gp['value'];
|
|
if($langid == 2) {
|
|
$return_data['conclusion_tensi'] = $this->translate_word($gp['value'], $langid);
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function laju_pernafasan($id, $langid = 1)
|
|
{
|
|
|
|
$return_data = "Err";
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'TANDA VITAL'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
if (count($rows) > 0) {
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$return_data = 'NaN';
|
|
if ($d["title"] == "TANDA VITAL") {
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp['id_code'] == 'tanda_vital_3') {
|
|
$return_data = $gp['value'] . " " . $this->translate_word($gp['unit'], $langid);
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function denyut_nadi($id, $langid = 1)
|
|
{
|
|
$return_data = "Err";
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'TANDA VITAL'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
if (count($rows) > 0) {
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$tanda_vital = array();
|
|
$return_data = 'NaN';
|
|
if ($d["title"] == "TANDA VITAL") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp['id_code'] == 'tanda_vital_1') {
|
|
$return_data = $gp['value'] . " " . $this->translate_word('x/menit', $langid);
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function ritme_denyut_nadi($id, $langid = 1)
|
|
{
|
|
$return_data = "Err";
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'TANDA VITAL'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
if (count($rows) > 0) {
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$tanda_vital = array();
|
|
$return_data = 'NaN';
|
|
if ($d["title"] == "TANDA VITAL") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp['id_code'] == 'tanda_vital_2') {
|
|
if($gp['chx_y'] == 1)
|
|
$return_data = $this->translate_word($gp['label_y'], $langid);
|
|
else
|
|
$return_data = $this->translate_word($gp['label_x'], $langid);
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function pola_nafas($id, $langid = 1)
|
|
{
|
|
$return_data = "Err";
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'TANDA VITAL'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
if (count($rows) > 0) {
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$tanda_vital = array();
|
|
$return_data = 'NaN';
|
|
if ($d["title"] == "TANDA VITAL") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp['id_code'] == 'tanda_vital_4') {
|
|
if($gp['chx_y'] == 1)
|
|
$return_data = $this->translate_word($gp['label_y'], $langid);
|
|
else
|
|
$return_data = $this->translate_word($gp['label_x'], $langid);
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
|
|
function suhu($id, $langid = 1)
|
|
{
|
|
$return_data = "Err";
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'TANDA VITAL'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
$return_data = 'Err';
|
|
//$return_data = $this->db_smartone->last_query();
|
|
return $return_data;
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
if (count($rows) > 0) {
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$tanda_vital = array();
|
|
$return_data = 'NaN';
|
|
if ($d["title"] == "TANDA VITAL") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp['id_code'] == 'tanda_vital_6') {
|
|
if ($gp['chx_x'] == 1)
|
|
$return_data = $this->translate_word($gp['label_x'], $langid);
|
|
if ($gp['chx_y'] == 1)
|
|
$return_data = $this->translate_word($gp['label_y'], $langid);
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function status_gizi($id, $langid = 1, $type = "fisik")
|
|
{
|
|
$sql = "SELECT *
|
|
FROM t_samplingso_additional_fisik_bbtb
|
|
WHERE
|
|
T_SamplingAdditionalFisikBBTBT_OrderHeaderID = $id AND
|
|
T_SamplingAdditionalFisikBBTBIsActive = 'Y'
|
|
LIMIT 1";
|
|
//echo $sql;
|
|
$qry = $this->db_smartone->query($sql);
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
//echo $this->db_smartone->last_query();
|
|
$row_s = $qry->result_array();
|
|
if(count($row_s) == 0) {
|
|
return "Err";
|
|
}
|
|
$row_result = $row_s[0];
|
|
|
|
$status_gizi = array();
|
|
$bb = $row_result["T_SamplingAdditionalFisikBBTBValueBB"] == 0 ? "Err" : $row_result["T_SamplingAdditionalFisikBBTBValueBB"];
|
|
$tb = $row_result["T_SamplingAdditionalFisikBBTBValueTB"] == 0 ? "Err" : $row_result["T_SamplingAdditionalFisikBBTBValueTB"];
|
|
$bodyfat = $row_result["T_SamplingAdditionalFisikBBTBBodyFat"] == 0 ? "Err" : $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'];
|
|
|
|
$standart_text = ucwords(str_replace("_", " ", $standart_bmi));
|
|
if ($bb == "Err" && $tb == "Err") {
|
|
$bodyfat = 'Err';
|
|
$standart_bmi = 'Err';
|
|
$bmi = 'Err';
|
|
$classification = 'Err';
|
|
$standart_text = 'Err';
|
|
}
|
|
|
|
$status_gizi['TB'] = $tb != "Err" ? $tb . " cm" : "Err";
|
|
$status_gizi['BB'] = $bb != "Err" ? $bb . " kg" : "Err";
|
|
$status_gizi['BodyFat'] = $bodyfat != "Err" ? $bodyfat : "Err";
|
|
$status_gizi['BMI'] = $bmi != "Err" ? $bmi . " " . $classification : "Err";
|
|
$status_gizi['Standart_BMI'] = $standart_text != "Err" ? $standart_text : "Err";
|
|
|
|
|
|
|
|
return $status_gizi;
|
|
}
|
|
|
|
function lapang_pandang($id, $langid = 1)
|
|
{
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'LAPANG PANDANG'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$return_data = "Err";
|
|
|
|
if (strtolower($d["title"]) == strtolower("LAPANG PANDANG")) {
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp["chx_y"] == "1")
|
|
$value = $this->translate_word($gp["label_y"], $langid);
|
|
|
|
if ($gp["chx_x"] == "1")
|
|
$value = $this->translate_word($gp["label_x"], $langid);
|
|
|
|
if ($gp['value'] != '')
|
|
$value = $value . " (" . $gp['value'] . ")";
|
|
|
|
$return_data = $value;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function klasifikasi_bmi($bmi, $standart_bmi)
|
|
{
|
|
$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 keadaan_umum($id, $langid = 1)
|
|
{
|
|
$ret_array = [];
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'KEADAAN UMUM'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if(count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
|
|
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"];
|
|
|
|
$ret_array[] = array(
|
|
"label" => $this->translate_word($gp["label"], $langid),
|
|
"value" => $this->translate_word($value, $langid). " " . $this->translate_word($gp["unit"], $langid)
|
|
);
|
|
}
|
|
}
|
|
|
|
return count($ret_array) > 0 ? $ret_array : "Err";
|
|
}
|
|
|
|
|
|
function kepala_wajah($id, $langid = 1, $type = "fisik")
|
|
{
|
|
$ret_array = [];
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM so_resultentry
|
|
WHERE
|
|
So_ResultEntryID = ?";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$row = $qry->row();
|
|
if (!$row) {
|
|
return "Err";
|
|
}
|
|
$orderid = $row->So_ResultEntryT_OrderHeaderID;
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'KEPALA WAJAH'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return 'Err';
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$kepala_wajah = array();
|
|
|
|
|
|
if ($d["title"] == "KEPALA WAJAH") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp["chx"] == 1) {
|
|
$hasil = $this->translate_word($gp["label"], $langid);
|
|
if ($gp["value"] != '')
|
|
$hasil = $this->translate_word($gp["label"], $langid) . " : " . $this->translate_word($gp["value"], $langid);
|
|
$kepala_wajah[] = $hasil;
|
|
}
|
|
}
|
|
}
|
|
|
|
if(count($kepala_wajah) == 0) {
|
|
return "Err";
|
|
}
|
|
$return_data = join(", ", $kepala_wajah);
|
|
return $return_data;
|
|
}
|
|
|
|
|
|
function persepsi_warna($id, $langid = 1)
|
|
{
|
|
$return_data = "Err";
|
|
|
|
$sql = "SELECT IFNULL(T_SamplingAdditionalFisikBWPWValue,'Z') as result,
|
|
IFNULL(T_SamplingAdditionalFisikBWPWVAngka,'') as angka
|
|
FROM t_samplingso_additional_fisik_bw
|
|
WHERE
|
|
T_SamplingAdditionalFisikBWT_OrderHeaderID = ?
|
|
LIMIT 1 ";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$row_s = $qry->result_array();
|
|
if(count($row_s) == 0) {
|
|
return "Err";
|
|
}
|
|
$row_result = $row_s[0];
|
|
$result = $this->translate_word("Bahan Belum", $langid);
|
|
if ($row_result) {
|
|
if ($row_result['result'] == 'BW')
|
|
$result = $this->translate_word("Red Green Deficiency", $langid) . " ( " . $this->translate_word($row_result['angka'], $langid) . " )";
|
|
if ($row_result['result'] == 'N')
|
|
$result = $this->translate_word("Normal", $langid);
|
|
if ($row_result['result'] == 'X')
|
|
$result = $this->translate_word("Tidak dilakukan", $langid);
|
|
}
|
|
|
|
$return_data = $result;
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
|
|
function doctor($id)
|
|
{
|
|
$return_data = "Err";
|
|
|
|
|
|
$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_ResultEntryFisikUmumT_OrderHeaderID = So_ResultEntryT_OrderHeaderID AND
|
|
So_ResultEntryNonlab_TemplateID = 27
|
|
JOIN m_doctor ON M_DOctorID = So_ResultEntryM_DoctorID
|
|
WHERE So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'
|
|
LIMIT 1";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
$return_data = 'Err';
|
|
$return_data = $this->db_smartone->last_query();
|
|
return $return_data;
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
$row_result = $rows[0];
|
|
$return_data = $row_result["doctor"];
|
|
if (trim((string)$return_data) === '') {
|
|
return "Err";
|
|
}
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function konjuktiva_sklera($id, $langid = 1)
|
|
{
|
|
$return_data = "Err";
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND
|
|
FisikTemplateTitle = 'MATA'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
$row_result = $rows[0];
|
|
$d = json_decode($row_result["So_ResultEntryFisikUmumDetails"], true);
|
|
|
|
$mata = array();
|
|
|
|
if ($d["title"] == "MATA") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp["chx"] == 1) {
|
|
$hasil = $this->translate_word($gp["label"], $langid);
|
|
if ($gp["value"] != '')
|
|
$hasil = $this->translate_word($gp["label"], $langid) . " (" . $this->translate_word($gp["value"], $langid) . ")";
|
|
$mata[] = $hasil;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
$string_mata = count($mata) > 0 ? join(", ", $mata) : "-";
|
|
$return_data = $string_mata;
|
|
|
|
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
|
|
function telinga($id, $langid = 1)
|
|
{
|
|
$ret_array = [];
|
|
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'TELINGA'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
$row_result = $rows[0];
|
|
$d = json_decode($row_result["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"]);
|
|
$hasil = $this->translate_word($gp["label"], $langid);
|
|
if ($gp["value"] != '')
|
|
$hasil = $this->translate_word($gp["label"], $langid) . " : " . $this->translate_word($gp["value"], $langid);
|
|
$telinga[] = $hasil;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
$string_telinga = count($telinga) > 0 ? join(", ", $telinga) : "-";
|
|
$return_data = $string_telinga;
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function visus($id, $type, $langid = 1)
|
|
{
|
|
$ret_array = [];
|
|
|
|
|
|
$sql = "SELECT *
|
|
FROM t_orderdetail
|
|
JOIN so_resultentry ON So_ResultEntryT_OrderHeaderID =
|
|
T_OrderDetailT_OrderHeaderID AND So_ResultEntryT_OrderHeaderID = {$id}
|
|
WHERE T_OrderDetailT_TestCode = '40111000'
|
|
AND T_OrderDetailIsActive = 'Y' LIMIT 1";
|
|
$qry = $this->db_smartone->query($sql);
|
|
|
|
|
|
$check_exist_test = $qry->result_array();
|
|
|
|
$ret_array = [];
|
|
if (intval($id) == 0 || count($check_exist_test) == 0) {
|
|
$return_data = 'Err';
|
|
//$return_data = $this->db_smartone->last_query();
|
|
return $return_data;
|
|
}
|
|
|
|
|
|
$sql = " SELECT * , T_SamplingAdditionalFisikVisusID as visus_id
|
|
FROM t_samplingso_additional_fisik_visus
|
|
WHERE
|
|
T_SamplingAdditionalFisikVisusT_OrderHeaderID = ? AND
|
|
T_SamplingAdditionalFisikVisusIsActive = 'Y'
|
|
LIMIT 1";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
$return_data = 'Err';
|
|
// $return_data = $this->db_smartone->last_query();
|
|
return $return_data;
|
|
}
|
|
|
|
//$return_data = $this->db_smartone->last_query();
|
|
//return $return_data;
|
|
|
|
$rows = $qry->result_array();
|
|
// return $rows;
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
$row_result = $rows[0];
|
|
$ret_array['a2'] = "";
|
|
|
|
if ($row_result && intval($row_result['visus_id']) > 0) {
|
|
|
|
$visus = array();
|
|
$visus_kiri = "";
|
|
$visus_kanan = "";
|
|
$visus_kesimpulan = "";
|
|
$normal = array("20/20", "20/25", "6/6", "6/7.5", "6/7,5");
|
|
|
|
$value_visus_od = "20/20";
|
|
$value_visus_os = "20/20";
|
|
$status_kcmt = $this->translate_word("tanpa kacamata", $langid);
|
|
|
|
$normal_kanan = "";
|
|
if (in_array($row_result['T_SamplingAdditionalFisikVisusTKODV'], $normal) || in_array($row_result['T_SamplingAdditionalFisikVisusDKODV'], $normal))
|
|
$normal_kanan = "(Normal)";
|
|
|
|
$normal_kiri = "";
|
|
if (in_array($row_result['T_SamplingAdditionalFisikVisusTKOSV'], $normal) || in_array($row_result['T_SamplingAdditionalFisikVisusDKOSV'], $normal))
|
|
$normal_kiri = "(Normal)";
|
|
|
|
if ($row_result['T_SamplingAdditionalFisikVisusTKODV'] == '6/7,5' || $row_result['T_SamplingAdditionalFisikVisusTKODV'] == '6/6' || $row_result['T_SamplingAdditionalFisikVisusTKODV'] == '6/7.5')
|
|
$value_visus_od = $row_result['T_SamplingAdditionalFisikVisusTKODV'];
|
|
|
|
if ($row_result['T_SamplingAdditionalFisikVisusTKOSV'] == '6/7,5' || $row_result['T_SamplingAdditionalFisikVisusTKOSV'] == '6/6' || $row_result['T_SamplingAdditionalFisikVisusTKOSV'] == '6/7.5')
|
|
$value_visus_os = $row_result['T_SamplingAdditionalFisikVisusTKOSV'];
|
|
|
|
|
|
if ((strtolower($row_result['T_SamplingAdditionalFisikVisusTKODV']) != "normal" && $row_result['T_SamplingAdditionalFisikVisusTKODV'] != "" && $row_result['T_SamplingAdditionalFisikVisusTKODV'] != "-") && ($row_result['T_SamplingAdditionalFisikVisusTKOSV'] != "" && $row_result['T_SamplingAdditionalFisikVisusTKOSV'] != "-")) {
|
|
$visus_kiri = "";
|
|
$visus_kanan = "";
|
|
|
|
$visus[] = array(
|
|
"xx1" => $row_result['T_SamplingAdditionalFisikVisusTKODV'] == 'OFF' ? '' : $this->translate_word("Tanpa Kacamata", $langid),
|
|
"xx2" => "OD : ",
|
|
"xx3" => $row_result['T_SamplingAdditionalFisikVisusTKODV'] == 'OFF' ? '' : $row_result['T_SamplingAdditionalFisikVisusTKODV']
|
|
);
|
|
|
|
$visus[] = array(
|
|
"xx1" => $row_result['T_SamplingAdditionalFisikVisusTKOSV'] == 'OFF' ? '' : $this->translate_word("Tanpa Kacamata", $langid),
|
|
"xx2" => "OS",
|
|
"xx3" => $row_result['T_SamplingAdditionalFisikVisusTKOSV'] == 'OFF' ? '' : $row_result['T_SamplingAdditionalFisikVisusTKOSV']
|
|
);
|
|
|
|
$rst['kelainan'] = $this->translate_word("Kelainan refraksi (tanpa kacamata)", $langid);
|
|
$value_visus_od = $row_result['T_SamplingAdditionalFisikVisusTKODV'] == 'OFF' ? '' : $row_result['T_SamplingAdditionalFisikVisusTKODV'];
|
|
$value_visus_os = $row_result['T_SamplingAdditionalFisikVisusTKOSV'] == 'OFF' ? '' : $row_result['T_SamplingAdditionalFisikVisusTKOSV'];
|
|
$status_kcmt = $row_result['T_SamplingAdditionalFisikVisusTKODV'] == 'OFF' ? '' : $this->translate_word("tanpa kacamata", $langid);
|
|
|
|
|
|
if (!in_array($row_result['T_SamplingAdditionalFisikVisusTKODV'], $normal)) {
|
|
|
|
$value_koreksi_od = "";
|
|
$od_sph = $row_result['T_SamplingAdditionalFisikVisusODSPH'];
|
|
if ($od_sph != "" && $od_sph != "-" && $od_sph != "--" && $od_sph != "/-" && $od_sph != "/" && $od_sph != "-/" && strtolower(trim($od_sph)) != 'plano') {
|
|
if ($visus_kanan != "")
|
|
$visus_kanan .= ", ";
|
|
$visus_kanan .= $od_sph . " (" . $this->translate_word("Miopia", $langid) . ")";
|
|
}
|
|
|
|
|
|
$od_cyl = $row_result['T_SamplingAdditionalFisikVisusODCYL'];
|
|
|
|
//$od_cyl = $row_result['T_SamplingAdditionalFisikVisusODCYL'];
|
|
if ($od_cyl != "" && $od_cyl != "-" && $od_cyl != "--" && $od_cyl != "/-" && $od_cyl != "/" && $od_cyl != "-/") {
|
|
if ($visus_kanan != "")
|
|
$visus_kanan .= ", ";
|
|
$visus_kanan .= "Cyl " . $od_cyl;
|
|
}
|
|
|
|
|
|
$od_x = $row_result['T_SamplingAdditionalFisikVisusODX'];
|
|
//echo $od_x;
|
|
if ($od_x != "" && $od_x != "-" && $od_x != "--" && $od_x != "/-" && $od_x != "/" && $od_x != "-/") {
|
|
//if ($visus_kanan != "") $visus_kanan .= ", ";
|
|
$visus_kanan .= " axis " . $od_x . " (" . $this->translate_word("Astigmatismus", $langid) . ")";
|
|
}
|
|
else {
|
|
if ($od_cyl != "" && $od_cyl != "-" && $od_cyl != "--" && $od_cyl != "/-" && $od_cyl != "/" && $od_cyl != "-/")
|
|
$visus_kanan .= " (" . $this->translate_word("Astigmatismus", $langid) . ")";
|
|
}
|
|
//$value_koreksi_od .= "X (".$od_x.") ";
|
|
|
|
|
|
|
|
}
|
|
|
|
if (!in_array($row_result['T_SamplingAdditionalFisikVisusTKOSV'], $normal)) {
|
|
$value_koreksi_os = "";
|
|
$os_sph = trim($row_result['T_SamplingAdditionalFisikVisusOSSPH']);
|
|
//echo $os_sph;
|
|
if (trim($os_sph) != " " && strtolower(trim($os_sph)) != "tidak terkoreksi" && strtolower(trim($os_sph)) != "tidak dapat dinilai" && $os_sph != "" && $os_sph != "-" && $os_sph != "--" && $os_sph != "/-" && $os_sph != "/" && $os_sph != "-/" && strtolower(trim($os_sph)) != 'plano') {
|
|
if ($visus_kiri != "")
|
|
$visus_kiri .= ", ";
|
|
$visus_kiri .= $os_sph . " (" . $this->translate_word("Miopia", $langid) . ")";
|
|
//return $langid;
|
|
}
|
|
|
|
|
|
$os_cyl = $row_result['T_SamplingAdditionalFisikVisusOSCYL'];
|
|
|
|
if (strtolower(trim($os_cyl)) != "tidak terkoreksi" && strtolower(trim($os_cyl)) != "tidak dapat dinilai" && $os_cyl != "" && $os_cyl != "-" && $os_cyl != "--" && $os_cyl != "/-" && $os_cyl != "/" && $os_cyl != "-/") {
|
|
if ($visus_kiri != "")
|
|
$visus_kiri .= ", ";
|
|
$visus_kiri .= "Cyl " . $os_cyl;
|
|
}
|
|
|
|
|
|
$os_x = $row_result['T_SamplingAdditionalFisikVisusOSX'];
|
|
|
|
if (strtolower(trim($os_x)) != "tidak terkoreksi" && strtolower(trim($os_x)) != "tidak dapat dinilai" && $os_x != "" && $os_x != "-" && $os_x != "--" && $os_x != "/-" && $os_x != "/" && $os_x != "-/") {
|
|
//if ($visus_kiri != "") $visus_kiri .= ", ";
|
|
$visus_kiri .= " axis " . $os_x . " (" . $this->translate_word("Astigmatismus", $langid) . ")";
|
|
}
|
|
else {
|
|
if ($os_cyl != "" && $os_cyl != "-")
|
|
$visus_kiri .= " (" . $this->translate_word("Astigmatismus", $langid) . ")";
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
//return $visus_kiri;
|
|
|
|
|
|
if (($row_result['T_SamplingAdditionalFisikVisusDKODV'] != "" && $row_result['T_SamplingAdditionalFisikVisusDKODV'] != "-") && ($row_result['T_SamplingAdditionalFisikVisusDKOSV'] != "" && $row_result['T_SamplingAdditionalFisikVisusDKOSV'] != "-")) {
|
|
|
|
$visus_kiri = "";
|
|
$visus_kanan = "";
|
|
$visus[] = array(
|
|
"xx1" => $row_result['T_SamplingAdditionalFisikVisusDKODV'] == 'OFF' ? '' : $this->translate_word("Dengan Kacamata", $langid),
|
|
"xx2" => "OD : ",
|
|
"xx3" => $row_result['T_SamplingAdditionalFisikVisusDKODV'] == 'OFF' ? '' : $row_result['T_SamplingAdditionalFisikVisusDKODV']
|
|
);
|
|
|
|
$visus[] = array(
|
|
"xx1" => $row_result['T_SamplingAdditionalFisikVisusDKOSV'] == 'OFF' ? '' : $this->translate_word("Dengan Kacamata", $langid),
|
|
"xx2" => "OS",
|
|
"xx3" => $row_result['T_SamplingAdditionalFisikVisusDKOSV'] == 'OFF' ? '' : $row_result['T_SamplingAdditionalFisikVisusDKOSV']
|
|
);
|
|
|
|
$rst['kelainan'] = $this->translate_word("Kelainan refraksi (dengan kacamata)", $langid);
|
|
$value_visus_od = $row_result['T_SamplingAdditionalFisikVisusDKODV'] == 'OFF' ? '' : $row_result['T_SamplingAdditionalFisikVisusDKODV'];
|
|
$value_visus_os = $row_result['T_SamplingAdditionalFisikVisusDKOSV'] == 'OFF' ? '' : $row_result['T_SamplingAdditionalFisikVisusDKOSV'];
|
|
$status_kcmt = $row_result['T_SamplingAdditionalFisikVisusDKODV'] == 'OFF' ? '' : $this->translate_word("dengan kacamata", $langid);
|
|
|
|
//if (!in_array($row_result['T_SamplingAdditionalFisikVisusDKODV'], $normal)){
|
|
$value_koreksi_od = "";
|
|
$od_sph = $row_result['T_SamplingAdditionalFisikVisusODSPH'];
|
|
if ($od_sph != "" && $od_sph != "-" && $od_sph != "--" && $od_sph != "/-" && $od_sph != "/" && $od_sph != "-/" && strtolower(trim($od_sph)) != 'plano') {
|
|
if ($visus_kanan != "")
|
|
$visus_kanan .= ", ";
|
|
$visus_kanan .= $od_sph . " (" . $this->translate_word("Miopia", $langid) . ")";
|
|
}
|
|
|
|
|
|
$od_cyl = $row_result['T_SamplingAdditionalFisikVisusODCYL'];
|
|
|
|
//$od_cyl = $row_result['T_SamplingAdditionalFisikVisusODCYL'];
|
|
if ($od_cyl != "" && $od_cyl != "-" && $od_cyl != "--" && $od_cyl != "/-" && $od_cyl != "/" && $od_cyl != "-/") {
|
|
if ($visus_kanan != "")
|
|
$visus_kanan .= ", ";
|
|
$visus_kanan .= "Cyl " . $od_cyl;
|
|
}
|
|
|
|
|
|
$od_x = $row_result['T_SamplingAdditionalFisikVisusODX'];
|
|
//echo $od_x;
|
|
if ($od_x != "" && $od_x != "-" && $od_x != "--" && $od_x != "/-" && $od_x != "/" && $od_x != "-/") {
|
|
//if ($visus_kanan != "") $visus_kanan .= ", ";
|
|
$visus_kanan .= " axis " . $od_x . " (" . $this->translate_word("Astigmatismus", $langid) . ")";
|
|
}
|
|
else {
|
|
if ($od_cyl != "" && $od_cyl != "-" && $od_cyl != "--" && $od_cyl != "/-" && $od_cyl != "/" && $od_cyl != "-/")
|
|
$visus_kanan .= " (" . $this->translate_word("Astigmatismus", $langid) . ")";
|
|
}
|
|
//$value_koreksi_od .= "X (".$od_x.") ";
|
|
|
|
|
|
// }
|
|
|
|
//if (!in_array($row_result['T_SamplingAdditionalFisikVisusDKOSV'], $normal)){
|
|
$value_koreksi_os = "";
|
|
$os_sph = trim($row_result['T_SamplingAdditionalFisikVisusOSSPH']);
|
|
//echo $os_sph;
|
|
if (trim($os_sph) != " " && strtolower(trim($os_sph)) != "tidak terkoreksi" && strtolower(trim($os_sph)) != "tidak dapat dinilai" && $os_sph != "" && $os_sph != "-" && $os_sph != "--" && $os_sph != "/-" && $os_sph != "/" && $os_sph != "-/" && strtolower(trim($os_sph)) != 'plano') {
|
|
if ($visus_kiri != "")
|
|
$visus_kiri .= ", ";
|
|
$visus_kiri .= $os_sph . " (" . $this->translate_word("Miopia", $langid) . ")";
|
|
}
|
|
|
|
$os_cyl = $row_result['T_SamplingAdditionalFisikVisusOSCYL'];
|
|
|
|
if (strtolower(trim($os_cyl)) != "tidak terkoreksi" && strtolower(trim($os_cyl)) != "tidak dapat dinilai" && $os_cyl != "" && $os_cyl != "-" && $os_cyl != "--" && $os_cyl != "/-" && $os_cyl != "/" && $os_cyl != "-/") {
|
|
if ($visus_kiri != "")
|
|
$visus_kiri .= ", ";
|
|
$visus_kiri .= "Cyl " . $os_cyl;
|
|
}
|
|
|
|
|
|
$os_x = $row_result['T_SamplingAdditionalFisikVisusOSX'];
|
|
|
|
if (strtolower(trim($os_x)) != "tidak terkoreksi" && strtolower(trim($os_x)) != "tidak dapat dinilai" && $os_x != "" && $os_x != "-" && $os_x != "--" && $os_x != "/-" && $os_x != "/" && $os_x != "-/") {
|
|
//if ($visus_kiri != "") $visus_kiri .= ", ";
|
|
$visus_kiri .= " axis " . $os_x . " (" . $this->translate_word("Astigmatismus", $langid) . ")";
|
|
}
|
|
else {
|
|
if ($os_cyl != "" && $os_cyl != "-")
|
|
$visus_kiri .= " (" . $this->translate_word("Astigmatismus", $langid) . ")";
|
|
}
|
|
|
|
|
|
//}
|
|
|
|
|
|
}
|
|
|
|
if (($row_result['T_SamplingAdditionalFisikVisusTKODV'] != "" && $row_result['T_SamplingAdditionalFisikVisusTKODV'] != "-") && ($row_result['T_SamplingAdditionalFisikVisusTKOSV'] != "" && $row_result['T_SamplingAdditionalFisikVisusTKOSV'] != "-")) {
|
|
if (!in_array($row_result['T_SamplingAdditionalFisikVisusTKODV'], $normal) && $visus_kanan == '' && $row_result['T_SamplingAdditionalFisikVisusTKODV'] != 'OFF') {
|
|
$visus_kanan = "Miopia";
|
|
}
|
|
|
|
if (!in_array($row_result['T_SamplingAdditionalFisikVisusTKOSV'], $normal) && $visus_kiri == '' && $row_result['T_SamplingAdditionalFisikVisusTKOSV'] != 'OFF') {
|
|
$visus_kiri = "Miopia";
|
|
}
|
|
}
|
|
|
|
if (($row_result['T_SamplingAdditionalFisikVisusDKODV'] != "" && $row_result['T_SamplingAdditionalFisikVisusDKODV'] != "-") && ($row_result['T_SamplingAdditionalFisikVisusDKOSV'] != "" && $row_result['T_SamplingAdditionalFisikVisusDKOSV'] != "-")) {
|
|
if (!in_array($row_result['T_SamplingAdditionalFisikVisusDKODV'], $normal) && $visus_kanan == '' && $row_result['T_SamplingAdditionalFisikVisusDKODV'] != 'OFF') {
|
|
$visus_kanan = "Miopia";
|
|
}
|
|
|
|
if (!in_array($row_result['T_SamplingAdditionalFisikVisusDKOSV'], $normal) && $visus_kiri == '' && $row_result['T_SamplingAdditionalFisikVisusDKOSV'] != 'OFF') {
|
|
$visus_kiri = "Miopia";
|
|
}
|
|
}
|
|
|
|
$od_add = $row_result['T_SamplingAdditionalFisikVisusADD'];
|
|
if ($od_add != "" && $od_add != "-" && $od_add != "--" && $od_add != "/-" && $od_add != "/" && $od_add != "-/") {
|
|
if ($visus_kanan != "")
|
|
$visus_kanan .= ", ";
|
|
$visus_kanan .= $od_add . " (" . $this->translate_word("Presbiopia", $langid) . ")";
|
|
|
|
if ($visus_kiri != "")
|
|
$visus_kiri .= ", ";
|
|
$visus_kiri .= $od_add . " (" . $this->translate_word("Presbiopia", $langid) . ")";
|
|
}
|
|
|
|
|
|
if ($row_result['T_SamplingAdditionalFisikVisusTKODV'] != 'OFF' &&
|
|
$row_result['T_SamplingAdditionalFisikVisusTKOSV'] != 'OFF' &&
|
|
$row_result['T_SamplingAdditionalFisikVisusDKODV'] != 'OFF' &&
|
|
$row_result['T_SamplingAdditionalFisikVisusDKOSV'] != 'OFF') {
|
|
|
|
$pre_result_od = $value_visus_od . " " . strtolower($this->translate_word($status_kcmt, $langid)) . " " . $normal_kanan;
|
|
$pre_result_os = $value_visus_os . " " . strtolower($this->translate_word($status_kcmt, $langid)) . " " . $normal_kiri;
|
|
|
|
if ($type == 'left')
|
|
$ret_array['a2'] = $visus_kiri == "" ? $pre_result_os : $pre_result_os . ";" . $visus_kiri;
|
|
|
|
if ($type == 'right')
|
|
$ret_array['a2'] = $visus_kanan == "" ? $pre_result_od : $pre_result_od . ";" . $visus_kanan;
|
|
|
|
}
|
|
|
|
//return $ret_array['a2'];
|
|
if ($row_result['T_SamplingAdditionalFisikVisusTKODV'] == 'OFF' &&
|
|
$row_result['T_SamplingAdditionalFisikVisusTKOSV'] == 'OFF' &&
|
|
$row_result['T_SamplingAdditionalFisikVisusDKODV'] == 'OFF' &&
|
|
$row_result['T_SamplingAdditionalFisikVisusDKOSV'] == 'OFF') {
|
|
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'] = $this->translate_word("Bahan belum", $langid);
|
|
}
|
|
|
|
$return_data = $ret_array['a2'];
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
|
|
function hidung($id, $langid = 1)
|
|
{
|
|
$ret_array = [];
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'HIDUNG'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
$row_result = $rows[0];
|
|
$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"]);
|
|
$hasil = $this->translate_word($gp["label"], $langid);
|
|
if ($gp["value"] != '')
|
|
$hasil = $this->translate_word($gp["label"], $langid) . " : " . $this->translate_word($gp["value"], $langid);
|
|
$hidung[] = $hasil;
|
|
}
|
|
}
|
|
|
|
}
|
|
$string_hidung = count($hidung) > 0 ? join(", ", $hidung) : "-";
|
|
$return_data = $string_hidung;
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function leher($id, $langid = 1)
|
|
{
|
|
$return_data = "Err";
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'LEHER'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
$row_result = $rows[0];
|
|
$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"]);
|
|
$hasil = $this->translate_word($gp["label"], $langid);
|
|
if ($gp["value"] != '')
|
|
$hasil = $this->translate_word($gp["label"], $langid) . " : " . $this->translate_word($gp["value"], $langid);
|
|
$leher[] = $hasil;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
$string_leher = count($leher) > 0 ? join(", ", $leher) : "Normal";
|
|
$return_data = $string_leher;
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function thorax($id, $langid = 1)
|
|
{
|
|
$return_data = "Err";
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND
|
|
FisikTemplateTitle = 'THORAX / DADA'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
//echo $this->db_smartone->last_query();
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
$row_result = $rows[0];
|
|
$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"]);
|
|
$hasil = $this->translate_word($gp["label"], $langid);
|
|
if ($gp["value"] != '')
|
|
$hasil = $this->translate_word($gp["label"], $langid) . " : " . $this->translate_word($gp["value"], $langid);
|
|
$leher[] = $hasil;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
$string_leher = count($leher) > 0 ? join(", ", $leher) : "Normal";
|
|
$return_data = $string_leher;
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function mulut($id, $langid = 1)
|
|
{
|
|
$return_data = "Err";
|
|
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND
|
|
( FisikTemplateTitle = 'MULUT' )
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//print_r($d);
|
|
//echo $d["title"];
|
|
//keluhan saat ini
|
|
$mulut = array();
|
|
|
|
if ($d["title"] == "MULUT") {
|
|
//print_r($d['details']);
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp['name'] == "Mukosa rongga mulut") {
|
|
//print_r($gp["details"]);
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1 && $xd["label"] != 'Normal') {
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"]);
|
|
// Convert to lowercase first, then capitalize first letter
|
|
$hasil = ucfirst(strtolower($this->translate_word($xd["label"], $langid)));
|
|
if ($xd["value"] != '')
|
|
$hasil = ucfirst(strtolower($this->translate_word($xd["label"], $langid))) . " : " . ucfirst(strtolower($this->translate_word($xd["value"], $langid)));
|
|
|
|
//echo $hasil;
|
|
$mulut[] = $hasil;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
$string_mulut = count($mulut) > 0 ? join(", ", $mulut) : "Normal";
|
|
$return_data = $string_mulut;
|
|
|
|
|
|
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function tenggorokan($id, $langid = 1)
|
|
{
|
|
$return_data = "Err";
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'MULUT'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) > 0) {
|
|
$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"]);
|
|
$hasil = $this->translate_word($xd["label"], $langid);
|
|
if ($xd["value"] != '')
|
|
$hasil = $this->translate_word($xd["label"], $langid) . " : " . $this->translate_word($xd["value"], $langid);
|
|
$mulut[] = $hasil;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
|
|
$string_mulut = count($mulut) > 0 ? join(", ", $mulut) : "Normal";
|
|
$return_data = $string_mulut;
|
|
}
|
|
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function gigi($id, $langid = 1)
|
|
{
|
|
$return_data = "Err";
|
|
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'GIGI'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
$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) {
|
|
$arr_result[] = array($gp["label"], $gp["value"]);
|
|
$hasil = $this->translate_word($gp["label"], $langid);
|
|
if ($gp["value"] != '')
|
|
$hasil = $this->translate_word($gp["label"], $langid) . " : " . $this->translate_word($gp["value"], $langid);
|
|
$gigi[] = $hasil;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
$string_gigi = count($gigi) > 0 ? join(", ", $gigi) : "Normal";
|
|
$return_data = $string_gigi;
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function paru($id, $langid = 1)
|
|
{
|
|
$ret_array = [];
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'PARU-PARU'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
$row_result = $rows[0];
|
|
$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"]);
|
|
$hasil = $this->translate_word($gp["label"], $langid);
|
|
if ($gp["value"] != '')
|
|
$hasil = $this->translate_word($gp["label"], $langid) . " : " . $this->translate_word($gp["value"], $langid);
|
|
$paru[] = $hasil;
|
|
}
|
|
}
|
|
|
|
}
|
|
$string_paru = count($paru) > 0 ? join(", ", $paru) : "-";
|
|
$return_data = $string_paru;
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function jantung($id, $langid = 1)
|
|
{
|
|
$ret_array = [];
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'JANTUNG'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
//echo $this->db_smartone->last_query();
|
|
$rows = $qry->result_array();
|
|
if (count($rows) > 0) {
|
|
$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"]);
|
|
$hasil = $this->translate_word($xd["label"], $langid);
|
|
if ($xd["value"] != '')
|
|
$hasil = $this->translate_word($xd["label"], $langid) . " : " . $this->translate_word($xd["value"], $langid);
|
|
$jantung[] = $hasil;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
|
|
$string_jantung = count($jantung) > 0 ? join(", ", $jantung) : "Normal";
|
|
$return_data = $string_jantung;
|
|
}
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function anogenital($id, $langid = 1)
|
|
{
|
|
$ret_array = [];
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'PERUT / ABDOMEN'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
//echo $this->db_smartone->last_query();
|
|
//exit;
|
|
$string_perut = "Err";
|
|
$rows = $qry->result_array();
|
|
if(count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
if (count($rows) > 0) {
|
|
$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 && $xd['id_code'] == 'perut_17') {
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"]);
|
|
$hasil = $gp["name"] . " : " . $this->translate_word($xd["label"], $langid);
|
|
if ($xd["value"] != '')
|
|
$hasil = $gp["name"] . " : " . $this->translate_word($xd["label"], $langid) . " (" . $this->translate_word($xd["value"], $langid) . ")";
|
|
$perut[] = $hasil;
|
|
}
|
|
if ($xd["chx"] == 1 && $xd['id_code'] == 'perut_15') {
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"]);
|
|
$hasil = $this->translate_word($xd["label"], $langid);
|
|
if ($xd["value"] != '')
|
|
$hasil = $this->translate_word($xd["label"], $langid) . " (" . $this->translate_word($xd["value"], $langid) . ")";
|
|
$perut[] = $hasil;
|
|
}
|
|
if ($xd["chx"] == 1 && $xd['id_code'] == 'perut_16') {
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"]);
|
|
$hasil = $this->translate_word($xd["label"], $langid);
|
|
if ($xd["value"] != '')
|
|
$hasil = $this->translate_word($xd["label"], $langid) . " (" . $this->translate_word($xd["value"], $langid) . ")";
|
|
$perut[] = $hasil;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$string_perut = count($perut) > 0 ? join(", ", $perut) : "-";
|
|
$ret_array['a2'] = $string_perut;
|
|
}
|
|
|
|
$return_data = $string_perut;
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function pengukuran($id, $langid = 1)
|
|
{
|
|
$return_data = [];
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'PERUT / ABDOMEN'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
if (count($rows) > 0) {
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
$perut = array();
|
|
|
|
if ($d["title"] == "PERUT / ABDOMEN") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp["name"] == 'Pengukuran') {
|
|
foreach ($gp["details"] as $xd) {
|
|
if ( $xd["id_code"] == 'perut_18') {
|
|
if (intval($xd["value"]) > 0) {
|
|
$return_data['lingkar_perut'] = $xd["value"] . " " . $xd["unit"];
|
|
}
|
|
else {
|
|
$return_data['lingkar_perut'] = 'NaN';
|
|
}
|
|
}
|
|
if ( $xd["id_code"] == 'perut_19') {
|
|
if (intval($xd["value"]) > 0) {
|
|
$return_data['lingkar_pinggang'] = $xd["value"] . " " . $xd["unit"];
|
|
}
|
|
else {
|
|
$return_data['lingkar_pinggang'] = 'NaN';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
return $return_data;
|
|
}
|
|
|
|
|
|
|
|
function tonometri($id, $langid = 1)
|
|
{
|
|
$return_data = "Err";
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'TONOMETRI'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
|
|
$return_data = 'Err';
|
|
return $return_data;
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
if ($d["title"] == "TONOMETRI") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["id_code"] == 'tonometri_od') {
|
|
$od = "OD : " . $xd["value"] . " " . $xd["unit"];
|
|
}
|
|
if ($xd["id_code"] == 'tonometri_os') {
|
|
$os = "OS : " . $xd["value"] . " " . $xd["unit"];
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
$return_data = $od . " ; " . $os;
|
|
return $return_data;
|
|
}
|
|
|
|
function perut($id, $langid = 1)
|
|
{
|
|
$return_data = "Err";
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$orderid = $id;
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'PERUT / ABDOMEN'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return 'Err';
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) > 0) {
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
$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"]);
|
|
$hasil = $this->translate_word($gp["name"], $langid) . " : " . $this->translate_word($xd["label"], $langid);
|
|
if ($xd["value"] != '')
|
|
$hasil = $this->translate_word($gp["name"], $langid) . " : " . $this->translate_word($xd["label"], $langid) . " (" . $this->translate_word($xd["value"], $langid) . ")";
|
|
$perut[] = $hasil;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
$string_perut = count($perut) > 0 ? join(", ", $perut) : "Normal";
|
|
$return_data = $string_perut;
|
|
}
|
|
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function ginjal($id, $langid = 1)
|
|
{
|
|
$ret_array = [];
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'PERUT / ABDOMEN'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
if (count($rows) > 0) {
|
|
$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"] == 'Abdomen') {
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1 && $xd["id_code"] == 'perut_3') {
|
|
//$arr_result[] = array($gp["name"],$xd["label"],$xd["value"]) ;
|
|
$hasil = $this->translate_word($xd["label"], $langid);
|
|
if ($xd["value"] != '')
|
|
$hasil = $this->translate_word($xd["label"], $langid) . " (" . $this->translate_word($xd["value"], $langid) . ")";
|
|
$perut[] = $hasil;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
$string_perut = count($perut) > 0 ? join(", ", $perut) : "Normal";
|
|
if ($string_perut == "")
|
|
$string_perut = "Normal";
|
|
$return_data = $string_perut;
|
|
}
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function hernia($id, $langid = 1)
|
|
{
|
|
$ret_array = [];
|
|
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'PERUT / ABDOMEN'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if(count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
if (count($rows) > 0) {
|
|
$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') {
|
|
if ($gp["details"][1]["chx"] == "1") {
|
|
|
|
$perut = $this->translate_word($gp["details"][1]["label"], $langid);
|
|
|
|
if ($gp["details"][1]["details"][0]["chx_value"] == 1) {
|
|
if ($perut != "")
|
|
$perut .= " : ";
|
|
$perut .= " " . $this->translate_word($gp["details"][1]["details"][0]["label"], $langid);
|
|
}
|
|
//print_r($gp["details"][1]["details"][1]);
|
|
if ($gp["details"][1]["details"][1]["chx_a_value"] == 1 || $gp["details"][1]["details"][1]["chx_b_value"] == 1) {
|
|
$ds_hasil = "";
|
|
if ($gp["details"][1]["details"][1]["chx_a_value"] == 1) {
|
|
if ($ds_hasil != "")
|
|
$ds_hasil .= ", ";
|
|
$ds_hasil .= $this->translate_word($gp["details"][1]["details"][1]["chx_a_label"], $langid);
|
|
}
|
|
|
|
if ($gp["details"][1]["details"][1]["chx_b_value"] == 1) {
|
|
if ($ds_hasil != "")
|
|
$ds_hasil .= ", ";
|
|
$ds_hasil .= $this->translate_word($gp["details"][1]["details"][1]["chx_b_label"], $langid);
|
|
}
|
|
|
|
if ($perut != "")
|
|
$perut .= " : ";
|
|
$perut .= " " . $this->translate_word($gp["details"][1]["details"][1]["label"], $langid) . " (" . $ds_hasil . ")";
|
|
}
|
|
|
|
if ($gp["details"][1]["details"][2]["chx_a_value"] == 1 || $gp["details"][1]["details"][2]["chx_b_value"] == 1) {
|
|
$ds_hasil = "";
|
|
if ($gp["details"][1]["details"][2]["chx_a_value"] == 1) {
|
|
if ($ds_hasil != "")
|
|
$ds_hasil .= ", ";
|
|
$ds_hasil .= $this->translate_word($gp["details"][1]["details"][1]["chx_a_label"], $langid);
|
|
}
|
|
|
|
if ($gp["details"][1]["details"][2]["chx_b_value"] == 1) {
|
|
if ($ds_hasil != "")
|
|
$ds_hasil .= ", ";
|
|
$ds_hasil .= $this->translate_word($gp["details"][1]["details"][2]["chx_b_label"], $langid);
|
|
}
|
|
|
|
if ($perut != "")
|
|
$perut .= " : ";
|
|
$perut .= " " . $this->translate_word($gp["details"][1]["details"][2]["label"], $langid) . " (" . $ds_hasil . ")";
|
|
}
|
|
|
|
}
|
|
if ($gp["details"][0]["chx"] == "1") {
|
|
$perut = $this->translate_word($gp["details"][0]["label"], $langid);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
$return_data = $perut;
|
|
}
|
|
return $return_data;
|
|
}
|
|
|
|
function kulit($id, $langid = 1)
|
|
{
|
|
$ret_array = [];
|
|
$return_data = "Err";
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND
|
|
FisikTemplateTitle = 'SISTEM INTEGUMEN'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
|
|
$rows = $qry->result_array();
|
|
if(count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
if (count($rows) > 0) {
|
|
$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"]);
|
|
$hasil = $this->translate_word($xd["label"], $langid);
|
|
if ($xd["value"] != '')
|
|
$hasil = $this->translate_word($xd["label"], $langid) . " : " . $this->translate_word($xd["value"], $langid);
|
|
$perut[] = $hasil;
|
|
}
|
|
|
|
if ($xd["chx"] == 1 && $xd["label"] == 'Lain-lain') {
|
|
// echo "lain";
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"]);
|
|
$hasil = $this->translate_word($xd["label"], $langid);
|
|
if ($xd["value"] != '')
|
|
$hasil = $this->translate_word($xd["label"], $langid) . " : " . $this->translate_word($xd["value"], $langid);
|
|
$perut[] = $hasil;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND
|
|
FisikTemplateTitle = 'KEPALA WAJAH'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return 'Err';
|
|
}
|
|
|
|
$rows_kepala = $qry->result_array();
|
|
if (count($rows_kepala) > 0) {
|
|
$d_kepala = json_decode($rows_kepala[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
if ($d_kepala["title"] == "KEPALA WAJAH") {
|
|
$kepala_wajah = [];
|
|
foreach ($d_kepala["details"] as $xd_kepala) {
|
|
if ($xd_kepala["chx"] == 1 && $xd_kepala["is_normal"] == 'N') {
|
|
$arr_result[] = array($d_kepala["title"], $xd_kepala["label"], $xd_kepala["value"]);
|
|
$hasil = $this->translate_word($xd_kepala["label"], $langid);
|
|
if ($xd_kepala["value"] != '')
|
|
$hasil = $this->translate_word($xd_kepala["label"], $langid) . " : " . $this->translate_word($xd_kepala["value"], $langid);
|
|
$kepala_wajah[] = $hasil;
|
|
}
|
|
}
|
|
if (count($kepala_wajah) > 0) {
|
|
$string_kepala_wajah = join(", ", $kepala_wajah);
|
|
$perut[] = "Kepala wajah ( ".$string_kepala_wajah." )";
|
|
}
|
|
}
|
|
}
|
|
|
|
$string_perut = count($perut) > 0 ? join(", ", $perut) : "-";
|
|
$return_data = $string_perut;
|
|
}
|
|
return $return_data;
|
|
}
|
|
|
|
function extremitas_xxx($id, $langid = 1)
|
|
{
|
|
$return_data = "Err";
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND
|
|
FisikTemplateTitle = 'ANGGOTA GERAK'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
if (count($rows) > 0) {
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
$perut = array();
|
|
|
|
|
|
if ($d["title"] == "ANGGOTA GERAK") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1 && $xd["label"] != 'Lain-lain' && $xd["label"] != 'Normal') {
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"]);
|
|
$hasil = $this->translate_word($xd["label"], $langid);
|
|
if ($xd["value"] != '')
|
|
$hasil = $gp["name"] . " : " . $this->translate_word($xd["label"], $langid) . " (" . $this->translate_word($xd["value"], $langid) . ")";
|
|
$perut[] = $hasil;
|
|
}
|
|
|
|
if ($xd["chx"] == 1 && $xd["label"] == 'Lain-lain') {
|
|
// echo "lain";
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"]);
|
|
$hasil = $this->translate_word($xd["label"], $langid);
|
|
if ($xd["value"] != '')
|
|
$hasil = $gp["name"] . " : " . $this->translate_word($xd["label"], $langid) . " (" . $this->translate_word($xd["value"], $langid) . ")";
|
|
$perut[] = $hasil;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
$string_perut = count($perut) > 0 ? join(", ", $perut) : "Normal";
|
|
$return_data = $string_perut;
|
|
}
|
|
return $return_data;
|
|
}
|
|
|
|
function reflek($id, $langid = 1)
|
|
{
|
|
$ret_array = [];
|
|
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND
|
|
FisikTemplateTitle = 'SISTEM PERSYARAFAN'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
if (count($rows) > 0) {
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$fisiologis = array();
|
|
$patologis = array();
|
|
|
|
|
|
if ($d["title"] == "SISTEM PERSYARAFAN") {
|
|
$is_lbp_based_patologis = false;
|
|
|
|
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"]);
|
|
$hasil = $this->translate_word($xd["label"], $langid);
|
|
if ($xd["value"] != '')
|
|
$hasil = $this->translate_word($xd["label"], $langid) . " (" . $this->translate_word($xd["value"], $langid) . ")";
|
|
$fisiologis[] = $hasil;
|
|
}
|
|
|
|
if ($xd["chx"] == 1 && $xd["label"] == 'Lain-lain') {
|
|
// echo "lain";
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"]);
|
|
$hasil = $this->translate_word($xd["label"], $langid);
|
|
if ($xd["value"] != '')
|
|
$hasil = $this->translate_word($xd["label"], $langid) . " (" . $this->translate_word($xd["value"], $langid) . ")";
|
|
$fisiologis[] = $hasil;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
if ($gp['name'] == 'Refleks Pathologis') {
|
|
$hasil_rst_lbp = [];
|
|
$low_back_pain_inspected = false;
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1) {
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND
|
|
FisikTemplateTitle = 'LOW BACK PAIN SCREENING TEST'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND
|
|
So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
$rows_lbp = $qry->result_array();
|
|
//return $this->db_smartone->last_query();
|
|
if (count($rows_lbp) > 0) {
|
|
$d_lbp = json_decode($rows_lbp[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
$patologis = array();
|
|
|
|
if ($d_lbp["title"] == "LOW BACK PAIN SCREENING TEST") {
|
|
$low_back_pain_inspected = true;
|
|
$is_lbp_based_patologis = true;
|
|
foreach ($d_lbp["details"] as $gp_lbp) {
|
|
foreach ($gp_lbp["details"] as $xd_lbp) {
|
|
|
|
if ($xd_lbp["chx"] == 1) {
|
|
$arr_result[] = array($gp_lbp["name"], $xd["label"], $xd_lbp["value"]);
|
|
$hasil = $gp_lbp["name"] . " : " . $xd_lbp["label"];
|
|
if ($xd_lbp["value"] != '')
|
|
$hasil = $gp_lbp["name"] . " : " . $xd_lbp["label"] . " (" . $xd_lbp['value'] . ")";
|
|
$patologis[] = $hasil;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"]);
|
|
$hasil = $this->translate_word($xd["label"], $langid);
|
|
if ($xd["value"] != '')
|
|
$hasil = $this->translate_word($xd["label"], $langid) . " : " . $this->translate_word($xd["value"], $langid);
|
|
$patologis[] = $hasil;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
$string_hasil_fisiologis = count($fisiologis) > 0 ? join(", ", $fisiologis) : "Normal";
|
|
$string_hasil_patologis = count($patologis) > 0 ? join(", ", $patologis) : "Normal";
|
|
|
|
$ret_array['Refleks_Fisiologis'] = $string_hasil_fisiologis;
|
|
if ($is_lbp_based_patologis) {
|
|
$ret_array['LBP'] = $string_hasil_patologis;
|
|
} else {
|
|
$ret_array['Refleks_Pathologis'] = $string_hasil_patologis;
|
|
}
|
|
}
|
|
|
|
|
|
return count($ret_array) > 0 ? $ret_array : "Err";
|
|
}
|
|
|
|
function romberg($id, $langid = 1)
|
|
{
|
|
$return_data = "Err";
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND
|
|
FisikTemplateTitle = 'SISTEM PERSYARAFAN'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
|
|
|
|
if (count($rows) > 0 ) {
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
$fisiologis = array();
|
|
$patologis = array();
|
|
|
|
if ($d["title"] == "SISTEM PERSYARAFAN") {
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp['name'] == 'Keseimbangan & Koordinasi (Romberg)' || $gp['name'] == 'Keseimbangan & Koordinasi') {
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1 && $xd["label"] != 'Lain-lain') {
|
|
$arr_result[] = array($gp["name"], $xd["label"], $xd["value"]);
|
|
$hasil = $this->translate_word($xd["label"], $langid);
|
|
if ($xd["value"] != '')
|
|
$hasil = $this->translate_word($xd["label"], $langid) . " (" . $this->translate_word($xd["value"], $langid) . ")";
|
|
$return_data = $hasil;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function genitourinaria($id, $langid = 1)
|
|
{
|
|
$return_data = "Err";
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND
|
|
FisikTemplateTitle = 'GENITOURINARIA'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
$return_data = "Err";
|
|
//$return_data = $this->db_smartone->last_query();
|
|
|
|
return $return_data;
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
$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"]);
|
|
$hasil = $this->translate_word($gp["label"], $langid);
|
|
if ($gp["value"] != '')
|
|
$hasil = $this->translate_word($gp["label"], $langid) . " : " . $this->translate_word($gp["value"], $langid);
|
|
$genitourinaria[] = $hasil;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
if (count($genitourinaria) == 0) {
|
|
return "Err";
|
|
}
|
|
|
|
$string_genitourinaria = count($genitourinaria) > 0 ? join(", ", $genitourinaria) : "Tidak diperiksa";
|
|
return $string_genitourinaria;
|
|
}
|
|
|
|
function anggota_gerak($id, $langid = 1)
|
|
{
|
|
$return_data = "";
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y'
|
|
AND FisikTemplateTitle IN ('ANGGOTA GERAK', 'PEMERIKSAAN EKSTREMITAS')
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
if (count($rows) > 0) {
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$anggota = array();
|
|
|
|
|
|
if ($d["title"] == "ANGGOTA GERAK" || $d["title"] == "PEMERIKSAAN EKSTREMITAS") {
|
|
foreach ($d["details"] as $gp) {
|
|
$segment_name = isset($gp["name"]) ? $gp["name"] : (isset($gp["label"]) ? $gp["label"] : "Ekstremitas");
|
|
$anggota[$segment_name] = array();
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1) {
|
|
$hasil = $this->translate_word($xd["label"], $langid);
|
|
if ($xd["value"] != '')
|
|
$hasil = $this->translate_word($xd["label"], $langid) . " (" . $this->translate_word($xd["value"], $langid) . ")";
|
|
$anggota[$segment_name][] = $hasil;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
$dt_return = array();
|
|
|
|
if(count($anggota) > 0) {
|
|
foreach ($anggota as $key => $value) {
|
|
$dt_return[$key] = count($value) > 0 ? join(", ", $value) : "Tidak diperiksa";
|
|
}
|
|
|
|
$return_data = "";
|
|
foreach ($dt_return as $key => $value) {
|
|
$return_data .= $key . " : " . $value . ", ";
|
|
}
|
|
$return_data = rtrim($return_data, ", ");
|
|
}
|
|
else {
|
|
$return_data = "Tidak diperiksa";
|
|
}
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
function sistem_persyarafan($id, $langid = 1)
|
|
{
|
|
$return_data = "";
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'SISTEM PERSYARAFAN'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
if (count($rows) > 0) {
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$sistem = array();
|
|
|
|
|
|
if ($d["title"] == "SISTEM PERSYARAFAN") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
|
|
if ($gp["name"] != 'Keseimbangan & Koordinasi (Romberg)' && $gp["name"] != 'Keseimbangan & Koordinasi') {
|
|
$gpname = str_replace(" ", "_", $gp["name"]);
|
|
$sistem[$gpname] = array();
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1 ) {
|
|
$hasil = $this->translate_word($xd["label"], $langid);
|
|
if ($xd["value"] != '')
|
|
$hasil = $this->translate_word($xd["label"], $langid) . " (" . $this->translate_word($xd["value"], $langid) . ")";
|
|
$sistem[$gpname][] = $hasil;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
if(count($sistem) > 0) {
|
|
foreach ($sistem as $key => $value) {
|
|
$dt_return[$key] = count($value) > 0 ? join(", ", $value) : "Tidak diperiksa";
|
|
}
|
|
$return_data = $dt_return;
|
|
}
|
|
else {
|
|
$return_data = "Tidak diperiksa";
|
|
}
|
|
|
|
return $return_data;
|
|
|
|
}
|
|
|
|
|
|
function smell_test($id, $langid = 1)
|
|
{
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND
|
|
FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'SMELL TEST'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return 'Err';
|
|
}
|
|
$rows = $qry->result_array();
|
|
$dt_return = array();
|
|
if (count($rows) > 0) {
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$smell = array();
|
|
|
|
|
|
if ($d["title"] == "SMELL TEST") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
//$smell[$gp["name"]] = array();
|
|
foreach ($gp["details"] as $xd) {
|
|
if ($xd["chx"] == 1) {
|
|
$hasil = $this->translate_word($xd["label"], $langid);
|
|
if ($xd["value"] != '')
|
|
$hasil = $this->translate_word($xd["label"], $langid) . " : " . $this->translate_word($xd["value"], $langid);
|
|
//$smell[$gp["name"]][] = $hasil;
|
|
$smell[] = $hasil;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
|
|
if(count($smell) > 0) {
|
|
$string_smell = count($smell) > 0 ? join(", ", $smell) : "Tidak diperiksa";
|
|
$dt_return = $string_smell;
|
|
}
|
|
|
|
|
|
}
|
|
return count($dt_return) > 0 ? $dt_return : "Err";
|
|
}
|
|
|
|
function rectum_urogenital($id, $langid = 1)
|
|
{
|
|
$return_data = "Err";
|
|
|
|
$table_fisik_umum = "so_resultentry_fisik_umum";
|
|
if ($langid == 2) {
|
|
$table_fisik_umum = "so_resultentry_fisik_umum_eng";
|
|
}
|
|
|
|
$sql = "SELECT *
|
|
FROM {$table_fisik_umum}
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y'
|
|
AND FisikTemplateTitle = 'PEMERIKSAAN RECTUM DAN UROGENITAL'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
$row_result = $rows[0];
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$leher = array();
|
|
|
|
|
|
if ($d["title"] == "PEMERIKSAAN RECTUM DAN UROGENITAL") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
if ($gp["chx"] == 1) {
|
|
$arr_result[] = array($gp["label"], $gp["value"]);
|
|
$hasil = $this->translate_word($gp["label"], $langid);
|
|
if ($gp["value"] != '')
|
|
$hasil = $this->translate_word($gp["label"], $langid) . " : " . $this->translate_word($gp["value"], $langid);
|
|
$leher[] = $hasil;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
$string_leher = count($leher) > 0 ? join(", ", $leher) : "Normal";
|
|
$return_data = $string_leher;
|
|
|
|
return $return_data;
|
|
}
|
|
|
|
|
|
|
|
function saran($id, $langid)
|
|
{
|
|
$sql = "select * from so_resultentry_fisik_umum
|
|
where So_ResultEntryFisikUmumSo_ResultEntryID= ?
|
|
and So_ResultEntryFisikUmumM_LangID=?
|
|
and So_ResultEntryFisikUmumType='saran'";
|
|
$qry = $this->db_smartone->query($sql, array($id, $langid));
|
|
$saran = "Err";
|
|
if ($qry) {
|
|
$rows = $qry->result_array();
|
|
if (count($rows) > 0) {
|
|
$saran = $this->translate_word($rows[0]["So_ResultEntryFisikUmumDetails"], $langid);
|
|
}
|
|
}
|
|
|
|
return trim((string)$saran) === '' ? "Err" : $saran;
|
|
}
|
|
|
|
function konsul($id, $langid)
|
|
{
|
|
$sql = "select * from so_resultentry_fisik_umum
|
|
where So_ResultEntryFisikUmumSo_ResultEntryID= ?
|
|
and So_ResultEntryFisikUmumM_LangID=?
|
|
and So_ResultEntryFisikUmumType='konsul'";
|
|
$qry = $this->db_smartone->query($sql, array($id, $langid));
|
|
$konsul = "Err";
|
|
if ($qry) {
|
|
$rows = $qry->result_array();
|
|
if (count($rows) > 0) {
|
|
$konsul = $this->translate_word($rows[0]["So_ResultEntryFisikUmumDetails"], $langid);
|
|
}
|
|
}
|
|
return trim((string)$konsul) === '' ? "Err" : $konsul;
|
|
}
|
|
|
|
//k3
|
|
function faktor_fisik($id, $langid = 1)
|
|
{
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID
|
|
AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'FAKTOR FISIK'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array ($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
$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 ) {
|
|
if ($gp["chx"] == 1) {
|
|
$faktor_fisik[] = $this->translate_word($gp["label"], $langid);
|
|
}
|
|
// }
|
|
}
|
|
|
|
}
|
|
|
|
|
|
$return_data = "";
|
|
if (count($faktor_fisik) > 0) {
|
|
foreach ($faktor_fisik as $key => $value) {
|
|
$return_data .= $value . ", ";
|
|
}
|
|
$return_data = rtrim($return_data, ", ");
|
|
}
|
|
else {
|
|
$return_data = "Tidak ada";
|
|
}
|
|
return $return_data;
|
|
}
|
|
|
|
function faktor_kimia($id, $langid = 1)
|
|
{
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'FAKTOR KIMIA'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
$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 ) {
|
|
if ($gp["chx"] == 1) {
|
|
$faktor_kimia[] = $this->translate_word($gp["label"], $langid);
|
|
}
|
|
// }
|
|
}
|
|
|
|
}
|
|
|
|
$return_data = "";
|
|
if (count($faktor_kimia) > 0) {
|
|
foreach ($faktor_kimia as $key => $value) {
|
|
$return_data .= $value . ", ";
|
|
}
|
|
$return_data = rtrim($return_data, ", ");
|
|
}
|
|
else {
|
|
$return_data = "Tidak ada";
|
|
}
|
|
return $return_data;
|
|
}
|
|
|
|
function faktor_biologi($id, $langid = 1)
|
|
{
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'FAKTOR BIOLOGI'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
$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 ) {
|
|
if ($gp["chx"] == 1) {
|
|
$faktor_biologi[] = $this->translate_word($gp["label"], $langid);
|
|
}
|
|
// }
|
|
}
|
|
|
|
}
|
|
|
|
$return_data = "";
|
|
if (count($faktor_biologi) > 0) {
|
|
foreach ($faktor_biologi as $key => $value) {
|
|
$return_data .= $value . ", ";
|
|
}
|
|
$return_data = rtrim($return_data, ", ");
|
|
}
|
|
else {
|
|
$return_data = "Tidak ada";
|
|
}
|
|
return $return_data;
|
|
}
|
|
|
|
function faktor_ergonomi($id, $langid = 1)
|
|
{
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'FAKTOR ERGONOMI'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
$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 ) {
|
|
if ($gp["chx"] == 1) {
|
|
|
|
$faktor_ergonomi[] = $this->translate_word($gp["label"], $langid);
|
|
}
|
|
// }
|
|
}
|
|
|
|
}
|
|
|
|
$return_data = "";
|
|
if (count($faktor_ergonomi) > 0) {
|
|
foreach ($faktor_ergonomi as $key => $value) {
|
|
$return_data .= $value . ", ";
|
|
}
|
|
$return_data = rtrim($return_data, ", ");
|
|
}
|
|
else {
|
|
$return_data = "Tidak ada";
|
|
}
|
|
return $return_data;
|
|
}
|
|
function faktor_psikologi($id, $langid = 1)
|
|
{
|
|
$sql = "SELECT *
|
|
FROM so_resultentry_fisik_umum
|
|
JOIN fisik_template ON So_ResultEntryFisikUmumFisikTemplateID = FisikTemplateID AND FisikTemplateIsActive = 'Y' AND FisikTemplateTitle = 'FAKTOR PSIKOLOGI'
|
|
WHERE
|
|
So_ResultEntryFisikUmumT_OrderHeaderID = ? AND So_ResultEntryFisikUmumIsActive = 'Y'";
|
|
$qry = $this->db_smartone->query($sql, array($id));
|
|
if (!$qry) {
|
|
return "Err";
|
|
}
|
|
$rows = $qry->result_array();
|
|
if (count($rows) == 0) {
|
|
return "Err";
|
|
}
|
|
$d = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
|
|
//keluhan saat ini
|
|
$faktor_psikologi = array();
|
|
|
|
|
|
if ($d["title"] == "FAKTOR PSIKOLOGI") {
|
|
|
|
foreach ($d["details"] as $gp) {
|
|
|
|
if ($gp["chx"] == 1) {
|
|
$faktor_psikologi[] = $this->translate_word($gp["label"], $langid);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$return_data = "";
|
|
if (count($faktor_psikologi) > 0) {
|
|
foreach ($faktor_psikologi as $key => $value) {
|
|
$return_data .= $value . ", ";
|
|
}
|
|
$return_data = rtrim($return_data, ", ");
|
|
}
|
|
else {
|
|
$return_data = "Tidak ada";
|
|
}
|
|
return $return_data;
|
|
}
|
|
|
|
/**
|
|
* Simpan semua hasil pemeriksaan fisik ke tabel result_fisik_umum.
|
|
*
|
|
* Logika penyimpanan:
|
|
* - Jika hasil fungsi berupa string / scalar → 1 row, ResultFisikUmumLabel = nama fungsi
|
|
* - Jika hasil berupa array of {label, value} (misal keadaan_umum) → tiap item jadi 1 row,
|
|
* ResultFisikUmumLabel = item['label']
|
|
* - Jika hasil berupa associative array (misal status_gizi, pengukuran, reflek, sistem_persyarafan)
|
|
* → tiap key jadi 1 row, ResultFisikUmumLabel = key
|
|
*
|
|
* @param int $orderHeaderId T_OrderHeaderID
|
|
* @param int $langid 1 = Indonesia, 2 = Inggris
|
|
* @return array ['success', 'orderHeaderId', 'rows_saved']
|
|
*/
|
|
function save_result_fisik_umum($orderHeaderId, $langid = 1)
|
|
{
|
|
/**
|
|
* Peta field:
|
|
* 'call' → cara memanggil: default | default3 | id_only | visus | tekanan_darah
|
|
* 'result_type' → bentuk hasil yang DIHARAPKAN dari fungsi:
|
|
* string → nilai tunggal, 1 row, label = nama field
|
|
* assoc → associative array, tiap key jadi 1 row
|
|
* label_value → array of {label, value}, tiap item jadi 1 row
|
|
*/
|
|
$field_map = [
|
|
// --- Anamnesis ---
|
|
'keluhan_saat_ini' => ['method' => 'keluhan_saat_ini', 'call' => 'default', 'result_type' => 'string'],
|
|
'riwayat_phobia' => ['method' => 'riwayat_phobia', 'call' => 'default', 'result_type' => 'string'],
|
|
'bodyfatmonitoring' => ['method' => 'bodyfatmonitoring', 'call' => 'default3', 'result_type' => 'string'],
|
|
'riwayat_penyakit' => ['method' => 'riwayat_penyakit', 'call' => 'default', 'result_type' => 'string'],
|
|
'alergi' => ['method' => 'alergi', 'call' => 'default', 'result_type' => 'string'],
|
|
'riwayat_penyakit_keluarga' => ['method' => 'riwayat_keluarga', 'call' => 'default', 'result_type' => 'assoc'],
|
|
'merokok' => ['method' => 'merokok', 'call' => 'default', 'result_type' => 'string'],
|
|
'alkohol' => ['method' => 'alkohol', 'call' => 'default', 'result_type' => 'string'],
|
|
'olahraga' => ['method' => 'olahraga', 'call' => 'default', 'result_type' => 'string'],
|
|
'riwayat_obat' => ['method' => 'riwayat_obat', 'call' => 'default', 'result_type' => 'string'],
|
|
'riwayat_imunisasi' => ['method' => 'riwayat_imunisasi', 'call' => 'default', 'result_type' => 'string'],
|
|
// --- Tanda Vital ---
|
|
'tekanan_darah' => ['method' => 'tekanan_darah', 'call' => 'tekanan_darah', 'result_type' => 'assoc'],
|
|
'laju_pernafasan' => ['method' => 'laju_pernafasan', 'call' => 'default', 'result_type' => 'string'],
|
|
'denyut_nadi' => ['method' => 'denyut_nadi', 'call' => 'default', 'result_type' => 'string'],
|
|
'suhu' => ['method' => 'suhu', 'call' => 'default', 'result_type' => 'string'],
|
|
'ritme_denyut_nadi' => ['method' => 'ritme_denyut_nadi', 'call' => 'default', 'result_type' => 'string'],
|
|
'pola_nafas' => ['method' => 'pola_nafas', 'call' => 'default', 'result_type' => 'string'],
|
|
// --- Status Gizi (object: TB, BB, BodyFat, BMI, Standart) ---
|
|
'status_gizi' => ['method' => 'status_gizi', 'call' => 'default3', 'result_type' => 'assoc'],
|
|
// --- Pemeriksaan Fisik ---
|
|
'lapang_pandang' => ['method' => 'lapang_pandang', 'call' => 'default', 'result_type' => 'string'],
|
|
'keadaan_umum' => ['method' => 'keadaan_umum', 'call' => 'default', 'result_type' => 'label_value'],
|
|
'kepala_wajah' => ['method' => 'kepala_wajah', 'call' => 'default3', 'result_type' => 'string'],
|
|
'persepsi_warna' => ['method' => 'persepsi_warna', 'call' => 'default', 'result_type' => 'string'],
|
|
'doctor' => ['method' => 'doctor', 'call' => 'id_only', 'result_type' => 'string'],
|
|
'konjuktiva_sklera' => ['method' => 'konjuktiva_sklera', 'call' => 'id_only', 'result_type' => 'string'],
|
|
'telinga' => ['method' => 'telinga', 'call' => 'default', 'result_type' => 'string'],
|
|
'visus_left' => ['method' => 'visus', 'call' => 'visus', 'result_type' => 'string', 'side' => 'left'],
|
|
'visus_right' => ['method' => 'visus', 'call' => 'visus', 'result_type' => 'string', 'side' => 'right'],
|
|
'hidung' => ['method' => 'hidung', 'call' => 'default', 'result_type' => 'string'],
|
|
'leher' => ['method' => 'leher', 'call' => 'default', 'result_type' => 'string'],
|
|
'thorax' => ['method' => 'thorax', 'call' => 'default', 'result_type' => 'string'],
|
|
'mulut' => ['method' => 'mulut', 'call' => 'default', 'result_type' => 'string'],
|
|
'tenggorokan' => ['method' => 'tenggorokan', 'call' => 'default', 'result_type' => 'string'],
|
|
'paru' => ['method' => 'paru', 'call' => 'default', 'result_type' => 'string'],
|
|
'jantung' => ['method' => 'jantung', 'call' => 'default', 'result_type' => 'string'],
|
|
'anogenital' => ['method' => 'anogenital', 'call' => 'default', 'result_type' => 'string'],
|
|
// --- Pengukuran (object: lingkar_perut, lingkar_pinggang) ---
|
|
'pengukuran' => ['method' => 'pengukuran', 'call' => 'default', 'result_type' => 'assoc'],
|
|
'tonometri' => ['method' => 'tonometri', 'call' => 'default', 'result_type' => 'string'],
|
|
'perut' => ['method' => 'perut', 'call' => 'default', 'result_type' => 'string'],
|
|
'ginjal' => ['method' => 'ginjal', 'call' => 'default', 'result_type' => 'string'],
|
|
'hernia' => ['method' => 'hernia', 'call' => 'default', 'result_type' => 'string'],
|
|
'kulit' => ['method' => 'kulit', 'call' => 'default', 'result_type' => 'string'],
|
|
// --- Reflek (object: Refleks_Fisiologis, Refleks_Pathologis) ---
|
|
'reflek' => ['method' => 'reflek', 'call' => 'default', 'result_type' => 'assoc'],
|
|
'romberg' => ['method' => 'romberg', 'call' => 'id_only', 'result_type' => 'string'],
|
|
'genitourinaria' => ['method' => 'genitourinaria', 'call' => 'default', 'result_type' => 'string'],
|
|
'anggota_gerak' => ['method' => 'anggota_gerak', 'call' => 'default', 'result_type' => 'string'],
|
|
// --- Sistem Persyarafan (object: Refleks_Fisiologis, Refleks_Pathologis, Refleks_Neurologis_Lainnya) ---
|
|
'sistem_persyarafan' => ['method' => 'sistem_persyarafan', 'call' => 'default', 'result_type' => 'assoc'],
|
|
'smell_test' => ['method' => 'smell_test', 'call' => 'default', 'result_type' => 'string'],
|
|
'rectum_urogenital' => ['method' => 'rectum_urogenital', 'call' => 'default', 'result_type' => 'string'],
|
|
// --- Faktor Risiko ---
|
|
'faktor_fisik' => ['method' => 'faktor_fisik', 'call' => 'default', 'result_type' => 'string'],
|
|
'faktor_kimia' => ['method' => 'faktor_kimia', 'call' => 'default', 'result_type' => 'string'],
|
|
'faktor_biologi' => ['method' => 'faktor_biologi', 'call' => 'default', 'result_type' => 'string'],
|
|
'faktor_ergonomi' => ['method' => 'faktor_ergonomi', 'call' => 'default', 'result_type' => 'string'],
|
|
'faktor_psikologi' => ['method' => 'faktor_psikologi', 'call' => 'default', 'result_type' => 'string'],
|
|
];
|
|
|
|
$riwayat_keys = [
|
|
'keluhan_saat_ini',
|
|
'riwayat_phobia',
|
|
'bodyfatmonitoring',
|
|
'riwayat_penyakit',
|
|
'alergi',
|
|
'riwayat_penyakit_keluarga',
|
|
'merokok',
|
|
'alkohol',
|
|
'olahraga',
|
|
'riwayat_obat',
|
|
'riwayat_imunisasi',
|
|
];
|
|
$k3_keys = [
|
|
'faktor_fisik',
|
|
'faktor_kimia',
|
|
'faktor_biologi',
|
|
'faktor_ergonomi',
|
|
'faktor_psikologi',
|
|
];
|
|
foreach ($field_map as $field_key => &$config) {
|
|
if (in_array($field_key, $riwayat_keys, true)) {
|
|
$config['template_type'] = 'Riwayat';
|
|
}
|
|
else if (in_array($field_key, $k3_keys, true)) {
|
|
$config['template_type'] = 'K3';
|
|
}
|
|
else {
|
|
$config['template_type'] = 'Fisik';
|
|
}
|
|
}
|
|
unset($config);
|
|
|
|
$rows_to_insert = [];
|
|
$now = date('Y-m-d H:i:s');
|
|
|
|
$order_header_row = $this->db_smartone->select('T_OrderHeaderDate')
|
|
->where('T_OrderHeaderID', $orderHeaderId)
|
|
->get('t_orderheader')
|
|
->row();
|
|
$order_header_date = $order_header_row ? $order_header_row->T_OrderHeaderDate : null;
|
|
|
|
foreach ($field_map as $label_key => $config) {
|
|
$method = $config['method'];
|
|
|
|
if (!method_exists($this, $method)) {
|
|
continue;
|
|
}
|
|
|
|
try {
|
|
switch ($config['call']) {
|
|
case 'id_only':
|
|
$result = $this->{$method}($orderHeaderId);
|
|
break;
|
|
case 'visus':
|
|
$result = $this->visus($orderHeaderId, $config['side'], $langid);
|
|
break;
|
|
case 'default3':
|
|
$result = $this->{$method}($orderHeaderId, $langid, 'fisik');
|
|
break;
|
|
case 'tekanan_darah':
|
|
$result = $this->tekanan_darah($orderHeaderId, '', $langid);
|
|
break;
|
|
default:
|
|
$result = $this->{$method}($orderHeaderId, $langid);
|
|
break;
|
|
}
|
|
} catch (Throwable $e) {
|
|
continue;
|
|
}
|
|
|
|
// Simpan berdasarkan result_type yang sudah ditentukan eksplisit di field_map
|
|
$result_type = $config['result_type'];
|
|
|
|
// Jika fungsi mengembalikan error / string saat diharapkan object, fallback ke string
|
|
if (!is_array($result)) {
|
|
$result_type = 'string';
|
|
}
|
|
|
|
switch ($result_type) {
|
|
|
|
case 'label_value':
|
|
// Array of [{label => '...', value => '...'}, ...] → misal: keadaan_umum
|
|
foreach ($result as $item) {
|
|
if (!isset($item['label'])) continue;
|
|
$rows_to_insert[] = [
|
|
'ResultFisikUmumType' => $config['template_type'],
|
|
'ResultFisikUmumLabel' => $item['label'],
|
|
'ResultFisikUmumT_OrderHeaderID' => $orderHeaderId,
|
|
'ResultFisikUmumT_OrderHeaderDate' => $order_header_date,
|
|
'ResultFisikUmumValue' => (string)($item['value'] ?? ''),
|
|
'ResultFisikUmumIsActive' => 'Y',
|
|
'ResultFisikUmumCreated' => $now,
|
|
];
|
|
}
|
|
break;
|
|
|
|
case 'assoc':
|
|
// Associative array → tiap key jadi 1 row
|
|
// misal: status_gizi, pengukuran, reflek, sistem_persyarafan, riwayat_penyakit_keluarga
|
|
foreach ($result as $key => $val) {
|
|
$save_val = is_array($val) ? json_encode($val, JSON_UNESCAPED_UNICODE) : (string)$val;
|
|
$rows_to_insert[] = [
|
|
'ResultFisikUmumType' => $config['template_type'],
|
|
'ResultFisikUmumLabel' => (string)$key,
|
|
'ResultFisikUmumT_OrderHeaderID' => $orderHeaderId,
|
|
'ResultFisikUmumT_OrderHeaderDate' => $order_header_date,
|
|
'ResultFisikUmumValue' => $save_val,
|
|
'ResultFisikUmumIsActive' => 'Y',
|
|
'ResultFisikUmumCreated' => $now,
|
|
];
|
|
}
|
|
break;
|
|
|
|
default: // string
|
|
$save_val = is_array($result) ? json_encode($result, JSON_UNESCAPED_UNICODE) : (string)$result;
|
|
$rows_to_insert[] = [
|
|
'ResultFisikUmumType' => $config['template_type'],
|
|
'ResultFisikUmumLabel' => $label_key,
|
|
'ResultFisikUmumT_OrderHeaderID' => $orderHeaderId,
|
|
'ResultFisikUmumT_OrderHeaderDate' => $order_header_date,
|
|
'ResultFisikUmumValue' => $save_val,
|
|
'ResultFisikUmumIsActive' => 'Y',
|
|
'ResultFisikUmumCreated' => $now,
|
|
];
|
|
break;
|
|
}
|
|
}
|
|
|
|
// Non-aktifkan data lama yang masih aktif untuk orderHeaderId ini
|
|
$this->db_smartone->where('ResultFisikUmumT_OrderHeaderID', $orderHeaderId);
|
|
$this->db_smartone->where('ResultFisikUmumIsActive', 'Y');
|
|
$this->db_smartone->update('result_fisik_umum', ['ResultFisikUmumIsActive' => 'N']);
|
|
|
|
if (!empty($rows_to_insert)) {
|
|
$this->db_smartone->insert_batch('result_fisik_umum', $rows_to_insert);
|
|
}
|
|
|
|
return [
|
|
'success' => true,
|
|
'orderHeaderId' => $orderHeaderId,
|
|
'rows_saved' => count($rows_to_insert),
|
|
];
|
|
}
|
|
|
|
function translate_result_fisik_umum_eng_labels_only($data, $langid = 2)
|
|
{
|
|
if (!is_array($data)) {
|
|
return $data;
|
|
}
|
|
|
|
$label_keys = [
|
|
'title',
|
|
'subtitle',
|
|
'name',
|
|
'label',
|
|
'label_x',
|
|
'label_y',
|
|
'label_flag_normal',
|
|
'label_notexist',
|
|
];
|
|
|
|
foreach ($data as $key => $value) {
|
|
if (is_array($value)) {
|
|
$data[$key] = $this->translate_result_fisik_umum_eng_labels_only($value, $langid);
|
|
continue;
|
|
}
|
|
|
|
if (in_array((string)$key, $label_keys, true)) {
|
|
$data[$key] = $this->translate_word($value, $langid);
|
|
}
|
|
}
|
|
|
|
return $data;
|
|
}
|
|
|
|
function save_result_fisik_umum_eng($orderHeaderId, $langid = 2)
|
|
{
|
|
$field_map = [
|
|
'keluhan_saat_ini' => ['method' => 'keluhan_saat_ini', 'call' => 'default', 'result_type' => 'string'],
|
|
'riwayat_phobia' => ['method' => 'riwayat_phobia', 'call' => 'default', 'result_type' => 'string'],
|
|
'bodyfatmonitoring' => ['method' => 'bodyfatmonitoring', 'call' => 'default3', 'result_type' => 'string'],
|
|
'riwayat_penyakit' => ['method' => 'riwayat_penyakit', 'call' => 'default', 'result_type' => 'string'],
|
|
'alergi' => ['method' => 'alergi', 'call' => 'default', 'result_type' => 'string'],
|
|
'riwayat_penyakit_keluarga' => ['method' => 'riwayat_keluarga', 'call' => 'default', 'result_type' => 'assoc'],
|
|
'merokok' => ['method' => 'merokok', 'call' => 'default', 'result_type' => 'string'],
|
|
'alkohol' => ['method' => 'alkohol', 'call' => 'default', 'result_type' => 'string'],
|
|
'olahraga' => ['method' => 'olahraga', 'call' => 'default', 'result_type' => 'string'],
|
|
'riwayat_obat' => ['method' => 'riwayat_obat', 'call' => 'default', 'result_type' => 'string'],
|
|
'riwayat_imunisasi' => ['method' => 'riwayat_imunisasi', 'call' => 'default', 'result_type' => 'string'],
|
|
'tekanan_darah' => ['method' => 'tekanan_darah', 'call' => 'tekanan_darah', 'result_type' => 'assoc'],
|
|
'laju_pernafasan' => ['method' => 'laju_pernafasan', 'call' => 'default', 'result_type' => 'string'],
|
|
'denyut_nadi' => ['method' => 'denyut_nadi', 'call' => 'default', 'result_type' => 'string'],
|
|
'suhu' => ['method' => 'suhu', 'call' => 'default', 'result_type' => 'string'],
|
|
'ritme_denyut_nadi' => ['method' => 'ritme_denyut_nadi', 'call' => 'default', 'result_type' => 'string'],
|
|
'pola_nafas' => ['method' => 'pola_nafas', 'call' => 'default', 'result_type' => 'string'],
|
|
'status_gizi' => ['method' => 'status_gizi', 'call' => 'default3', 'result_type' => 'assoc'],
|
|
'lapang_pandang' => ['method' => 'lapang_pandang', 'call' => 'default', 'result_type' => 'string'],
|
|
'keadaan_umum' => ['method' => 'keadaan_umum', 'call' => 'default', 'result_type' => 'label_value'],
|
|
'kepala_wajah' => ['method' => 'kepala_wajah', 'call' => 'default3', 'result_type' => 'string'],
|
|
'persepsi_warna' => ['method' => 'persepsi_warna', 'call' => 'default', 'result_type' => 'string'],
|
|
'doctor' => ['method' => 'doctor', 'call' => 'id_only', 'result_type' => 'string'],
|
|
'konjuktiva_sklera' => ['method' => 'konjuktiva_sklera', 'call' => 'id_only', 'result_type' => 'string'],
|
|
'telinga' => ['method' => 'telinga', 'call' => 'default', 'result_type' => 'string'],
|
|
'visus_left' => ['method' => 'visus', 'call' => 'visus', 'result_type' => 'string', 'side' => 'left'],
|
|
'visus_right' => ['method' => 'visus', 'call' => 'visus', 'result_type' => 'string', 'side' => 'right'],
|
|
'hidung' => ['method' => 'hidung', 'call' => 'default', 'result_type' => 'string'],
|
|
'leher' => ['method' => 'leher', 'call' => 'default', 'result_type' => 'string'],
|
|
'thorax' => ['method' => 'thorax', 'call' => 'default', 'result_type' => 'string'],
|
|
'mulut' => ['method' => 'mulut', 'call' => 'default', 'result_type' => 'string'],
|
|
'tenggorokan' => ['method' => 'tenggorokan', 'call' => 'default', 'result_type' => 'string'],
|
|
'paru' => ['method' => 'paru', 'call' => 'default', 'result_type' => 'string'],
|
|
'jantung' => ['method' => 'jantung', 'call' => 'default', 'result_type' => 'string'],
|
|
'anogenital' => ['method' => 'anogenital', 'call' => 'default', 'result_type' => 'string'],
|
|
'pengukuran' => ['method' => 'pengukuran', 'call' => 'default', 'result_type' => 'assoc'],
|
|
'tonometri' => ['method' => 'tonometri', 'call' => 'default', 'result_type' => 'string'],
|
|
'perut' => ['method' => 'perut', 'call' => 'default', 'result_type' => 'string'],
|
|
'ginjal' => ['method' => 'ginjal', 'call' => 'default', 'result_type' => 'string'],
|
|
'hernia' => ['method' => 'hernia', 'call' => 'default', 'result_type' => 'string'],
|
|
'kulit' => ['method' => 'kulit', 'call' => 'default', 'result_type' => 'string'],
|
|
'reflek' => ['method' => 'reflek', 'call' => 'default', 'result_type' => 'assoc'],
|
|
'romberg' => ['method' => 'romberg', 'call' => 'id_only', 'result_type' => 'string'],
|
|
'genitourinaria' => ['method' => 'genitourinaria', 'call' => 'default', 'result_type' => 'string'],
|
|
'anggota_gerak' => ['method' => 'anggota_gerak', 'call' => 'default', 'result_type' => 'string'],
|
|
'sistem_persyarafan' => ['method' => 'sistem_persyarafan', 'call' => 'default', 'result_type' => 'assoc'],
|
|
'smell_test' => ['method' => 'smell_test', 'call' => 'default', 'result_type' => 'string'],
|
|
'rectum_urogenital' => ['method' => 'rectum_urogenital', 'call' => 'default', 'result_type' => 'string'],
|
|
'faktor_fisik' => ['method' => 'faktor_fisik', 'call' => 'default', 'result_type' => 'string'],
|
|
'faktor_kimia' => ['method' => 'faktor_kimia', 'call' => 'default', 'result_type' => 'string'],
|
|
'faktor_biologi' => ['method' => 'faktor_biologi', 'call' => 'default', 'result_type' => 'string'],
|
|
'faktor_ergonomi' => ['method' => 'faktor_ergonomi', 'call' => 'default', 'result_type' => 'string'],
|
|
'faktor_psikologi' => ['method' => 'faktor_psikologi', 'call' => 'default', 'result_type' => 'string'],
|
|
];
|
|
|
|
$riwayat_keys = [
|
|
'keluhan_saat_ini',
|
|
'riwayat_phobia',
|
|
'bodyfatmonitoring',
|
|
'riwayat_penyakit',
|
|
'alergi',
|
|
'riwayat_penyakit_keluarga',
|
|
'merokok',
|
|
'alkohol',
|
|
'olahraga',
|
|
'riwayat_obat',
|
|
'riwayat_imunisasi',
|
|
];
|
|
$k3_keys = [
|
|
'faktor_fisik',
|
|
'faktor_kimia',
|
|
'faktor_biologi',
|
|
'faktor_ergonomi',
|
|
'faktor_psikologi',
|
|
];
|
|
foreach ($field_map as $field_key => &$config) {
|
|
if (in_array($field_key, $riwayat_keys, true)) {
|
|
$config['template_type'] = 'Riwayat';
|
|
}
|
|
else if (in_array($field_key, $k3_keys, true)) {
|
|
$config['template_type'] = 'K3';
|
|
}
|
|
else {
|
|
$config['template_type'] = 'Fisik';
|
|
}
|
|
}
|
|
unset($config);
|
|
|
|
$rows_to_insert = [];
|
|
$now = date('Y-m-d H:i:s');
|
|
|
|
$order_header_row = $this->db_smartone->select('T_OrderHeaderDate')
|
|
->where('T_OrderHeaderID', $orderHeaderId)
|
|
->get('t_orderheader')
|
|
->row();
|
|
$order_header_date = $order_header_row ? $order_header_row->T_OrderHeaderDate : null;
|
|
|
|
foreach ($field_map as $label_key => $config) {
|
|
$method = $config['method'];
|
|
|
|
if (!method_exists($this, $method)) {
|
|
continue;
|
|
}
|
|
|
|
try {
|
|
switch ($config['call']) {
|
|
case 'id_only':
|
|
$result = $this->{$method}($orderHeaderId);
|
|
break;
|
|
case 'visus':
|
|
$result = $this->visus($orderHeaderId, $config['side'], 1);
|
|
break;
|
|
case 'default3':
|
|
$result = $this->{$method}($orderHeaderId, 1, 'fisik');
|
|
break;
|
|
case 'tekanan_darah':
|
|
$result = $this->tekanan_darah($orderHeaderId, '', 1);
|
|
break;
|
|
default:
|
|
$result = $this->{$method}($orderHeaderId, 1);
|
|
break;
|
|
}
|
|
} catch (Throwable $e) {
|
|
continue;
|
|
}
|
|
|
|
$result_type = $config['result_type'];
|
|
if (!is_array($result)) {
|
|
$result_type = 'string';
|
|
}
|
|
|
|
switch ($result_type) {
|
|
case 'label_value':
|
|
foreach ($result as $item) {
|
|
if (!isset($item['label'])) continue;
|
|
$rows_to_insert[] = [
|
|
'ResultFisikUmumEngType' => $config['template_type'],
|
|
'ResultFisikUmumEngLabel' => $this->translate_word($item['label'], $langid),
|
|
'ResultFisikUmumEngT_OrderHeaderID' => $orderHeaderId,
|
|
'ResultFisikUmumEngT_OrderHeaderDate' => $order_header_date,
|
|
'ResultFisikUmumEngValue' => (string)($item['value'] ?? ''),
|
|
'ResultFisikUmumEngIsActive' => 'Y',
|
|
'ResultFisikUmumEngCreated' => $now,
|
|
];
|
|
}
|
|
break;
|
|
|
|
case 'assoc':
|
|
foreach ($result as $key => $val) {
|
|
$save_val = $val;
|
|
if (is_array($val)) {
|
|
$save_val = json_encode(
|
|
$this->translate_result_fisik_umum_eng_labels_only($val, $langid),
|
|
JSON_UNESCAPED_UNICODE
|
|
);
|
|
}
|
|
$rows_to_insert[] = [
|
|
'ResultFisikUmumEngType' => $config['template_type'],
|
|
'ResultFisikUmumEngLabel' => (string)$key,
|
|
'ResultFisikUmumEngT_OrderHeaderID' => $orderHeaderId,
|
|
'ResultFisikUmumEngT_OrderHeaderDate' => $order_header_date,
|
|
'ResultFisikUmumEngValue' => (string)$save_val,
|
|
'ResultFisikUmumEngIsActive' => 'Y',
|
|
'ResultFisikUmumEngCreated' => $now,
|
|
];
|
|
}
|
|
break;
|
|
|
|
default:
|
|
$save_val = is_array($result)
|
|
? json_encode($this->translate_result_fisik_umum_eng_labels_only($result, $langid), JSON_UNESCAPED_UNICODE)
|
|
: (string)$result;
|
|
$rows_to_insert[] = [
|
|
'ResultFisikUmumEngType' => $config['template_type'],
|
|
'ResultFisikUmumEngLabel' => $label_key,
|
|
'ResultFisikUmumEngT_OrderHeaderID' => $orderHeaderId,
|
|
'ResultFisikUmumEngT_OrderHeaderDate' => $order_header_date,
|
|
'ResultFisikUmumEngValue' => $save_val,
|
|
'ResultFisikUmumEngIsActive' => 'Y',
|
|
'ResultFisikUmumEngCreated' => $now,
|
|
];
|
|
break;
|
|
}
|
|
}
|
|
|
|
$this->db_smartone->where('ResultFisikUmumEngT_OrderHeaderID', $orderHeaderId);
|
|
$this->db_smartone->where('ResultFisikUmumEngIsActive', 'Y');
|
|
$this->db_smartone->update('result_fisik_umum_eng', ['ResultFisikUmumEngIsActive' => 'N']);
|
|
|
|
if (!empty($rows_to_insert)) {
|
|
$this->db_smartone->insert_batch('result_fisik_umum_eng', $rows_to_insert);
|
|
}
|
|
|
|
return [
|
|
'success' => true,
|
|
'orderHeaderId' => $orderHeaderId,
|
|
'rows_saved' => count($rows_to_insert),
|
|
];
|
|
}
|
|
|
|
function update_unvalidated($t_order_header_id){
|
|
$errors = [
|
|
'success' => false,
|
|
'orderHeaderId' => $t_order_header_id,
|
|
'message' => 'Error update unvalidated fisik umum genresultfisik',
|
|
];
|
|
try {
|
|
$this->db_smartone->where('ResultFisikUmumT_OrderHeaderID', $t_order_header_id);
|
|
$this->db_smartone->where('ResultFisikUmumIsActive', 'Y');
|
|
$this->db_smartone->update('result_fisik_umum', ['ResultFisikUmumIsActive' => 'N']);
|
|
$this->db_smartone->update('result_fisik_umum', ['ResultFisikUmumLastUpdated' => date('Y-m-d H:i:s')]);
|
|
|
|
//echo $this->db_smartone->last_query();
|
|
$errors['success'] = true;
|
|
$errors['message'] = 'Data unvalidated fisik umum genresultfisik updated successfully';
|
|
return $errors;
|
|
} catch (Throwable $e) {
|
|
$errors['message'] = $e->getMessage();
|
|
return $errors;
|
|
}
|
|
}
|
|
|
|
function update_unvalidated_eng($t_order_header_id){
|
|
$errors = [
|
|
'success' => false,
|
|
'orderHeaderId' => $t_order_header_id,
|
|
'message' => 'Error update unvalidated fisik umum eng genresultfisik',
|
|
];
|
|
try {
|
|
$this->db_smartone->where('ResultFisikUmumEngT_OrderHeaderID', $t_order_header_id);
|
|
$this->db_smartone->where('ResultFisikUmumEngIsActive', 'Y');
|
|
$this->db_smartone->update('result_fisik_umum_eng', ['ResultFisikUmumEngIsActive' => 'N']);
|
|
$this->db_smartone->update('result_fisik_umum_eng', ['ResultFisikUmumEngLastUpdated' => date('Y-m-d H:i:s')]);
|
|
|
|
$errors['success'] = true;
|
|
$errors['message'] = 'Data unvalidated fisik umum eng genresultfisik updated successfully';
|
|
return $errors;
|
|
} catch (Throwable $e) {
|
|
$errors['message'] = $e->getMessage();
|
|
return $errors;
|
|
}
|
|
}
|
|
|
|
}
|
|
?>
|