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

{{ $dassConclusion }}

@php $examinerDoctor = null; $examinerUser = null; $isGeneralAccount = false; if ($appointment->dass21Result->selectedDoctorStaff) { $examinerDoctor = $appointment->dass21Result->selectedDoctorStaff; if (!$examinerDoctor && $appointment->dass21Result->verified_by) { $examinerUser = $appointment->dass21Result->verifiedBy; } } elseif ($appointment->dass21Result->verified_by) { $examinerUser = $appointment->dass21Result->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'; $doctorPosition = 'Dokter Umum'; 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'; $doctorPosition = $examinerDoctor->employee->position->name ?? 'Dokter Umum'; } 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'; $doctorPosition = 'Dokter Umum'; } 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'; $doctorPosition = 'Dokter Umum'; } catch (Exception $e) { $signatureImageData = null; } } } if (!$isGeneralAccount && !$signatureImageData) { $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'; $doctorPosition = 'Dokter Umum'; } catch (Exception $e) { $signatureImageData = null; } } } @endphp @if (isset($qr_image) && $qr_image) QR Code Verifikasi Pemeriksaan DASS21
{{ $doctorName }}
@elseif ($signatureImageData) Tanda Tangan {{ $doctorName }} @endif
@endif
@endif