@php $plan = $dentalPlan; $openItems = $plan?->items?->whereIn('status', ['proposed', 'accepted']) ?? collect(); $currentStage = $workspaceVisit->specialty_stage; $canManage = $canConsult ?? false; $stageFlow = [ 'waiting' => ['next' => 'chair', 'label' => 'Seat at chair'], 'chair' => ['next' => 'procedure', 'label' => 'Start procedure'], 'procedure' => ['next' => 'recovery', 'label' => 'Move to recovery'], 'recovery' => ['next' => 'completed', 'label' => 'Complete visit'], ]; @endphp

Overview

Visit stage, summary, and open treatment work.

Dentistry reports

Visit stage

{{ $currentStage ? ucfirst(str_replace('_', ' ', $currentStage)) : 'Not set' }}

@foreach (['waiting', 'chair', 'procedure', 'recovery', 'completed'] as $stageCode) @if ($canManage)
@csrf
@else $currentStage === $stageCode, 'border border-slate-200 bg-white text-slate-400' => $currentStage !== $stageCode, ]) @if ($currentStage !== $stageCode) aria-disabled="true" title="View-only access" @endif > {{ ucfirst($stageCode) }} @endif @endforeach @if ($canManage && $currentStage && isset($stageFlow[$currentStage]))
@csrf
@endif
Visit status
{{ ucfirst(str_replace('_', ' ', $workspaceVisit->status)) }}
Checked in
{{ $workspaceVisit->checked_in_at?->format('d M Y H:i') ?? '—' }}
Queue
{{ $workspaceVisit->appointment?->queue_ticket_number ?? '—' }} @if ($workspaceVisit->appointment?->queue_ticket_status) ({{ $workspaceVisit->appointment->queue_ticket_status }}) @endif
Treatment plan
@if ($plan) {{ ucfirst(str_replace('_', ' ', $plan->status)) }} · {{ $currency ?? 'GHS' }} {{ number_format($plan->estimate_minor / 100, 2) }} @else None open @endif
@if ($openItems->isNotEmpty())

Unfinished plan items

@endif @if (! empty($clinicalAlerts))

Alerts

@foreach ($clinicalAlerts as $alert)

{{ $alert['message'] ?? '' }}

@endforeach
@endif