Redesign Care patient-flow board and remove Queue from nurses.
Deploy Ladill Care / deploy (push) Successful in 39s
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>
This commit is contained in:
@@ -32,7 +32,7 @@ class QueueController extends Controller
|
||||
public function index(Request $request): View
|
||||
{
|
||||
$this->authorizeAbility($request, 'appointments.view');
|
||||
abort_unless(app(CarePermissions::class)->handlesFloorCare($this->member($request)), 403);
|
||||
abort_unless(app(CarePermissions::class)->canAccessPatientQueue($this->member($request)), 403);
|
||||
$organization = $this->organization($request);
|
||||
$member = $this->member($request);
|
||||
$owner = $this->ownerRef($request);
|
||||
@@ -126,6 +126,24 @@ class QueueController extends Controller
|
||||
$todayQuery->where('branch_id', $branchId);
|
||||
}
|
||||
|
||||
$doneQuery = Appointment::owned($owner)
|
||||
->where('organization_id', $organization->id)
|
||||
->where('status', Appointment::STATUS_COMPLETED)
|
||||
->whereDate('completed_at', today());
|
||||
if ($lockToPractitioner) {
|
||||
$doneQuery->whereIn('practitioner_id', $practitionerScope ?: [0]);
|
||||
} elseif ($branchId) {
|
||||
$doneQuery->where('branch_id', $branchId);
|
||||
}
|
||||
if ($practitionerId && ! $lockToPractitioner) {
|
||||
$doneQuery->where('practitioner_id', $practitionerId);
|
||||
}
|
||||
$done = $doneQuery
|
||||
->with(['patient', 'practitioner'])
|
||||
->orderByDesc('completed_at')
|
||||
->limit(20)
|
||||
->get();
|
||||
|
||||
$heroStats = [
|
||||
'waiting' => $queue->count(),
|
||||
'in_consultation' => $inConsultation->count(),
|
||||
@@ -149,6 +167,7 @@ class QueueController extends Controller
|
||||
'practitionerId' => $practitionerId,
|
||||
'queue' => $queue,
|
||||
'inConsultation' => $inConsultation,
|
||||
'done' => $done,
|
||||
'canManageQueue' => $canManageQueue,
|
||||
'canConsult' => $canConsult,
|
||||
'heroStats' => $heroStats,
|
||||
@@ -160,7 +179,7 @@ class QueueController extends Controller
|
||||
|
||||
public function callNext(Request $request, CareQueueSessionAdvance $advance): RedirectResponse
|
||||
{
|
||||
abort_unless(app(CarePermissions::class)->handlesFloorCare($this->member($request)), 403);
|
||||
abort_unless(app(CarePermissions::class)->canAccessPatientQueue($this->member($request)), 403);
|
||||
$this->authorizeAbility($request, 'appointments.view');
|
||||
$organization = $this->organization($request);
|
||||
abort_unless($this->queueBridge->isEnabled($organization), 404);
|
||||
|
||||
Reference in New Issue
Block a user