From 39b5fc7c3ee585f338a307aa30847a08632a5481 Mon Sep 17 00:00:00 2001 From: DevSoftTech Server Date: Sat, 25 Jul 2026 21:20:10 +0530 Subject: [PATCH] Use opd_no on OPD history header --- app/Controllers/Patient.php | 8 +++++--- app/Views/billing/Patient_Profile_Opd_V.php | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/Controllers/Patient.php b/app/Controllers/Patient.php index 212f11b..aac6cfe 100644 --- a/app/Controllers/Patient.php +++ b/app/Controllers/Patient.php @@ -986,7 +986,9 @@ class Patient extends BaseController $opdFields = $this->db->getFieldNames('opd_master') ?? []; $opdSelect = [ 'opd_id', + 'opd_no', 'opd_code', + 'doc_id', 'doc_name', 'apointment_date', ]; @@ -1001,12 +1003,12 @@ class Patient extends BaseController $totalOpdVisits = count($opdList); $lastVisitDate = ''; - $lastVisitSrNo = ''; + $lastVisitOpdNo = ''; if ($totalOpdVisits > 0 && !empty($opdList[0]['apointment_date'])) { $lastVisitDate = (string) $opdList[0]['apointment_date']; } if ($totalOpdVisits > 0) { - $lastVisitSrNo = trim((string) ($opdList[0]['queue_no'] ?? '')); + $lastVisitOpdNo = trim((string) (($opdList[0]['opd_no'] ?? '') !== '' ? $opdList[0]['opd_no'] : ($opdList[0]['opd_code'] ?? ''))); } $opdIds = array_column($opdList, 'opd_id'); @@ -1119,7 +1121,7 @@ class Patient extends BaseController 'opdGroups' => $opdGroups, 'totalOpdVisits' => $totalOpdVisits, 'lastVisitDate' => $lastVisitDate, - 'lastVisitSrNo' => $lastVisitSrNo, + 'lastVisitOpdNo' => $lastVisitOpdNo, 'backUrl' => $backUrl, 'backTitle' => $backTitle, ]); diff --git a/app/Views/billing/Patient_Profile_Opd_V.php b/app/Views/billing/Patient_Profile_Opd_V.php index 599e51d..40e0e65 100644 --- a/app/Views/billing/Patient_Profile_Opd_V.php +++ b/app/Views/billing/Patient_Profile_Opd_V.php @@ -21,7 +21,7 @@ $abhaIsVerified = $abhaVerifiedStatus === 'VERIFIED' || ($abhaKycVerified && $ab $totalOpdVisits = (int) ($totalOpdVisits ?? 0); $lastVisitDateRaw = trim((string) ($lastVisitDate ?? '')); $lastVisitDateLabel = $lastVisitDateRaw !== '' ? date('d-m-Y', strtotime($lastVisitDateRaw)) : 'Not available'; -$lastVisitSrNo = trim((string) ($lastVisitSrNo ?? '')); +$lastVisitOpdNo = trim((string) ($lastVisitOpdNo ?? '')); $patientAge = trim((string) get_age_1($patient->dob ?? null, $patient->age ?? '', $patient->age_in_month ?? '', $patient->estimate_dob ?? '')); $genderRaw = trim((string) ($patient->xgender ?? $patient->gender ?? '')); @@ -81,7 +81,7 @@ if ($patientPhotoPath === '') { Age: Gender: Last Visit: - OPD Sr No.: + OPD No.: No. of Visit: @@ -203,7 +203,7 @@ if ($patientPhotoPath === '') { Dr.
- +