@extends('layouts.app') @php $source = $source ?? 'all'; $showMcuWorklist = $source !== 'regular'; $showRegularWorklist = $source !== 'mcu'; $worklistTitle = match ($source) { 'mcu' => 'Antrian Lab MCU', 'regular' => 'Antrian Lab Reguler', default => 'Worklist Laboratorium', }; @endphp @section('title', $worklistTitle . ' - MCU Klinik Mustika') @section('breadcrumb')
Permintaan Klinik
{{ $source === 'regular' ? 'Menunggu Sampel' : 'Antrian Menunggu' }}
Sedang Diproses
Sampel Diambil
Menunggu Verifikasi
Total Aktif
| No. | @include('partials.tables.sort_link', ['column' => 'order_number', 'label' => 'Nomor']) | @include('partials.tables.sort_link', ['column' => 'name', 'label' => 'Pasien']) | Jenis Kelamin | Umur | Tanggal Kunjungan | Dokter | Pemeriksaan | Total Snapshot | Status | @include('partials.tables.sort_link', ['column' => 'ordered_at', 'label' => 'Waktu Dikirim']) | Aksi |
|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ $regularLabOrders->firstItem() + $loop->index }} |
{{ $labOrder->order_number }}
{{ $labOrder->regularCheckup?->checkup_number }}
|
{{ $labOrder->patient?->name ?? '-' }}
{{ $labOrder->patient?->medical_record_number ?: '-' }}
|
{{ ['male' => 'Laki-laki', 'female' => 'Perempuan'][$labOrder->patient?->gender] ?? '-' }} | {{ $labOrder->patient?->formatAgeAt($labOrder->regularCheckup->checkup_date) ?? '-' }} | {{ \App\Helpers\DateHelper::formatShort( $labOrder->regularCheckup->checkup_date, ) }} | {{ $labOrder->orderedBy?->name ?? '-' }} |
@foreach ($labOrder->displayItems() as $item)
{{ $item->test_name }}
@endforeach
{{ $labOrder->displayItems()->count() }} item
|
Rp {{ number_format((float) $labOrder->total_amount, 0, ',', '.') }} | {{ $labOrder->statusLabel() }} | {{ $labOrder->ordered_at?->format('d/m/Y H:i') ?? '-' }} |
@if ($labOrder->status === \App\Models\LabOrder::STATUS_REQUESTED)
@can ('process-lab-exam')
Ambil Sampel
@endcan
@elseif ($labOrder->status === \App\Models\LabOrder::STATUS_SAMPLE_FAILED)
@can ('process-lab-exam')
Ambil Ulang Sampel
@endcan
@elseif ($labOrder->status === \App\Models\LabOrder::STATUS_IN_PROGRESS)
@can ('process-lab-exam')
Input Hasil
@endcan
@elseif ($labOrder->status === \App\Models\LabOrder::STATUS_REJECTED)
@can ('process-lab-exam')
Edit Hasil
@endcan
@elseif ($labOrder->status === \App\Models\LabOrder::STATUS_PENDING_VERIFICATION)
Menunggu Dokter
@endif
@if ($labOrder->canBeCancelled())
@can ('process-lab-exam')
@endcan
@endif
|
| Belum ada permintaan laboratorium dari Klinik Reguler pada tanggal ini. | |||||||||||
| Sumber | No. | No. Registrasi & MR | @include('partials.tables.sort_link', ['column' => 'name', 'label' => 'Nama Pasien']) | @include('partials.tables.sort_link', ['column' => 'gender', 'label' => 'Jenis Kelamin']) | @include('partials.tables.sort_link', ['column' => 'age', 'label' => 'Umur']) | @include('partials.tables.sort_link', ['column' => 'appointment_date', 'label' => 'Tanggal MCU']) | Status | Pemeriksa | Waktu Diarahkan | MCU Ke | Aksi |
|---|---|---|---|---|---|---|---|---|---|---|---|
| MCU | {{ $pendingAppointments->firstItem() + $loop->index }} |
{{ $appointment->registration_number ?? '-' }}
{{ $appointment->patient->medical_record_number ?? '-' }}
|
{{ $appointment->patient->name }}
@php
$companyFromPatient = $appointment->patient && $appointment->patient->company ? $appointment->patient->company : null;
$company = $companyFromPatient ?: $appointment->company ?? null;
@endphp
@if ($company)
{{ $company->name }}
@if ($appointment->patient->job_position)
{{ $appointment->patient->job_position }}
@endif
@else
Individu
@endif
|
{{ $appointment->patient->gender == 'male' ? 'Laki-laki' : 'Perempuan' }} | {{ $appointment->patient->detailed_age ?: '-' }} | {{ $appointment->appointment_date ? $appointment->appointment_date->format('d/m/Y') : '-' }} |
@if ($labItem)
@if ($labItem->status === 'menunggu')
Menunggu Pemeriksaan
@elseif ($labItem->status === 'antrian')
Siap Diperiksa
@elseif ($labItem->status === 'sedang_diproses')
@if ($workflowLabResult && $workflowLabResult->cancelled_at && $workflowLabResult->status !== 'rejected')
Verifikasi Dibatalkan
@elseif ($workflowLabResult && $workflowLabResult->status === 'rejected')
Ditolak - Perlu Perbaikan
@else
Sedang Diproses
@endif
@elseif ($labItem->status === 'menunggu_verifikasi')
@if ($workflowLabResult && $workflowLabResult->cancelled_at && $workflowLabResult->status !== 'rejected')
Verifikasi Dibatalkan
@elseif ($workflowLabResult && $workflowLabResult->status === 'rejected')
Ditolak - Perlu Perbaikan
@else
Menunggu Verifikasi
@endif
@elseif ($labItem->status === 'sample_collected')
@if ($workflowLabResult && $workflowLabResult->cancelled_at && $workflowLabResult->status !== 'rejected')
Verifikasi Dibatalkan
@elseif ($workflowLabResult && $workflowLabResult->status === 'rejected')
Ditolak - Perlu Perbaikan
@else
Sampel Diambil
@endif
@endif
@elseif ($workflowLabResult && $workflowLabResult->status === 'completed' && !$labItem)
Menunggu Verifikasi
@elseif ($labResultSampleCollected)
@php $labResult = $labResultSampleCollected; @endphp
@if ($labResult->isCancelledResult ?? false)
Perlu Perbaikan
Verifikasi dibatalkan @else Sampel Diambil @endif @elseif (!$labItem && $hasCancelledOrRejected) @if ($workflowLabResult && $workflowLabResult->status === 'rejected') Ditolak - Perlu Perbaikan @elseif ($workflowLabResult && $workflowLabResult->cancelled_at && $workflowLabResult->status !== 'rejected') Verifikasi Dibatalkan @endif @endif |
{{ $workflowLabResult->technician->name ?? ($workflowLabResult->selectedTechnicianStaff->employee->full_name ?? '-') }} |
@php
$assignedTime = $labItem && $labItem->assigned_at ? $labItem->assigned_at->format('d/m/Y H:i') : '';
$assignedBy = $labItem && $labItem->assignedBy ? $labItem->assignedBy->name : '';
if ($assignedTime === '' && $workflowLabResult && $workflowLabResult->created_at) {
$assignedTime = $workflowLabResult->created_at->format('d/m/Y H:i');
if ($workflowLabResult->relationLoaded('technician') && $workflowLabResult->technician) {
$assignedBy = $workflowLabResult->technician->name;
}
}
@endphp
@if ($assignedTime)
{{ $assignedTime }}
@if ($assignedBy)
oleh: {{ $assignedBy }}
@endif
@else
-
@endif
|
@php
$mcuOrder = $appointment->patient->appointments
->filter(function ($apt) use ($appointment) {
return $apt->status !== 'cancelled' &&
($apt->appointment_date < $appointment->appointment_date ||
($apt->appointment_date->eq($appointment->appointment_date) && $apt->id <= $appointment->id));
})
->count();
$previousMcu = $appointment->patient->appointments
->filter(function ($apt) use ($appointment) {
return $apt->status !== 'cancelled' &&
($apt->appointment_date < $appointment->appointment_date ||
($apt->appointment_date->eq($appointment->appointment_date) && $apt->id < $appointment->id));
})
->sortByDesc('appointment_date')
->first();
@endphp
MCU ke-{{ $mcuOrder }}
@if ($previousMcu)
MCU Terakhir: {{ \App\Helpers\DateHelper::formatFull($previousMcu->appointment_date) }}
@else
Pertama kali
@endif
|
@if ($labItem && $labItem->status === 'menunggu_verifikasi')
@if ($workflowLabResult)
@canRoute ('lab.results.edit')
@endcanRoute
@if ($workflowLabResult->cancelled_at)
Verifikasi Dibatalkan
@elseif ($workflowLabResult->status === 'rejected')
Ditolak - Perlu Perbaikan
@else
Menunggu Dokter
@endif
@else
Menunggu Dokter
@endif
@elseif ($labItem && in_array($labItem->status, ['menunggu', 'antrian', 'sedang_diproses']))
@if ($workflowLabResult && in_array($workflowLabResult->status, ['sample_collected', 'completed']))
@if ($workflowLabResult->cancelled_at)
@elseif ($workflowLabResult->status === 'completed')
@else
@canRoute ('lab.input_results')
Input
Hasil
@endcanRoute
@endif
@elseif ($workflowLabResult && $workflowLabResult->cancelled_at && $workflowLabResult->status !== 'rejected')
@elseif ($workflowLabResult && $workflowLabResult->status === 'rejected')
@else
@php
$buttonText = $labItem->status === 'sedang_diproses' ? 'Lanjutkan' : 'Ambil Sampel';
$buttonClass = $labItem->status === 'sedang_diproses' ? 'btn-warning' : 'btn-danger';
@endphp
@canRoute ('lab.process')
{{ $buttonText }}
@endcanRoute
@endif
@elseif ($labItem && $labItem->status === 'sample_collected')
@if ($workflowLabResult && $workflowLabResult->cancelled_at && $workflowLabResult->status !== 'rejected')
@elseif ($workflowLabResult && $workflowLabResult->status === 'rejected')
@else
@canRoute ('lab.input_results')
Input Hasil
@endcanRoute
@endif
@elseif (!$labItem && $labResultSampleCollected)
@php $labResult = $labResultSampleCollected; @endphp
@if ($labResult->isCancelledResult ?? false)
@canRoute ('lab.results.edit')
@endcanRoute
Verifikasi
dibatalkan
@if ($labResult->cancelledBy && $labResult->cancelled_at)
@elseif (!$labItem && $workflowLabResult && $workflowLabResult->status === 'completed')
oleh: {{ $labResult->cancelledBy->name }} @endif @else @canRoute ('lab.input_results') Input Hasil @endcanRoute @endif
@canRoute ('lab.results.edit')
@endcanRoute
@if ($workflowLabResult->cancelled_at)
Verifikasi Dibatalkan
@elseif ($workflowLabResult->status === 'rejected')
Ditolak - Perlu Perbaikan
@else
Menunggu Dokter
@endif
@elseif (!$labItem && $hasCancelledOrRejected)
@if ($workflowLabResult)
@canRoute ('lab.results.edit')
@endcanRoute
@if ($workflowLabResult->status === 'rejected')
Ditolak - Perlu Perbaikan
@elseif ($workflowLabResult->cancelled_at)
Verifikasi Dibatalkan
@endif
@endif
@else
@if ($workflowLabResult && in_array($workflowLabResult->status, ['sample_collected', 'completed']))
Hasil lab sudah tersedia
@else
@canRoute ('appointments.assign-workstation')
@endcanRoute
@endif
@endif
|
| Tidak ada data yang cocok dengan pencarian. | |||||||||||