@extends('admin.layouts.main') @section('title', 'Konseling') @section('content')

Detail Kuisioner

@foreach($questions as $q) @endforeach
No Aspek Penilaian Nilai
{{ $loop->iteration }} {{ $q['aspek_penilaian'] }} @if(isset($kuisioner->answers[$loop->iteration - 1])) {{ $kuisioner->answers[$loop->iteration - 1] }} @else - @endif
@php $answers = $kuisioner->answers ?? []; $depression_items = [3, 5, 10, 13, 16, 17, 21, 24, 26, 31, 34, 37, 38, 42]; $anxiety_items = [2, 4, 7, 9, 15, 19, 20, 23, 25, 28, 30, 36, 40, 41]; $stress_items = [1, 6, 8, 11, 12, 14, 18, 22, 27, 29, 32, 33, 35, 39]; $depression_score = collect($depression_items)->reduce(function ($carry, $index) use ($answers) { return $carry + ($answers[$index - 1] ?? 0); }, 0); $anxiety_score = collect($anxiety_items)->reduce(function ($carry, $index) use ($answers) { return $carry + ($answers[$index - 1] ?? 0); }, 0); $stress_score = collect($stress_items)->reduce(function ($carry, $index) use ($answers) { return $carry + ($answers[$index - 1] ?? 0); }, 0); function get_dass_category($type, $score) { $thresholds = [ 'depression' => [ ['label' => 'Normal', 'max' => 9], ['label' => 'Ringan', 'max' => 13], ['label' => 'Sedang', 'max' => 20], ['label' => 'Berat', 'max' => 27], ['label' => 'Sangat Berat', 'max' => PHP_INT_MAX], ], 'anxiety' => [ ['label' => 'Normal', 'max' => 7], ['label' => 'Ringan', 'max' => 9], ['label' => 'Sedang', 'max' => 14], ['label' => 'Berat', 'max' => 19], ['label' => 'Sangat Berat', 'max' => PHP_INT_MAX], ], 'stress' => [ ['label' => 'Normal', 'max' => 14], ['label' => 'Ringan', 'max' => 18], ['label' => 'Sedang', 'max' => 25], ['label' => 'Berat', 'max' => 33], ['label' => 'Sangat Berat', 'max' => PHP_INT_MAX], ], ]; foreach ($thresholds[$type] as $threshold) { if ($score <= $threshold['max']) { return $threshold['label']; } } return 'Tidak Diketahui' ; } function get_interpretation($label) { return match ($label) { 'Normal'=> 'Tidak ada indikasi gangguan.', 'Ringan' => 'Perlu pemantauan berkala.', 'Sedang' => 'Pertimbangkan untuk konsultasi.', 'Berat' => 'Disarankan konsultasi dengan profesional.', 'Sangat Berat' => 'Sangat disarankan mendapatkan bantuan profesional segera.', default => '-', }; } $depression_label = get_dass_category('depression', $depression_score); $anxiety_label = get_dass_category('anxiety', $anxiety_score); $stress_label = get_dass_category('stress', $stress_score); @endphp @php $categories = [ 'Depresi' => [ 'score' => $depression_score, 'label' => $depression_label, 'color' => 'primary', 'interpretation' => get_interpretation($depression_label), 'dass21' => round($depression_score / 2, 1), ], 'Kecemasan' => [ 'score' => $anxiety_score, 'label' => $anxiety_label, 'color' => 'success', 'interpretation' => get_interpretation($anxiety_label), 'dass21' => round($anxiety_score / 2, 1), ], 'Stres' => [ 'score' => $stress_score, 'label' => $stress_label, 'color' => 'warning', 'interpretation' => get_interpretation($stress_label), 'dass21' => round($stress_score / 2, 1), ] ]; @endphp

🧠 Hasil Evaluasi Skor DASS-42

@foreach ($categories as $key => $data) @endforeach
Aspek Skor DASS-42 Versi DASS-21 Kategori Interpretasi
{{ $key }} {{ $data['score'] }} {{ $data['dass21'] }} {{ $data['label'] }} {{ $data['interpretation'] }}

Skor DASS-42 dikonversi ke DASS-21 untuk referensi standar internasional. Interpretasi bertujuan sebagai gambaran awal dan bukan diagnosis klinis.

@endsection