Route Care tickets to per-staff service points instead of shared branch queues.
Deploy Ladill Care / deploy (push) Successful in 1m40s
Deploy Ladill Care / deploy (push) Successful in 1m40s
Provision one consultation point per doctor (room + identity) and role-based points for pharmacy, lab, billing, and triage. Fixed-doctor appointments and walk-ins issue only to the assigned point; Call next respects that assignment and flags unresolved patients rather than random routing. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -246,10 +246,12 @@ class AppointmentController extends Controller
|
||||
*/
|
||||
protected function validatedWalkInData(Request $request): array
|
||||
{
|
||||
$queueOn = (bool) data_get($this->organization($request)->settings, 'queue_integration_enabled');
|
||||
|
||||
return $request->validate([
|
||||
'branch_id' => ['required', 'integer', 'exists:care_branches,id'],
|
||||
'patient_id' => ['required', 'integer', 'exists:care_patients,id'],
|
||||
'practitioner_id' => ['nullable', 'integer', 'exists:care_practitioners,id'],
|
||||
'practitioner_id' => [$queueOn ? 'required' : 'nullable', 'integer', 'exists:care_practitioners,id'],
|
||||
'department_id' => ['nullable', 'integer', 'exists:care_departments,id'],
|
||||
'reason' => ['nullable', 'string', 'max:1000'],
|
||||
'notes' => ['nullable', 'string', 'max:5000'],
|
||||
|
||||
@@ -69,10 +69,10 @@ class BillController extends Controller
|
||||
abort_unless($branchId > 0, 422);
|
||||
abort_unless($this->queueBridge->isEnabled($organization), 404);
|
||||
|
||||
$result = $this->queueBridge->callNext($organization, CareQueueContexts::BILLING, $branchId);
|
||||
$result = $this->queueBridge->callNext($organization, CareQueueContexts::BILLING, $branchId, $member);
|
||||
$ticket = $result['ticket'] ?? null;
|
||||
if (! $ticket) {
|
||||
return back()->with('info', 'No bills waiting in the billing queue.');
|
||||
return back()->with('info', 'No bills waiting at your billing service point.');
|
||||
}
|
||||
|
||||
return back()->with('success', 'Called '.$ticket['ticket_number'].'.');
|
||||
|
||||
@@ -93,10 +93,10 @@ class InvestigationController extends Controller
|
||||
abort_unless($branchId > 0, 422);
|
||||
abort_unless($this->queueBridge->isEnabled($organization), 404);
|
||||
|
||||
$result = $this->queueBridge->callNext($organization, CareQueueContexts::LABORATORY, $branchId);
|
||||
$result = $this->queueBridge->callNext($organization, CareQueueContexts::LABORATORY, $branchId, $member);
|
||||
$ticket = $result['ticket'] ?? null;
|
||||
if (! $ticket) {
|
||||
return back()->with('info', 'No lab work waiting in the laboratory queue.');
|
||||
return back()->with('info', 'No lab work waiting at your laboratory service point.');
|
||||
}
|
||||
|
||||
return back()->with('success', 'Called '.$ticket['ticket_number'].'.');
|
||||
|
||||
@@ -95,10 +95,10 @@ class PrescriptionController extends Controller
|
||||
abort_unless($branchId > 0, 422);
|
||||
abort_unless($this->queueBridge->isEnabled($organization), 404);
|
||||
|
||||
$result = $this->queueBridge->callNext($organization, CareQueueContexts::PHARMACY, $branchId);
|
||||
$result = $this->queueBridge->callNext($organization, CareQueueContexts::PHARMACY, $branchId, $member);
|
||||
$ticket = $result['ticket'] ?? null;
|
||||
if (! $ticket) {
|
||||
return back()->with('info', 'No prescriptions waiting in the pharmacy queue.');
|
||||
return back()->with('info', 'No prescriptions waiting at your pharmacy service point.');
|
||||
}
|
||||
|
||||
return back()->with('success', 'Called '.$ticket['ticket_number'].'.');
|
||||
|
||||
@@ -108,10 +108,16 @@ class QueueController extends Controller
|
||||
$branchId = (int) ($request->input('branch_id') ?: $branchScope);
|
||||
abort_unless($branchId > 0, 422);
|
||||
|
||||
$result = $this->queueBridge->callNext($organization, CareQueueContexts::CONSULTATION, $branchId);
|
||||
$result = $this->queueBridge->callNext(
|
||||
$organization,
|
||||
CareQueueContexts::CONSULTATION,
|
||||
$branchId,
|
||||
$member,
|
||||
$request->input('practitioner_id') ? (int) $request->input('practitioner_id') : null,
|
||||
);
|
||||
$ticket = $result['ticket'] ?? null;
|
||||
if (! $ticket) {
|
||||
return back()->with('info', 'No patients waiting in the consultation queue.');
|
||||
return back()->with('info', 'No patients waiting at your consultation service point.');
|
||||
}
|
||||
|
||||
return back()->with('success', 'Called '.$ticket['ticket_number'].' — '.($ticket['customer_name'] ?? 'patient').'.');
|
||||
|
||||
Reference in New Issue
Block a user