Route all specialty patient flow through Queue.
Deploy Ladill Care / deploy (push) Successful in 37s

Remove Dentistry and other specialty modules from the sidebar; Queue now uses each doctor's specialty desk context for Call next, waiting lists, and Start into specialty clinical workspaces.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-18 16:03:38 +00:00
co-authored by Cursor
parent ec9135c59d
commit 5bdc17777c
10 changed files with 110 additions and 75 deletions
+19 -4
View File
@@ -46,6 +46,19 @@ class QueueController extends Controller
: ($request->input('practitioner_id') ? (int) $request->input('practitioner_id') : null);
$queueIntegration = ['enabled' => false];
$queueContext = CareQueueContexts::CONSULTATION;
$specialtyLabel = null;
if ($lockToPractitioner && $practitionerId) {
$prac = Practitioner::owned($owner)->with('organization')->find($practitionerId);
$deskContext = $this->queueBridge->contextForPractitioner($organization, $prac);
if ($deskContext !== CareQueueContexts::CONSULTATION) {
$queueContext = $deskContext;
$specialtyLabel = (string) (config("care.specialty_modules.{$deskContext}.label")
?? config("care.specialty_modules.{$deskContext}.nav_label")
?? ucfirst(str_replace('_', ' ', $deskContext)));
}
}
if ($this->queueBridge->isEnabled($organization)) {
$syncBranches = $lockToPractitioner
? Practitioner::owned($owner)
@@ -63,11 +76,11 @@ class QueueController extends Controller
}
if ($branchId > 0) {
$queueIntegration = $this->queueBridge->listMeta($organization, CareQueueContexts::CONSULTATION, $branchId);
$queueIntegration = $this->queueBridge->listMeta($organization, $queueContext, $branchId);
} elseif ($syncBranches !== []) {
$queueIntegration = $this->queueBridge->listMeta(
$organization,
CareQueueContexts::CONSULTATION,
$queueContext,
(int) $syncBranches[0],
);
}
@@ -83,7 +96,7 @@ class QueueController extends Controller
->where('organization_id', $organization->id)
->where('status', Appointment::STATUS_IN_CONSULTATION)
->whereIn('practitioner_id', $practitionerScope ?: [0])
->with(['patient', 'practitioner', 'consultation'])
->with(['patient', 'practitioner', 'consultation', 'visit', 'organization'])
->orderBy('started_at')
->get();
} else {
@@ -95,7 +108,7 @@ class QueueController extends Controller
->where('status', Appointment::STATUS_IN_CONSULTATION)
->when($branchId, fn ($q) => $q->where('branch_id', $branchId))
->when($practitionerId, fn ($q) => $q->where('practitioner_id', $practitionerId))
->with(['patient', 'practitioner', 'consultation'])
->with(['patient', 'practitioner', 'consultation', 'visit', 'organization'])
->orderBy('started_at')
->get();
}
@@ -139,6 +152,8 @@ class QueueController extends Controller
'canConsult' => $canConsult,
'heroStats' => $heroStats,
'queueIntegration' => $queueIntegration,
'queueContext' => $queueContext,
'specialtyLabel' => $specialtyLabel,
]);
}