Let nurses open specialty visits from the queue list.
Deploy Ladill Care / deploy (push) Successful in 51s
Deploy Ladill Care / deploy (push) Successful in 51s
Open on waiting/called cards no longer requires consultations.manage so view roles can re-enter Emergency and other specialty workspaces. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -3,20 +3,34 @@
|
||||
|
||||
Expected: $appointment, $stage (waiting|called|in_care|done),
|
||||
$canConsult, $queueIntegration, $startRouteName, $openInCareUrl (callable)
|
||||
|
||||
Open (view workspace / form) is available whenever a destination URL exists —
|
||||
not gated by canConsult. Start / Call again remain consult-manage only.
|
||||
--}}
|
||||
@php
|
||||
$stage = $stage ?? 'waiting';
|
||||
$ticketStatus = $appointment->queue_ticket_status ?? null;
|
||||
$isCalled = in_array($ticketStatus, ['called', 'serving'], true);
|
||||
$openUrl = isset($openInCareUrl) ? $openInCareUrl($appointment) : null;
|
||||
$canConsult = $canConsult ?? false;
|
||||
@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',
|
||||
])>
|
||||
<article
|
||||
@if ($openUrl)
|
||||
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 }"
|
||||
@endif
|
||||
@class([
|
||||
'group relative flex gap-3 rounded-xl border px-3 py-3 transition',
|
||||
'cursor-pointer hover:shadow-sm' => (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',
|
||||
])
|
||||
>
|
||||
<div class="min-w-0 flex-1 space-y-1.5">
|
||||
@if (! empty($queueIntegration['enabled']) && $appointment->queue_ticket_number)
|
||||
@include('care.partials.queue-ticket', [
|
||||
@@ -51,7 +65,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex shrink-0 flex-col items-end justify-center gap-1.5">
|
||||
<div class="relative z-10 flex shrink-0 flex-col items-end justify-center gap-1.5" @click.stop>
|
||||
@if ($stage === 'waiting' || $stage === 'called')
|
||||
@if (! empty($queueIntegration['enabled']) && $appointment->queue_ticket_uuid && $isCalled && $canConsult)
|
||||
<form method="POST" action="{{ route('care.queue.recall', $appointment) }}">
|
||||
@@ -71,6 +85,13 @@
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
@if ($openUrl)
|
||||
<a href="{{ $openUrl }}" @class([
|
||||
'rounded-lg px-2.5 py-1.5 text-xs font-semibold',
|
||||
'bg-indigo-600 text-white hover:bg-indigo-700' => ! $canConsult,
|
||||
'border border-slate-200 bg-white text-slate-700 hover:bg-slate-50' => $canConsult,
|
||||
])>Open</a>
|
||||
@endif
|
||||
@elseif ($stage === 'in_care')
|
||||
@if (! empty($queueIntegration['enabled']) && $appointment->queue_ticket_uuid && $isCalled && $canConsult)
|
||||
<form method="POST" action="{{ route('care.queue.recall', $appointment) }}">
|
||||
@@ -81,6 +102,8 @@
|
||||
@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
|
||||
@elseif ($stage === 'done' && $openUrl)
|
||||
<a href="{{ $openUrl }}" class="rounded-lg border border-slate-200 bg-white px-2.5 py-1.5 text-xs font-semibold text-slate-700 hover:bg-slate-50">Open</a>
|
||||
@endif
|
||||
</div>
|
||||
</article>
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
- $canConsult (bool)
|
||||
- $queueCallNextRoute, $queueCallNextParams (optional — if set, Call next renders above board)
|
||||
- $startRouteName (default care.queue.start) — route(name, $appointment)
|
||||
- $openInCareUrl (callable Appointment $a): ?string — link for in-care Open
|
||||
- $openInCareUrl (callable Appointment $a): ?string — workspace/form URL for Open
|
||||
(waiting / called / in-care / done; not gated by canConsult)
|
||||
- $inCareLabel (default "In care")
|
||||
- $lockToPractitioner, $canSwitchBranch, $branches, $practitioners, $practitionerId (filter bar)
|
||||
- $showFilters (default true)
|
||||
|
||||
Reference in New Issue
Block a user