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';
}
}
?>
= esc($patientName !== '' ? $patientName : 'Patient') ?>
= esc($patientCode) ?>
Person Profile
= esc($timingCardTitle) ?>
Report Operations
Test List : [Invoice Code : = esc((string) ($invoice->invoice_code ?? '')) ?>]