Deploy Ladill Care / deploy (push) Successful in 39s
Shared queue-board is now a Waiting/Called/In care/Done stage board with prominent tickets and Call next; nurses lose queue.manage and canAccessPatientQueue so /queue and queue nav are gated while specialty workspaces stay available. Co-authored-by: Cursor <cursoragent@cursor.com>
87 lines
4.8 KiB
PHP
87 lines
4.8 KiB
PHP
{{--
|
|
Single patient-flow card for queue-board stages.
|
|
|
|
Expected: $appointment, $stage (waiting|called|in_care|done),
|
|
$canConsult, $queueIntegration, $startRouteName, $openInCareUrl (callable)
|
|
--}}
|
|
@php
|
|
$stage = $stage ?? 'waiting';
|
|
$ticketStatus = $appointment->queue_ticket_status ?? null;
|
|
$isCalled = in_array($ticketStatus, ['called', 'serving'], true);
|
|
$openUrl = isset($openInCareUrl) ? $openInCareUrl($appointment) : null;
|
|
@endphp
|
|
<article @class([
|
|
'group relative flex gap-3 rounded-xl border px-3 py-3 transition',
|
|
'border-indigo-200 bg-indigo-50/70 ring-1 ring-indigo-100' => $stage === 'called' || ($stage === 'waiting' && $isCalled),
|
|
'border-emerald-200 bg-emerald-50/60' => $stage === 'in_care',
|
|
'border-slate-100 bg-slate-50/80' => $stage === 'waiting' && ! $isCalled,
|
|
'border-slate-100 bg-white opacity-90' => $stage === 'done',
|
|
])>
|
|
<div class="min-w-0 flex-1 space-y-1.5">
|
|
@if (! empty($queueIntegration['enabled']) && $appointment->queue_ticket_number)
|
|
@include('care.partials.queue-ticket', [
|
|
'ticketNumber' => $appointment->queue_ticket_number,
|
|
'ticketStatus' => $ticketStatus,
|
|
'destination' => $appointment->queue_destination,
|
|
'staffDisplayName' => $appointment->queue_staff_display_name,
|
|
'showAssignment' => $stage !== 'in_care' && $stage !== 'done',
|
|
'prominent' => true,
|
|
])
|
|
@elseif (! empty($queueIntegration['enabled']) && ($appointment->queue_routing_status ?? '') === 'unresolved')
|
|
<span class="inline-flex rounded-md bg-amber-100 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-amber-800">Unassigned</span>
|
|
@elseif ($appointment->queue_position)
|
|
<span class="inline-flex h-8 min-w-[2rem] items-center justify-center rounded-lg bg-slate-200/80 px-2 font-mono text-sm font-bold text-slate-700">{{ $appointment->queue_position }}</span>
|
|
@endif
|
|
|
|
<div class="min-w-0">
|
|
<p class="truncate text-sm font-semibold text-slate-900">{{ $appointment->patient?->fullName() ?? 'Patient' }}</p>
|
|
<p class="mt-0.5 truncate text-xs text-slate-500">
|
|
@if ($stage === 'in_care' || $stage === 'done')
|
|
{{ $appointment->practitioner?->name ?? 'Unassigned' }}
|
|
@if ($appointment->patient?->patient_number)
|
|
<span class="text-slate-300"> · </span>{{ $appointment->patient->patient_number }}
|
|
@endif
|
|
@else
|
|
{{ $appointment->patient?->patient_number ?? '—' }}
|
|
@if ($appointment->reason)
|
|
<span class="text-slate-300"> · </span>{{ $appointment->reason }}
|
|
@endif
|
|
@endif
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="flex shrink-0 flex-col items-end justify-center gap-1.5">
|
|
@if ($stage === 'waiting' || $stage === 'called')
|
|
@if (! empty($queueIntegration['enabled']) && $appointment->queue_ticket_uuid && $isCalled && $canConsult)
|
|
<form method="POST" action="{{ route('care.queue.recall', $appointment) }}">
|
|
@csrf
|
|
<button type="submit" class="rounded-lg border border-indigo-200 bg-white px-2.5 py-1 text-[11px] font-medium text-indigo-700 hover:bg-indigo-50">Call again</button>
|
|
</form>
|
|
@endif
|
|
@if ($canConsult)
|
|
<form method="POST" action="{{ route($startRouteName, $appointment) }}">
|
|
@csrf
|
|
<button type="submit" @class([
|
|
'rounded-lg px-2.5 py-1.5 text-xs font-semibold text-white',
|
|
'bg-indigo-600 hover:bg-indigo-700' => $isCalled,
|
|
'bg-slate-800 hover:bg-slate-900' => ! $isCalled,
|
|
])>
|
|
{{ ! empty($queueIntegration['enabled']) && $ticketStatus === 'called' ? 'Serve & start' : 'Start' }}
|
|
</button>
|
|
</form>
|
|
@endif
|
|
@elseif ($stage === 'in_care')
|
|
@if (! empty($queueIntegration['enabled']) && $appointment->queue_ticket_uuid && $isCalled && $canConsult)
|
|
<form method="POST" action="{{ route('care.queue.recall', $appointment) }}">
|
|
@csrf
|
|
<button type="submit" class="rounded-lg border border-indigo-200 bg-white px-2.5 py-1 text-[11px] font-medium text-indigo-700 hover:bg-indigo-50">Call again</button>
|
|
</form>
|
|
@endif
|
|
@if ($openUrl)
|
|
<a href="{{ $openUrl }}" class="rounded-lg bg-emerald-600 px-2.5 py-1.5 text-xs font-semibold text-white hover:bg-emerald-700">Open</a>
|
|
@endif
|
|
@endif
|
|
</div>
|
|
</article>
|