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;
|
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(
|
return $this->workflowGate->canRelease(
|
||||||
$organization,
|
$organization,
|
||||||
$appointment->visit,
|
$appointment->visit,
|
||||||
$this->queueBridge->contextForAppointment($organization, $appointment),
|
$context,
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
->values()
|
->values()
|
||||||
|
|||||||
@@ -115,7 +115,8 @@ class DemoTenantSeeder
|
|||||||
$departments = $this->seedDepartments($branches, $ownerRef, $volumes);
|
$departments = $this->seedDepartments($branches, $ownerRef, $volumes);
|
||||||
if (in_array($plan, ['pro', 'enterprise'], true)) {
|
if (in_array($plan, ['pro', 'enterprise'], true)) {
|
||||||
$this->seedSpecialtyModules($organization, $ownerRef);
|
$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);
|
$practitioners = $this->seedPractitioners($organization, $branches, $departments, $ownerRef, $volumes);
|
||||||
$this->linkStaffDoctorsToPractitioners($organization, $ownerRef, $plan, $branches, $practitioners);
|
$this->linkStaffDoctorsToPractitioners($organization, $ownerRef, $plan, $branches, $practitioners);
|
||||||
@@ -1085,9 +1086,14 @@ class DemoTenantSeeder
|
|||||||
for ($i = 0; $i < $volumes['appointments']; $i++) {
|
for ($i = 0; $i < $volumes['appointments']; $i++) {
|
||||||
$patient = $patients[$i % count($patients)];
|
$patient = $patients[$i % count($patients)];
|
||||||
$practitioner = $practitioners[$i % count($practitioners)];
|
$practitioner = $practitioners[$i % count($practitioners)];
|
||||||
$branch = $branches[$i % count($branches)];
|
$branch = collect($branches)->first(
|
||||||
$branchDepts = $departments[$branch->id] ?? [];
|
fn (Branch $b) => (int) $b->id === (int) $practitioner->branch_id,
|
||||||
$department = $branchDepts[$i % max(1, count($branchDepts))] ?? null;
|
) ?? $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)];
|
$status = $statuses[$i % count($statuses)];
|
||||||
$scheduledAt = now()->subDays(14)->addHours($i * 3);
|
$scheduledAt = now()->subDays(14)->addHours($i * 3);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user