From b10661c8d06253b3ebc3809e3dc165d939125032 Mon Sep 17 00:00:00 2001 From: DevSoftTech Server Date: Sat, 1 Aug 2026 03:06:45 +0530 Subject: [PATCH] Refine OPD profile photo flow --- app/Controllers/Patient.php | 4 + app/Views/billing/Patient_Profile_Opd_V.php | 583 +++++++++++++++++--- 2 files changed, 517 insertions(+), 70 deletions(-) diff --git a/app/Controllers/Patient.php b/app/Controllers/Patient.php index b7c98da..b32b18a 100644 --- a/app/Controllers/Patient.php +++ b/app/Controllers/Patient.php @@ -998,6 +998,9 @@ class Patient extends BaseController } $profileFilePath = $this->getProfileFilePath((int) ($patient->profile_file_id ?? 0)); + $hospitalEnabled = hospital_setting_value('ALLOW_IMAGE_PREUPLOAD_EDIT', '0') === '1'; + $user = function_exists('auth') ? auth()->user() : null; + $userAllowed = $user && method_exists($user, 'can') && $user->can('media.image.preupload-edit'); $request = service('request'); $backUrl = trim((string) $request->getGet('back_url')); @@ -1144,6 +1147,7 @@ class Patient extends BaseController return view('billing/Patient_Profile_Opd_V', [ 'patient' => $patient, 'profileFilePath' => $profileFilePath, + 'allow_image_preupload_edit' => ($hospitalEnabled && $userAllowed) ? 1 : 0, 'opdGroups' => $opdGroups, 'totalOpdVisits' => $totalOpdVisits, 'lastVisitDate' => $lastVisitDate, diff --git a/app/Views/billing/Patient_Profile_Opd_V.php b/app/Views/billing/Patient_Profile_Opd_V.php index 3405a63..cd17088 100644 --- a/app/Views/billing/Patient_Profile_Opd_V.php +++ b/app/Views/billing/Patient_Profile_Opd_V.php @@ -3,6 +3,7 @@ $patient = $patient ?? (object) []; $opdGroups = (isset($opdGroups) && is_array($opdGroups)) ? $opdGroups : []; $backUrl = trim((string) ($backUrl ?? '')); $backTitle = trim((string) ($backTitle ?? 'Profile')); +$allowImagePreuploadEdit = !empty($allow_image_preupload_edit); if ($backUrl === '') { $backUrl = base_url('billing/patient/person_record') . '/' . (int) ($patient->id ?? 0) . '/0'; } @@ -18,6 +19,7 @@ $abhaVerifiedStatus = strtoupper(trim((string) ($patient->abha_verified_status ? $abhaKycVerified = (int) ($patient->abha_kyc_verified ?? 0) === 1; $abhaMobileVerified = (int) ($patient->abha_mobile_verified ?? 0) === 1; $abhaIsVerified = $abhaVerifiedStatus === 'VERIFIED' || ($abhaKycVerified && $abhaMobileVerified); +$hasAbhaIdentity = $patientAbhaAddress !== '' || $patientAbhaId !== '' || $abhaIsVerified; $totalOpdVisits = (int) ($totalOpdVisits ?? 0); $lastVisitDateRaw = trim((string) ($lastVisitDate ?? '')); $lastVisitDateLabel = $lastVisitDateRaw !== '' ? date('d-m-Y', strtotime($lastVisitDateRaw)) : 'Not available'; @@ -75,7 +77,7 @@ if ($patientPhotoPath === '') {
- Patient Photo + Patient Photo
Patient: p_fname ?? '') ?> Age: @@ -84,6 +86,11 @@ if ($patientPhotoPath === '') { OPD No.: No. of Visit:
+ +
+ +
+
@@ -91,9 +98,11 @@ if ($patientPhotoPath === '') { - + + +
@@ -294,83 +303,85 @@ if ($patientPhotoPath === '') {
-
-
-
-
-
-
ABDM M3 — Fetch Patient Health Records
-
- ABHA Address: -  |  - ABHA Status: - - VERIFIED - - - -
-
-
- + +
+
+
+
- +
ABDM M3 — Fetch Patient Health Records
+
+ ABHA Address: +  |  + ABHA Status: + + VERIFIED + + + +
+
+
+ +
+ +
-
- -
- ABHA must be linked and verified for this patient before ABDM records can be requested. Verify ABHA from the patient's profile first. -
- -
- Send a consent request to the patient's ABHA (PHR) app. Once the patient approves it there, HMS automatically fetches their health records — no need to click again. -
- + +
+ ABHA must be linked and verified for this patient before ABDM records can be requested. Verify ABHA from the patient's profile first. +
+ +
+ Send a consent request to the patient's ABHA (PHR) app. Once the patient approves it there, HMS automatically fetches their health records — no need to click again. +
+ -
- +
+ +
-
-
-
-
-
Consent Request History
-
- - +
+
+
+
Consent Request History
+
+ + +
+
+
+ + + + + + + + + + + + + + + +
IDStatusExpiry DateDate FromDate ToViewShow Data
No consent requests yet.
-
- - - - - - - - - - - - - - - -
IDStatusExpiry DateDate FromDate ToViewShow Data
No consent requests yet.
-
-
-
+
+
@@ -383,12 +394,78 @@ if ($patientPhotoPath === '') {
+ + + + + +