@php $examData = \App\Helpers\PhysicalExamHelper::processExamData($item->physical_examination_data ?? []); $systemNames = [ 'head_neck' => ['name' => 'Kepala & Leher', 'color' => 'primary', 'icon' => 'ri-user-head-line'], 'chest_lungs' => ['name' => 'Dada dan Paru-Paru', 'color' => 'info', 'icon' => 'ri-lungs-line'], 'heart' => ['name' => 'Jantung', 'color' => 'danger', 'icon' => 'ri-heart-line'], 'abdomen' => ['name' => 'Abdomen', 'color' => 'success', 'icon' => 'ri-body-scan-line'], 'extremities' => ['name' => 'Ekstremitas', 'color' => 'warning', 'icon' => 'ri-hand-line'], 'skin_nails' => ['name' => 'Kulit dan Kuku', 'color' => 'secondary', 'icon' => 'ri-hand-sanitizer-line'], 'special' => ['name' => 'Penilaian Khusus', 'color' => 'dark', 'icon' => 'ri-stethoscope-line'], ]; @endphp
Informasi Pemeriksaan
Tanggal MCU
{{ optional($item->appointment->appointment_date) ? \App\Helpers\DateHelper::formatFull($item->appointment->appointment_date) : '-' }}
No. Regitrasi
{{ $item->appointment->registration_number ?? '-' }}
Nama Pasien
{{ $item->appointment->patient->name ?? '-' }}
No. Rekam Medis
{{ $item->appointment->patient->medical_record_number ?? '-' }}
Perusahaan
@php $modalCompanyObj = $item->appointment?->company ?? $item->appointment?->mcuResult?->company; $modalCompany = $modalCompanyObj?->name ?? $item->appointment?->patient?->company?->name; $currentPatientCompanyId = $item->appointment?->patient?->company_id; $isPreviousCompanyModal = false; if ($modalCompanyObj) { if ($currentPatientCompanyId) { $isPreviousCompanyModal = (int) $modalCompanyObj->id !== (int) $currentPatientCompanyId; } else { $isPreviousCompanyModal = true; } } $modalPatient = $item->appointment?->patient; $modalWorkAct = $item->appointment?->workActivity ?? ($item->appointment?->id ? \App\Models\WorkActivity::where('appointment_id', $item->appointment->id)->first() : null); // Resolusi Jabatan di Modal Detail $modalJobPosition = null; if ($modalWorkAct && !empty($modalWorkAct->occupation) && $modalWorkAct->occupation !== '-') { $modalJobPosition = $modalWorkAct->occupation; } if (!$modalJobPosition || $modalJobPosition === '-') { $compTargetId = $modalCompanyObj?->id ?? $item->appointment?->company_id; if ($compTargetId && $modalPatient) { $corpEmp = $modalPatient->corporateInvitationEmployees?->first( fn($emp) => $emp->invitation?->company_id == $compTargetId || $emp->company_id == $compTargetId, ); if ($corpEmp) { $modalJobPosition = $corpEmp->resolvedPositionName(); } } } if (!$modalJobPosition || $modalJobPosition === '-') { $anyCorpEmp = $modalPatient?->corporateInvitationEmployees?->first(); if ($anyCorpEmp) { $modalJobPosition = $anyCorpEmp->resolvedPositionName(); } } if (!$modalJobPosition || $modalJobPosition === '-') { $modalJobPosition = $modalPatient?->job_position ?? ($modalPatient?->occupation ?? '-'); } if (empty($modalJobPosition)) { $modalJobPosition = '-'; } // Resolusi Tahun Mulai Bekerja di Modal Detail $modalWorkStartYear = null; if ($modalWorkAct && !empty($modalWorkAct->work_start_year) && $modalWorkAct->work_start_year !== '-') { $modalWorkStartYear = $modalWorkAct->work_start_year; } if ((!$modalWorkStartYear || $modalWorkStartYear === '-') && $item->appointment?->id) { $aptLog = \App\Models\PatientChangeLog::where('appointment_id', $item->appointment->id) ->where('field_name', 'work_start_year') ->whereNotNull('new_value') ->where('new_value', '!=', '-') ->where('new_value', '!=', '') ->orderBy('created_at', 'desc') ->first(); if ($aptLog) { $modalWorkStartYear = $aptLog->new_value; } } if ((!$modalWorkStartYear || $modalWorkStartYear === '-') && $modalCompanyObj?->id && $modalPatient) { $compTargetId = $modalCompanyObj->id; $compWork = \App\Models\WorkActivity::where('patient_id', $modalPatient->id) ->whereHas('appointment', function ($q) use ($compTargetId) { $q->where('company_id', $compTargetId); }) ->whereNotNull('work_start_year') ->where('work_start_year', '!=', '-') ->where('work_start_year', '!=', '') ->latest() ->first(); if ($compWork) { $modalWorkStartYear = $compWork->work_start_year; } } if ((!$modalWorkStartYear || $modalWorkStartYear === '-') && $modalPatient) { $aptCreatedAt = $item->appointment?->created_at ?: now(); $prevWorkYear = \App\Models\WorkActivity::where('patient_id', $modalPatient->id) ->where('created_at', '<=', $aptCreatedAt) ->whereNotNull('work_start_year') ->where('work_start_year', '!=', '-') ->where('work_start_year', '!=', '') ->orderBy('created_at', 'desc') ->first(); if ($prevWorkYear) { $modalWorkStartYear = $prevWorkYear->work_start_year; } } if ((!$modalWorkStartYear || $modalWorkStartYear === '-') && $modalPatient) { $aptCreatedAt = $item->appointment?->created_at ?: now(); $changeLogYear = \App\Models\PatientChangeLog::where('patient_id', $modalPatient->id) ->where('field_name', 'work_start_year') ->whereNotNull('new_value') ->where('new_value', '!=', '-') ->where('new_value', '!=', '') ->where('created_at', '<=', $aptCreatedAt) ->orderBy('created_at', 'desc') ->first(); if ($changeLogYear) { $modalWorkStartYear = $changeLogYear->new_value; } } if (empty($modalWorkStartYear)) { $modalWorkStartYear = '-'; } @endphp {{ $modalCompany ? $modalCompany . ($isPreviousCompanyModal ? ' (Perusahaan Sebelumnya)' : '') : 'Individu' }}
Jabatan
{{ $modalJobPosition }}
Tahun Mulai Bekerja
{{ $modalWorkStartYear }}
Paket MCU
{{ $item->appointment->mcuPackage->name ?? '-' }}
Ringkasan Abnormal
@if (!empty($item->history_abnormal_details) && count($item->history_abnormal_details) > 0)
    @foreach ($item->history_abnormal_details as $note)
  • {{ $note }}
  • @endforeach
@else

Dalam batas normal

@endif
Tanda Vital Singkat
  • Tekanan darah: {{ $item->blood_pressure_systolic ?? '-' }}/{{ $item->blood_pressure_diastolic ?? '-' }} mmHg
  • Nadi: {{ $item->heart_rate ? $item->heart_rate . ' bpm' : '-' }}
  • Respirasi: {{ $item->respiratory_rate ? $item->respiratory_rate . '/menit' : '-' }}
  • Suhu: {{ $item->body_temperature !== null ? number_format((float) $item->body_temperature, 1) . '°C' : '-' }}
  • IMT: {{ $item->bmi !== null && $item->bmi !== '' ? number_format((float) $item->bmi, 1) : '-' }}
Keadaan Umum
Keadaan Umum {{ $item->general_appearance ?? '-' }}
Kesadaran {{ $item->consciousness_level ?? '-' }}
@if ($item->notes)
Catatan
{{ $item->notes }}
@endif
Pemeriksaan Sistem Organ
@if (!empty(array_filter((array) $examData))) @php $has_any = false; @endphp @foreach ($systemNames as $systemKey => $systemInfo) @if (isset($examData[$systemKey]) && is_array($examData[$systemKey]) && !empty(array_filter($examData[$systemKey]))) @php $has_any = true; @endphp
{{ $systemInfo['name'] }}
@php if ($systemKey === 'special') { $orderedFields = ['breast_exam', 'prostate_exam', 'anus_exam', 'romberg_test']; foreach ($orderedFields as $field) { if (isset($examData[$systemKey][$field]) && !empty($examData[$systemKey][$field])) { $value = $examData[$systemKey][$field]; echo ''; echo ''; echo ''; echo ''; } } } else { foreach ($examData[$systemKey] as $key => $value) { if (!str_ends_with((string) $key, '_detail') && !empty($value)) { echo ''; echo ''; echo ''; echo ''; } } } @endphp
Pemeriksaan Hasil
' . \App\Helpers\PhysicalExamHelper::getFieldLabel($field) . '' . \App\Helpers\PhysicalExamHelper::renderPhysicalExamValue( $value, $examData[$systemKey][$field . '_detail'] ?? null, $field, ) . '
' . \App\Helpers\PhysicalExamHelper::getFieldLabel((string) $key) . '' . \App\Helpers\PhysicalExamHelper::renderPhysicalExamValue( $value, $examData[$systemKey][$key . '_detail'] ?? null, (string) $key, ) . '
@endif @endforeach @if (!$has_any)

Detail pemeriksaan sistem tidak tercatat.

@endif @else

Data sistem organ tidak tersedia.

@endif