Make admin Patients, Appointments, Inventory, Billing, and Reports data-driven.
Deploy Ladill Care / deploy (push) Successful in 44s
Deploy Ladill Care / deploy (push) Successful in 44s
Facility admins see analytics overviews instead of operational directories; floor roles keep list UIs, with optional ?view=list for admins who need records. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6,6 +6,7 @@ use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Care\Concerns\ScopesToAccount;
|
||||
use App\Models\Branch;
|
||||
use App\Models\Patient;
|
||||
use App\Services\Care\AdminOverviewService;
|
||||
use App\Services\Care\CareFeatures;
|
||||
use App\Services\Care\CarePermissions;
|
||||
use App\Services\Care\OrganizationResolver;
|
||||
@@ -21,6 +22,7 @@ class PatientController extends Controller
|
||||
|
||||
public function __construct(
|
||||
protected PatientService $patients,
|
||||
protected AdminOverviewService $adminOverview,
|
||||
) {}
|
||||
|
||||
public function index(Request $request): View
|
||||
@@ -31,6 +33,20 @@ class PatientController extends Controller
|
||||
$resolver = app(OrganizationResolver::class);
|
||||
$branchScope = $resolver->branchScope($member);
|
||||
$practitionerScope = $resolver->practitionerScope($organization, $member);
|
||||
$permissions = app(CarePermissions::class);
|
||||
|
||||
if ($permissions->isAdmin($member) && $request->query('view') !== 'list') {
|
||||
return view('care.admin.analytics', [
|
||||
'title' => 'Patients',
|
||||
'badge' => 'Analytics · Population',
|
||||
'description' => 'Registration and visit trends across your facility — not a bedside patient list.',
|
||||
'adminOverview' => $this->adminOverview->patients(
|
||||
$organization,
|
||||
$this->ownerRef($request),
|
||||
$branchScope,
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
$patients = $this->patients->search(
|
||||
$this->ownerRef($request),
|
||||
|
||||
Reference in New Issue
Block a user