@extends('layouts.branch') @section('title', 'Dashboard') @section('header', 'Branch Dashboard') @section('content')
@push('header_extra')

Branch Unit

{{ auth()->guard('branch')->user()->name }}

Code

{{ auth()->guard('branch')->user()->outlet_code }}

@endpush

OPD {{ $selectedDate === today()->format('Y-m-d') ? 'Today' : 'Count' }}

{{ number_format($todayOpdCount) }}

Called

{{ number_format($todayCalledCount) }}

In Queue

{{ number_format($todayRemainingCount) }}

IPD {{ $selectedDate === today()->format('Y-m-d') ? 'Today' : 'Count' }}

{{ number_format($todayIpdCount) }}

@php $registryServices = [ 'registration' => [ 'label' => 'New Patient', 'color' => 'emerald', 'url' => route('branch.patients.create'), 'key' => 'registration' ], 'opd' => [ 'label' => 'OPD Check-in', 'color' => 'maroon', 'url' => route('branch.registrations.index'), 'key' => 'opd' ], 'ipd' => [ 'label' => 'IPD', 'color' => 'indigo', 'url' => route('branch.ipd-registrations.index'), 'key' => 'ipd' ], 'ipd_charges' => [ 'label' => 'IPD Charges', 'color' => 'amber', 'url' => route('branch.ipd-patient-charges.index'), 'key' => 'ipd_charges' ], 'doctors' => [ 'label' => 'Doctors', 'color' => 'violet', 'url' => route('branch.doctors.index'), 'key' => 'doctors' ], 'employees' => [ 'label' => 'Workforce', 'color' => 'sky', 'url' => route('branch.employees.index'), 'key' => 'employees' ], 'tokens' => [ 'label' => 'Live Dashboard', 'color' => 'indigo', 'url' => route('public.token.dashboard', auth()->guard('branch')->id()), 'key' => 'tokens', 'external' => true ], 'revenue' => [ 'label' => 'Revenue Hub', 'color' => 'rose', 'url' => route('branch.revenue.index'), 'key' => 'revenue' ], 'reports' => [ 'label' => 'Reports Hub', 'color' => 'violet', 'url' => route('branch.reports.index'), 'key' => 'reports' ] ]; @endphp @foreach($registryServices as $key => $service) @php $sched = $schedules->get($service['key']); $isManualPaused = $sched?->manual_pause ?? false; $isClosedBySchedule = false; if ($sched) { if ($sched->is_closed) { $isClosedBySchedule = true; } elseif (!$sched->is_24_7) { $now = now(); $open = $sched->open_time; $close = $sched->close_time; if ($open && $close) { $isClosedBySchedule = !($now->between($open, $close)); } } } $isPaused = $isManualPaused || $isClosedBySchedule; $colorMap = [ 'emerald' => [ 'bg' => 'bg-emerald-500', 'border' => 'border-emerald-400 shadow-emerald-600/10', 'text' => 'text-emerald-100', 'sub' => 'text-emerald-50' ], 'indigo' => [ 'bg' => 'bg-indigo-600', 'border' => 'border-indigo-500 shadow-indigo-600/10', 'text' => 'text-indigo-100', 'sub' => 'text-indigo-50' ], 'maroon' => [ 'bg' => 'bg-[#800000]', 'border' => 'border-[#660000] shadow-[#800000]/20', 'text' => 'text-red-100', 'sub' => 'text-red-50' ], 'violet' => [ 'bg' => 'bg-violet-600', 'border' => 'border-violet-500 shadow-violet-600/10', 'text' => 'text-violet-100', 'sub' => 'text-violet-50' ], 'sky' => [ 'bg' => 'bg-sky-500', 'border' => 'border-sky-400 shadow-sky-600/10', 'text' => 'text-sky-100', 'sub' => 'text-sky-50' ], 'amber' => [ 'bg' => 'bg-amber-500', 'border' => 'border-amber-400 shadow-amber-600/10', 'text' => 'text-amber-100', 'sub' => 'text-amber-50' ], 'rose' => [ 'bg' => 'bg-rose-600', 'border' => 'border-rose-500 shadow-rose-600/10', 'text' => 'text-rose-100', 'sub' => 'text-rose-50' ], 'paused' => [ 'bg' => 'bg-slate-200 grayscale opacity-60', 'border' => 'border-slate-300', 'text' => 'text-slate-500', 'sub' => 'text-slate-400' ] ]; $styles = $isPaused ? $colorMap['paused'] : $colorMap[$service['color']]; $bgClass = $styles['bg']; $borderClass = $styles['border'] . ' shadow-lg'; @endphp
@if(!$isPaused) Go to {{ $service['label'] }} @endif

{{ $service['label'] }}

@if($isManualPaused) PAUSED @elseif($isClosedBySchedule) CLOSED @else ACTIVE @endif @if(!$isPaused)
@endif
@endforeach

Consultant Activity

Patient counts per doctor for {{ $selectedDate === today()->format('Y-m-d') ? 'today' : \Carbon\Carbon::parse($selectedDate)->format('d M, Y') }}

Select Date

@forelse($doctorOpdCounts as $stats) @empty @endforelse
Consulting Doctor Called Unattended Total Activity Status
{{ substr($stats['name'], 0, 1) }}

{{ $stats['name'] }}

{{ $stats['code'] }}

{{ number_format($stats['called']) }} Consulted
{{ number_format($stats['remaining']) }} Waiting
{{ number_format($stats['count']) }} Total
Active Now

Quiet Day Ahead

Consultants will appear here as registrations are processed.

Bed Occupancy Status

Real-time room availability across all types

Occupied
Available
@include('branch.dashboard._occupancy_table', ['occupancyStats' => $occupancyStats])
@endsection