@include('pdf.partials.styles')
HASIL PEMERIKSAAN DASS-21
@include('pdf.partials.patient_information')
Jenis Pemeriksaan: DASS-21 (Depression, Anxiety, Stress Scale)
Tanggal Pemeriksaan: {{ $result->examination_time ? \App\Helpers\DateHelper::formatDate($result->examination_time) : ($result->created_at ? \App\Helpers\DateHelper::formatDate($result->created_at) : '-') }}
Skor Pemeriksaan :
{{ $result->depression_score ?? '-' }}
{{ $result->depression_rating ?? 'Normal' }}
Depresi
{{ $result->anxiety_score ?? '-' }}
{{ $result->anxiety_rating ?? 'Normal' }}
Kecemasan
{{ $result->stress_score ?? '-' }}
{{ $result->stress_rating ?? 'Normal' }}
Stres
@if ($result->notes)
CATATAN PEMERIKSAAN
{{ $result->notes }}
@endif
KESIMPULAN DASS-21:
@php $depressionScore = $result->depression_score ?? 0; $anxietyScore = $result->anxiety_score ?? 0; $stressScore = $result->stress_score ?? 0; $depressionRating = $result->depression_rating ?? 'Normal'; $anxietyRating = $result->anxiety_rating ?? 'Normal'; $stressRating = $result->stress_rating ?? 'Normal'; $conclusionItems = []; if ($depressionRating !== 'Normal') { $conclusionItems[] = "Depresi: {$depressionRating} ({$depressionScore})"; } if ($anxietyRating !== 'Normal') { $conclusionItems[] = "Kecemasan: {$anxietyRating} ({$anxietyScore})"; } if ($stressRating !== 'Normal') { $conclusionItems[] = "Stres: {$stressRating} ({$stressScore})"; } $dassConclusion = count($conclusionItems) > 0 ? implode(";\n", $conclusionItems) . '.' : 'Dalam batas normal.'; @endphp

{{ $dassConclusion }}

@php $doctorIdentity = $result->workstationIdentity('doctor'); $verifierIdentity = $result->workstationIdentity('verifier'); $examinerDoctor = null; $examinerUser = null; $isGeneralAccount = false; if ($result->selectedDoctorStaff) { $examinerDoctor = $result->selectedDoctorStaff; } elseif ($result->verified_by) { $examinerUser = $result->verifiedBy; } if ($examinerUser) { $examinerEmail = strtolower($examinerUser->email ?? ''); $examinerName = strtolower($examinerUser->name ?? ''); if ($examinerEmail === 'dokterumum@gmail.com' || strpos($examinerName, 'dokter umum') !== false) { $isGeneralAccount = true; } } if ($examinerDoctor && $examinerDoctor->employee && $examinerDoctor->employee->position) { $positionName = strtolower($examinerDoctor->employee->position->name ?? ''); if (strpos($positionName, 'dokter umum') !== false || $positionName === 'dokter umum') { $isGeneralAccount = true; } } @endphp @if (!$isGeneralAccount)
Dokter Pemeriksa
@php $signatureImageData = null; $signatureMimeType = 'png'; $doctorName = 'Dokter Pemeriksa'; if (!$isGeneralAccount && $examinerDoctor && $examinerDoctor->signature_image) { $signaturePath = storage_path('app/public/' . $examinerDoctor->signature_image); if (file_exists($signaturePath)) { try { $signatureImageData = base64_encode(file_get_contents($signaturePath)); $imageType = pathinfo($signaturePath, PATHINFO_EXTENSION); $signatureMimeType = $imageType === 'jpg' ? 'jpeg' : strtolower($imageType); $doctorName = $examinerDoctor->employee->full_name ?? 'Dokter Pemeriksa'; } catch (Exception $e) { $signatureImageData = null; } } } if (!$isGeneralAccount && !$signatureImageData && $examinerUser && stripos($examinerUser->name, 'Said') !== false) { $signaturePath = public_path('assets/images/ttd/dr.said.jpg'); if (file_exists($signaturePath)) { try { $signatureImageData = base64_encode(file_get_contents($signaturePath)); $signatureMimeType = 'jpeg'; $doctorName = 'dr. Said. M. Bin. Smith. MAP'; } catch (Exception $e) { $signatureImageData = null; } } } if (!$isGeneralAccount && !$signatureImageData && $examinerUser && stripos($examinerUser->name, 'Zakia') !== false) { $signaturePath = public_path('assets/images/ttd/dr.zakia.jpg'); if (file_exists($signaturePath)) { try { $signatureImageData = base64_encode(file_get_contents($signaturePath)); $signatureMimeType = 'jpeg'; $doctorName = 'dr. Zakia Alaydrus'; } catch (Exception $e) { $signatureImageData = null; } } } if (!$isGeneralAccount && !$signatureImageData) { if ($result->status === 'verified' && $examinerUser) { $doctorName = $examinerUser->name; } else { $doctorName = ''; $signatureImageData = null; } } $doctorName = $doctorIdentity['name'] ?? ($verifierIdentity['name'] ?? $doctorName); @endphp @if ($result->status === 'verified') @if (isset($qr_image) && $qr_image) QR Code Verifikasi Pemeriksaan DASS21
{{ $doctorName }}
@elseif ($signatureImageData) Tanda Tangan {{ $doctorName }}
{{ $doctorName }}
@else
{{ $doctorName }}
@endif @else
 
@endif
@endif
@if (isset($showPrintMode) && $showPrintMode) @endif