Hide Clinical forms nav and callout from nurses.
Deploy Ladill Care / deploy (push) Successful in 53s
Deploy Ladill Care / deploy (push) Successful in 53s
That surface is for consult/pathway intake. Nurses use My care unit for ward assessments; require consultations.manage to show Clinical forms. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
@php
|
||||
$canManagePatients = app(\App\Services\Care\CarePermissions::class)->can(
|
||||
auth()->user() ? app(\App\Services\Care\OrganizationResolver::class)->memberFor(auth()->user(), $organization) : null,
|
||||
'patients.manage'
|
||||
);
|
||||
$memberForPatients = auth()->user()
|
||||
? app(\App\Services\Care\OrganizationResolver::class)->memberFor(auth()->user(), $organization)
|
||||
: null;
|
||||
$permissionsForPatients = app(\App\Services\Care\CarePermissions::class);
|
||||
$canManagePatients = $permissionsForPatients->can($memberForPatients, 'patients.manage');
|
||||
$canUseClinicalForms = $permissionsForPatients->can($memberForPatients, 'consultations.manage')
|
||||
&& $permissionsForPatients->can($memberForPatients, 'assessments.view');
|
||||
@endphp
|
||||
|
||||
<x-app-layout title="Patients">
|
||||
@@ -23,7 +26,7 @@
|
||||
@endif
|
||||
</x-care.page-hero>
|
||||
|
||||
@if (request('focus') === 'assessments')
|
||||
@if (request('focus') === 'assessments' && $canUseClinicalForms)
|
||||
<div class="rounded-2xl border border-sky-100 bg-sky-50 px-4 py-3 text-sm text-sky-900">
|
||||
<p class="font-medium">Clinical forms</p>
|
||||
<p class="mt-1 text-sky-800/90">
|
||||
|
||||
@@ -62,7 +62,13 @@
|
||||
$organization,
|
||||
\App\Services\Care\CareFeatures::ASSESSMENTS_ENGINE,
|
||||
);
|
||||
if ($assessmentsEngineOn && $permissions->can($member, 'assessments.view') && $permissions->can($member, 'patients.view') && $permissions->handlesFloorCare($member)) {
|
||||
// Clinical forms = consult/pathway intake (doctors), not ward nursing assessments.
|
||||
if ($assessmentsEngineOn
|
||||
&& $permissions->can($member, 'assessments.view')
|
||||
&& $permissions->can($member, 'patients.view')
|
||||
&& $permissions->can($member, 'consultations.manage')
|
||||
&& $permissions->handlesFloorCare($member)
|
||||
) {
|
||||
$nav[] = [
|
||||
'name' => 'Clinical forms',
|
||||
'route' => route('care.patients.index', ['focus' => 'assessments']),
|
||||
|
||||
@@ -223,6 +223,7 @@ class CareMyShiftsAndNavPermissionsTest extends TestCase
|
||||
->assertDontSee('>Departments<', false)
|
||||
->assertDontSee('>Nursing Services<', false)
|
||||
->assertDontSee('>Nursing<', false)
|
||||
->assertDontSee('>Clinical forms<', false)
|
||||
->assertSee('>My care unit<', false)
|
||||
->assertSee('My shifts', false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user