Total Pasien MCU

{{ $monitoringStats['total'] }}

Sedang dalam proses
Menunggu

{{ $monitoringStats['waiting'] }}

Tahapan menunggu
Sedang Diproses

{{ $monitoringStats['in_progress'] }}

Tahapan dalam proses
Selesai

{{ $monitoringStats['completed'] }}

Tahapan selesai
@include('partials.tables.examination_date_filter') @include('partials.tables.filters', ['paginator' => $appointments, 'tableFilters' => ['date', 'sort', 'direction']])
@if ($appointments->isEmpty())
Tidak ada pasien yang sedang dalam proses MCU saat ini

Pasien yang terdaftar akan muncul di halaman ini ketika sedang menjalani pemeriksaan MCU.

@else
@foreach ($appointments as $index => $appointment) @php // Define all stages including registration and finalization $allStages = [ 'registration' => [ 'name' => 'Pendaftaran', 'icon' => 'ri-user-add-line', 'result' => $appointment, // Always completed if appointment exists 'short' => 'REG', 'type' => 'registration', ], 'physical_exam' => [ 'name' => 'Pemeriksaan Fisik', 'icon' => 'ri-stethoscope-line', 'result' => $appointment->physicalExamResult, 'short' => 'PE', 'type' => 'workstation', ], 'lab' => [ 'name' => 'Laboratorium', 'icon' => 'ri-test-tube-line', 'result' => $appointment->labResult, 'short' => 'LAB', 'type' => 'workstation', ], 'radiology' => [ 'name' => 'Radiologi', 'icon' => 'ri-camera-line', 'result' => $appointment->radiologyResult, 'short' => 'RAD', 'type' => 'workstation', ], 'spirometry' => [ 'name' => 'Spirometry', 'icon' => 'ri-lungs-line', 'result' => $appointment->spirometryResult, 'short' => 'SPR', 'type' => 'workstation', ], 'audiometry' => [ 'name' => 'Audiometry', 'icon' => 'ri-ear-line', 'result' => $appointment->audiometryResult, 'short' => 'AUD', 'type' => 'workstation', ], 'visus' => [ 'name' => 'Visus', 'icon' => 'ri-eye-line', 'result' => $appointment->visusResult, 'short' => 'VIS', 'type' => 'workstation', ], 'ekg' => [ 'name' => 'EKG', 'icon' => 'ri-heart-pulse-line', 'result' => $appointment->ekgResult, 'short' => 'EKG', 'type' => 'workstation', ], 'finalization' => [ 'name' => 'Finalisasi Dokter', 'icon' => 'ri-file-check-line', 'result' => $appointment->mcuResult, 'short' => 'FIN', 'type' => 'finalization', ], ]; // Calculate completion status (only for workstations) $workstationStages = array_filter($allStages, function ($stage) { return $stage['type'] === 'workstation'; }); $completedStations = 0; $totalStations = count($workstationStages); $inProgressStations = 0; foreach ($workstationStages as $stage) { if ($stage['result']) { $status = $stage['result']->status ?? ''; // Completed status: verified, finalized, or completed (waiting for verification) if (in_array($status, ['verified', 'finalized', 'completed'])) { $completedStations++; } elseif (in_array($status, ['pending_verification', 'draft', 'in_progress'])) { $inProgressStations++; } } } // Calculate overall progress $overallPercent = $totalStations > 0 ? ($completedStations / $totalStations) * 100 : 0; @endphp @endforeach
No. @include('partials.tables.sort_link', ['column' => 'registration_number', 'label' => 'No. Registrasi']) @include('partials.tables.sort_link', ['column' => 'medical_record_number', 'label' => 'No. Rekam Medis']) @include('partials.tables.sort_link', ['column' => 'name', 'label' => 'Nama Pasien']) Tanggal MCU Progress Pemeriksaan Aksi
{{ $index + 1 }} {{ $appointment->registration_number ?? '-' }} {{ $appointment->patient->medical_record_number ?? '-' }}
{{ $appointment->patient->name ?? 'Pasien Tidak Ditemukan' }} {{ $appointment->patient ? ($appointment->patient->gender == 'male' ? 'Laki-laki' : 'Perempuan') : '-' }} @php $displayCompany = $appointment->company ?? ($appointment->patient?->company ?? $appointment->mcuResult?->company); @endphp @if ($displayCompany) • {{ $displayCompany->name }} @endif
{{ \App\Helpers\DateHelper::formatShort( $appointment->appointment_date, ) }} {{ $appointment->appointment_time ?? '08:00' }}
Progress: {{ $completedStations }}/{{ $totalStations }}
@foreach ($allStages as $stageName => $stageData) @php $statusClass = 'bg-secondary'; $tooltip = 'Menunggu'; if ($stageData['type'] === 'registration') { // Registration always completed $statusClass = 'bg-success'; $tooltip = 'Selesai'; } elseif ($stageData['type'] === 'finalization') { // Finalization status if ($stageData['result'] && in_array($stageData['result']->status ?? '', ['finalized'])) { $statusClass = 'bg-success'; $tooltip = 'Selesai'; } elseif ($appointment->status === 'completed') { $statusClass = 'bg-info'; $tooltip = 'Menunggu Finalisasi'; } } else { // Workstation status if ($stageData['result']) { $status = $stageData['result']->status ?? ''; if (in_array($status, ['verified', 'finalized'])) { $statusClass = 'bg-success'; $tooltip = 'Selesai & Diverifikasi'; } elseif ($status === 'completed') { $statusClass = 'bg-success'; $tooltip = 'Selesai (Menunggu Verifikasi)'; } elseif (in_array($status, ['pending_verification', 'draft'])) { $statusClass = 'bg-info'; $tooltip = 'Menunggu Verifikasi'; } elseif ($status === 'in_progress') { $statusClass = 'bg-warning'; $tooltip = 'Sedang Diproses'; } } } @endphp {{ $stageData['short'] }} @endforeach
@canRoute ('monitoring.detail') @endcanRoute {{-- @if($completedStations === $totalStations && $totalStations > 0) @endif @if($appointment->mcuResult && $appointment->mcuResult->status === 'finalized') @endif --}}
{{ $appointments->links('partials.tables.pagination') }}
@endif