@php $specialtyLabel = $specialtyLabel ?? null; $queueBridge = app(\App\Services\Care\CareQueueBridge::class); @endphp
@if ($canManageQueue) Walk-in @endif @include('care.partials.queue-board', [ 'queue' => $queue, 'inConsultation' => $inConsultation, 'queueIntegration' => $queueIntegration ?? null, 'branchId' => $branchId, 'canConsult' => $canConsult, 'lockToPractitioner' => $lockToPractitioner ?? false, 'canSwitchBranch' => $canSwitchBranch ?? false, 'branches' => $branches ?? collect(), 'practitioners' => $practitioners ?? collect(), 'practitionerId' => $practitionerId ?? null, 'queueCallNextRoute' => 'care.queue.call-next', 'queueCallNextParams' => array_filter(['practitioner_id' => $practitionerId]), 'startRouteName' => 'care.queue.start', 'inCareLabel' => $specialtyLabel ? 'In care' : 'In consultation', 'openInCareUrl' => function ($appointment) use ($queueBridge) { $organization = $appointment->organization; if ($organization && $appointment->visit) { $context = $queueBridge->contextForAppointment($organization, $appointment); if ($context !== \App\Services\Care\CareQueueContexts::CONSULTATION) { return route('care.specialty.workspace', [ 'module' => $context, 'visit' => $appointment->visit, ]); } } return $appointment->consultation ? route('care.consultations.show', $appointment->consultation) : null; }, ])