diff --git a/app/Views/diagnosis/pathology_detail.php b/app/Views/diagnosis/pathology_detail.php index 53ccb29..24689ec 100644 --- a/app/Views/diagnosis/pathology_detail.php +++ b/app/Views/diagnosis/pathology_detail.php @@ -7,11 +7,27 @@ $flowTypeLabel = $isPathologyFlow ? 'Lab' : 'Imaging'; $timingTitle = $isPathologyFlow ? 'Lab Timing Information' : 'Imaging Workflow Timing'; $testListTitle = $isPathologyFlow ? 'Test List' : 'Imaging Study List'; $collectedTimeLabel = $isPathologyFlow ? 'Sample Collection Time' : 'Request Collection Time'; +$timingCardTitle = $isPathologyFlow ? 'Lab Collection and Report Time' : 'Imaging Start and Report Time'; $isImagingFlow = !$isPathologyFlow; $printTemplates = $print_templates ?? []; +$patientName = trim((string) ($invoice->p_fname ?? '')); +$relativeName = trim((string) ($invoice->p_relative ?? $invoice->relative_name ?? '')); +$relativePersonName = trim((string) ($invoice->p_rname ?? '')); +$relativeLabel = $relativeName !== '' && $relativePersonName !== '' ? $relativeName . ' ' . $relativePersonName : ($relativePersonName !== '' ? $relativePersonName : ''); +$patientCode = (string) ($invoice->p_code ?? 'N/A'); +$rawGender = (string) ($invoice->gender ?? ''); +$genderMap = ['1' => 'Male', '2' => 'Female', 'M' => 'Male', 'F' => 'Female', 'Male' => 'Male', 'Female' => 'Female']; +$genderLabel = $genderMap[$rawGender] ?? ($rawGender !== '' ? $rawGender : 'N/A'); +$ageLabel = trim((string) ($invoice->age ?? '')); +if ($ageLabel === '') { + if (!empty($invoice->age_in_month) && (int) $invoice->age_in_month > 0) { + $ageLabel = (int) $invoice->age_in_month . ' Month'; + } else { + $ageLabel = 'N/A'; + } +} ?> - - -
-

- Invoice Details

- -
+
+
+

+ +

+
-
- -
+
-
Person Profile
+
Person Profile
-
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Patient Name:p_fname . ' ' . ($invoice->p_rname ?? '')); ?>
Patient Code:p_code ?? 'N/A'); ?>
Gender:gender ?? 'N/A'); ?>
Age: - age_in_month) && intval($invoice->age_in_month) > 0) { - echo htmlspecialchars($invoice->age_in_month . ' months'); - } elseif (!empty($invoice->age)) { - echo htmlspecialchars($invoice->age . ' years'); - } else { - echo 'N/A'; - } - ?> -
Aadhar:udai ?? 'N/A'); ?>
Phone:phone_number ?? 'N/A'); ?>
Email:email ?? 'N/A'); ?>
Address: - address_line1)) $address[] = $invoice->address_line1; - if (!empty($invoice->city)) $address[] = $invoice->city; - if (!empty($invoice->state)) $address[] = $invoice->state; - echo htmlspecialchars(implode(', ', $address) ?: 'N/A'); - ?> -
Invoice Date:inv_date ?? ''))); ?>
+
+
Name :
+ +
+ +
Phone Number : phone_number ?? 'N/A')) ?>
+
Email : email ?? 'N/A')) ?>
+
Gender : / Age :
+
Aadhar No. : udai ?? 'N/A')) ?>
+
+ address_line1)) { + $address[] = $invoice->address_line1; + } + if (!empty($invoice->city)) { + $address[] = $invoice->city; + } + if (!empty($invoice->state)) { + $address[] = $invoice->state; + } + ?> + Address : +
+
-
- -
- -
+
-
+
-
+
-
reported_time)) { + echo htmlspecialchars(date('Y-m-d\TH:i', strtotime($lab_invoice->reported_time))); + } ?>">
@@ -182,31 +154,12 @@ $printTemplates = $print_templates ?? [];
- -
-
-
-
-
-
-
- Loading... -
-
-
-
-
-
- - - -
-
-
+ +
-
Report Operations
+
Report Operations
-
+
+ +
+ +
+
+
+
Test List : [Invoice Code : invoice_code ?? '')) ?>]
+
+
+
+
+ Loading... +
+
+
- +
+
@@ -683,8 +652,8 @@ function createReportXray(reqId, testName) { }) .then(response => response.text()) .then(html => { - // Load full-page editor using load_form - load_form(baseUrl + 'diagnosis/open-report-editor/' + reqId, testName + ' - Report Editor'); + // Keep search header visible by loading editor inside searchresult. + load_form_div(baseUrl + 'diagnosis/open-report-editor/' + reqId, 'searchresult', testName + ' - Report Editor'); }) .catch(error => { console.error('createReportXray error:', error); @@ -1165,7 +1134,7 @@ function openReportEditor(reqId, testName) { } const editorUrl = baseUrl + 'diagnosis/open-report-editor/' + reqId + '?edit_reason=' + encodeURIComponent(cleanReason); - load_form(editorUrl, (testName || 'Radiology') + ' - Report Editor'); + load_form_div(editorUrl, 'searchresult', (testName || 'Radiology') + ' - Report Editor'); } function toggleTestDetails(reqId) {