{{-- Specialty action buttons (desktop sticky + mobile sheet). --}} @php $btn = 'flex w-full items-center justify-center rounded-xl px-3 py-2.5 text-sm font-semibold transition'; $btnPrimary = $btn.' bg-indigo-600 text-white hover:bg-indigo-700'; $btnSecondary = $btn.' border border-slate-200 bg-white text-slate-800 hover:bg-slate-50'; $btnAccent = $btn.' border border-indigo-200 bg-indigo-50 text-indigo-900 hover:bg-indigo-100'; $onWorkspace = ($section ?? '') === 'workspace'; $appointment = $workspaceVisit?->appointment; $openConsultation = $appointment?->consultation; $ticketCalled = $appointment && $appointment->queue_ticket_status === 'called'; $canStartConsultation = $appointment && in_array($appointment->status, [ \App\Models\Appointment::STATUS_WAITING, \App\Models\Appointment::STATUS_CHECKED_IN, ], true); $consultationInProgress = $appointment && ( $appointment->status === \App\Models\Appointment::STATUS_IN_CONSULTATION || ($openConsultation && $openConsultation->status !== \App\Models\Consultation::STATUS_COMPLETED) ); $canCompleteConsultation = $consultationInProgress && $openConsultation && $openConsultation->status !== \App\Models\Consultation::STATUS_COMPLETED; $chartTab = collect($workspaceTabs ?? []) ->keys() ->first(fn ($key) => ! in_array($key, ['overview', 'timeline', 'orders', 'billing', 'documents'], true)) ?: 'clinical_notes'; @endphp @if ($onWorkspace) @include('care.partials.queue-ops', [ 'queueIntegration' => $queueIntegration ?? null, 'queueCallNextRoute' => 'care.specialty.call-next', 'queueCallNextParams' => ['module' => $moduleKey], 'branchId' => $branchId ?? null, 'currentAppointmentId' => $appointment?->id, ]) @endif @if ($ticketCalled && $appointment)
@csrf
@endif @if ($workspaceVisit) @if ($canCompleteConsultation) @endif @if ($consultationInProgress) Open chart @elseif ($canStartConsultation)
@csrf
@endif @if ($workspaceVisit->patient) Patient chart @endif @if ($workspaceVisit->appointment) Appointment @endif @endif Back to queue Register / book