Lock doctors to their assigned patients and hide branch filters.
Deploy Ladill Care / deploy (push) Successful in 1m2s
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user