{{-- Shared patient-flow board (GP Queue + specialty Queue homes). Expected vars: - $queue, $inConsultation (collections of Appointment) - $done (optional — completed today) - $queueIntegration, $branchId - $canConsult (bool) - $queueCallNextRoute, $queueCallNextParams (optional — if set, Call next renders above board) - $startRouteName (default care.queue.start) — route(name, $appointment) - $openInCareUrl (callable Appointment $a): ?string — link for in-care Open - $inCareLabel (default "In care") - $lockToPractitioner, $canSwitchBranch, $branches, $practitioners, $practitionerId (filter bar) - $showFilters (default true) --}} @php $canConsult = $canConsult ?? false; $showFilters = $showFilters ?? true; $inCareLabel = $inCareLabel ?? 'In care'; $startRouteName = $startRouteName ?? 'care.queue.start'; $openInCareUrl = $openInCareUrl ?? function ($appointment) { return $appointment->consultation ? route('care.consultations.show', $appointment->consultation) : null; }; $queueCallNextRoute = $queueCallNextRoute ?? null; $queueCallNextParams = $queueCallNextParams ?? []; $done = $done ?? collect(); $calledStatuses = ['called', 'serving']; $waitingList = $queue->reject( fn ($a) => in_array($a->queue_ticket_status ?? '', $calledStatuses, true) )->values(); $calledList = $queue->filter( fn ($a) => in_array($a->queue_ticket_status ?? '', $calledStatuses, true) )->values(); $stages = [ [ 'key' => 'waiting', 'label' => 'Waiting', 'count' => $waitingList->count(), 'items' => $waitingList, 'empty' => 'No patients waiting.', 'accent' => 'text-slate-500', 'dot' => 'bg-slate-400', ], [ 'key' => 'called', 'label' => 'Called', 'count' => $calledList->count(), 'items' => $calledList, 'empty' => 'No one called yet.', 'accent' => 'text-indigo-600', 'dot' => 'bg-indigo-500', ], [ 'key' => 'in_care', 'label' => $inCareLabel, 'count' => $inConsultation->count(), 'items' => $inConsultation, 'empty' => 'No active encounters.', 'accent' => 'text-emerald-700', 'dot' => 'bg-emerald-500', ], [ 'key' => 'done', 'label' => 'Done', 'count' => $done->count(), 'items' => $done, 'empty' => 'None completed today.', 'accent' => 'text-slate-400', 'dot' => 'bg-slate-300', ], ]; @endphp @if ($showFilters)
@endifStart patients from the waiting column when they arrive at your desk.
@endif{{ $stage['empty'] }}
@endforelse