@php
// Helper function to format date
$formatDate = function($date) {
if (!$date) return '-';
try {
return \Carbon\Carbon::parse($date)->format('d/m/Y');
} catch (\Exception $e) {
return '-';
}
};
@endphp
| Bil. |
Jenis Ujian |
Test I |
Test II |
|
|
Tarikh |
Keputusan |
Tarikh |
Keputusan |
@php
$tests = [
['key' => 'rhesus_blood_group', 'name' => 'Kumpulan darah Rhesus'],
['key' => 'vdrl_tpha', 'name' => 'VDRL +/- TPHA'],
['key' => 'syphilis_rapid_ibu', 'name' => 'Syphilis / Rapid Test (Ibu)'],
['key' => 'syphilis_rapid_pasangan', 'name' => 'Syphilis / Rapid Test (Pasangan)'],
['key' => 'hiv_rapid_ibu', 'name' => 'HIV / Rapid Test (Ibu)'],
['key' => 'hiv_rapid_pasangan', 'name' => 'HIV / Rapid Test (Pasangan)'],
['key' => 'hepatitis_b', 'name' => 'Hepatitis B'],
['key' => 'malaria_bfmp', 'name' => 'Malaria (BFMP)'],
];
@endphp
@foreach($tests as $index => $test)
| {{ $index + 1 }} |
{{ $test['name'] }} |
{{ $formatDate(data_get($testData, $test['key'] . '.taken_at_1')) }}
|
{{ data_get($testData, $test['key'] . '.result_1', '-') }}
|
{{ $formatDate(data_get($testData, $test['key'] . '.taken_at_2')) }}
|
{{ data_get($testData, $test['key'] . '.result_2', '-') }}
|
@endforeach
@if(data_get($testData, 'notes'))
Notes: {{ data_get($testData, 'notes') }}
@endif
@if(data_get($testData, 'name') || data_get($testData, 'signature'))
Responsible Person: {{ data_get($testData, 'name', 'N/A') }}
@if(data_get($testData, 'signature'))
@endif
@endif