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:
@@ -31,20 +31,9 @@ class SpecialtyModuleController extends Controller
|
||||
SpecialtyModuleService $modules,
|
||||
SpecialtyShellService $shell,
|
||||
CareQueueBridge $queueBridge,
|
||||
): RedirectResponse {
|
||||
$definition = $modules->definition($module);
|
||||
abort_unless($definition, 404);
|
||||
abort_unless(
|
||||
$modules->memberCanAccess($this->organization($request), $this->member($request), $module),
|
||||
403,
|
||||
);
|
||||
|
||||
// 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);
|
||||
): View {
|
||||
// Everyone lands on the specialty list/index — never auto-open a patient.
|
||||
return $this->renderShell($request, $module, 'visits', $modules, $shell, $queueBridge);
|
||||
}
|
||||
|
||||
public function visits(
|
||||
@@ -53,19 +42,8 @@ class SpecialtyModuleController extends Controller
|
||||
SpecialtyModuleService $modules,
|
||||
SpecialtyShellService $shell,
|
||||
CareQueueBridge $queueBridge,
|
||||
): RedirectResponse {
|
||||
$definition = $modules->definition($module);
|
||||
abort_unless($definition, 404);
|
||||
abort_unless(
|
||||
$modules->memberCanAccess($this->organization($request), $this->member($request), $module),
|
||||
403,
|
||||
);
|
||||
|
||||
if (app(\App\Services\Care\CarePermissions::class)->canAccessPatientQueue($this->member($request))) {
|
||||
return redirect()->route('care.queue.index');
|
||||
}
|
||||
|
||||
return redirect()->route('care.specialty.workspace', $module);
|
||||
): View {
|
||||
return $this->renderShell($request, $module, 'visits', $modules, $shell, $queueBridge);
|
||||
}
|
||||
|
||||
public function history(
|
||||
@@ -95,7 +73,12 @@ class SpecialtyModuleController extends Controller
|
||||
SpecialtyShellService $shell,
|
||||
CareQueueBridge $queueBridge,
|
||||
?Visit $visit = null,
|
||||
): View {
|
||||
): View|RedirectResponse {
|
||||
// Bare /workspace (no visit) is the old auto-open entry — send users to the list.
|
||||
if ($visit === null) {
|
||||
return redirect()->route('care.specialty.show', $module);
|
||||
}
|
||||
|
||||
return $this->renderShell($request, $module, 'workspace', $modules, $shell, $queueBridge, $visit);
|
||||
}
|
||||
|
||||
@@ -589,14 +572,7 @@ class SpecialtyModuleController extends Controller
|
||||
);
|
||||
|
||||
return redirect()
|
||||
->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],
|
||||
)
|
||||
->route('care.specialty.show', $module)
|
||||
->with('success', 'Referred '.$patient->fullName().' to '.($definition['label'] ?? $module).'.');
|
||||
}
|
||||
|
||||
@@ -792,25 +768,6 @@ class SpecialtyModuleController extends Controller
|
||||
);
|
||||
$timeline = $shell->patientTimeline($visit->patient);
|
||||
}
|
||||
} elseif ($section === 'workspace') {
|
||||
$first = $openVisits->first();
|
||||
if ($first?->patient) {
|
||||
$first->load([
|
||||
'patient.allergies',
|
||||
'patient.emergencyContacts',
|
||||
'patient.attachments',
|
||||
'appointment.practitioner',
|
||||
'appointment.consultation.investigationRequests.investigationType',
|
||||
'bill.lineItems',
|
||||
'consultations.investigationRequests.investigationType',
|
||||
]);
|
||||
$workspaceVisit = $first;
|
||||
$patientHeader = array_merge(
|
||||
['patient' => $first->patient, 'visit' => $first, 'appointment' => $first->appointment],
|
||||
$shell->patientHeaderMeta($first->patient),
|
||||
);
|
||||
$timeline = $shell->patientTimeline($first->patient);
|
||||
}
|
||||
}
|
||||
|
||||
if ($workspaceVisit && $section === 'workspace') {
|
||||
|
||||
Reference in New Issue
Block a user