@if ($appointment->spirometryResult)
HASIL PEMERIKSAAN SPIROMETRI
@include('pdf.partials.patient_information')
Jenis Pemeriksaan: Spirometri
Tanggal Pemeriksaan: {{ $appointment->spirometryResult->created_at ? \App\Helpers\DateHelper::formatDate($appointment->spirometryResult->created_at) : '-' }}
@if ($appointment->spirometryResult->fvc || $appointment->spirometryResult->fev1 || $appointment->spirometryResult->fev1_fvc_ratio)

PARAMETER SPIROMETRI:

@if ($appointment->spirometryResult->fvc)
{{ $appointment->spirometryResult->fvc }}
FVC
Liter
@endif @if ($appointment->spirometryResult->fev1)
{{ $appointment->spirometryResult->fev1 }}
FEV1
Liter
@endif @if ($appointment->spirometryResult->fev1_fvc_ratio)
{{ $appointment->spirometryResult->fev1_fvc_ratio }}
FEV1/FVC
%
@endif
@endif {{-- @if($appointment->spirometryResult->interpretation)

INTERPRETASI:

{{ $appointment->spirometryResult->interpretation }}

@endif --}} @if ($appointment->spirometryResult->result_file_path)

Hasil Pemeriksaan Spirometri:

@php $fullPath = storage_path('app/public/' . $appointment->spirometryResult->result_file_path); $alternativePath = public_path('storage/' . $appointment->spirometryResult->result_file_path); $imageUri = \App\Helpers\PdfImageHelper::dataUri($fullPath) ?? \App\Helpers\PdfImageHelper::dataUri($alternativePath); @endphp @if ($imageUri) Grafik Spirometri @else

Grafik spirometri tidak dapat ditampilkan. Periksa berkas hasil pemeriksaan.

@endif
@endif {{-- @if($appointment->spirometryResult->notes)
CATATAN:

{{ $appointment->spirometryResult->notes }}

@endif --}}
KESIMPULAN PEMERIKSAAN SPIROMETRI:

@if ($appointment->spirometryResult->conclusion && strtolower($appointment->spirometryResult->conclusion) !== 'normal' && strtolower($appointment->spirometryResult->conclusion) !== 'dalam batas normal') {{ $appointment->spirometryResult->conclusion }} @else Dalam batas normal @endif

{{--
Petugas Spirometri
@if(isset($spirometry_technician_stamp_path) && $spirometry_technician_stamp_path) @php // Try different path approaches for stamp $stampFullPath = storage_path('app/public/' . $spirometry_technician_stamp_path); $stampAltPath = public_path('storage/' . $spirometry_technician_stamp_path); $stampImageData = null; $stampMimeType = 'png'; if(file_exists($stampFullPath)) { try { $stampImageData = base64_encode(file_get_contents($stampFullPath)); $stampImageType = pathinfo($stampFullPath, PATHINFO_EXTENSION); $stampMimeType = $stampImageType === 'jpg' ? 'jpeg' : strtolower($stampImageType); } catch(Exception $e) { $stampImageData = null; } } elseif(file_exists($stampAltPath)) { try { $stampImageData = base64_encode(file_get_contents($stampAltPath)); $stampImageType = pathinfo($stampAltPath, PATHINFO_EXTENSION); $stampMimeType = $stampImageType === 'jpg' ? 'jpeg' : strtolower($stampImageType); } catch(Exception $e) { $stampImageData = null; } } @endphp @if($stampImageData) Stempel Petugas @endif @endif @if(isset($spirometry_technician_signature_path) && $spirometry_technician_signature_path) @php // Try different path approaches for signature $sigFullPath = storage_path('app/public/' . $spirometry_technician_signature_path); $sigAltPath = public_path('storage/' . $spirometry_technician_signature_path); $sigImageData = null; $sigMimeType = 'png'; if(file_exists($sigFullPath)) { try { $sigImageData = base64_encode(file_get_contents($sigFullPath)); $sigImageType = pathinfo($sigFullPath, PATHINFO_EXTENSION); $sigMimeType = $sigImageType === 'jpg' ? 'jpeg' : strtolower($sigImageType); } catch(Exception $e) { $sigImageData = null; } } elseif(file_exists($sigAltPath)) { try { $sigImageData = base64_encode(file_get_contents($sigAltPath)); $sigImageType = pathinfo($sigAltPath, PATHINFO_EXTENSION); $sigMimeType = $sigImageType === 'jpg' ? 'jpeg' : strtolower($sigImageType); } catch(Exception $e) { $sigImageData = null; } } @endphp @if($sigImageData) Tanda Tangan Petugas @endif @endif
{{ $defaultSpirometryTechnician && $defaultSpirometryTechnician->employee ? $defaultSpirometryTechnician->employee->full_name : 'Petugas Spirometri' }}
--}}
Dokter Penanggung Jawab
@php // Gunakan dokter spirometry khusus jika tersedia, fallback ke dokter verifikator aktual, lalu ke default doctor $spirometryDoctorName = $spirometryDoctorName ?? null; if (!$spirometryDoctorName && isset($appointment->spirometryResult->selectedDoctor->employee->full_name)) { $spirometryDoctorName = $appointment->spirometryResult->selectedDoctor->employee->full_name; } elseif ( !$spirometryDoctorName && isset($defaultSpirometryDoctor) && $defaultSpirometryDoctor && $defaultSpirometryDoctor->employee ) { $spirometryDoctorName = $defaultSpirometryDoctor->employee->full_name; } elseif (!$spirometryDoctorName && isset($defaultDoctor) && $defaultDoctor && $defaultDoctor->employee) { $spirometryDoctorName = $defaultDoctor->employee->full_name; } $spirometryDoctorSignature = $spirometryDoctorName ? \App\Helpers\SignatureHelper::getDoctorSignatureBase64($spirometryDoctorName) : null; @endphp @if (isset($spirometry_qr_image) && $spirometry_qr_image) QR Code Verifikasi Hasil Spirometri
@if (!empty($spirometryDoctorName)) {{ $spirometryDoctorName }} @elseif (isset($defaultSpirometryDoctor) && $defaultSpirometryDoctor && $defaultSpirometryDoctor->employee) {{ $defaultSpirometryDoctor->employee->full_name }} @elseif (isset($defaultDoctor) && $defaultDoctor && $defaultDoctor->employee) {{ $defaultDoctor->employee->full_name }} @endif
@elseif ($spirometryDoctorSignature) Tanda Tangan Dokter @elseif (isset($doctor_signature) && $doctor_signature) Tanda Tangan Dokter @endif
@endif @if (!$appointment->spirometryResult)
HASIL PEMERIKSAAN SPIROMETRI

Belum ada hasil pemeriksaan spirometri

@endif