@php
$appointment = $appointment ?? null;
@endphp
@if ($appointment && $appointment->mcuResult && $appointment->mcuResult->health_status)
Kesimpulan
:
@php
$healthStatusMap = [
'fit' => 'Fit',
'fit_with_treatment' => 'Fit with Treatment',
'temporary_unfit' => 'Temporary Unfit',
'unfit' => 'Unfit',
'fit_for_the_job' => 'Fit for the Job',
'fit_for_the_job_with_treatment' => 'Fit for the Job with Treatment',
'fit_with_note' => 'Fit with Note',
'fit_for_the_job_with_note' => 'Fit for the Job with Note',
];
@endphp
{{
$healthStatusMap[$appointment->mcuResult->health_status] ??
ucwords(str_replace('_', ' ', $appointment->mcuResult->health_status))
}}
@endif
@if ($appointment && $appointment->clinicalDiagnoses->isNotEmpty())
Diagnosis ICD-10
:
@foreach ($appointment->clinicalDiagnoses as $diagnosis)
@if ($diagnosis->is_primary)
Utama:
@endif
{{ $diagnosis->code_snapshot }}
— {{ $diagnosis->display_snapshot }}
@if (!$loop->last)
@endif
@endforeach
@endif
@if ($appointment && $appointment->clinicalProcedures->isNotEmpty())
Tindakan ICD-9-CM
:
@foreach ($appointment->clinicalProcedures as $procedure)
{{ $procedure->code_snapshot }}
— {{ $procedure->display_snapshot }}
@if (!$loop->last)
@endif
@endforeach
@endif
@if ($appointment && $appointment->mcuResult && $appointment->mcuResult->examination_summary)
Saran
:
{{ $appointment->mcuResult->examination_summary }}
@endif
SARAN MCU:
@if ($appointment && $appointment->mcuResult && $appointment->mcuResult->mcu_suggestions)
@php
// Ambil sumber data saran (array langsung atau JSON), lalu bersihkan dan hilangkan duplikasi
$rawSuggestions = is_array($appointment->mcuResult->mcu_suggestions)
? $appointment->mcuResult->mcu_suggestions
: json_decode($appointment->mcuResult->mcu_suggestions, true) ?? [];
// Normalisasi isi: trim spasi, rapikan spasi berlebih, abaikan item kosong,
// dan hilangkan duplikasi secara case-insensitive sambil mempertahankan teks asli yang dibersihkan
$seenKeys = [];
$suggestions = [];
foreach ($rawSuggestions as $item) {
if (!is_string($item)) {
continue;
}
$clean = trim(preg_replace('/\s+/', ' ', $item));
if ($clean === '') {
continue;
}
$key = mb_strtolower($clean);
if (!isset($seenKeys[$key])) {
$seenKeys[$key] = true;
$suggestions[] = $clean;
}
}
@endphp
@if (count($suggestions) > 0)
@foreach ($suggestions as $suggestion)
- {{ $suggestion }}
@endforeach
@else
Tidak ada saran khusus
@endif
@elseif ($appointment && $appointment->mcuResult && $appointment->mcuResult->examination_summary)
{{-- Fallback to old examination_summary for backward compatibility --}}
Catatan Verifikasi (Legacy):
{{ $appointment->mcuResult->examination_summary }}
@else
Tidak ada saran khusus
@endif