Files
ladill-care/resources/views/care/specialty/ambulance/dispatch-card.blade.php
T
isaaccladandCursor 4e753e68c0
Deploy Ladill Care / deploy (push) Successful in 35s
Replace ambulance Call next queue with an EMS dispatch board.
Home columns follow New call → Dispatched → On scene → Transport → Handover; walk-ins land as New call and Call next is disabled for this module.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-20 12:13:33 +00:00

59 lines
3.1 KiB
PHP

{{-- Single EMS call card on the ambulance dispatch board. --}}
@php
$appointment = $visit->appointment;
$patient = $visit->patient;
$openUrl = route('care.specialty.workspace', ['module' => 'ambulance', 'visit' => $visit]);
$ticketNumber = $appointment?->queue_ticket_number;
$reason = $appointment?->reason;
$nextStage = $column['next_stage'] ?? null;
$nextLabel = $column['next_label'] ?? null;
$isCompleted = ($column['key'] ?? '') === 'completed';
@endphp
<article
role="link"
tabindex="0"
data-href="{{ $openUrl }}"
onclick="if (! event.target.closest('a, button, form, input, select, textarea, label')) { window.location.href = this.dataset.href }"
onkeydown="if ((event.key === 'Enter' || event.key === ' ') && ! event.target.closest('a, button, form, input, select, textarea, label')) { event.preventDefault(); window.location.href = this.dataset.href }"
@class([
'group relative flex gap-3 rounded-xl border px-3 py-3 transition cursor-pointer hover:shadow-sm',
'border-amber-200 bg-amber-50/70' => ($column['key'] ?? '') === 'check_in',
'border-indigo-200 bg-indigo-50/50' => ($column['key'] ?? '') === 'dispatch',
'border-sky-200 bg-sky-50/50' => ($column['key'] ?? '') === 'on_scene',
'border-violet-200 bg-violet-50/50' => ($column['key'] ?? '') === 'transport',
'border-emerald-200 bg-emerald-50/50' => ($column['key'] ?? '') === 'handover',
'border-slate-100 bg-white opacity-90' => $isCompleted,
])
>
<div class="min-w-0 flex-1 space-y-1.5">
@if ($ticketNumber)
<span class="inline-flex rounded-md bg-slate-900 px-2 py-0.5 font-mono text-[11px] font-semibold tracking-wide text-white">{{ $ticketNumber }}</span>
@endif
<div class="min-w-0">
<p class="truncate text-sm font-semibold text-slate-900">{{ $patient?->fullName() ?? 'Patient' }}</p>
<p class="mt-0.5 truncate text-xs text-slate-500">
{{ $patient?->patient_number ?? '—' }}
@if ($reason)
<span class="text-slate-300"> · </span>{{ \Illuminate\Support\Str::limit($reason, 40) }}
@endif
</p>
@if ($appointment?->practitioner?->name)
<p class="mt-0.5 truncate text-xs text-slate-400">{{ $appointment->practitioner->name }}</p>
@endif
</div>
</div>
<div class="relative z-10 flex shrink-0 flex-col items-end justify-center gap-1.5" @click.stop>
<a href="{{ $openUrl }}" class="rounded-lg border border-slate-200 bg-white px-2.5 py-1 text-[11px] font-medium text-slate-700 hover:bg-slate-50">Open</a>
@if ($canAdvanceStage && $nextStage && $nextLabel)
<form method="POST" action="{{ route($specialtyStageRoute, $visit) }}">
@csrf
<input type="hidden" name="stage" value="{{ $nextStage }}">
<button type="submit" class="rounded-lg bg-slate-900 px-2.5 py-1 text-[11px] font-semibold text-white hover:bg-slate-800">
{{ $nextLabel }}
</button>
</form>
@endif
</div>
</article>