Route Care tickets to per-staff service points instead of shared branch queues.
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:
isaacclad
2026-07-17 17:22:14 +00:00
co-authored by Cursor
parent c5151ad476
commit e73b39b678
22 changed files with 1331 additions and 97 deletions
+55 -1
View File
@@ -213,6 +213,42 @@ class CareQueueWorkflowTest extends TestCase
{
$this->fakeQueueApi();
$practitioner = \App\Models\Practitioner::create([
'owner_ref' => $this->owner->public_id,
'organization_id' => $this->organization->id,
'branch_id' => $this->branch->id,
'name' => 'Dr. Workflow',
'room' => 'Room 2',
'is_active' => true,
]);
$this->organization->update([
'settings' => array_merge($this->organization->settings ?? [], [
'department_queue_provisioning' => [
CareQueueContexts::CONSULTATION => [
'queues' => [[
'branch_id' => $this->branch->id,
'branch_name' => 'Main',
'name' => 'Consultation',
'prefix' => 'C',
'active' => true,
'synced' => true,
'routing_mode' => 'assigned_only',
'queue_uuid' => 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa',
'counter_uuid' => 'cccccccc-cccc-cccc-cccc-cccccccccccc',
'points' => [[
'kind' => 'practitioner',
'ref_id' => $practitioner->id,
'destination' => 'Room 2',
'counter_uuid' => 'cccccccc-cccc-cccc-cccc-cccccccccccc',
'synced' => true,
]],
]],
],
],
]),
]);
$patient = Patient::create([
'uuid' => (string) Str::uuid(),
'owner_ref' => $this->owner->public_id,
@@ -229,6 +265,7 @@ class CareQueueWorkflowTest extends TestCase
'organization_id' => $this->organization->id,
'branch_id' => $this->branch->id,
'patient_id' => $patient->id,
'practitioner_id' => $practitioner->id,
'type' => Appointment::TYPE_SCHEDULED,
'status' => Appointment::STATUS_SCHEDULED,
'scheduled_at' => now(),
@@ -246,6 +283,14 @@ class CareQueueWorkflowTest extends TestCase
{
$this->fakeQueueApi();
$pharmacist = Member::create([
'owner_ref' => $this->owner->public_id,
'organization_id' => $this->organization->id,
'user_ref' => 'pharm-workflow',
'role' => 'pharmacist',
'branch_id' => $this->branch->id,
]);
$this->organization->update([
'settings' => array_merge($this->organization->settings ?? [], [
'department_queue_provisioning' => [
@@ -257,10 +302,19 @@ class CareQueueWorkflowTest extends TestCase
'prefix' => 'P',
'active' => true,
'synced' => true,
'routing_mode' => 'assigned_only',
'queue_uuid' => 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb',
'counter_uuid' => 'dddddddd-dddd-dddd-dddd-dddddddddddd',
'queue_external_key' => CareQueueContexts::queueExternalKey(CareQueueContexts::PHARMACY, $this->branch->id),
'counter_external_key' => CareQueueContexts::counterExternalKey(CareQueueContexts::PHARMACY, $this->branch->id),
'points' => [[
'kind' => 'member',
'ref_id' => $pharmacist->id,
'staff_ref' => 'pharm-workflow',
'destination' => 'Pharmacy counter 1',
'counter_uuid' => 'dddddddd-dddd-dddd-dddd-dddddddddddd',
'synced' => true,
]],
]],
],
],
@@ -341,7 +395,7 @@ class CareQueueWorkflowTest extends TestCase
->assertOk()
->assertDontSee('Service counter')
->assertSee('Call next')
->assertSee('tickets are for this department only', false);
->assertSee('assigned service point', false);
}
public function test_integration_off_hides_queue_ops_on_pharmacy_page(): void