Initial import

This commit is contained in:
sas.fajri
2026-04-27 10:26:26 +07:00
commit bf9b9097ee
2388 changed files with 3002242 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
<?php
class Agama extends MY_Controller
{
public function __construct() {
parent::__construct();
$this->db_smartone = $this->load->database("onedev", true);
}
function list() {
$sql = "select * from m_religion";
$qry = $this->db_smartone->query($sql);
if ($qry) {
$rows = $qry->result_array();
echo json_encode($rows);
} else {
echo json_encode(array());
}
}
function get($id) {
$sql = "select * from m_religion where M_ReligionID=?";
$qry = $this->db_smartone->query($sql,$id);
if ($qry) {
$rows = $qry->result_array();
echo json_encode($rows);
} else {
echo json_encode(array());
}
}
}
?>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,352 @@
<?php
class Fisik extends MY_Controller
{
public function __construct() {
parent::__construct();
$this->db_smartone = $this->load->database("onedev", true);
}
function pribadi($id,$langid) {
//$id = So_ResultEntryID
$sql = "select concat(M_TitleName,' ', M_PatientName) M_PatientName,
T_OrderHeaderLabNumber RegNo, fn_numbering_external(T_OrderHeaderLabNumber) ExternalRegNo,
T_OrderHeaderM_PatientAge,
date_format(M_PatientDOB,'%d-%m-%Y') M_PatientDOB ,
date_format(T_OrderHeaderDate,'%d-%m-%Y') T_OrderHeaderDate,
M_SexName,
(SELECT concat(M_PatientAddressDescription,' ',M_KelurahanName,' ' ,M_DistrictName,' ',M_CityName) from m_patientaddress AS p
left join m_kelurahan on 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_PatientAddressDescription
from so_resultentry
join t_orderheader on So_ResultEntryT_OrderHeaderID = T_OrderHeaderID
and So_ResultEntryID = ?
join m_patient on M_PatientID = T_OrderHeaderM_PatientID
join m_title on M_PatientM_TitleID = M_TitleID
left join m_sex on M_PatientM_SexID = M_SexID
";
$qry = $this->db_smartone->query($sql,array($id));
if ($qry) {
$rows = $qry->result_array();
foreach($rows as $idx => $r ) {
$rows[$idx]["keluhan_saat_ini"] = $this->keluhan_saat_ini($id,$langid);
$rows[$idx]["phobia"] = $this->phobia($id,$langid);
}
echo json_encode($rows);
} else {
echo json_encode(array());
}
}
function phobia($id,$langid) {
$sql = "select * from so_resultentry_fisik_umum
where So_ResultEntryFisikUmumSo_ResultEntryID= ?
and So_ResultEntryFisikUmumM_LangID=?
and So_ResultEntryFisikUmumType='riwayat'";
$qry = $this->db_smartone->query($sql,array($id,$langid));
if (! $qry) {
return "";
}
$rows = $qry->result_array();
if (count($rows) == 0 ) {
return "";
}
$details = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"],true);
//keluhan saat ini
$phobia = "";
foreach($details as $d) {
if ($d["title"] == "RIWAYAT POBIA") {
if ($d["flag_normal"] == "Y") {
$phobia = $d["label_flag_normal"];
break;
} else {
foreach($d["details"] as $xd) {
if ($xd["chx"] == "1" ) {
if ( $phobia != "" ) $phobia .= ", ";
$phobia .= $xd["label"];
if ($xd["value"] != "") $phobia .= " (" .$xd["value"] . ")";
}
}
}
}
}
return $phobia;
}
function keluhan_saat_ini($id,$langid) {
$sql = "select * from so_resultentry_fisik_umum
where So_ResultEntryFisikUmumSo_ResultEntryID= ?
and So_ResultEntryFisikUmumM_LangID=?
and So_ResultEntryFisikUmumType='riwayat'";
$qry = $this->db_smartone->query($sql,array($id,$langid));
if (! $qry) {
return "";
}
$rows = $qry->result_array();
if (count($rows) == 0 ) {
return "";
}
$details = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"],true);
//keluhan saat ini
$keluhan_saat_ini = "";
foreach($details as $d) {
if ($d["title"] == "KELUHAN SAAT INI") {
if ($d["flag_normal"] == "Y") {
$keluhan_saat_ini = $d["label_flag_normal"];
break;
} else {
foreach($d["details"] as $xd) {
if ($xd["chx"] == "1" ) {
if ( $keluhan_saat_ini != "" ) $keluhan_saat_ini .= ", ";
$keluhan_saat_ini .= $xd["label"];
}
}
}
}
}
return $keluhan_saat_ini;
}
function riwayat_penyakit($id,$langid) {
$sql = "select * from so_resultentry_fisik_umum
where So_ResultEntryFisikUmumSo_ResultEntryID= ?
and So_ResultEntryFisikUmumM_LangID=?
and So_ResultEntryFisikUmumType='riwayat'";
$qry = $this->db_smartone->query($sql,array($id,$langid));
if (! $qry) {
return "";
}
$rows = $qry->result_array();
if (count($rows) == 0 ) {
return "";
}
$details = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"],true);
//keluhan saat ini
$riwayat_penyakit = array();
foreach($details as $d) {
if ($d["title"] == "RIWAYAT PENYAKIT") {
if ($d["flag_normal"] == "Y") {
$riwayat_penyakit = $d["label_flag_normal"];
break;
} else {
$prev_group = "";
$chex_group = array();
$tot_baris= 0;
$arr_result = array();
foreach($d["details"] as $gp) {
$group = $gp["name"];
if ($group == "Allergi" ) continue;
$have_detail = false;
foreach($gp["details"] as $xd ) {
if ($xd["chx"] == 1 ) {
$have_detail = true;
}
}
if ($have_detail) {
$arr_result[] = array($group, "", "","") ;
foreach($gp["details"] as $xd ) {
if ($xd["chx"] == 1 ) {
$arr_result[] = array($xd["label"], "X", "",$xd["value"]) ;
}
}
}
}
$tot_baris = ceil( count($arr_result) / 2 ) ;
for($i=0; $i < $tot_baris ; $i++) {
$left = $arr_result[$i];
$right = array("","","","");
if ( isset($arr_result[$i+$tot_baris]) ) {
$right = $arr_result[$i+$tot_baris];
}
$riwayat_penyakit[] = array(
"c1" => $left[0],
"c2" => $left[1],
"c3" => $left[2],
"c4" => $left[3],
"c5" => $right[0],
"c6" => $right[1],
"c7" => $right[2],
"c8" => $right[3],
);
}
}
}
}
echo json_encode($riwayat_penyakit);
//return ($riwayat_penyakit);
}
//riwayat penyakit keluarga
function penyakit_keluarga($id,$langid) {
$sql = "select * from so_resultentry_fisik_umum
where So_ResultEntryFisikUmumSo_ResultEntryID= ?
and So_ResultEntryFisikUmumM_LangID=?
and So_ResultEntryFisikUmumType='riwayat'";
$qry = $this->db_smartone->query($sql,array($id,$langid));
if (! $qry) {
return "";
}
$rows = $qry->result_array();
if (count($rows) == 0 ) {
return "";
}
$details = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"],true);
//keluhan saat ini
$penyakit_keluarga = array();
foreach($details as $d) {
if ($d["title"] == "RIWAYAT PENYAKIT KELUARGA") {
if ($d["flag_normal"] == "Y") {
$penyakit_keluarga = $d["label_flag_normal"];
break;
} else {
$prev_group = "";
$chex_group = array();
$tot_baris= 0;
$arr_result = array();
foreach($d["details"] as $gp) {
if ($gp["chx"] == 1 ) {
$arr_result[] = array($gp["label"], "X", "",$gp["value"]) ;
}
}
$tot_baris = ceil( count($arr_result) / 2 ) ;
for($i=0; $i < $tot_baris ; $i++) {
$left = $arr_result[$i];
$right = array("","","","");
if ( isset($arr_result[$i+$tot_baris]) ) {
$right = $arr_result[$i+$tot_baris];
}
$penyakit_keluarga[] = array(
"d1" => $left[0],
"d2" => $left[1],
"d3" => $left[2],
"d4" => $left[3],
"d5" => $right[0],
"d6" => $right[1],
"d7" => $right[2],
"d8" => $right[3],
);
}
}
}
}
echo json_encode($penyakit_keluarga);
//return ($penyakit_keluarga);
}
function riwayat_alergi($id,$langid) {
$sql = "select * from so_resultentry_fisik_umum
where So_ResultEntryFisikUmumSo_ResultEntryID= ?
and So_ResultEntryFisikUmumM_LangID=?
and So_ResultEntryFisikUmumType='riwayat'";
$qry = $this->db_smartone->query($sql,array($id,$langid));
if (! $qry) {
return "";
}
$rows = $qry->result_array();
if (count($rows) == 0 ) {
return "";
}
$details = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"],true);
//keluhan saat ini
$riwayat_alergi = array();
foreach($details as $d) {
if ($d["title"] == "RIWAYAT PENYAKIT") {
if ($d["flag_normal"] == "Y") {
$riwayat_alergi = $d["label_flag_normal"];
break;
} else {
$prev_group = "";
$chex_group = array();
$tot_baris= 0;
$arr_result = array();
foreach($d["details"] as $gp) {
$group = $gp["name"];
if ($group != "Allergi" ) continue;
foreach($gp["details"] as $xd ) {
if ($xd["chx"] == 1 ) {
$arr_result = array($xd["label"], "Ya", "",$xd["value"]) ;
} else {
$arr_result = array($xd["label"], "Tidak", "X",$xd["value"]) ;
}
$riwayat_alergi[] = array(
"a1" => $arr_result[0],
"a2" => $arr_result[1],
"a3" => $arr_result[2],
"a4" => $arr_result[3],
);
}
}
}
}
}
echo json_encode($riwayat_alergi);
}
function riwayat_obat($id,$langid) {
$sql = "select * from so_resultentry_fisik_umum
where So_ResultEntryFisikUmumSo_ResultEntryID= ?
and So_ResultEntryFisikUmumM_LangID=?
and So_ResultEntryFisikUmumType='riwayat'";
$qry = $this->db_smartone->query($sql,array($id,$langid));
if (! $qry) {
return json_encode(array());
}
$rows = $qry->result_array();
if (count($rows) == 0 ) {
return json_encode(array());
}
$details = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"],true);
//keluhan saat ini
$riwayat_obat = array();
foreach($details as $d) {
if ($d["title"] == "RIWAYAT KONSUMSI OBAT TERATUR") {
if ($d["flag_normal"] == "Y") {
$riwayat_obat = $d["label_flag_normal"];
break;
} else {
foreach($d["details"] as $gp) {
if ($gp["chx"] == 1 ) {
$arr_result[] = array($gp["label"], "Ya", "Tidak",$gp["value"]) ;
$riwayat_obat[] = array(
"o1" => $gp["label"],
"o2" => "Ya",
"o3" => $gp["value"],
);
}
}
}
}
}
echo json_encode($riwayat_obat);
}
function list() {
$sql = "select * from m_religion";
$qry = $this->db_smartone->query($sql);
if ($qry) {
$rows = $qry->result_array();
echo json_encode($rows);
} else {
echo json_encode(array());
}
}
function get($id) {
$sql = "select * from m_religion where M_ReligionID=?";
$qry = $this->db_smartone->query($sql,$id);
if ($qry) {
$rows = $qry->result_array();
echo json_encode($rows);
} else {
echo json_encode(array());
}
}
}
?>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,68 @@
<?php
class Hs_payment extends MY_Controller {
function __construct() {
parent::__construct();
}
function by_id($paymentID,$userID =3) {
$sql = "select M_UserUserName from m_user where M_UserID = ?";
$qry = $this->db->query($sql,[$userID]);
if (!$qry) {
// echo $this->db->error()["message"];
echo json_encode([]);
exit;
}
$rows = $qry->result_array();
$userName = "RptAdmin";
if (count($rows) > 0) {
$userName = $rows[0]["M_UserUserName"];
}
$sql = "select
? M_UserName,
F_PaymentLogDetailsID ,
F_PaymentLogDetailsHS_DeliveryOrderID ,
F_PaymentLogDetailsF_PaymentID,
F_PaymentLogDetailsJSON ,
F_PaymentLogDetailsUserID ,
F_PaymentLogDetailsUsername
from one_hs.f_payment_log_details
where F_PaymentLogDetailsF_PaymentID =?";
$qry = $this->db->query($sql,[$userName,$paymentID]);
if (!$qry) {
// echo $this->db->error()["message"];
echo json_encode([]);
exit;
}
$rows = $qry->result_array();
$result = [];
foreach($rows as $r) {
$json= json_decode($r["F_PaymentLogDetailsJSON"],true);
unset($r["F_PaymentLogDetailsJSON"]);
$header= $json["details"][0];
$patient_name = $json["details"][0]["patient_name"];
$j_details = $json["details"][0]["details"];
$payment = $json["payment"];
unset($json["details"]);
unset($json["payment"]);
unset($payment["username"]);
unset($payment["payment_id"]);
$payment["payment_amount"] = $payment["amount"];
unset($payment["amount"]);
$r = array_merge($r,$json);
$r = array_merge($r,$payment);
foreach( $j_details as $j) {
$arr = ["patient_name"=>$patient_name,
"amount" => $j["amount"],
"discount" => $j["discount"],
"discountrp" => $j["discountrp"],
"subtotal" => $j["subtotal"],
"test_name" => $j["test_name"],
"total" => $j["total"]
];
$result[] = array_merge($r,$arr) ;
}
$idx = count($result) - 1;
}
echo json_encode($result);
}
}

View File

@@ -0,0 +1,492 @@
<?php
class Medis extends MY_Controller
{
public function __construct()
{
parent::__construct();
//$this->db = $this->load->database("one", true);
}
function pribadi($id, $langid)
{
//$id = orderID
$sql = "SELECT
orderID,
orderDate,
orderAge,
orderNumber ,
one.fn_get_name(orderM_PatientID) as M_PatientName,
orderKeluhan,
orderDiagnosisAwal,
orderDiagnosisAkhir,
CONCAT(ifnull( M_DoctorPrefix,''),' ', M_DoctorName,' ',ifnull( M_DoctorSufix,''),' ',ifnull( M_DoctorSufix2,''),' ',ifnull( M_DoctorSufix3,'')) AS M_DoctorName,
orderDoctorVitalSign ,
orderDoctorReceipt,
orderDoctorDiagnosePrimer ,
orderDoctorDiagnoseSekunder ,
orderDoctorSaran
FROM one_klinik.`order`
left join m_doctor ON order.orderM_DoctorID = M_DoctorID
left join one_klinik.order_doctor on orderDoctorOrderID = OrderID and orderDoctorIsActive = 'Y'
where
orderID = ?
and
orderDoctorType = 'TEXT'
";
$qry = $this->db->query($sql, array($id));
//echo $this->db->last_query();
if ($qry) {
$rows = $qry->result_array();
// foreach($rows as $idx => $r ) {
// $rows[$idx]["keluhan_saat_ini"] = $this->keluhan_saat_ini($id,$langid,$type);
// $rows[$idx]["phobia"] = $this->phobia($id,$langid,$type);
// $rows[$idx]["kesimpulan"] = $this->kesimpulanv4($id,$langid);
// }
echo json_encode($rows);
} else {
echo json_encode(array());
}
}
function keluhan_saat_ini_new($id,$langid)
{
$sql = "select * from one_klinik.order_anamnesis
left join one_klinik.`order` on orderAnamnesisOrderID = OrderID
where OrderID = ?
and orderM_LanguageID =?
and orderAnamnesisTypeForm = 'FORM' ";
$qry = $this->db->query($sql, array($id,$langid));
if (!$qry) {
return json_encode(array());
}
$rows = $qry->result_array();
//print_r($rows[0]["orderAnamnesisKeluhanUtama"]);
if (count($rows) == 0) {
return json_encode(array());
}
$details = json_decode($rows[0]["orderAnamnesisKeluhanUtama"], true);
//keluhan saat ini
$keluhan_saat_ini_new = array();
foreach ($details[0]["details"] as $d) {
if ($d["chx"] == 1) {
$keluhan_saat_ini_new[] = array(
"a1" => $d["label"],
"a2" => $d["value"],
);
}
}
echo json_encode($keluhan_saat_ini_new);
}
function riwayat_penyakit($id,$langid) {
$sql = "select * from one_klinik.order_anamnesis
left join one_klinik.`order` on orderAnamnesisOrderID = OrderID
where OrderID = ?
and orderM_LanguageID =?
and orderAnamnesisTypeForm = 'FORM' ";
$qry = $this->db->query($sql,array($id,$langid));
if (! $qry) {
return json_encode(array());
}
$rows = $qry->result_array();
if (count($rows) == 0 ) {
return json_encode(array());
}
$details = json_decode($rows[0]["orderAnamnesisRiwayatPenyakitDanAlergiDahulu"],true);
//keluhan saat ini
$riwayat_penyakit = array();
foreach ($details[0]["details"] as $d) {
foreach($d["details"] as $xd) {
if ($xd["chx"] == 1 ) {
$arr_result[] = array($xd["label"],$xd["value"],$xd["segment_name"],$xd["id"]) ;
$riwayat_penyakit[] = array(
"c1" => $xd["label"],
"c2" => $xd["value"],
"c3" => $xd["segment_name"],
"c4" => $xd["id"]
);
}
}
}
echo json_encode($riwayat_penyakit);
}
function riwayat_penyakit_sekarang($id,$langid) {
$sql = "select * from one_klinik.order_anamnesis
left join one_klinik.`order` on orderAnamnesisOrderID = OrderID
where OrderID = ?
and orderM_LanguageID =?
and orderAnamnesisTypeForm = 'FORM' ";
$qry = $this->db->query($sql,array($id,$langid));
if (! $qry) {
return json_encode(array());
}
$rows = $qry->result_array();
if (count($rows) == 0 ) {
return json_encode(array());
}
$details = json_decode($rows[0]["orderAnamnesisRiwayatPenyakitDanAlergiSekarang"],true);
$riwayat_penyakit_sekarang = array();
foreach ($details[0]["details"] as $d) {
foreach($d["details"] as $xd) {
if ($xd["chx"] == 1 ) {
$arr_result[] = array($xd["label"],$xd["value"],$xd["segment_name"],$xd["id"]) ;
$riwayat_penyakit_sekarang[] = array(
"cc1" => $xd["label"],
"cc2" => $xd["value"],
"cc3" => $xd["segment_name"],
"cc4" => $xd["id"]
);
}
}
}
echo json_encode($riwayat_penyakit_sekarang);
}
function riwayat_keluarga($id, $langid)
{
$sql = "select * from one_klinik.order_anamnesis
left join one_klinik.`order` on orderAnamnesisOrderID = OrderID
where OrderID = ?
and orderM_LanguageID =?
and orderAnamnesisTypeForm = 'FORM' ";
$qry = $this->db->query($sql, array($id, $langid));
if (!$qry) {
return json_encode(array());
}
$rows = $qry->result_array();
if (count($rows) == 0) {
return json_encode(array());
}
$details = json_decode($rows[0]["orderAnamnesisRiwayatPenyakitKeluarga"], true);
//keluhan saat ini
$riwayat_keluarga = array();
foreach ($details[0]["details"] as $d) {
// foreach ($d["details"] as $gp) {
//echo print_r($d["details"]);
if (true || $d["chx"] == 1) {
$arr_result[] = array($d["label"], $d["value"], $d["id"]);
foreach ($d["options"] as $gpd) {
if ($gpd["selected"] == 1) {
$riwayat_keluarga[] = array(
"d1" => $d["label"],
"d2" => $gpd["label"],
"d3" => $d["id"],
);
}
}
// }
}
}
echo json_encode($riwayat_keluarga);
}
function riwayat_obat($id, $langid)
{
$sql = "select * from one_klinik.order_anamnesis
left join one_klinik.`order` on orderAnamnesisOrderID = OrderID
where OrderID = ?
and orderM_LanguageID =?
and orderAnamnesisTypeForm = 'FORM' ";
$qry = $this->db->query($sql, array($id, $langid));
if (!$qry) {
return json_encode(array());
}
$rows = $qry->result_array();
if (count($rows) == 0) {
return json_encode(array());
}
$details = json_decode($rows[0]["orderAnamnesisRiwayatPengobatan"], true);
//keluhan saat ini
$riwayat_obat = array();
foreach ($details[0]["details"] as $gp) {
// echo print_r($d);
if ($gp["chx"] == 1) {
$arr_result[] = array($gp["label"], $gp["value"]);
$riwayat_obat[] = array(
"f1" => $gp["label"],
"f2" => $gp["value"],
);
}
}
echo json_encode($riwayat_obat);
}
function riwayat_hidup($id, $langid )
{
$sql = "select * from one_klinik.order_anamnesis
left join one_klinik.`order` on orderAnamnesisOrderID = OrderID
where OrderID = ?
and orderM_LanguageID =?
and orderAnamnesisTypeForm = 'FORM' ";
$qry = $this->db->query($sql, array($id, $langid ));
if (!$qry) {
return json_encode(array());
}
$rows = $qry->result_array();
if (count($rows) == 0) {
return json_encode(array());
}
$details = json_decode($rows[0]["orderAnamnesisRiwayatSosial"], true);
//keluhan saat ini
$riwayat_hidup = array();
foreach ($details[0]["details"] as $d) {
foreach ($d["details"] as $xd) {
if ($xd["chx"] == 1) {
$arr_result[] = array($xd["segment_name"], $xd["label"], $xd["value"]);
$riwayat_hidup[] = array(
"e1" => $xd["segment_name"],
"e2" => $xd["label"] . ' ' . $xd["value"],
"e3" => $xd["value"],
);
}
}
}
echo json_encode($riwayat_hidup);
}
function riwayat_imunisasi($id, $langid )
{
$sql = "select orderAnamnesisRiwayatImunisasi as details from one_klinik.order_anamnesis
left join one_klinik.`order` on orderAnamnesisOrderID = OrderID
where OrderID = ?
and orderM_LanguageID =?
and orderAnamnesisTypeForm = 'FORM' AND orderAnamnesisIsActive = 'Y' LIMIT 1";
$qry = $this->db->query($sql, array($id, $langid ));
//echo $this->db->last_query(). "<br>";
if (!$qry) {
return json_encode(array());
}
$rows = $qry->row_array();
//print_r($rows['details']);
$imunisasi = json_decode($rows["details"], true);
//print_r($imunisasi );
//keluhan saat ini
$riwayat_imunisasi = array();
// print_r($imunisasi['details']);
foreach ($imunisasi[0]['details'] as $key => $d) {
//print_r($d);
foreach($d['details'] as $k => $xd){
// echo $xd['id_code'];
if ($xd["chx"] == 1) {
$arr_result[] = array($xd["segment_name"], $xd["label"], $xd["value"]);
//print_r($arr_result);
$riwayat_imunisasi[] = array(
"g1" => $xd["segment_name"],
"g2" => $xd["label"] . ' ' . $xd["value"],
"g3" => $xd["value"],
);
}
}
}
echo json_encode($riwayat_imunisasi);
}
//pemeriksaan Fisik
function tanda_vital($id, $langid)
{
$sql = "select * from one_klinik.order_doctor
left join one_klinik.`order` on orderDoctorOrderID = OrderID
where orderDoctorOrderID = ?
and orderM_LanguageID =?
and orderDoctorType = 'FORM'
";
$qry = $this->db->query($sql, array($id, $langid));
if (!$qry) {
return json_encode(array());
}
$rows = $qry->result_array();
if (count($rows) == 0) {
return json_encode(array());
}
$details = json_decode($rows[0]["orderDoctorVitalSign"], true);
//keluhan saat ini
$tanda_vital = array();
foreach ($details as $d) {
if ($d["title"] == "TANDA VITAL") {
foreach ($d["details"] as $gp) {
$value = $gp["value"] . ' ' . $gp["unit"];
if ($gp["chx_x"] == "1") $value = $gp["label_x"];
if ($gp["chx_y"] == "1") $value = $gp["label_y"] . ' ' . $gp["value"] . ' ' . $gp["unit"];
$tanda_vital[] = array(
"aa1" => $gp["label"],
"aa2" => $value,
"aa3" => ucwords(strtolower($gp["value_x"])),
);
}
}
}
echo json_encode($tanda_vital);
}
function status_gizi($id, $langid)
{
$sql = "select * from one_klinik.order_doctor
left join one_klinik.`order` on orderDoctorOrderID = OrderID
where orderDoctorOrderID = ?
and orderM_LanguageID =?
and orderDoctorType = 'FORM'
";
$qry = $this->db->query($sql, array($id, $langid));
if (!$qry) {
return json_encode(array());
}
$rows = $qry->result_array();
if (count($rows) == 0) {
return json_encode(array());
}
$details = json_decode($rows[0]["orderDoctorVitalSign"], true);
//keluhan saat ini
$status_gizi = array();
foreach ($details as $d) {
if ($d["title"] == "STATUS GIZI") {
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"];
if ($gp["value"] == NaN) {
$value = '-';
}
$status_gizi[] = array(
"qq1" => $gp["label"],
"qq2" => $value,
"qq3" => $gp["unit"],
);
}
}
}
echo json_encode($status_gizi);
}
//k3
function kesimpulanx2($id, $langid, $type)
{
$sql = "select * from one_klinik.so_resultentry_fisik_umum
where So_ResultEntryFisikUmumSo_ResultEntryID= ?
and So_ResultEntryFisikUmumM_LangID=?
and So_ResultEntryFisikUmumType=?";
$qry = $this->db->query($sql, array($id, $langid, $type));
if (!$qry) {
return json_encode(array());
}
$rows = $qry->result_array();
if (count($rows) == 0) {
return json_encode(array());
}
$details = json_decode($rows[0]["So_ResultEntryFisikUmumDetails"], true);
//keluhan saat ini
$kesimpulanx = array("asdasdasdasdasd");
foreach ($details as $d) {
if ($d["title"] == "") {
foreach ($d["details"] as $gp) {
if ($gp["chx"] == 1) {
$arr_result[] = array($gp["label"], $gp["value"]);
$kesimpulanx[] = array(
"nn1" => $gp["label"],
"nn2" => $gp["value"]
);
}
}
}
}
echo json_encode(array("abc" => $kesimpulanx));
}
function list()
{
$sql = "select * from m_religion";
$qry = $this->db->query($sql);
if ($qry) {
$rows = $qry->result_array();
echo json_encode($rows);
} else {
echo json_encode(array());
}
}
function get($id)
{
$sql = "select * from m_religion where M_ReligionID=?";
$qry = $this->db->query($sql, $id);
if ($qry) {
$rows = $qry->result_array();
echo json_encode($rows);
} else {
echo json_encode(array());
}
}
}