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
|
@php
|
||||||
$canManagePatients = app(\App\Services\Care\CarePermissions::class)->can(
|
$memberForPatients = auth()->user()
|
||||||
auth()->user() ? app(\App\Services\Care\OrganizationResolver::class)->memberFor(auth()->user(), $organization) : null,
|
? app(\App\Services\Care\OrganizationResolver::class)->memberFor(auth()->user(), $organization)
|
||||||
'patients.manage'
|
: 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
|
@endphp
|
||||||
|
|
||||||
<x-app-layout title="Patients">
|
<x-app-layout title="Patients">
|
||||||
@@ -23,7 +26,7 @@
|
|||||||
@endif
|
@endif
|
||||||
</x-care.page-hero>
|
</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">
|
<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="font-medium">Clinical forms</p>
|
||||||
<p class="mt-1 text-sky-800/90">
|
<p class="mt-1 text-sky-800/90">
|
||||||
|
|||||||
@@ -62,7 +62,13 @@
|
|||||||
$organization,
|
$organization,
|
||||||
\App\Services\Care\CareFeatures::ASSESSMENTS_ENGINE,
|
\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[] = [
|
$nav[] = [
|
||||||
'name' => 'Clinical forms',
|
'name' => 'Clinical forms',
|
||||||
'route' => route('care.patients.index', ['focus' => 'assessments']),
|
'route' => route('care.patients.index', ['focus' => 'assessments']),
|
||||||
|
|||||||
@@ -223,6 +223,7 @@ class CareMyShiftsAndNavPermissionsTest extends TestCase
|
|||||||
->assertDontSee('>Departments<', false)
|
->assertDontSee('>Departments<', false)
|
||||||
->assertDontSee('>Nursing Services<', false)
|
->assertDontSee('>Nursing Services<', false)
|
||||||
->assertDontSee('>Nursing<', false)
|
->assertDontSee('>Nursing<', false)
|
||||||
|
->assertDontSee('>Clinical forms<', false)
|
||||||
->assertSee('>My care unit<', false)
|
->assertSee('>My care unit<', false)
|
||||||
->assertSee('My shifts', false);
|
->assertSee('My shifts', false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user