Give specialty modules the same Queue UI as GPs.
Deploy Ladill Care / deploy (push) Successful in 36s
Deploy Ladill Care / deploy (push) Successful in 36s
Specialty homes now use the shared Waiting/In care board with Call next, Start routes specialty tickets into specialty workspaces, and redundant Dentistry/Specialty module chrome is removed. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -163,16 +163,29 @@ class QueueController extends Controller
|
||||
|
||||
abort_unless($branchId > 0, 422);
|
||||
|
||||
$context = CareQueueContexts::CONSULTATION;
|
||||
if ($practitionerId) {
|
||||
$prac = Practitioner::owned($this->ownerRef($request))->find($practitionerId);
|
||||
$specialtyContext = $this->queueBridge->contextForPractitioner($organization, $prac);
|
||||
if ($specialtyContext !== CareQueueContexts::CONSULTATION) {
|
||||
$context = $specialtyContext;
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->queueBridge->callNext(
|
||||
$organization,
|
||||
CareQueueContexts::CONSULTATION,
|
||||
$context,
|
||||
$branchId,
|
||||
$member,
|
||||
$practitionerId,
|
||||
);
|
||||
$ticket = $result['ticket'] ?? null;
|
||||
if (! $ticket) {
|
||||
return back()->with('info', 'No patients waiting at your consultation service point.');
|
||||
$label = $context === CareQueueContexts::CONSULTATION
|
||||
? 'consultation'
|
||||
: $context;
|
||||
|
||||
return back()->with('info', "No patients waiting at your {$label} service point.");
|
||||
}
|
||||
|
||||
return back()->with('success', 'Called '.$ticket['ticket_number'].' — '.($ticket['customer_name'] ?? 'patient').'.');
|
||||
@@ -234,6 +247,26 @@ class QueueController extends Controller
|
||||
$this->ownerRef($request),
|
||||
);
|
||||
|
||||
$organization = $this->organization($request);
|
||||
$appointment = $appointment->fresh(['visit', 'department']);
|
||||
$specialtyContext = $this->queueBridge->contextForAppointment($organization, $appointment);
|
||||
|
||||
if ($specialtyContext !== CareQueueContexts::CONSULTATION && $appointment->visit) {
|
||||
$clinical = app(\App\Services\Care\SpecialtyClinicalRecordService::class);
|
||||
$shell = app(\App\Services\Care\SpecialtyShellService::class);
|
||||
$preferredTab = collect(array_keys($shell->workspaceTabs($specialtyContext)))
|
||||
->first(fn (string $tab) => $clinical->recordTypeForTab($specialtyContext, $tab) !== null)
|
||||
?? 'clinical_notes';
|
||||
|
||||
return redirect()
|
||||
->route('care.specialty.workspace', [
|
||||
'module' => $specialtyContext,
|
||||
'visit' => $appointment->visit,
|
||||
'tab' => $preferredTab,
|
||||
])
|
||||
->with('success', 'Encounter started.');
|
||||
}
|
||||
|
||||
return redirect()->route('care.consultations.show', $consultation)
|
||||
->with('success', 'Consultation started.');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user