From adccdcfd7342c873cdb80360dadd704f7a5e07d0 Mon Sep 17 00:00:00 2001 From: mikael-zakaria Date: Mon, 25 Aug 2025 10:35:05 +0700 Subject: [PATCH] Update CustodianID --- app/Controllers/Patient.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Controllers/Patient.php b/app/Controllers/Patient.php index 6b5d9f8..2da6f05 100644 --- a/app/Controllers/Patient.php +++ b/app/Controllers/Patient.php @@ -101,9 +101,11 @@ class Patient extends Controller { if ($patient['Custodian'] != null) { + $custodianId = (int) $patient['Custodian']; + $patientCustodian = $this->db->table('patient') ->select('InternalPID, PatientID') - ->where('InternalPID', (int) $InternalPID) + ->where('InternalPID', $custodianId) ->get() ->getResultArray(); $patient["Custodian"] = $patientCustodian == [] ? null : $patientCustodian[0];