Deploy Ladill Care / deploy (push) Successful in 1m0s
Phase 3 staff management: real shift entities, week roster linked to temporary assignments, and a nursing ops module surface (registry, today’s allocation, unit shortcuts). Co-authored-by: Cursor <cursoragent@cursor.com>
59 lines
2.1 KiB
PHP
59 lines
2.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Care;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Controllers\Care\Concerns\ScopesToAccount;
|
|
use App\Services\Care\CarePermissions;
|
|
use App\Services\Care\NursingServicesService;
|
|
use App\Services\Care\RosterService;
|
|
use App\Services\Care\SpecialtyModuleService;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\View\View;
|
|
|
|
class NursingServicesController extends Controller
|
|
{
|
|
use ScopesToAccount;
|
|
|
|
public function index(
|
|
Request $request,
|
|
NursingServicesService $nursing,
|
|
RosterService $roster,
|
|
SpecialtyModuleService $modules,
|
|
): View {
|
|
$this->authorizeAbility($request, 'nursing.services.view');
|
|
$organization = $this->organization($request);
|
|
$owner = $this->ownerRef($request);
|
|
|
|
$nurses = $nursing->nurseRegistry($organization, $owner);
|
|
$allocations = $nursing->activeAllocations($organization, $owner);
|
|
$todayRoster = $roster->todayAllocation($organization, $owner);
|
|
$units = $nursing->careUnits($organization, $owner);
|
|
$moduleEnabled = $modules->isEnabled($organization, 'nursing_services');
|
|
|
|
$labelMembers = $nurses
|
|
->merge($allocations->pluck('member')->filter())
|
|
->merge($todayRoster->pluck('member')->filter())
|
|
->unique('id')
|
|
->values();
|
|
|
|
$permissions = app(CarePermissions::class);
|
|
$member = $this->member($request);
|
|
|
|
return view('care.nursing.services-hub', [
|
|
'organization' => $organization,
|
|
'nurses' => $nurses,
|
|
'nurseLabels' => $nursing->memberLabels($labelMembers),
|
|
'allocations' => $allocations,
|
|
'todayRoster' => $todayRoster,
|
|
'units' => $units,
|
|
'moduleEnabled' => $moduleEnabled,
|
|
'roles' => config('care.roles'),
|
|
'canRoster' => $permissions->can($member, 'nursing.roster.manage'),
|
|
'canViewRoster' => $permissions->can($member, 'nursing.roster.view'),
|
|
'assignmentRoles' => config('care.staff_assignment_roles'),
|
|
'shiftCodes' => config('care.staff_shift_codes'),
|
|
]);
|
|
}
|
|
}
|