@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 && !in_array($item->result_file_path, $paths, true)) { array_unshift($paths, $item->result_file_path); } $primaryPath = $item->result_file_path ?: $paths[0] ?? null; $additionalPaths = []; if ($primaryPath) { foreach ($paths as $p) { if ($p && $p !== $primaryPath) { $additionalPaths[] = $p; } } } $patientLabel = $item->appointment?->patient?->full_name ?? ''; @endphp @if ($primaryPath) @php $fileExtension = strtolower(pathinfo($primaryPath, PATHINFO_EXTENSION)); $fileUrl = Storage::url($primaryPath); $viewerTitle = 'Hasil Spirometry - ' . $patientLabel; @endphp
@if (in_array($fileExtension, ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp'])) @elseif ($fileExtension === 'pdf') @else
{{ basename($primaryPath) }}
{{ strtoupper($fileExtension) }} File
@endif
@endif @if (count($additionalPaths) > 0)
@foreach ($additionalPaths as $idx => $extraPath) @php $exExt = strtolower(pathinfo($extraPath, PATHINFO_EXTENSION)); $exUrl = Storage::url($extraPath); $exRaster = in_array($exExt, ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp'], true); $exTitle = 'Hasil Spirometry (' . ($idx + 2) . ') - ' . $patientLabel; @endphp
@if ($exRaster)
Spirometry {{ $idx + 2 }}
Download
@elseif ($exExt === 'pdf')
Download
@else
{{ basename($extraPath) }}
@endif
@endforeach
@endif @if ($item->interpretation)
{!! nl2br(e($item->interpretation)) !!}
@endif @if ($item->recommendations)
{!! nl2br(e($item->recommendations)) !!}
@endif @if ($item->conclusion)
{!! nl2br(e($item->conclusion)) !!}
@endif @if ($item->notes)
{!! nl2br(e($item->notes)) !!}
@endif {{-- @include('partials.staff_info', [ 'workstationType' => 'Spirometri', 'result' => $item, 'defaultDoctor' => $item->selectedDoctor, 'defaultTechnician' => $item->selectedTechnician, ]) --}} @once @push('styles') @endpush @endonce