Lock doctors to their assigned patients and hide branch filters.
Deploy Ladill Care / deploy (push) Successful in 1m2s

Doctors no longer see branch/practitioner pickers; queue, appointments, patients, and dashboard only include visits on their linked desk.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-18 06:28:07 +00:00
co-authored by Cursor
parent 5264035705
commit dcbc62d1d3
11 changed files with 361 additions and 89 deletions
@@ -109,6 +109,23 @@ class DashboardController extends Controller
?Member $member,
?int $branchScope,
): array {
$organization = $this->organization($request);
$practitionerScope = app(OrganizationResolver::class)->practitionerScope($organization, $member);
if ($practitionerScope !== null) {
$queue = $this->appointments->queueForPractitioners($owner, $practitionerScope);
$inConsultation = Appointment::owned($owner)
->where('organization_id', $organizationId)
->where('status', Appointment::STATUS_IN_CONSULTATION)
->whereIn('practitioner_id', $practitionerScope ?: [0])
->with(['patient', 'practitioner', 'consultation'])
->orderBy('started_at')
->limit(20)
->get();
return [$queue, $inConsultation, $practitionerScope[0] ?? null];
}
$practitioner = null;
if ($member) {
$practitioner = Practitioner::owned($owner)