Wire specialty Start consultation to the real consultation page.
Deploy Ladill Care / deploy (push) Successful in 58s
Deploy Ladill Care / deploy (push) Successful in 58s
Doctors leave the specialty shell into Care consultations instead of a no-op workspace link. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -205,4 +205,66 @@ class CareSpecialtyShellTest extends TestCase
|
||||
$bill->lineItems()->where('description', 'Emergency consultation')->exists()
|
||||
);
|
||||
}
|
||||
|
||||
public function test_specialty_start_consultation_opens_consultation_page(): void
|
||||
{
|
||||
app(SpecialtyModuleService::class)->activate(
|
||||
$this->organization,
|
||||
$this->owner->public_id,
|
||||
'dentistry',
|
||||
);
|
||||
|
||||
$department = Department::query()
|
||||
->where('branch_id', $this->branch->id)
|
||||
->where('type', 'dental')
|
||||
->firstOrFail();
|
||||
|
||||
$patient = Patient::create([
|
||||
'owner_ref' => $this->owner->public_id,
|
||||
'organization_id' => $this->organization->id,
|
||||
'branch_id' => $this->branch->id,
|
||||
'patient_number' => 'P-DEN-1',
|
||||
'first_name' => 'Abena',
|
||||
'last_name' => 'Osei',
|
||||
'gender' => 'female',
|
||||
'date_of_birth' => '1993-01-01',
|
||||
]);
|
||||
|
||||
$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(),
|
||||
]);
|
||||
|
||||
$appointment = 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(),
|
||||
]);
|
||||
|
||||
$response = $this->actingAs($this->owner)
|
||||
->post(route('care.specialty.consultation.start', [
|
||||
'module' => 'dentistry',
|
||||
'visit' => $visit,
|
||||
]));
|
||||
|
||||
$consultation = \App\Models\Consultation::query()
|
||||
->where('appointment_id', $appointment->id)
|
||||
->first();
|
||||
$this->assertNotNull($consultation);
|
||||
|
||||
$response->assertRedirect(route('care.consultations.show', $consultation));
|
||||
$this->assertSame(Appointment::STATUS_IN_CONSULTATION, $appointment->fresh()->status);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user