@php $toDash = static function ($value) { if ($value === null || $value === '') { return '-'; } return $value; }; $heightValue = $record->height; if (is_numeric($heightValue) && (float)$heightValue > 0 && (float)$heightValue <= 3) { $heightValue = round((float)$heightValue * 100, 1) . ' cm'; } elseif (is_numeric($heightValue)) { $heightValue = (float)$heightValue . ' cm'; } else { $heightValue = '-'; } $weightValue = is_numeric($record->weight) ? ((float)$record->weight . ' kg') : '-'; $bmiValue = is_numeric($record->bmi) ? number_format((float)$record->bmi, 2) : '-'; $mainComplaint = trim((string) ($record->main_presenting_complaint ?? '')); $mainComplaint = $mainComplaint === '' ? '-' : $mainComplaint; @endphp

Pre-TB Visit Clinical Report

Record ID: {{ $record->id }} | CID: {{ $record->cid ?: '-' }} | Date of screening: {{ $dateOfScreening }} | Generated: {{ $generatedAt }}

Patient And Visit Details

Patient name {{ $toDash($record->name) }} Age / Sex {{ $toDash($record->age) }} / {{ $toDash($sexLabel) }} Type of screening {{ $toDash($typeOfScreeningLabel) }}
Height / Weight / BMI {{ $heightValue }} / {{ $weightValue }} / {{ $bmiValue }} Mode of entry {{ $toDash($modeOfEntryLabel) }} Date of next visit {{ $dateOfNextVisit }}
Main presenting complaint {{ $mainComplaint }}

Symptoms And Risk Factors

@foreach ($symptoms as $symptom) @endforeach
Symptom Present Days
{{ $symptom['label'] }} {{ $toDash($symptom['present']) }} {{ $toDash($symptom['days']) }}
@foreach ($riskFactors as $label => $value) @endforeach
Risk factor Value
{{ $label }} {{ $toDash($value) }}

Investigations And Radiology

Item Requested/Tested Date Result / Value Other details
Chest X-ray {{ $toDash($radiology['Chest X-ray requested'] ?? '-') }} {{ $toDash($radiology['Chest X-ray date'] ?? '-') }} {{ $toDash($radiology['MD diagnosis'] ?? '-') }} Facility: {{ $toDash($radiology['Facility'] ?? '-') }} | MD other: {{ $toDash($radiology['MD diagnosis other'] ?? '-') }}
CAD score - - {{ $toDash($radiology['CAD score'] ?? '-') }} Numerical CAD score
Radiologist requested {{ $toDash($radiology['Radiologist requested'] ?? '-') }} {{ $toDash($radiology['Radiologist request date'] ?? '-') }} {{ $toDash($radiology['Radiologist result'] ?? '-') }} Other: {{ $toDash($radiology['Radiologist result other'] ?? '-') }}
Radiologist comment {{ $toDash($radiology['Radiologist opinion / comment'] ?? '-') }}
Sputum AFB {{ $toDash($labTests['Sputum AFB'] ?? '-') }} {{ $toDash($labTests['Sputum AFB date'] ?? '-') }} {{ $toDash($labTests['Sputum AFB result'] ?? '-') }} -
GeneXpert {{ $toDash($labTests['GeneXpert'] ?? '-') }} {{ $toDash($labTests['GeneXpert date'] ?? '-') }} {{ $toDash($labTests['GeneXpert result'] ?? '-') }} -
Truenat {{ $toDash($labTests['Truenat'] ?? '-') }} {{ $toDash($labTests['Truenat date'] ?? '-') }} {{ $toDash($labTests['Truenat result'] ?? '-') }} -
HIV (determine) {{ $toDash($labTests['HIV (determine) tested'] ?? '-') }} {{ $toDash($labTests['HIV (determine) date'] ?? '-') }} {{ $toDash($labTests['HIV (determine) result'] ?? '-') }} -
CRP {{ $toDash($labTests['CRP tested'] ?? '-') }} {{ $toDash($labTests['CRP date'] ?? '-') }} {{ $toDash($labTests['CRP result'] ?? '-') }} -

Management And Clinician Notes

Item Given Date Details
Antibiotics {{ $toDash($management['Antibiotics'] ?? '-') }} {{ $toDash($management['Antibiotic date'] ?? '-') }} Drug: {{ $toDash($management['Drug'] ?? '-') }}
TB treatment {{ $toDash($management['TB treatment'] ?? '-') }} {{ $toDash($management['TB treatment date'] ?? '-') }} Regimen: {{ $toDash($management['Regimen'] ?? '-') }}
Other management {{ $toDash($management['Other management'] ?? '-') }}
Remark {{ $toDash($management['Remark'] ?? '-') }}
MD {{ $toDash($management['MD'] ?? '-') }}
X-ray image {{ $xrayImageDataUri ? 'Attached' : 'Not attached' }} @if ($xrayImagePath) | Path: {{ $xrayImagePath }} @endif @if ($xrayImageDataUri)
X-ray image
@endif