@include('pdf.partials.patient_information')
| Jenis Pemeriksaan: |
{{
$appointment->radiologyResult->exam_type_name ??
'Chest X-Ray'
}}
|
| Tanggal Pemeriksaan: |
{{
$appointment->radiologyResult->created_at
? \App\Helpers\DateHelper::formatDate($appointment->radiologyResult->created_at)
: '-'
}}
|
@if ($appointment->radiologyResult->findings)
Temuan:
{{ $appointment->radiologyResult->findings }}
@endif
@if ($appointment->radiologyResult->image_paths && count($appointment->radiologyResult->image_paths) > 0)
Hasil Pemeriksaan Radiologi:
@php
$imagePaths = is_array($appointment->radiologyResult->image_paths)
? array_values(array_unique($appointment->radiologyResult->image_paths))
: [];
@endphp
@foreach ($imagePaths as $imagePath)
@php
// Normalisasi path: hapus prefix 'storage/' jika ada agar konsisten dengan penyimpanan disk 'public'
$normalizedPath = ltrim(preg_replace('/^storage\//', '', $imagePath), '/');
$fullPath = storage_path('app/public/' . $normalizedPath);
$alternativePath = public_path('storage/' . $normalizedPath);
$resolvedPath = null;
if (file_exists($fullPath)) {
$resolvedPath = $fullPath;
} elseif (file_exists($alternativePath)) {
$resolvedPath = $alternativePath;
}
$imageUri = \App\Helpers\PdfImageHelper::dataUri($resolvedPath);
@endphp
@if ($imageUri)

@else
@if (config('app.debug'))
Image not found or unreadable: {{ $normalizedPath }}
@else
Gambar tidak dapat ditampilkan
@endif
@endif
@endforeach
@endif
{{-- @if($appointment->radiologyResult->notes)
CATATAN:
{{ $appointment->radiologyResult->notes }}
@endif --}}
KESIMPULAN PEMERIKSAAN RADIOLOGI:
{{ $appointment->radiologyResult->conclusion }}