diff --git a/app/Controllers/Opd.php b/app/Controllers/Opd.php index 3c78899..fa85c66 100644 --- a/app/Controllers/Opd.php +++ b/app/Controllers/Opd.php @@ -894,7 +894,8 @@ class Opd extends BaseController } $sql = "select o.opd_id,o.opd_code,o.opd_no,o.opd_status, - p.id,p.p_code,p.p_fname as P_name,p.p_rname, + p.id,p.p_code,p.p_fname as P_name,p.p_rname, + p.gender,p.age,p.age_in_month,p.estimate_dob,p.dob, o.opd_fee_desc,o.opd_fee_amount,o.payment_status,o.opd_fee_type, coalesce(o.running_opd,0) as running_opd, o.confirm_pay_opd, diff --git a/app/Views/billing/opd_appointment_list.php b/app/Views/billing/opd_appointment_list.php index bc6116d..10b158a 100644 --- a/app/Views/billing/opd_appointment_list.php +++ b/app/Views/billing/opd_appointment_list.php @@ -93,7 +93,15 @@ $mergedGroups = [ $hasQueueNo = $queueNo > 0; $showFullActions = $hasPrescription || $isConfirmedForQueue; $opdId = (int) ($row->opd_id ?? 0); - $patientName = esc(($row->P_name ?? '') . ' { ' . ($row->p_rname ?? '') . ' }'); + $patientRawName = trim((string) ($row->P_name ?? '') . ' { ' . (string) ($row->p_rname ?? '') . ' }'); + $patientName = esc($patientRawName); + $patientAgeText = function_exists('get_age_1') + ? trim((string) get_age_1($row->dob ?? null, $row->age ?? '', $row->age_in_month ?? '', $row->estimate_dob ?? '', $opd_date ?? null)) + : trim((string) ($row->age ?? '')); + $patientGenderCode = (int) ($row->gender ?? 0); + $patientGenderText = $patientGenderCode === 1 ? 'Male' : ($patientGenderCode === 2 ? 'Female' : ($patientGenderCode === 3 ? 'Other' : '')); + $patientAgeGender = trim($patientAgeText . ($patientGenderText !== '' ? ' / ' . $patientGenderText : '')); + $patientDisplayName = esc($patientRawName . ($patientAgeGender !== '' ? ' (' . $patientAgeGender . ')' : '')); $tabType = $group['tabType']; $status = $group['status']; ?> @@ -103,7 +111,7 @@ $mergedGroups = [ data-has-prescription=""> opd_code ?? '') ?> - + p_code ?? '') ?> opd_type ?? '') ?> / Amt: opd_fee_amount ?? '') ?>