CUSTOMER #{{ $customer->id }}
{{ $customer->user->name }} — Test History
{{ $customer->user->email }} • {{ $customer->phone ?? '-' }}
Back
{{-- Search + Date filter --}}
| Test |
Kind |
Status |
Assigned |
Ready |
Result |
Unit |
Range |
@forelse($items as $it)
@php
$kind = $it->item_kind ?? '-'; // main / sub
$isSub = ($kind === 'sub');
// Name + code source:
// - main => from snapshots
// - sub => snapshots + show parent test name (helpful)
$name = $it->test_name_snapshot ?? '-';
$code = $it->test_code_snapshot ?? '-';
$parentName = null;
if ($isSub) {
$parentName = $it->subTest?->parentTest?->test_name
?? $it->labTest?->test_name
?? null;
}
$unit = $it->unit_snapshot ?? '';
$range = $it->reference_range_snapshot ?? '';
$status = $it->result_status ?? 'pending';
$assignedIso = optional($it->created_at)->format('Y-m-d');
$readyIso = optional($it->result_posted_at)->format('Y-m-d');
$qText = strtolower(
trim(
($name ?? '') . ' ' .
($code ?? '') . ' ' .
($parentName ?? '') . ' ' .
($it->result_text ?? '') . ' ' .
($unit ?? '') . ' ' .
($range ?? '')
)
);
$badgeClass = 'b-pending';
if ($status === 'ready') $badgeClass = 'b-ready';
elseif ($status === 'processing') $badgeClass = 'b-processing';
@endphp
|
{{ $name }}
{{ $code }}
@if($isSub && $parentName)
Parent: {{ $parentName }}
@endif
|
{{ strtoupper($kind) }}
|
{{ strtoupper($status) }}
|
{{ optional($it->created_at)->format('d-m-Y') }} |
{{ $it->result_posted_at ? $it->result_posted_at->format('d-m-Y') : '—' }}
|
{{ $it->result_text ?: '—' }}
|
{{ $unit ?: '—' }} |
{{ $range ?: '—' }} |
@empty
| No tests found. |
@endforelse
No matching tests found.