{{-- DTHospital — dashboard Copyright (c) ICT Innovations Part of DTHospital Licensed under the GNU General Public License v3.0. --}} @extends('layouts.master') @section("style") @endsection @section('content') @php $ihHour = (int) date('G'); $ihGreet = $ihHour < 12 ? 'Good morning' : ($ihHour < 17 ? 'Good afternoon' : 'Good evening'); $ihFirst = trim(explode(' ', trim((string) Session::get('name')))[0] ?? ''); $ihMay = function ($perm) { return \App\Support\Permissions::allows($perm); }; @endphp

{{ $ihGreet }}{{ $ihFirst !== '' ? ', ' . $ihFirst : '' }}

Here is how the hospital is doing today, {{ date('l, j F Y') }}.

@if($ihMay('patient_add')) New patient@endif @if($ihMay('appointment_add')) Book appointment@endif
@if($ihMay('patient_view'))Patients@endif @if($ihMay('appointment_view'))Appointments@endif @if($ihMay('prescription_view'))Prescriptions@endif @if($ihMay('lab_test_view'))Laboratory@endif @if($ihMay('pharmacy_stock_view'))Pharmacy@endif @if($ihMay('invoice_view'))Billing@endif
@if($error)
{{ $error }}
@endif @if($success)
{{ $success }}
@endif
{{-- headline counts --}}
{{ number_format($totalPatients) }}
Patients
{{ number_format($totalAppointments) }}
Appointments
{{ number_format($totalDoctors) }}
Doctors
{{ number_format($totalStaff) }}
Staff
{{-- beds + money --}}
Bed occupancy
{{ $occupiedBeds }} of {{ $totalBeds }} occupied
{{ $occupancy }}% occupied · {{ $freeBeds }} free
Finance
{{ number_format($income, 2) }}
Received
{{ number_format($expenses, 2) }}
Expenses
{{ number_format($balance, 2) }}
Balance
{{-- clinical activity --}}
{{ number_format($totalPrescriptions) }}
Prescriptions
{{ number_format($totalLabTests) }}
Lab tests
{{ number_format($totalReports) }}
Diagnostic reports
{{ number_format($totalMedicines) }}
Medicines
{{-- recent activity --}}
Recent patients
@if($recentPatients->count()) @foreach($recentPatients as $p) @endforeach
NamePhoneSexAge
{{ $p->name ?? '-' }} {{ $p->phone ?? '-' }} {{ $p->sex ?? '-' }} {{ $p->age ?? '-' }}
@else
No patients registered yet.
@endif
Recent appointments
@if($recentAppointments->count()) @foreach($recentAppointments as $a) @endforeach
PatientDoctorDateStatus
@if (isset($patientNames[$a->patient])){{ $patientNames[$a->patient] }}@else - @endif {{ $doctorNames[$a->doctor] ?? '-' }} {{ $a->date ?? '-' }} {{ $a->time_slot ? '(' . substr($a->time_slot, 0, 5) . ')' : '' }} {{ $a->status ? ucfirst($a->status) : '-' }}
@else
No appointments booked yet.
@endif
@endsection