Files
ladill-care/resources/views/care/specialty/emergency/workspace-overview.blade.php
T
isaaccladandCursor 7989ab9184
Deploy Ladill Care / deploy (push) Successful in 34s
Ship full Emergency specialty suite on the shared shell.
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>
2026-07-18 17:48:57 +00:00

118 lines
6.2 KiB
PHP

@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>