Gate Queue to doctors and land specialty modules on list indexes.
Deploy Ladill Care / deploy (push) Successful in 34s
Deploy Ladill Care / deploy (push) Successful in 34s
Hide the patient-flow Queue board from nurses, reception, and other non-doctors; specialty home routes now render the queue board list instead of auto-opening the first open visit. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -111,15 +111,13 @@ class CarePermissions
|
||||
}
|
||||
|
||||
/**
|
||||
* Dedicated patient-flow board (GP / specialty Queue homes).
|
||||
* Nurses keep specialty workspaces and vitals — not the call-next board.
|
||||
* Dedicated patient-flow board (GP Queue home / call-next board).
|
||||
* Doctors only — nurses, reception, pharmacy, and other floor roles use
|
||||
* specialty module lists and service queues instead.
|
||||
* Facility admins manage settings/staff and do not staff this board.
|
||||
*/
|
||||
public function canAccessPatientQueue(?Member $member): bool
|
||||
{
|
||||
if (! $this->handlesFloorCare($member)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $member->role !== 'nurse';
|
||||
return $member !== null && $member->role === 'doctor';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,6 +284,8 @@ class OrganizationResolver
|
||||
|
||||
/**
|
||||
* Explicit branch IDs for a doctor's linked practitioner desks (pivot + legacy branch_id).
|
||||
* GPs with no practitioner desk fall back to their member branch so they can still
|
||||
* open the shared consultation Queue board.
|
||||
*
|
||||
* @return list<int>
|
||||
*/
|
||||
@@ -304,7 +306,13 @@ class OrganizationResolver
|
||||
$ids = array_merge($ids, $practitioner->assignedBranchIds());
|
||||
}
|
||||
|
||||
return array_values(array_unique(array_map('intval', $ids)));
|
||||
$ids = array_values(array_unique(array_map('intval', $ids)));
|
||||
|
||||
if ($ids === [] && $member->branch_id) {
|
||||
return [(int) $member->branch_id];
|
||||
}
|
||||
|
||||
return $ids;
|
||||
}
|
||||
|
||||
public function mayAccessBranch(?Member $member, ?int $branchId): bool
|
||||
@@ -357,8 +365,9 @@ class OrganizationResolver
|
||||
}
|
||||
|
||||
/**
|
||||
* Practitioner IDs a doctor is locked to. Null = no practitioner lock.
|
||||
* Empty array = doctor with no linked desk.
|
||||
* Practitioner IDs a doctor is locked to. Null = no practitioner lock
|
||||
* (non-doctors, or GPs with no linked desk — they work the shared consultation board).
|
||||
* Non-empty = desk-locked specialist / assigned GP.
|
||||
*
|
||||
* @return list<int>|null
|
||||
*/
|
||||
@@ -368,7 +377,7 @@ class OrganizationResolver
|
||||
return null;
|
||||
}
|
||||
|
||||
return Practitioner::owned((string) $organization->owner_ref)
|
||||
$ids = Practitioner::owned((string) $organization->owner_ref)
|
||||
->where('organization_id', $organization->id)
|
||||
->where('is_active', true)
|
||||
->where(function ($query) use ($member) {
|
||||
@@ -380,5 +389,7 @@ class OrganizationResolver
|
||||
->map(fn ($id) => (int) $id)
|
||||
->values()
|
||||
->all();
|
||||
|
||||
return $ids === [] ? null : $ids;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user