Redesign Care patient-flow board and remove Queue from nurses.
Deploy Ladill Care / deploy (push) Successful in 39s
Deploy Ladill Care / deploy (push) Successful in 39s
Shared queue-board is now a Waiting/Called/In care/Done stage board with prominent tickets and Call next; nurses lose queue.manage and canAccessPatientQueue so /queue and queue nav are gated while specialty workspaces stay available. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -39,8 +39,12 @@ class SpecialtyModuleController extends Controller
|
||||
403,
|
||||
);
|
||||
|
||||
// Specialty patient flow lives on Queue; clinical depth opens from Queue Start.
|
||||
return redirect()->route('care.queue.index');
|
||||
// Specialty patient flow lives on Queue; nurses stay on the specialty workspace.
|
||||
if (app(\App\Services\Care\CarePermissions::class)->canAccessPatientQueue($this->member($request))) {
|
||||
return redirect()->route('care.queue.index');
|
||||
}
|
||||
|
||||
return redirect()->route('care.specialty.workspace', $module);
|
||||
}
|
||||
|
||||
public function visits(
|
||||
@@ -57,7 +61,11 @@ class SpecialtyModuleController extends Controller
|
||||
403,
|
||||
);
|
||||
|
||||
return redirect()->route('care.queue.index');
|
||||
if (app(\App\Services\Care\CarePermissions::class)->canAccessPatientQueue($this->member($request))) {
|
||||
return redirect()->route('care.queue.index');
|
||||
}
|
||||
|
||||
return redirect()->route('care.specialty.workspace', $module);
|
||||
}
|
||||
|
||||
public function history(
|
||||
@@ -543,7 +551,14 @@ class SpecialtyModuleController extends Controller
|
||||
);
|
||||
|
||||
return redirect()
|
||||
->route('care.queue.index')
|
||||
->route(
|
||||
app(\App\Services\Care\CarePermissions::class)->canAccessPatientQueue($member)
|
||||
? 'care.queue.index'
|
||||
: 'care.specialty.workspace',
|
||||
app(\App\Services\Care\CarePermissions::class)->canAccessPatientQueue($member)
|
||||
? []
|
||||
: ['module' => $module],
|
||||
)
|
||||
->with('success', 'Referred '.$patient->fullName().' to '.($definition['label'] ?? $module).'.');
|
||||
}
|
||||
|
||||
@@ -650,6 +665,7 @@ class SpecialtyModuleController extends Controller
|
||||
|| $permissions->can($member, 'consultations.manage')
|
||||
);
|
||||
$canManageQueue = $permissions->can($member, 'appointments.manage') && $canManageSpecialty;
|
||||
$canAccessPatientQueue = $permissions->canAccessPatientQueue($member);
|
||||
$canBookAppointments = $permissions->can($member, 'appointments.manage');
|
||||
$canViewPatients = $permissions->can($member, 'patients.view');
|
||||
$canViewAppointments = $permissions->can($member, 'appointments.view');
|
||||
@@ -657,6 +673,22 @@ class SpecialtyModuleController extends Controller
|
||||
? (string) (\App\Models\Branch::owned($owner)->whereKey($branchId)->value('name') ?? '')
|
||||
: '';
|
||||
|
||||
$done = Appointment::owned($owner)
|
||||
->where('organization_id', $organization->id)
|
||||
->where('status', Appointment::STATUS_COMPLETED)
|
||||
->whereDate('completed_at', today())
|
||||
->when($departmentIds !== [], fn ($q) => $q->whereIn('department_id', $departmentIds))
|
||||
->when($departmentIds === [], fn ($q) => $q->whereRaw('1 = 0'))
|
||||
->when($kpiBranch, fn ($q) => $q->where('branch_id', $kpiBranch))
|
||||
->when(
|
||||
$practitionerScope !== null,
|
||||
fn ($q) => $q->whereIn('practitioner_id', $practitionerScope ?: [0]),
|
||||
)
|
||||
->with(['patient', 'practitioner'])
|
||||
->orderByDesc('completed_at')
|
||||
->limit(20)
|
||||
->get();
|
||||
|
||||
$workspaceVisit = null;
|
||||
$patientHeader = null;
|
||||
$timeline = [];
|
||||
@@ -843,6 +875,7 @@ class SpecialtyModuleController extends Controller
|
||||
'waiting' => $waiting,
|
||||
'queue' => $waiting,
|
||||
'inConsultation' => $inConsultation,
|
||||
'done' => $done,
|
||||
'openVisits' => $openVisits,
|
||||
'visitHistory' => $visitHistory,
|
||||
'kpis' => $kpis,
|
||||
@@ -900,6 +933,7 @@ class SpecialtyModuleController extends Controller
|
||||
'canManageClinical' => $canManageClinical,
|
||||
'canManageVitals' => $canManageVitals,
|
||||
'canManageQueue' => $canManageQueue,
|
||||
'canAccessPatientQueue' => $canAccessPatientQueue,
|
||||
'canBookAppointments' => $canBookAppointments,
|
||||
'canViewPatients' => $canViewPatients,
|
||||
'canViewAppointments' => $canViewAppointments,
|
||||
|
||||
Reference in New Issue
Block a user