Add ambulance New call flow under ambulance.manage.
Deploy Ladill Care / deploy (push) Successful in 1m41s
Deploy Ladill Care / deploy (push) Successful in 1m41s
Walk-in appointments require appointments.manage, which blocked EMS staff; New call now uses a dedicated specialty route that lands on the dispatch board. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -254,6 +254,54 @@ class CareAmbulanceSuiteTest extends TestCase
|
||||
->assertSee('Handover')
|
||||
->assertSee($this->patient->fullName())
|
||||
->assertDontSee('Call next')
|
||||
->assertDontSee('Bring the next waiting patient to your desk');
|
||||
->assertDontSee('Bring the next waiting patient to your desk')
|
||||
->assertSee(route('care.specialty.ambulance.new-call'), false);
|
||||
}
|
||||
|
||||
public function test_ambulance_staff_can_log_new_call_without_appointments_manage(): void
|
||||
{
|
||||
$user = User::create([
|
||||
'public_id' => 'amb-crew',
|
||||
'name' => 'Kojo Ambulance',
|
||||
'email' => 'kojo-amb@example.com',
|
||||
]);
|
||||
Member::create([
|
||||
'owner_ref' => $this->owner->public_id,
|
||||
'organization_id' => $this->organization->id,
|
||||
'user_ref' => $user->public_id,
|
||||
'role' => 'ambulance_staff',
|
||||
'branch_id' => $this->branch->id,
|
||||
]);
|
||||
|
||||
$this->actingAs($user)
|
||||
->get(route('care.appointments.walk-in.create'))
|
||||
->assertForbidden();
|
||||
|
||||
$this->actingAs($user)
|
||||
->get(route('care.specialty.ambulance.new-call'))
|
||||
->assertOk()
|
||||
->assertSee('Log a new call');
|
||||
|
||||
$this->actingAs($user)
|
||||
->post(route('care.specialty.ambulance.new-call.store'), [
|
||||
'branch_id' => $this->branch->id,
|
||||
'patient_id' => $this->patient->id,
|
||||
'reason' => 'Chest pain',
|
||||
'location' => 'Spintex Road',
|
||||
])
|
||||
->assertRedirect(route('care.specialty.show', 'ambulance'));
|
||||
|
||||
$this->assertDatabaseHas('care_appointments', [
|
||||
'patient_id' => $this->patient->id,
|
||||
'branch_id' => $this->branch->id,
|
||||
'type' => Appointment::TYPE_WALK_IN,
|
||||
]);
|
||||
|
||||
$visit = Visit::query()
|
||||
->where('patient_id', $this->patient->id)
|
||||
->where('specialty_stage', 'check_in')
|
||||
->latest('id')
|
||||
->first();
|
||||
$this->assertNotNull($visit);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user