@extends(request()->query('fragment') === 'detail' ? 'layouts.fragment' : 'layouts.app') @section('title', 'Detail Progress MCU - MCU Klinik Mustika') @section('breadcrumb')

Detail Progress MCU

@endsection @section('content')
@if (session('success')) @endif @if (session('error')) @endif @if ($appointment->mcuResult && $appointment->mcuResult->status === 'finalized')
{{--
--}}
MCU Telah Selesai & Diverifikasi

Hasil MCU sudah dapat diunduh dalam format PDF
Diverifikasi pada: {{ \App\Helpers\DateHelper::formatDate( $appointment->mcuResult->finalized_at, ) }}{{ $appointment->mcuResult->finalized_at ? ', ' . $appointment->mcuResult->finalized_at->format('H:i') : '' }} WITA

@canRoute ('monitoring.print-pdf') @endcanRoute
@endif
Informasi Pasien
{{ $appointment->patient->medical_record_number ?? '-' }}
Nama Lengkap {{ $appointment->patient->name }}
NIK {{ $appointment->patient->nik ?? '-' }}
Tanggal Lahir {{ $appointment->patient->birth_date ? \App\Helpers\DateHelper::formatShort($appointment->patient->birth_date) : '-' }}
Jenis Kelamin {{ $appointment->patient->gender == 'male' ? 'Laki-laki' : 'Perempuan' }}
Telepon {{ $appointment->patient->phone_number ?? '-' }}
Informasi MCU
{{ ucfirst($appointment->status) }}
Tanggal MCU {{ \App\Helpers\DateHelper::formatShort( $appointment->appointment_date, ) }}
Waktu {{ $appointment->appointment_time ?? '08:00' }}
Paket MCU {{ $appointment->mcuPackage->name ?? '-' }}
Perusahaan @php $displayCompany = $appointment->company ?? ($appointment->patient?->company ?? $appointment->mcuResult?->company); @endphp @if ($displayCompany) {{ $displayCompany->name }} @else Individu @endif
No. Registrasi {{ $appointment->registration_number ?? '-' }}
Timeline Progress MCU
@canRoute ('monitoring.progress') Kembali ke Monitoring @endcanRoute
@php $stages = [ [ 'label' => 'Pendaftaran', 'icon' => 'ri-user-add-line', 'timestamp' => $appointment->created_at, 'verified_at' => $appointment->created_at, 'status' => 'Selesai', 'detail' => ['Operator' => $appointment->creator->name ?? '-'], ], [ 'label' => 'Pemeriksaan Fisik', 'icon' => 'ri-stethoscope-line', 'timestamp' => optional($appointment->physicalExamResult)->created_at, 'verified_at' => optional($appointment->physicalExamResult)->verified_at, 'status' => $appointment->physicalExamResult && in_array($appointment->physicalExamResult->status, ['verified', 'completed', 'finalized']) ? 'Selesai' : 'Menunggu', 'detail' => [], ], [ 'label' => 'Laboratorium', 'icon' => 'ri-test-tube-line', 'timestamp' => optional($appointment->labResult)->created_at, 'verified_at' => optional($appointment->labResult)->verified_at, 'status' => $appointment->labResult && in_array($appointment->labResult->status, ['verified', 'completed', 'finalized']) ? 'Selesai' : 'Menunggu', 'detail' => [], ], [ 'label' => 'Radiologi', 'icon' => 'ri-camera-line', 'timestamp' => optional($appointment->radiologyResult)->created_at, 'verified_at' => optional($appointment->radiologyResult)->verified_at, 'status' => $appointment->radiologyResult && in_array($appointment->radiologyResult->status, ['verified', 'completed', 'finalized']) ? 'Selesai' : 'Menunggu', 'detail' => [], ], [ 'label' => 'Spirometry', 'icon' => 'ri-lungs-line', 'timestamp' => optional($appointment->spirometryResult)->created_at, 'verified_at' => optional($appointment->spirometryResult)->verified_at, 'status' => $appointment->spirometryResult && in_array($appointment->spirometryResult->status, ['verified', 'completed', 'finalized']) ? 'Selesai' : 'Menunggu', 'detail' => [], ], [ 'label' => 'Audiometri', 'icon' => 'ri-volume-up-line', 'timestamp' => optional($appointment->audiometryResult)->created_at, 'verified_at' => optional($appointment->audiometryResult)->verified_at, 'status' => $appointment->audiometryResult && in_array($appointment->audiometryResult->status, ['verified', 'completed', 'finalized']) ? 'Selesai' : 'Menunggu', 'detail' => [], ], [ 'label' => 'Visus', 'icon' => 'ri-eye-line', 'timestamp' => optional($appointment->visusResult)->created_at, 'verified_at' => optional($appointment->visusResult)->verified_at, 'status' => $appointment->visusResult && in_array($appointment->visusResult->status, ['verified', 'completed', 'finalized']) ? 'Selesai' : 'Menunggu', 'detail' => [], ], [ 'label' => 'EKG', 'icon' => 'ri-heart-pulse-line', 'timestamp' => optional($appointment->ekgResult)->created_at, 'verified_at' => optional($appointment->ekgResult)->verified_at, 'status' => $appointment->ekgResult && in_array($appointment->ekgResult->status, ['verified', 'completed', 'finalized']) ? 'Selesai' : 'Menunggu', 'detail' => [], ], [ 'label' => 'Finalisasi Dokter', 'icon' => 'ri-file-paper-2-line', 'timestamp' => optional($appointment->mcuResult)->finalized_at, 'verified_at' => optional($appointment->mcuResult)->finalized_at, 'status' => optional($appointment->mcuResult)->status === 'finalized' ? 'Selesai' : 'Menunggu', 'detail' => ['Dokter' => optional($appointment->mcuResult)->doctor_name ?? '-'], ], ]; @endphp @foreach ($stages as $stage)
{{ $stage['label'] }}
{{ $stage['status'] }}
{{ $stage['timestamp'] ? \App\Helpers\DateHelper::formatShort($stage['timestamp']) . ' ' . $stage['timestamp']->format('H:i') : '-' }}
@if ($stage['verified_at'])
{{ \App\Helpers\DateHelper::formatShort( $stage['verified_at'], ) }} {{ $stage['verified_at']->format('H:i') }}
@endif @foreach ($stage['detail'] as $label => $value)
{{ $label }}: {{ $value }}
@endforeach
@endforeach
@php // Calculate overall completion based on timeline stages $totalStages = count($stages); $completedStagesTimeline = collect($stages)->filter(fn($s) => $s['status'] === 'Selesai')->count(); @endphp {{--
Progress Keseluruhan
{{ $completedStagesTimeline }}/{{ $totalStages }} Selesai
{{ $totalStages > 0 ? round(($completedStagesTimeline / $totalStages) * 100) : 0 }}% Progress Pemeriksaan @if($completedStagesTimeline === $totalStages && $totalStages > 0) Lihat Hasil & Verifikasi @else {{ $totalStages - $completedStagesTimeline }} tahapan tersisa @endif
--}}
{{-- Prepare all stages array for summary stats --}} @php $allStages = [ ['type' => 'registration', 'result' => $appointment], ['type' => 'physical_exam', 'result' => $appointment->physicalExamResult], ['type' => 'lab', 'result' => $appointment->labResult], ['type' => 'radiology', 'result' => $appointment->radiologyResult], ['type' => 'spirometry', 'result' => $appointment->spirometryResult], ['type' => 'audiometry', 'result' => $appointment->audiometryResult], ['type' => 'visus', 'result' => $appointment->visusResult], ['type' => 'ekg', 'result' => $appointment->ekgResult], ['type' => 'finalization', 'result' => $appointment->mcuResult], ]; @endphp

{{ count($stages) }}

Total Tahapan
@php $waitingStages = 0; $inProgressStages = 0; $completedStages = 0; foreach ($stages as $stage) { if ($stage['status'] === 'Selesai') { $completedStages++; } else { $waitingStages++; } } @endphp

{{ $waitingStages }}

Menunggu

{{ $inProgressStages }}

Dalam Proses

{{ $completedStages }}

Selesai
@endsection @push('styles') @endpush @push('scripts') @endpush