Wire Care lists into Ladill Queue workflows instead of reception panels.
Deploy Ladill Care / deploy (push) Successful in 1m45s
Deploy Ladill Care / deploy (push) Successful in 1m45s
When Queue integration is on, role pages issue tickets into their own department queues and drive Call next → Serve → Complete on the native lists. Integration off leaves existing UI unchanged. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6,9 +6,10 @@ use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Care\Concerns\ScopesToAccount;
|
||||
use App\Models\Appointment;
|
||||
use App\Models\Department;
|
||||
use App\Services\Care\CareQueueBridge;
|
||||
use App\Services\Care\OrganizationResolver;
|
||||
use App\Services\Care\ServiceQueuePresenter;
|
||||
use App\Services\Care\SpecialtyModuleService;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
|
||||
@@ -20,7 +21,7 @@ class SpecialtyModuleController extends Controller
|
||||
Request $request,
|
||||
string $module,
|
||||
SpecialtyModuleService $modules,
|
||||
ServiceQueuePresenter $presenter,
|
||||
CareQueueBridge $queueBridge,
|
||||
): View {
|
||||
$definition = $modules->definition($module);
|
||||
abort_unless($definition, 404);
|
||||
@@ -59,13 +60,7 @@ class SpecialtyModuleController extends Controller
|
||||
->limit(25)
|
||||
->get();
|
||||
|
||||
$serviceQueuePanel = $presenter->panel(
|
||||
$request,
|
||||
$organization,
|
||||
$member,
|
||||
$module,
|
||||
$request->input('counter_uuid'),
|
||||
);
|
||||
$branchId = (int) ($branchScope ?: $departments->first()?->branch_id);
|
||||
|
||||
return view('care.specialty.show', [
|
||||
'organization' => $organization,
|
||||
@@ -74,7 +69,37 @@ class SpecialtyModuleController extends Controller
|
||||
'departments' => $departments,
|
||||
'waiting' => $waiting,
|
||||
'queueStubs' => $modules->queueStubsFor($organization, $module),
|
||||
'serviceQueuePanel' => $serviceQueuePanel,
|
||||
'branchId' => $branchId,
|
||||
'queueIntegration' => $branchId
|
||||
? $queueBridge->listMeta($organization, $module, $branchId)
|
||||
: ['enabled' => false],
|
||||
]);
|
||||
}
|
||||
|
||||
public function callNext(
|
||||
Request $request,
|
||||
string $module,
|
||||
SpecialtyModuleService $modules,
|
||||
CareQueueBridge $queueBridge,
|
||||
): RedirectResponse {
|
||||
$definition = $modules->definition($module);
|
||||
abort_unless($definition, 404);
|
||||
|
||||
$organization = $this->organization($request);
|
||||
abort_unless($modules->isEnabled($organization, $module), 404);
|
||||
abort_unless($queueBridge->isEnabled($organization), 404);
|
||||
|
||||
$member = $this->member($request);
|
||||
$branchScope = app(OrganizationResolver::class)->branchScope($member);
|
||||
$branchId = (int) ($request->input('branch_id') ?: $branchScope);
|
||||
abort_unless($branchId > 0, 422);
|
||||
|
||||
$result = $queueBridge->callNext($organization, $module, $branchId);
|
||||
$ticket = $result['ticket'] ?? null;
|
||||
if (! $ticket) {
|
||||
return back()->with('error', 'No patients waiting in this specialty queue.');
|
||||
}
|
||||
|
||||
return back()->with('success', 'Called '.$ticket['ticket_number'].'.');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user