Files
ladill-care/resources/views/care/lab/queue/index.blade.php
T
isaaccladandCursor 015a4cc7fe
Deploy Ladill Care / deploy (push) Successful in 1m45s
Wire Care lists into Ladill Queue workflows instead of reception panels.
When Queue integration is on, role pages issue tickets into their own
department queues and drive Call next → Serve → Complete on the native
lists. Integration off leaves existing UI unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 16:27:48 +00:00

71 lines
3.9 KiB
PHP

<x-app-layout title="Lab queue">
<div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
<div>
<h1 class="text-xl font-semibold text-slate-900">Lab work queue</h1>
<p class="mt-1 text-sm text-slate-500">Pending samples and investigations in progress</p>
</div>
<div class="flex gap-2">
<a href="{{ route('care.lab.requests.index') }}" class="rounded-lg border border-slate-200 px-4 py-2 text-sm">All requests</a>
@if (app(\App\Services\Care\CarePermissions::class)->can(auth()->user() ? app(\App\Services\Care\OrganizationResolver::class)->memberFor(auth()->user(), $organization) : null, 'lab.manage'))
<a href="{{ route('care.lab.catalog.index') }}" class="rounded-lg border border-slate-200 px-4 py-2 text-sm">Catalog</a>
@endif
</div>
</div>
<form method="GET" class="mt-4 flex flex-wrap gap-3 rounded-2xl border border-slate-200 bg-white p-4">
<select name="branch_id" class="rounded-lg border-slate-300 text-sm" onchange="this.form.submit()">
@foreach ($branches as $branch)
<option value="{{ $branch->id }}" @selected($branchId == $branch->id)>{{ $branch->name }}</option>
@endforeach
</select>
<select name="status" class="rounded-lg border-slate-300 text-sm">
<option value="">All active</option>
@foreach ($statuses as $value => $label)
@if (in_array($value, \App\Models\InvestigationRequest::activeStatuses()))
<option value="{{ $value }}" @selected($status === $value)>{{ $label }}</option>
@endif
@endforeach
</select>
<button type="submit" class="btn-primary">Filter</button>
</form>
<div class="mt-4">
@include('care.partials.queue-ops', [
'queueIntegration' => $queueIntegration ?? null,
'queueCallNextRoute' => 'care.lab.queue.call-next',
'queueCallNextParams' => [],
'branchId' => $branchId,
])
</div>
<div class="mt-4 space-y-3">
@forelse ($queue as $item)
<div class="flex items-center justify-between rounded-2xl border border-slate-200 bg-white p-4">
<div>
<p class="font-medium text-slate-900">
@if (! empty($queueIntegration['enabled']) && $item->queue_ticket_number)
@include('care.partials.queue-ticket', [
'ticketNumber' => $item->queue_ticket_number,
'ticketStatus' => $item->queue_ticket_status,
])
@endif
{{ $item->patient->fullName() }} {{ $item->investigationType->name }}
</p>
<p class="text-xs text-slate-500">{{ $statuses[$item->status] ?? $item->status }} · {{ $item->priority }} · {{ $item->created_at->diffForHumans() }}</p>
</div>
<div class="flex items-center gap-2">
@if (! empty($queueIntegration['enabled']) && $item->queue_ticket_uuid && ($item->queue_ticket_status ?? '') !== 'serving')
<form method="POST" action="{{ route('care.lab.queue.serve', $item) }}">
@csrf
<button type="submit" class="rounded-lg bg-sky-600 px-3 py-1.5 text-xs font-medium text-white hover:bg-sky-700">Serve</button>
</form>
@endif
<a href="{{ route('care.lab.requests.show', $item) }}" class="text-sm text-sky-600">Open</a>
</div>
</div>
@empty
<p class="rounded-2xl border border-dashed border-slate-200 bg-white p-8 text-center text-sm text-slate-500">Queue is empty.</p>
@endforelse
</div>
</x-app-layout>