@php $pageTitle = match ($section) { 'workspace' => ($patientHeader['patient'] ?? null)?->fullName() ?: 'Workspace', 'history' => 'Visit history', 'billing' => 'Billing', 'visits' => 'Patient queue', default => 'Patient queue', }; @endphp
@if ($section === 'workspace')
@if (! empty($canAccessPatientQueue)) ← Back to queue @else @endif
@if ($moduleKey === 'dentistry') Reports @endif @if ($moduleKey === 'emergency') Reports @endif @if ($moduleKey === 'blood_bank') Reports @endif History @if ($canManageClinical ?? $canManageSpecialty ?? true) Billing @endif
@if (($specialtyAccessLevel ?? 'manage') !== 'manage')
@if (($specialtyAccessLevel ?? '') === 'refer') You have view + refer access. You can review results and refer patients into this specialty queue; clinical editing is limited to specialists and supporting staff. @else You have view-only access. Results and history are available; clinical edits require specialty access. @endif
@elseif (($canManageSpecialty ?? false) && ! ($canConsult ?? false))
You can work this specialty floor (queue, vitals, billing support) but starting encounters and clinical chart edits require a clinician with consultation access.
@endif
@include('care.specialty.sections.workspace')
@include('care.partials.clinical-actions-panel', [ 'actionsView' => 'care.specialty.partials.actions-menu', 'title' => 'Actions', ])
@include('care.partials.clinical-actions-mobile', [ 'actionsView' => 'care.specialty.partials.actions-menu', 'title' => 'Actions', ]) @php $completeConsultation = ($canConsult ?? false) ? $workspaceVisit?->appointment?->consultation : null; @endphp @if ($completeConsultation && $completeConsultation->status !== \App\Models\Consultation::STATUS_COMPLETED) @endif @elseif ($section === 'history')

{{ $definition['nav_label'] ?? $definition['label'] ?? ucfirst($moduleKey) }} · Visit history

Completed encounters for this service line.

← Specialty home
@include('care.specialty.sections.history') @elseif ($section === 'billing')

{{ $definition['nav_label'] ?? $definition['label'] ?? ucfirst($moduleKey) }} · Billing

Service catalog for this module.

← Specialty home
@include('care.specialty.sections.billing') @else {{-- Queue home (overview / visits) — same UI as GP Queue --}}
@php $specialtyLabel = $definition['nav_label'] ?? $definition['label'] ?? ucfirst($moduleKey); @endphp

{{ $specialtyLabel }}

@if ($canManageQueue ?? false) Walk-in @endif
History @if ($canManageClinical ?? $canManageSpecialty ?? true) Billing @endif
@include('care.partials.queue-board', [ 'queue' => $queue, 'inConsultation' => $inConsultation, 'done' => $done ?? collect(), 'queueIntegration' => $queueIntegration ?? null, 'branchId' => $branchId, 'branchLabel' => $branchLabel ?? null, 'canConsult' => $canConsult ?? false, 'lockToPractitioner' => $lockToPractitioner ?? false, 'showFilters' => true, 'queueCallNextRoute' => ($canCallNext ?? $canManageSpecialty ?? false) ? 'care.specialty.call-next' : null, 'queueCallNextParams' => ['module' => $moduleKey], 'startRouteName' => 'care.queue.start', 'inCareLabel' => 'In care', 'openInCareUrl' => function ($appointment) use ($moduleKey) { if ($appointment->visit) { return route('care.specialty.workspace', [ 'module' => $moduleKey, 'visit' => $appointment->visit, ]); } return $appointment->consultation ? route('care.consultations.show', $appointment->consultation) : null; }, ])
@include('care.partials.clinical-actions-panel', [ 'actionsView' => 'care.specialty.partials.actions-menu', 'title' => 'Actions', ])
@include('care.partials.clinical-actions-mobile', [ 'actionsView' => 'care.specialty.partials.actions-menu', 'title' => 'Actions', ]) @endif