From a599f15ec276fe3beb37db5e1b3557f04be54ffc Mon Sep 17 00:00:00 2001 From: "sas.fajri" Date: Wed, 10 Jun 2026 14:32:47 +0700 Subject: [PATCH] FHM09062601IBL - screening list_patient: tambah _enc columns, decrypt PDP, foto pasien Co-Authored-By: Claude Sonnet 4.6 --- .../klinik/screening/Screening.php | 37 +++++++++++++++---- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/application/controllers/klinik/screening/Screening.php b/application/controllers/klinik/screening/Screening.php index aebb48ba..72df11ae 100644 --- a/application/controllers/klinik/screening/Screening.php +++ b/application/controllers/klinik/screening/Screening.php @@ -205,26 +205,47 @@ class Screening extends MY_Controller $status = $prm['status']; $sql = "SELECT 'N' divider, - CONCAT(IF(ISNULL(M_TitleName),'',CONCAT(M_TitleName,'. ')),M_PatientName) as patient_name, + M_PatientName, M_PatientName_enc, + M_PatientHP, M_PatientHP_enc, + M_PatientDOB, M_PatientDOB_enc, + M_PatientEmail, M_PatientEmail_enc, + M_PatientPhone, M_PatientPhone_enc, + M_PatientPOB, M_PatientPOB_enc, + M_PatientIDNumber, M_PatientIDNumber_enc, + M_PatientNIK, M_PatientNIK_enc, + M_PatientPhoto, M_PatientPhotoThumb, `order`.*,DATE_FORMAT(orderDate,'%d-%m-%Y') as date_order, - '' as kode_status, '' as status + '' as kode_status, '' as status, + M_TitleName, M_PatientNoReg, M_PatientM_SexID FROM one_klinik.`order` JOIN m_patient ON orderM_PatientID = M_PatientID LEFT JOIN m_title ON M_PatientM_TitleID = M_TitleID - WHERE - orderIsActive = 'Y' AND DATE(orderDate) = ? AND orderIsScreening = ? + WHERE + orderIsActive = 'Y' AND DATE(orderDate) = ? AND orderIsScreening = ? LIMIT $number_limit offset $number_offset"; //echo $sql; $query = $this->db_oneklinik->query($sql,array($xdate,$status)); //echo $this->db_oneklinik->last_query(); - if ($query) { + if ($query) { $rows = $query->result_array(); - $result = array("total" => $tot_page, "records" => $rows, "sql"=> $this->db_onedev->last_query()); + $enc = $this->ibl_encryptor; + foreach ($rows as $k => $v) { + $rows[$k]['M_PatientName'] = $enc->decrypt($v['M_PatientName_enc'] ?? '') ?: $v['M_PatientName']; + $rows[$k]['M_PatientHP'] = $enc->decrypt($v['M_PatientHP_enc'] ?? '') ?: $v['M_PatientHP']; + $rows[$k]['M_PatientDOB'] = $enc->decrypt($v['M_PatientDOB_enc'] ?? '') ?: $v['M_PatientDOB']; + $rows[$k]['M_PatientEmail'] = $enc->decrypt($v['M_PatientEmail_enc'] ?? '') ?: $v['M_PatientEmail']; + $rows[$k]['M_PatientPhone'] = $enc->decrypt($v['M_PatientPhone_enc'] ?? '') ?: $v['M_PatientPhone']; + $rows[$k]['M_PatientPOB'] = $enc->decrypt($v['M_PatientPOB_enc'] ?? '') ?: $v['M_PatientPOB']; + $rows[$k]['M_PatientIDNumber'] = $enc->decrypt($v['M_PatientIDNumber_enc'] ?? '') ?: $v['M_PatientIDNumber']; + $rows[$k]['M_PatientNIK'] = $enc->decrypt($v['M_PatientNIK_enc'] ?? '') ?: $v['M_PatientNIK']; + $rows[$k]['patient_name'] = trim(($v['M_TitleName'] ?? '') . ' ' . $rows[$k]['M_PatientName']); + } + $result = array("total" => $tot_page, "records" => $rows, "sql"=> $this->db_oneklinik->last_query()); $this->sys_ok($result); - } + } else { - $this->sys_error_db("m_patient rows",$this->db_onedev); + $this->sys_error_db("m_patient rows",$this->db_oneklinik); exit; }