@if ($history->isNotEmpty())
| No. |
No. Registrasi |
Tanggal MCU |
Perusahaan/Jabatan |
Paket MCU |
Kesimpulan |
Status |
Gambar hasil spirometry |
Aksi |
@foreach ($history as $item)
@php
$paths = [];
$rawImages = $item->spirometry_images ?? null;
if ($rawImages) {
$decoded = is_array($rawImages) ? $rawImages : json_decode($rawImages, true);
if (is_array($decoded)) {
foreach ($decoded as $p) {
if ($p) {
$paths[] = $p;
}
}
}
}
if ($item->result_file_path) {
if (!in_array($item->result_file_path, $paths, true)) {
array_unshift($paths, $item->result_file_path);
}
}
$previewPath = $paths[0] ?? null;
$previewUrl = $previewPath ? Storage::url($previewPath) : null;
$previewExt = $previewPath ? strtolower(pathinfo($previewPath, PATHINFO_EXTENSION)) : '';
$isRaster = $previewPath && in_array($previewExt, ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp'], true);
$patientLabel = $item->appointment?->patient?->full_name ?? ($item->appointment?->patient?->name ?? '');
$zoomTitle = 'Spirometry — ' . $patientLabel;
@endphp
@include('partials.examination_history_first_columns',
[
'appointment' => $item->appointment,
'alternateDate' => $item->completed_at
])
|
{{
\Illuminate\Support\Str::limit(
$item->conclusion ?? 'Dalam batas normal',
120,
)
}}
|
{{ ucfirst(str_replace('_', ' ', $item->status)) }}
|
@if ($previewUrl)
@if ($isRaster)
@else
@endif
@else
-
@endif
|
|
@endforeach
@foreach ($history as $item)
@endforeach
@else
Belum ada riwayat pemeriksaan spirometry sebelumnya untuk pasien ini.
@endif