diff --git a/resources/views/care/partials/queue-board-card.blade.php b/resources/views/care/partials/queue-board-card.blade.php index 0cfe04a..614c27b 100644 --- a/resources/views/care/partials/queue-board-card.blade.php +++ b/resources/views/care/partials/queue-board-card.blade.php @@ -6,6 +6,9 @@ Open (view workspace / form) is available whenever a destination URL exists — not gated by canConsult. Start / Call again remain consult-manage only. + + Layout: stacked — badges on top, patient info in the middle, actions in a + footer row — so narrow board columns never squeeze text under buttons. --}} @php $stage = $stage ?? 'waiting'; @@ -13,6 +16,10 @@ $isCalled = in_array($ticketStatus, ['called', 'serving'], true); $openUrl = isset($openInCareUrl) ? $openInCareUrl($appointment) : null; $canConsult = $canConsult ?? false; + + $canRecall = ! empty($queueIntegration['enabled']) && $appointment->queue_ticket_uuid && $isCalled && $canConsult; + $showStart = $canConsult && ($stage === 'waiting' || $stage === 'called'); + $hasActions = $openUrl || $canRecall || $showStart; @endphp
(bool) $openUrl, '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', + 'border-slate-200 bg-white' => $stage === 'waiting' && ! $isCalled, + 'border-slate-100 bg-white opacity-80' => $stage === 'done', ]) > -
+
@if (! empty($queueIntegration['enabled']) && $appointment->queue_ticket_number) @include('care.partials.queue-ticket', [ 'ticketNumber' => $appointment->queue_ticket_number, @@ -39,12 +46,12 @@ 'destination' => $appointment->queue_destination, 'staffDisplayName' => $appointment->queue_staff_display_name, 'showAssignment' => $stage !== 'in_care' && $stage !== 'done', - 'prominent' => true, + 'prominent' => false, ]) @elseif (! empty($queueIntegration['enabled']) && ($appointment->queue_routing_status ?? '') === 'unresolved') Unassigned @elseif ($appointment->queue_position) - {{ $appointment->queue_position }} + {{ $appointment->queue_position }} @endif
@@ -65,45 +72,35 @@
-
- @if ($stage === 'waiting' || $stage === 'called') - @if (! empty($queueIntegration['enabled']) && $appointment->queue_ticket_uuid && $isCalled && $canConsult) + @if ($hasActions) +
+ @if ($canRecall)
@csrf - +
@endif - @if ($canConsult) + @if ($openUrl) + $stage === 'in_care', + 'bg-indigo-600 text-white hover:bg-indigo-700' => ! $showStart && $stage !== 'in_care' && $stage !== 'done', + 'text-slate-600 hover:bg-slate-100' => $stage === 'done' || ($showStart && $stage !== 'in_care'), + ])>Open + @endif + @if ($showStart)
@csrf
@endif - @if ($openUrl) - ! $canConsult, - 'border border-slate-200 bg-white text-slate-700 hover:bg-slate-50' => $canConsult, - ])>Open - @endif - @elseif ($stage === 'in_care') - @if (! empty($queueIntegration['enabled']) && $appointment->queue_ticket_uuid && $isCalled && $canConsult) -
- @csrf - -
- @endif - @if ($openUrl) - Open - @endif - @elseif ($stage === 'done' && $openUrl) - Open - @endif -
+
+ @endif
diff --git a/resources/views/care/specialty/ambulance/dispatch-card.blade.php b/resources/views/care/specialty/ambulance/dispatch-card.blade.php index e15438b..708911e 100644 --- a/resources/views/care/specialty/ambulance/dispatch-card.blade.php +++ b/resources/views/care/specialty/ambulance/dispatch-card.blade.php @@ -1,4 +1,8 @@ -{{-- Single EMS call card on the ambulance dispatch board. --}} +{{-- + Single EMS call card on the ambulance dispatch board. + Stacked layout: ticket badge, patient info, then an action footer — + narrow columns never push buttons over the text. +--}} @php $appointment = $visit->appointment; $patient = $visit->patient; @@ -8,6 +12,7 @@ $nextStage = $column['next_stage'] ?? null; $nextLabel = $column['next_label'] ?? null; $isCompleted = ($column['key'] ?? '') === 'completed'; + $showAdvance = $canAdvanceStage && $nextStage && $nextLabel; @endphp
($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, + 'group relative flex cursor-pointer flex-col rounded-xl border bg-white transition hover:shadow-sm', + 'border-amber-200' => ($column['key'] ?? '') === 'check_in', + 'border-indigo-200' => ($column['key'] ?? '') === 'dispatch', + 'border-sky-200' => ($column['key'] ?? '') === 'on_scene', + 'border-violet-200' => ($column['key'] ?? '') === 'transport', + 'border-emerald-200' => ($column['key'] ?? '') === 'handover', + 'border-slate-100 opacity-80' => $isCompleted, ]) > -
- @if ($ticketNumber) - {{ $ticketNumber }} - @endif +
+
+ @if ($ticketNumber) + {{ $ticketNumber }} + @else + + @endif + ($column['key'] ?? '') === 'check_in', + 'bg-indigo-400' => ($column['key'] ?? '') === 'dispatch', + 'bg-sky-400' => ($column['key'] ?? '') === 'on_scene', + 'bg-violet-400' => ($column['key'] ?? '') === 'transport', + 'bg-emerald-400' => ($column['key'] ?? '') === 'handover', + 'bg-slate-300' => $isCompleted, + ])> +
+

{{ $patient?->fullName() ?? 'Patient' }}

{{ $patient?->patient_number ?? '—' }} @if ($reason) - · {{ \Illuminate\Support\Str::limit($reason, 40) }} + · {{ \Illuminate\Support\Str::limit($reason, 48) }} @endif

@if ($appointment?->practitioner?->name) @@ -43,14 +62,14 @@
-
- Open - @if ($canAdvanceStage && $nextStage && $nextLabel) +
+ Open + @if ($showAdvance)
@csrf -
@endif diff --git a/tests/Feature/CareQueueBoardPerformanceTest.php b/tests/Feature/CareQueueBoardPerformanceTest.php index 342af8f..f56d7a6 100644 --- a/tests/Feature/CareQueueBoardPerformanceTest.php +++ b/tests/Feature/CareQueueBoardPerformanceTest.php @@ -59,11 +59,12 @@ class CareQueueBoardPerformanceTest extends TestCase ], ]); + // Patient queue board is reserved for clinical staff (receptionists are 403'd). Member::create([ 'owner_ref' => $this->owner->public_id, 'organization_id' => $this->organization->id, 'user_ref' => $this->owner->public_id, - 'role' => 'receptionist', + 'role' => 'doctor', ]); $this->branch = Branch::create([ diff --git a/tests/Feature/CareQueueWorkflowTest.php b/tests/Feature/CareQueueWorkflowTest.php index e135b47..a9d2485 100644 --- a/tests/Feature/CareQueueWorkflowTest.php +++ b/tests/Feature/CareQueueWorkflowTest.php @@ -316,6 +316,12 @@ class CareQueueWorkflowTest extends TestCase { Http::fake(); + // Patient queue is reserved for clinical staff; receptionists are 403'd. + Member::query()->where('user_ref', $this->owner->public_id)->update([ + 'role' => 'doctor', + 'branch_id' => $this->branch->id, + ]); + $this->actingAs($this->owner) ->get(route('care.queue.index')) ->assertOk()