@php $hour = (int) now()->format('G'); $greeting = $hour < 12 ? 'Good morning' : ($hour < 17 ? 'Good afternoon' : 'Good evening'); @endphp @if ($user->department) @endif @unless ($user->hasMfaEnabled()) @endunless Security @if (route_if('patients.create')) Register patient @endif @if ($kpis->isEmpty()) Your account is signed in but has no operational permissions yet. A system administrator can assign you a role. @endif {{-- ---------------------------------------------------------------- KPIs --}} @if ($kpis->isNotEmpty())
@foreach ($kpis as $kpi) @endforeach
@endif {{-- ------------------------------------------------------------ clinical --}} @if ($clinical)
@if (route_if('appointments.index')) All appointments @endif @forelse ($clinical['appointments'] as $appointment)

{{ $appointment->patient?->full_name ?? '—' }}

{{ $appointment->appointment_no }} @if ($appointment->slot_time) · {{ \Illuminate\Support\Str::substr($appointment->slot_time, 0, 5) }} @endif @if ($appointment->token_number) · Token {{ $appointment->token_number }} @endif

@empty @endforelse
@forelse ($clinical['inpatients'] as $admission)

{{ $admission->patient?->full_name ?? '—' }}

{{ $admission->admission_no }} @if ($admission->bed?->bed_number) · Bed {{ $admission->bed->bed_number }} @endif @if ($admission->admission_date) · since {{ $admission->admission_date->format('d M Y') }} @endif

@if ($admission->is_icu) @else @endif
@empty @endforelse
@endif {{-- ----------------------------------------------------------- front desk --}} @if ($frontDesk)
@if (route_if('queue.index')) Manage queue @endif @forelse ($frontDesk['queue'] as $entry)
{{ $entry->token_number }}

{{ $entry->patient?->full_name ?? '—' }}

{{ $entry->department?->name ?? 'Unassigned' }} @if ($entry->doctor) · {{ $entry->doctor->name }} @endif

@if ($entry->priority !== 'routine') @endif
@empty @endforelse
@if (route_if('patients.index')) All patients @endif @forelse ($frontDesk['todayRegistrations'] as $patient)

{{ $patient->full_name }}

{{ $patient->medical_record_number }} · {{ $patient->gender ? lookup_label('gender', $patient->gender) : '—' }} · {{ patient_age($patient->date_of_birth) }}

@if ($patient->patient_category !== 'general') @endif
@empty @endforelse
@endif {{-- -------------------------------------------------------- lab & pharmacy --}} @if ($lab || $pharmacy)
@if ($lab) @if (route_if('lab-orders.index')) Open worklist @endif @forelse ($lab['worklist'] as $order)

{{ $order->patient?->full_name ?? '—' }}

{{ $order->order_no }} · {{ lookup_label('lab_department', $order->department) }} @if ($order->ordered_at) · {{ $order->ordered_at->diffForHumans() }} @endif

@if ($order->priority !== 'routine') @endif
@empty @endforelse
@endif @if ($pharmacy) @if (route_if('prescriptions.index')) Open queue @endif @forelse ($pharmacy['queue'] as $prescription)

{{ $prescription->patient?->full_name ?? '—' }}

{{ $prescription->prescription_no }} · {{ $prescription->items->count() }} item(s) @if ($prescription->prescribed_at) · {{ $prescription->prescribed_at->diffForHumans() }} @endif

@empty @endforelse @if ($pharmacy['expiring']->isNotEmpty())

Expiring within 60 days

    @foreach ($pharmacy['expiring'] as $batch)
  • {{ $batch->item?->name ?? '—' }} · {{ $batch->batch_number }} {{ $batch->quantity_available }} left · {{ $batch->expiry_date?->format('d M Y') }}
  • @endforeach
@endif
@endif
@endif {{-- --------------------------------------------------------- vaccination --}} @if ($vaccination && $vaccination['dueSoon']->isNotEmpty())
@foreach ($vaccination['dueSoon'] as $immunization)

{{ $immunization->patient?->full_name ?? '—' }}

{{ $immunization->vaccine?->name ?? '—' }}

{{ $immunization->next_due_date?->format('d M Y') }}
@endforeach
@endif {{-- ------------------------------------------------------------- finance --}} @if ($finance)
@if (route_if('billing.index')) All invoices @endif @forelse ($finance['outstanding'] as $invoice)

{{ $invoice->patient?->full_name ?? '—' }}

{{ $invoice->invoice_no }} @if ($invoice->invoice_date) · {{ $invoice->invoice_date->format('d M Y') }} @endif

{{ money($invoice->balance) }}
@empty @endforelse
@endif {{-- ---------------------------------------------------------- management --}} @if ($management)

{{ $management['occupancy'] }}%

{{ $management['totalBeds'] - $management['bedsAvailable'] }} of {{ $management['totalBeds'] }} beds occupied · {{ $management['bedsAvailable'] }} available

@if ($management['totalBeds'] > 0)
@endif @if ($management['occupancyByWard']->isNotEmpty())
@foreach ($management['occupancyByWard'] as $ward)
{{ $ward->ward }}
{{ (int) $ward->occupied }}/{{ (int) $ward->total }}
@endforeach
@endif

{{ money($management['revenueMonth']) }}

Receipts recorded since {{ now()->startOfMonth()->format('d M Y') }}

@if (route_if('reports.index')) Open reports @endif

{{ $management['claimsPending'] }}

Worth {{ money($management['claimsValue']) }} across submitted, in-review and queried claims

@if (route_if('claims.index')) Open claim register @endif
@endif {{-- ------------------------------------------------------------ security --}} @if ($security)
@if ($security['recentAudit']->isNotEmpty()) @if (route_if('audit-logs.index')) Full trail @endif @foreach ($security['recentAudit'] as $log)

{{ $log->user?->name ?? 'System' }} {{ $log->description ?: $log->event }}

{{ $log->module ?? 'General' }} @if ($log->created_at) · {{ $log->created_at->diffForHumans() }} @endif @if ($log->ip_address) · {{ $log->ip_address }} @endif

@if ($log->is_sensitive) @endif
@endforeach
@endif @if ($security['recentLogins']->isNotEmpty()) @if (route_if('login-activities.index')) View all @endif @foreach ($security['recentLogins'] as $activity)

{{ $activity->user?->name ?? $activity->email ?? 'Unknown' }}

{{ $activity->login_at?->format('d M Y H:i') ?? '—' }} @if ($activity->ip_address) · {{ $activity->ip_address }} @endif

@endforeach
@endif
@endif