Keep specialty waiters off the regular doctor Queue.
Deploy Ladill Care / deploy (push) Successful in 1m3s
Deploy Ladill Care / deploy (push) Successful in 1m3s
Demo GP appointments now use core desk departments, and the doctor waiting list excludes specialty queue contexts so MAT/PHY tickets stay on specialty modules. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -161,10 +161,16 @@ class AppointmentService
|
||||
return true;
|
||||
}
|
||||
|
||||
$context = $this->queueBridge->contextForAppointment($organization, $appointment);
|
||||
// Regular doctor Queue is consultation-only; specialty waiters belong on specialty modules.
|
||||
if ($context !== CareQueueContexts::CONSULTATION) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->workflowGate->canRelease(
|
||||
$organization,
|
||||
$appointment->visit,
|
||||
$this->queueBridge->contextForAppointment($organization, $appointment),
|
||||
$context,
|
||||
);
|
||||
})
|
||||
->values()
|
||||
|
||||
@@ -115,7 +115,8 @@ class DemoTenantSeeder
|
||||
$departments = $this->seedDepartments($branches, $ownerRef, $volumes);
|
||||
if (in_array($plan, ['pro', 'enterprise'], true)) {
|
||||
$this->seedSpecialtyModules($organization, $ownerRef);
|
||||
$departments = $this->departmentsByBranch($branches, $ownerRef);
|
||||
// Keep $departments as core/paid only. Specialty departments must not feed
|
||||
// general GP desks or appointments — those waiters live in seedSpecialtyDemoData.
|
||||
}
|
||||
$practitioners = $this->seedPractitioners($organization, $branches, $departments, $ownerRef, $volumes);
|
||||
$this->linkStaffDoctorsToPractitioners($organization, $ownerRef, $plan, $branches, $practitioners);
|
||||
@@ -1085,9 +1086,14 @@ class DemoTenantSeeder
|
||||
for ($i = 0; $i < $volumes['appointments']; $i++) {
|
||||
$patient = $patients[$i % count($patients)];
|
||||
$practitioner = $practitioners[$i % count($practitioners)];
|
||||
$branch = $branches[$i % count($branches)];
|
||||
$branchDepts = $departments[$branch->id] ?? [];
|
||||
$department = $branchDepts[$i % max(1, count($branchDepts))] ?? null;
|
||||
$branch = collect($branches)->first(
|
||||
fn (Branch $b) => (int) $b->id === (int) $practitioner->branch_id,
|
||||
) ?? $branches[$i % count($branches)];
|
||||
$branchDepts = $departments[(int) $practitioner->branch_id] ?? ($departments[$branch->id] ?? []);
|
||||
// Align department to the practitioner desk so Queue tickets stay consultation-context.
|
||||
$department = collect($branchDepts)->first(
|
||||
fn (Department $dept) => (int) $dept->id === (int) ($practitioner->department_id ?? 0),
|
||||
) ?? ($branchDepts[$i % max(1, count($branchDepts))] ?? null);
|
||||
$status = $statuses[$i % count($statuses)];
|
||||
$scheduledAt = now()->subDays(14)->addHours($i * 3);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user