FHM09062601IBL - screening list_patient: tambah _enc columns, decrypt PDP, foto pasien
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -205,26 +205,47 @@ class Screening extends MY_Controller
|
|||||||
$status = $prm['status'];
|
$status = $prm['status'];
|
||||||
|
|
||||||
$sql = "SELECT 'N' divider,
|
$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,
|
`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`
|
FROM one_klinik.`order`
|
||||||
JOIN m_patient ON orderM_PatientID = M_PatientID
|
JOIN m_patient ON orderM_PatientID = M_PatientID
|
||||||
LEFT JOIN m_title ON M_PatientM_TitleID = M_TitleID
|
LEFT JOIN m_title ON M_PatientM_TitleID = M_TitleID
|
||||||
WHERE
|
WHERE
|
||||||
orderIsActive = 'Y' AND DATE(orderDate) = ? AND orderIsScreening = ?
|
orderIsActive = 'Y' AND DATE(orderDate) = ? AND orderIsScreening = ?
|
||||||
LIMIT $number_limit offset $number_offset";
|
LIMIT $number_limit offset $number_offset";
|
||||||
//echo $sql;
|
//echo $sql;
|
||||||
$query = $this->db_oneklinik->query($sql,array($xdate,$status));
|
$query = $this->db_oneklinik->query($sql,array($xdate,$status));
|
||||||
//echo $this->db_oneklinik->last_query();
|
//echo $this->db_oneklinik->last_query();
|
||||||
|
|
||||||
if ($query) {
|
if ($query) {
|
||||||
$rows = $query->result_array();
|
$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);
|
$this->sys_ok($result);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this->sys_error_db("m_patient rows",$this->db_onedev);
|
$this->sys_error_db("m_patient rows",$this->db_oneklinik);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user