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'; + } +} ?> - - -
| 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 ?? ''))); ?> | -