Clarify patient vs nurse unit placement on nursing charts.
Deploy Ladill Care / deploy (push) Successful in 55s
Deploy Ladill Care / deploy (push) Successful in 55s
The empty state referred to the patient but read like the nurse was unassigned; show duty units and patient-specific copy instead. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -349,12 +349,68 @@ class CareMyShiftsAndNavPermissionsTest extends TestCase
|
||||
->get(route('care.patients.show', $patient))
|
||||
->assertOk()
|
||||
->assertSee('Visit & nursing care', false)
|
||||
->assertSee('On unit now')
|
||||
->assertSee('Patient on unit')
|
||||
->assertSee('Medical Ward')
|
||||
->assertSee('Nursing assessments')
|
||||
->assertSee('My care unit')
|
||||
->assertDontSee('Visit & clinical history', false)
|
||||
->assertDontSee('Condition pathways')
|
||||
->assertDontSee('Follow-up scores')
|
||||
->assertDontSee('Start assessment');
|
||||
->assertDontSee('Start assessment')
|
||||
->assertDontSee('This patient is not on a care unit');
|
||||
}
|
||||
|
||||
public function test_nurse_patient_chart_clarifies_unplaced_patient_vs_nurse_duty(): void
|
||||
{
|
||||
$user = User::create([
|
||||
'public_id' => 'nurse-chart-unplaced',
|
||||
'name' => 'Nurse Duty',
|
||||
'email' => 'nurse-chart-unplaced@example.com',
|
||||
]);
|
||||
$member = Member::create([
|
||||
'owner_ref' => $this->owner->public_id,
|
||||
'organization_id' => $this->organization->id,
|
||||
'user_ref' => $user->public_id,
|
||||
'role' => 'nurse',
|
||||
'branch_id' => $this->branch->id,
|
||||
]);
|
||||
|
||||
$roster = app(RosterService::class);
|
||||
$day = $roster->ensureDefaultShifts($this->organization, $this->owner->public_id)->firstWhere('code', 'day');
|
||||
$roster->assign(
|
||||
$this->unit,
|
||||
$day,
|
||||
$member,
|
||||
now()->toDateString(),
|
||||
$this->owner->public_id,
|
||||
$this->owner->public_id,
|
||||
);
|
||||
|
||||
$patient = \App\Models\Patient::create([
|
||||
'uuid' => (string) \Illuminate\Support\Str::uuid(),
|
||||
'owner_ref' => $this->owner->public_id,
|
||||
'organization_id' => $this->organization->id,
|
||||
'branch_id' => $this->branch->id,
|
||||
'patient_number' => 'P-CHART-2',
|
||||
'first_name' => 'Kofi',
|
||||
'last_name' => 'Mensah',
|
||||
]);
|
||||
|
||||
\App\Models\Visit::create([
|
||||
'owner_ref' => $this->owner->public_id,
|
||||
'organization_id' => $this->organization->id,
|
||||
'branch_id' => $this->branch->id,
|
||||
'patient_id' => $patient->id,
|
||||
'status' => \App\Models\Visit::STATUS_IN_PROGRESS,
|
||||
'checked_in_at' => now(),
|
||||
]);
|
||||
|
||||
$this->actingAs($user)
|
||||
->get(route('care.patients.show', $patient))
|
||||
->assertOk()
|
||||
->assertSee('This patient is not on a care unit right now.')
|
||||
->assertSee('You are on duty at')
|
||||
->assertSee('Medical Ward')
|
||||
->assertSee('Open Medical Ward')
|
||||
->assertDontSee('Not placed on a care unit right now.');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user