Let nurses open specialty visits from the queue list.
Deploy Ladill Care / deploy (push) Successful in 51s

Open on waiting/called cards no longer requires consultations.manage so
view roles can re-enter Emergency and other specialty workspaces.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-19 13:52:28 +00:00
co-authored by Cursor
parent f82964b2a0
commit 64e3f75159
3 changed files with 122 additions and 11 deletions
+89 -2
View File
@@ -212,20 +212,107 @@ class CarePatientQueueAccessTest extends TestCase
'checked_in_at' => now(),
]);
$this->actingAs($nurseUser)
$workspaceUrl = route('care.specialty.workspace', [
'module' => 'blood_bank',
'visit' => $visit,
], absolute: false);
$listHtml = $this->actingAs($nurseUser)
->get(route('care.specialty.show', 'blood_bank'))
->assertOk()
->assertSee('Blood Bank')
->assertSee('Patient flow')
->assertSee('Waiting')
->assertSee('Kwame Donor')
->assertDontSee('No open visit selected');
->assertSee('Open')
->assertDontSee('No open visit selected')
->getContent();
$this->assertStringContainsString($workspaceUrl, $listHtml);
$this->assertStringNotContainsString('>Start</button>', $listHtml);
$this->actingAs($nurseUser)
->get(route('care.specialty.workspace', ['module' => 'blood_bank', 'visit' => $visit]))
->assertOk();
$this->actingAs($nurseUser)
->get(route('care.specialty.workspace', 'blood_bank'))
->assertRedirect(route('care.specialty.show', 'blood_bank'));
}
public function test_nurse_can_open_emergency_visit_from_specialty_list(): void
{
[$nurseUser] = $this->makeStaff('nurse', 'nurse-er-open');
$modules = app(SpecialtyModuleService::class);
$modules->ensureDefaultModulesProvisioned($this->organization, $this->owner->public_id);
$modules->activate($this->organization->fresh(), $this->owner->public_id, 'emergency');
$department = Department::query()
->where('branch_id', $this->branch->id)
->where('type', 'emergency')
->firstOrFail();
$patient = Patient::create([
'owner_ref' => $this->owner->public_id,
'organization_id' => $this->organization->id,
'branch_id' => $this->branch->id,
'patient_number' => 'P-ER-OPEN',
'first_name' => 'Akosua',
'last_name' => 'Owusu',
'gender' => 'female',
'date_of_birth' => '1990-03-15',
]);
$visit = Visit::create([
'owner_ref' => $this->owner->public_id,
'organization_id' => $this->organization->id,
'branch_id' => $this->branch->id,
'patient_id' => $patient->id,
'status' => Visit::STATUS_OPEN,
'checked_in_at' => now(),
'specialty_stage' => 'arrival',
]);
Appointment::create([
'owner_ref' => $this->owner->public_id,
'organization_id' => $this->organization->id,
'branch_id' => $this->branch->id,
'patient_id' => $patient->id,
'department_id' => $department->id,
'visit_id' => $visit->id,
'type' => Appointment::TYPE_WALK_IN,
'status' => Appointment::STATUS_WAITING,
'scheduled_at' => now(),
'waiting_at' => now(),
'checked_in_at' => now(),
'queue_ticket_number' => 'ER002',
'queue_ticket_status' => 'waiting',
]);
$workspaceUrl = route('care.specialty.workspace', [
'module' => 'emergency',
'visit' => $visit,
], absolute: false);
$html = $this->actingAs($nurseUser)
->get(route('care.specialty.show', 'emergency'))
->assertOk()
->assertSee('Akosua Owusu')
->assertSee('ER002')
->assertSee('Open')
->assertDontSee('>Start</button>', false)
->getContent();
$this->assertStringContainsString($workspaceUrl, $html);
$this->actingAs($nurseUser)
->get(route('care.specialty.workspace', ['module' => 'emergency', 'visit' => $visit]))
->assertOk()
->assertSee('Akosua Owusu')
->assertDontSee('No open visit selected');
}
public function test_nurse_specialty_show_redirects_to_workspace_not_queue(): void
{
[$nurseUser] = $this->makeStaff('nurse', 'nurse-spec-er');