Gate Queue to doctors and land specialty modules on list indexes.
Deploy Ladill Care / deploy (push) Successful in 34s
Deploy Ladill Care / deploy (push) Successful in 34s
Hide the patient-flow Queue board from nurses, reception, and other non-doctors; specialty home routes now render the queue board list instead of auto-opening the first open visit. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -78,6 +78,29 @@ class CareQueueBridgeTest extends TestCase
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Patient-flow board is doctor-only; reception keeps check-in / walk-in helpers.
|
||||
*
|
||||
* @return array{0: User, 1: Member}
|
||||
*/
|
||||
protected function makeDoctor(string $suffix = 'doc'): array
|
||||
{
|
||||
$user = User::create([
|
||||
'public_id' => 'bridge-'.$suffix,
|
||||
'name' => 'Bridge Doctor '.$suffix,
|
||||
'email' => $suffix.'@bridge.example.com',
|
||||
]);
|
||||
$member = Member::create([
|
||||
'owner_ref' => $this->owner->public_id,
|
||||
'organization_id' => $this->organization->id,
|
||||
'user_ref' => $user->public_id,
|
||||
'role' => 'doctor',
|
||||
'branch_id' => $this->branch->id,
|
||||
]);
|
||||
|
||||
return [$user, $member];
|
||||
}
|
||||
|
||||
public function test_check_in_issues_consultation_ticket_when_integration_on(): void
|
||||
{
|
||||
Http::fake();
|
||||
@@ -164,7 +187,9 @@ class CareQueueBridgeTest extends TestCase
|
||||
'queue_ticket_status' => 'waiting',
|
||||
]);
|
||||
|
||||
$this->actingAs($this->owner)
|
||||
[$doctor] = $this->makeDoctor('wait');
|
||||
|
||||
$this->actingAs($doctor)
|
||||
->get(route('care.queue.index'))
|
||||
->assertOk()
|
||||
->assertSee('C042')
|
||||
@@ -198,7 +223,9 @@ class CareQueueBridgeTest extends TestCase
|
||||
'queue_position' => 1,
|
||||
]);
|
||||
|
||||
$response = $this->actingAs($this->owner)
|
||||
[$doctor] = $this->makeDoctor('backfill');
|
||||
|
||||
$response = $this->actingAs($doctor)
|
||||
->from(route('care.queue.index'))
|
||||
->post(route('care.queue.call-next'), [
|
||||
'branch_id' => $this->branch->id,
|
||||
@@ -221,7 +248,9 @@ class CareQueueBridgeTest extends TestCase
|
||||
{
|
||||
Http::fake();
|
||||
|
||||
$this->actingAs($this->owner)
|
||||
[$doctor] = $this->makeDoctor('empty');
|
||||
|
||||
$this->actingAs($doctor)
|
||||
->from(route('care.queue.index'))
|
||||
->post(route('care.queue.call-next'), ['branch_id' => $this->branch->id])
|
||||
->assertRedirect(route('care.queue.index'))
|
||||
@@ -304,7 +333,9 @@ class CareQueueBridgeTest extends TestCase
|
||||
|
||||
$this->assertSame('called', $appointment->fresh()->queue_ticket_status);
|
||||
|
||||
$this->actingAs($this->owner)
|
||||
[$viewer] = $this->makeDoctor('recall-view');
|
||||
|
||||
$this->actingAs($viewer)
|
||||
->get(route('care.queue.index', ['branch_id' => $this->branch->id]))
|
||||
->assertOk()
|
||||
->assertSee($appointment->queue_ticket_number);
|
||||
@@ -368,7 +399,9 @@ class CareQueueBridgeTest extends TestCase
|
||||
]);
|
||||
|
||||
// Board GET must remain read-only; ticket backfill is explicit (Call next / artisan).
|
||||
$this->actingAs($this->owner)
|
||||
[$doctor] = $this->makeDoctor('sync');
|
||||
|
||||
$this->actingAs($doctor)
|
||||
->get(route('care.queue.index', ['branch_id' => $this->branch->id]))
|
||||
->assertOk()
|
||||
->assertSee('Toothache');
|
||||
@@ -484,7 +517,9 @@ class CareQueueBridgeTest extends TestCase
|
||||
$next->fresh(['patient', 'practitioner', 'organization']),
|
||||
);
|
||||
|
||||
$response = $this->actingAs($this->owner)
|
||||
[$doctor] = $this->makeDoctor('advance');
|
||||
|
||||
$response = $this->actingAs($doctor)
|
||||
->post(route('care.queue.call-next'), [
|
||||
'branch_id' => $this->branch->id,
|
||||
'practitioner_id' => $practitioner->id,
|
||||
@@ -499,7 +534,7 @@ class CareQueueBridgeTest extends TestCase
|
||||
$this->assertSame('called', $next->queue_ticket_status);
|
||||
$response->assertRedirect(route('care.appointments.show', $next));
|
||||
|
||||
$this->actingAs($this->owner)
|
||||
$this->actingAs($doctor)
|
||||
->get(route('care.appointments.show', $next))
|
||||
->assertOk()
|
||||
->assertSee('Call again');
|
||||
@@ -675,7 +710,9 @@ class CareQueueBridgeTest extends TestCase
|
||||
'care_entity_uuid' => $appointment->uuid,
|
||||
]);
|
||||
|
||||
$this->actingAs($this->owner)
|
||||
[$caller] = $this->makeDoctor('reclaim');
|
||||
|
||||
$this->actingAs($caller)
|
||||
->from(route('care.queue.index'))
|
||||
->post(route('care.queue.call-next'), [
|
||||
'branch_id' => $this->branch->id,
|
||||
@@ -700,7 +737,7 @@ class CareQueueBridgeTest extends TestCase
|
||||
'status' => 'pending',
|
||||
]);
|
||||
|
||||
$this->actingAs($this->owner)
|
||||
$this->actingAs($caller)
|
||||
->get(route('care.queue.index', [
|
||||
'branch_id' => $this->branch->id,
|
||||
'practitioner_id' => $doctor->id,
|
||||
|
||||
Reference in New Issue
Block a user