Ship full Emergency specialty suite on the shared shell.
Deploy Ladill Care / deploy (push) Successful in 34s

Add ED visit stages, triage-driven routing, vitals, observation, disposition, reports, and print summary so Emergency matches Dentistry’s operational depth without a parallel EHR.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-18 17:48:57 +00:00
co-authored by Cursor
parent 18c24077e3
commit 7989ab9184
19 changed files with 1413 additions and 22 deletions
@@ -0,0 +1,88 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ED summary · {{ $patient->fullName() }}</title>
<style>
body { font-family: system-ui, sans-serif; color: #0f172a; margin: 2rem; }
h1 { font-size: 1.25rem; margin: 0 0 .25rem; }
h2 { font-size: .95rem; margin: 1.25rem 0 .5rem; border-bottom: 1px solid #e2e8f0; padding-bottom: .25rem; }
.meta { color: #64748b; font-size: .875rem; }
dl { display: grid; grid-template-columns: 10rem 1fr; gap: .35rem .75rem; font-size: .875rem; }
dt { color: #64748b; }
dd { margin: 0; font-weight: 500; }
@media print { .no-print { display: none; } }
</style>
</head>
<body>
<p class="no-print"><a href="{{ route('care.specialty.workspace', ['module' => 'emergency', 'visit' => $visit]) }}">Back</a></p>
<h1>{{ $patient->fullName() }}</h1>
<p class="meta">
{{ $patient->patient_number }}
· Visit #{{ $visit->id }}
· Stage {{ $visit->specialty_stage ?? '—' }}
· {{ $visit->checked_in_at?->format('d M Y H:i') ?? '—' }}
</p>
<h2>Triage</h2>
@if ($triage)
<dl>
<dt>Acuity</dt><dd>{{ $triage->payload['acuity'] ?? '—' }}</dd>
<dt>Chief complaint</dt><dd>{{ $triage->payload['chief_complaint'] ?? '—' }}</dd>
<dt>Mode of arrival</dt><dd>{{ $triage->payload['mode_of_arrival'] ?? '—' }}</dd>
<dt>ABC</dt>
<dd>
A {{ ($triage->payload['airway_ok'] ?? true) ? 'OK' : 'Compromised' }}
· B {{ ($triage->payload['breathing_ok'] ?? true) ? 'OK' : 'Compromised' }}
· C {{ ($triage->payload['circulation_ok'] ?? true) ? 'OK' : 'Compromised' }}
</dd>
<dt>GCS / Pain</dt><dd>{{ $triage->payload['gcs'] ?? '—' }} / {{ $triage->payload['pain_score'] ?? '—' }}</dd>
<dt>Notes</dt><dd>{{ $triage->payload['notes'] ?? '—' }}</dd>
</dl>
@else
<p class="meta">No triage recorded.</p>
@endif
<h2>Latest vitals</h2>
@if ($latestVitals)
<dl>
<dt>BP</dt><dd>{{ $latestVitals->bp_systolic ?? '—' }}/{{ $latestVitals->bp_diastolic ?? '—' }}</dd>
<dt>Pulse</dt><dd>{{ $latestVitals->pulse ?? '—' }}</dd>
<dt>SpO₂</dt><dd>{{ $latestVitals->spo2 ?? '—' }}%</dd>
<dt>Temp</dt><dd>{{ $latestVitals->temperature ?? '—' }}</dd>
<dt>RR</dt><dd>{{ $latestVitals->respiratory_rate ?? '—' }}</dd>
<dt>Recorded</dt><dd>{{ $latestVitals->recorded_at?->format('d M Y H:i') }}</dd>
</dl>
@else
<p class="meta">No vitals recorded.</p>
@endif
<h2>Clinical note</h2>
@if ($clinicalNote)
<dl>
<dt>History</dt><dd>{{ $clinicalNote->payload['history'] ?? '—' }}</dd>
<dt>Examination</dt><dd>{{ $clinicalNote->payload['examination'] ?? '—' }}</dd>
<dt>Diagnosis</dt><dd>{{ $clinicalNote->payload['working_diagnosis'] ?? '—' }}</dd>
<dt>Plan</dt><dd>{{ $clinicalNote->payload['plan'] ?? '—' }}</dd>
</dl>
@else
<p class="meta">No clinical note.</p>
@endif
<h2>Disposition</h2>
@if ($disposition)
<dl>
<dt>Disposition</dt><dd>{{ $disposition->payload['disposition'] ?? '—' }}</dd>
<dt>Condition</dt><dd>{{ $disposition->payload['condition'] ?? '—' }}</dd>
<dt>Destination</dt><dd>{{ $disposition->payload['destination'] ?? '—' }}</dd>
<dt>Diagnosis</dt><dd>{{ $disposition->payload['diagnosis'] ?? '—' }}</dd>
<dt>Advice</dt><dd>{{ $disposition->payload['advice'] ?? '—' }}</dd>
</dl>
@else
<p class="meta">No disposition recorded.</p>
@endif
<script>window.print();</script>
</body>
</html>
@@ -0,0 +1,88 @@
<x-app-layout title="Emergency reports">
<div class="space-y-6">
<div class="flex flex-wrap items-center justify-between gap-3">
<div>
<h1 class="text-xl font-semibold text-slate-900">Emergency reports</h1>
<p class="mt-1 text-sm text-slate-500">Arrivals, acuity mix, dispositions, length of stay, and ED service revenue.</p>
</div>
<a href="{{ route('care.queue.index') }}" class="text-sm font-medium text-indigo-600"> Back to queue</a>
</div>
<form method="GET" class="flex flex-wrap items-end gap-3 rounded-2xl border border-slate-200 bg-white p-4">
<div>
<label class="block text-xs font-medium text-slate-600">From</label>
<input type="date" name="from" value="{{ $report['from'] ?? '' }}" class="mt-1 rounded-xl border border-slate-200 px-3 py-2 text-sm">
</div>
<div>
<label class="block text-xs font-medium text-slate-600">To</label>
<input type="date" name="to" value="{{ $report['to'] ?? '' }}" class="mt-1 rounded-xl border border-slate-200 px-3 py-2 text-sm">
</div>
<button type="submit" class="rounded-xl bg-indigo-600 px-4 py-2 text-sm font-semibold text-white">Apply</button>
</form>
<div class="grid gap-4 sm:grid-cols-4">
<div class="rounded-2xl border border-slate-200 bg-white p-4">
<p class="text-xs font-semibold uppercase tracking-wide text-slate-500">Arrivals today</p>
<p class="mt-2 text-2xl font-semibold tabular-nums text-slate-900">{{ number_format($report['arrivals_today']) }}</p>
</div>
<div class="rounded-2xl border border-slate-200 bg-white p-4">
<p class="text-xs font-semibold uppercase tracking-wide text-slate-500">Completed today</p>
<p class="mt-2 text-2xl font-semibold tabular-nums text-slate-900">{{ number_format($report['completed_today']) }}</p>
</div>
<div class="rounded-2xl border border-slate-200 bg-white p-4">
<p class="text-xs font-semibold uppercase tracking-wide text-slate-500">High-acuity open</p>
<p class="mt-2 text-2xl font-semibold tabular-nums text-rose-700">{{ number_format($report['high_acuity_open']) }}</p>
</div>
<div class="rounded-2xl border border-slate-200 bg-white p-4">
<p class="text-xs font-semibold uppercase tracking-wide text-slate-500">Avg LOS (range)</p>
<p class="mt-2 text-2xl font-semibold tabular-nums text-slate-900">
{{ $report['avg_los_minutes'] !== null ? $report['avg_los_minutes'].' min' : '—' }}
</p>
</div>
</div>
<div class="grid gap-4 lg:grid-cols-2">
<section class="rounded-2xl border border-slate-200 bg-white p-5">
<h2 class="text-sm font-semibold text-slate-900">Acuity distribution</h2>
<ul class="mt-3 space-y-2 text-sm">
@forelse ($report['acuity_distribution'] as $row)
<li class="flex justify-between gap-3">
<span>{{ $row['acuity'] }}</span>
<span class="tabular-nums text-slate-600">{{ $row['total'] }}</span>
</li>
@empty
<li class="text-slate-500">No triage records in range.</li>
@endforelse
</ul>
</section>
<section class="rounded-2xl border border-slate-200 bg-white p-5">
<h2 class="text-sm font-semibold text-slate-900">Dispositions</h2>
<ul class="mt-3 space-y-2 text-sm">
@forelse ($report['disposition_breakdown'] as $row)
<li class="flex justify-between gap-3">
<span>{{ $row['disposition'] }}</span>
<span class="tabular-nums text-slate-600">{{ $row['total'] }}</span>
</li>
@empty
<li class="text-slate-500">No dispositions in range.</li>
@endforelse
</ul>
</section>
</div>
<section class="rounded-2xl border border-slate-200 bg-white p-5">
<h2 class="text-sm font-semibold text-slate-900">ED service revenue</h2>
<ul class="mt-3 space-y-2 text-sm">
@forelse ($report['revenue_by_service'] as $row)
<li class="flex justify-between gap-3">
<span>{{ $row->description }} <span class="text-slate-400">×{{ $row->total }}</span></span>
<span class="tabular-nums">{{ $currency }} {{ number_format($row->amount_minor / 100, 2) }}</span>
</li>
@empty
<li class="text-slate-500">No ED bill lines in range.</li>
@endforelse
</ul>
</section>
</div>
</x-app-layout>
@@ -0,0 +1,68 @@
@php
$record = $emergencyDisposition;
$payload = old('payload', $record?->payload ?? []);
@endphp
<section class="rounded-2xl border border-slate-200 bg-white p-5">
<div class="flex flex-wrap items-start justify-between gap-3">
<div>
<h3 class="text-sm font-semibold text-slate-900">Disposition</h3>
<p class="mt-0.5 text-xs text-slate-500">Final disposition closes the emergency visit episode.</p>
</div>
<a href="{{ route('care.specialty.emergency.print', $workspaceVisit) }}" target="_blank" class="text-sm font-medium text-indigo-600">Print summary</a>
</div>
<form method="POST" action="{{ route('care.specialty.emergency.disposition', $workspaceVisit) }}" class="mt-4 space-y-3">
@csrf
<input type="hidden" name="tab" value="disposition">
<div class="grid gap-3 sm:grid-cols-2">
<div>
<label class="block text-xs font-medium text-slate-600">Final disposition</label>
<select name="payload[disposition]" required class="mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm">
<option value="">Select…</option>
@foreach (['Discharge home', 'Admit to ward', 'Admit to ICU', 'Transfer to facility', 'Left against advice', 'Died', 'Absconded'] as $opt)
<option value="{{ $opt }}" @selected(($payload['disposition'] ?? '') === $opt)>{{ $opt }}</option>
@endforeach
</select>
@error('payload.disposition')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
</div>
<div>
<label class="block text-xs font-medium text-slate-600">Condition</label>
<select name="payload[condition]" class="mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm">
<option value="">Select…</option>
@foreach (['Stable', 'Improving', 'Unstable', 'Critical', 'Deceased'] as $opt)
<option value="{{ $opt }}" @selected(($payload['condition'] ?? '') === $opt)>{{ $opt }}</option>
@endforeach
</select>
</div>
<div>
<label class="block text-xs font-medium text-slate-600">Destination</label>
<input type="text" name="payload[destination]" value="{{ $payload['destination'] ?? '' }}" class="mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm">
</div>
<div>
<label class="block text-xs font-medium text-slate-600">Disposition time</label>
<input type="text" name="payload[time]" value="{{ $payload['time'] ?? '' }}" placeholder="e.g. 14:30" class="mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm">
</div>
<div class="sm:col-span-2">
<label class="block text-xs font-medium text-slate-600">Diagnosis</label>
<input type="text" name="payload[diagnosis]" value="{{ $payload['diagnosis'] ?? '' }}" required class="mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm">
@error('payload.diagnosis')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
</div>
<div class="sm:col-span-2">
<label class="block text-xs font-medium text-slate-600">Advice / follow-up</label>
<textarea name="payload[advice]" rows="3" class="mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm">{{ $payload['advice'] ?? '' }}</textarea>
</div>
<div class="sm:col-span-2">
<label class="block text-xs font-medium text-slate-600">Medications on discharge</label>
<textarea name="payload[medications]" rows="2" class="mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm">{{ $payload['medications'] ?? '' }}</textarea>
</div>
<div class="sm:col-span-2">
<label class="block text-xs font-medium text-slate-600">Notes</label>
<textarea name="payload[notes]" rows="2" class="mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm">{{ $payload['notes'] ?? '' }}</textarea>
</div>
</div>
<button type="submit" class="btn-primary">Save disposition &amp; complete visit</button>
</form>
</section>
@@ -0,0 +1,117 @@
@php
$triage = $emergencyTriage;
$payload = $triage?->payload ?? [];
$currentStage = $workspaceVisit->specialty_stage;
$stageFlow = $emergencyStageFlow ?? [];
$latest = $emergencyLatestVitals;
@endphp
<section class="rounded-2xl border border-slate-200 bg-white p-5">
<div class="flex flex-wrap items-start justify-between gap-3">
<div>
<h3 class="text-sm font-semibold text-slate-900">Emergency overview</h3>
<p class="mt-0.5 text-xs text-slate-500">Acuity, stage, ABC flags, and latest vitals for this visit.</p>
</div>
<div class="flex flex-wrap gap-3 text-sm">
<a href="{{ route('care.specialty.emergency.print', $workspaceVisit) }}" target="_blank" class="font-medium text-indigo-600">Print summary</a>
<a href="{{ route('care.specialty.emergency.reports') }}" class="font-medium text-indigo-600">ED reports</a>
</div>
</div>
<div class="mt-4 grid gap-3 sm:grid-cols-3">
<div class="rounded-xl border border-slate-100 bg-slate-50 px-3 py-3">
<p class="text-xs font-semibold uppercase tracking-wide text-slate-500">Acuity</p>
<p class="mt-1 text-sm font-semibold text-slate-900">{{ $payload['acuity'] ?? 'Not triaged' }}</p>
<p class="mt-1 text-xs text-slate-500">{{ $payload['chief_complaint'] ?? '—' }}</p>
</div>
<div class="rounded-xl border border-slate-100 bg-slate-50 px-3 py-3">
<p class="text-xs font-semibold uppercase tracking-wide text-slate-500">ABC</p>
<p class="mt-1 text-sm text-slate-900">
A {{ ($payload['airway_ok'] ?? true) ? '✓' : '✗' }}
· B {{ ($payload['breathing_ok'] ?? true) ? '✓' : '✗' }}
· C {{ ($payload['circulation_ok'] ?? true) ? '✓' : '✗' }}
</p>
<p class="mt-1 text-xs text-slate-500">Pain {{ $payload['pain_score'] ?? '—' }} · GCS {{ $payload['gcs'] ?? '—' }}</p>
</div>
<div class="rounded-xl border border-slate-100 bg-slate-50 px-3 py-3">
<p class="text-xs font-semibold uppercase tracking-wide text-slate-500">Latest vitals</p>
@if ($latest)
<p class="mt-1 text-sm text-slate-900">
BP {{ $latest->bp_systolic ?? '—' }}/{{ $latest->bp_diastolic ?? '—' }}
· P {{ $latest->pulse ?? '—' }}
· SpO₂ {{ $latest->spo2 ?? '—' }}%
</p>
<p class="mt-1 text-xs text-slate-500">{{ $latest->recorded_at?->format('d M H:i') }}</p>
@else
<p class="mt-1 text-sm text-slate-500">None recorded</p>
@endif
</div>
</div>
<div class="mt-4 rounded-xl border border-slate-100 bg-slate-50 px-3 py-3">
<p class="text-xs font-semibold uppercase tracking-wide text-slate-500">Visit stage</p>
<p class="mt-1 text-sm font-medium text-slate-900">
{{ $currentStage ? ucfirst(str_replace('_', ' ', $currentStage)) : 'Not set' }}
</p>
<div class="mt-3 flex flex-wrap gap-2">
@foreach (($emergencyStageCodes ?: ['arrival', 'resus', 'treatment', 'observation', 'disposition']) as $stageCode)
<form method="POST" action="{{ route('care.specialty.emergency.stage', $workspaceVisit) }}">
@csrf
<input type="hidden" name="stage" value="{{ $stageCode }}">
<button type="submit"
@class([
'rounded-lg px-2.5 py-1 text-xs font-semibold',
'bg-indigo-600 text-white' => $currentStage === $stageCode,
'border border-slate-200 bg-white text-slate-700 hover:bg-slate-50' => $currentStage !== $stageCode,
])>
{{ ucfirst(str_replace('_', ' ', $stageCode)) }}
</button>
</form>
@endforeach
@if ($currentStage && isset($stageFlow[$currentStage]) && $stageFlow[$currentStage]['next'] !== $currentStage)
<form method="POST" action="{{ route('care.specialty.emergency.stage', $workspaceVisit) }}">
@csrf
<input type="hidden" name="stage" value="{{ $stageFlow[$currentStage]['next'] }}">
<button type="submit" class="rounded-lg bg-emerald-600 px-2.5 py-1 text-xs font-semibold text-white hover:bg-emerald-700">
{{ $stageFlow[$currentStage]['label'] }}
</button>
</form>
@endif
</div>
</div>
<dl class="mt-4 grid gap-3 text-sm sm:grid-cols-2">
<div>
<dt class="text-slate-500">Mode of arrival</dt>
<dd class="font-medium text-slate-900">{{ $payload['mode_of_arrival'] ?? '—' }}</dd>
</div>
<div>
<dt class="text-slate-500">Disposition intent</dt>
<dd class="font-medium text-slate-900">{{ $payload['disposition_intent'] ?? '—' }}</dd>
</div>
<div>
<dt class="text-slate-500">Queue</dt>
<dd class="font-medium text-slate-900">
{{ $workspaceVisit->appointment?->queue_ticket_number ?? '—' }}
@if ($workspaceVisit->appointment?->queue_ticket_status)
<span class="text-slate-500">({{ $workspaceVisit->appointment->queue_ticket_status }})</span>
@endif
</dd>
</div>
<div>
<dt class="text-slate-500">Checked in</dt>
<dd class="font-medium text-slate-900">{{ $workspaceVisit->checked_in_at?->format('d M Y H:i') ?? '—' }}</dd>
</div>
</dl>
@if (! empty($clinicalAlerts))
<div class="mt-4 space-y-1.5 border-t border-slate-100 pt-4">
<p class="text-xs font-semibold uppercase tracking-wide text-slate-500">Alerts</p>
@foreach ($clinicalAlerts as $alert)
<p class="text-sm {{ ($alert['severity'] ?? '') === 'critical' ? 'text-rose-700' : 'text-amber-800' }}">
{{ $alert['message'] ?? '' }}
</p>
@endforeach
</div>
@endif
</section>
@@ -0,0 +1,67 @@
<section class="rounded-2xl border border-slate-200 bg-white p-5">
<div class="flex flex-wrap items-start justify-between gap-3">
<div>
<h3 class="text-sm font-semibold text-slate-900">Vitals</h3>
<p class="mt-0.5 text-xs text-slate-500">Record BP, pulse, SpO₂, temperature, and respiratory rate on this ED visit.</p>
</div>
</div>
<form method="POST" action="{{ route('care.specialty.emergency.vitals', $workspaceVisit) }}" class="mt-4 grid gap-3 sm:grid-cols-4">
@csrf
<div>
<label class="block text-xs font-medium text-slate-600">BP systolic</label>
<input type="number" name="bp_systolic" class="mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm">
</div>
<div>
<label class="block text-xs font-medium text-slate-600">BP diastolic</label>
<input type="number" name="bp_diastolic" class="mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm">
</div>
<div>
<label class="block text-xs font-medium text-slate-600">Pulse</label>
<input type="number" name="pulse" class="mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm">
</div>
<div>
<label class="block text-xs font-medium text-slate-600">SpO₂ %</label>
<input type="number" name="spo2" class="mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm">
</div>
<div>
<label class="block text-xs font-medium text-slate-600">Temperature °C</label>
<input type="number" step="0.1" name="temperature" class="mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm">
</div>
<div>
<label class="block text-xs font-medium text-slate-600">Respiratory rate</label>
<input type="number" name="respiratory_rate" class="mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm">
</div>
<div>
<label class="block text-xs font-medium text-slate-600">Weight kg</label>
<input type="number" step="0.1" name="weight_kg" class="mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm">
</div>
<div>
<label class="block text-xs font-medium text-slate-600">Height cm</label>
<input type="number" step="0.1" name="height_cm" class="mt-1 w-full rounded-xl border border-slate-200 px-3 py-2 text-sm">
</div>
<div class="sm:col-span-4">
<button type="submit" class="btn-primary">Save vitals</button>
</div>
</form>
<div class="mt-6 border-t border-slate-100 pt-4">
<p class="text-xs font-semibold uppercase tracking-wide text-slate-500">History</p>
<ul class="mt-2 divide-y divide-slate-100 text-sm">
@forelse ($emergencyVitals as $row)
<li class="flex flex-wrap justify-between gap-2 py-2">
<span>
BP {{ $row->bp_systolic ?? '—' }}/{{ $row->bp_diastolic ?? '—' }}
· P {{ $row->pulse ?? '—' }}
· SpO₂ {{ $row->spo2 ?? '—' }}%
· T {{ $row->temperature ?? '—' }}
· RR {{ $row->respiratory_rate ?? '—' }}
</span>
<span class="text-slate-500">{{ $row->recorded_at?->format('d M Y H:i') }}</span>
</li>
@empty
<li class="py-3 text-slate-500">No vitals recorded yet.</li>
@endforelse
</ul>
</div>
</section>
@@ -22,14 +22,21 @@
&& $openConsultation->status !== \App\Models\Consultation::STATUS_COMPLETED;
$chartTab = collect($workspaceTabs ?? [])
->keys()
->first(fn ($key) => ! in_array($key, ['overview', 'timeline', 'plan', 'treat', 'notes', 'imaging', 'orders', 'billing', 'documents', 'perio', 'lab', 'recalls'], true))
?: 'odontogram';
$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'],
];
->first(fn ($key) => ! in_array($key, ['overview', 'timeline', 'plan', 'treat', 'notes', 'imaging', 'orders', 'billing', 'documents', 'perio', 'lab', 'recalls', 'vitals', 'disposition', 'observation'], true))
?: ($moduleKey === 'emergency' ? 'triage' : 'odontogram');
$stageFlow = $moduleKey === 'emergency'
? ($emergencyStageFlow ?? [
'arrival' => ['next' => 'treatment', 'label' => 'Move to treatment'],
'resus' => ['next' => 'treatment', 'label' => 'Move to treatment bay'],
'treatment' => ['next' => 'observation', 'label' => 'Move to observation'],
'observation' => ['next' => 'disposition', 'label' => 'Ready for disposition'],
])
: [
'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'],
];
$currentStage = $workspaceVisit?->specialty_stage;
@endphp
@@ -63,6 +70,18 @@
<input type="hidden" name="stage" value="chair">
<button type="submit" class="{{ $btnAccent }}">Seat at chair</button>
</form>
@elseif ($moduleKey === 'emergency' && $currentStage && isset($stageFlow[$currentStage]) && ($stageFlow[$currentStage]['next'] ?? null) !== $currentStage)
<form method="POST" action="{{ route('care.specialty.emergency.stage', $workspaceVisit) }}" class="w-full" @click.stop>
@csrf
<input type="hidden" name="stage" value="{{ $stageFlow[$currentStage]['next'] }}">
<button type="submit" class="{{ $btnAccent }}">{{ $stageFlow[$currentStage]['label'] }}</button>
</form>
@elseif ($moduleKey === 'emergency' && ! $currentStage)
<form method="POST" action="{{ route('care.specialty.emergency.stage', $workspaceVisit) }}" class="w-full" @click.stop>
@csrf
<input type="hidden" name="stage" value="arrival">
<button type="submit" class="{{ $btnAccent }}">Start triage</button>
</form>
@endif
@if ($canCompleteConsultation)
@@ -38,6 +38,8 @@
@include('care.partials.patient-timeline', ['events' => $timeline ?? []])
@elseif ($moduleKey === 'dentistry' && in_array($activeTab, ['odontogram', 'plan', 'treat', 'notes', 'imaging', 'overview', 'perio', 'lab', 'recalls'], true))
@include('care.specialty.dentistry.workspace-'.$activeTab)
@elseif ($moduleKey === 'emergency' && in_array($activeTab, ['overview', 'vitals', 'disposition'], true))
@include('care.specialty.emergency.workspace-'.$activeTab)
@elseif ($activeTab === 'billing')
<section class="rounded-2xl border border-slate-200 bg-white p-5">
<h3 class="text-sm font-semibold text-slate-900">Add specialty service</h3>