@extends('layouts.app') @section('title', 'Discharges') @section('styles') @endsection @section('content') {{-- Stats --}}

Pending Discharge

{{ $stats['pending'] }}

Ready to Go

{{ $stats['ready'] }}

Discharged Today

{{ $stats['discharged_today'] }}

This Month

{{ $stats['discharged_month'] }}

{{-- Tabs --}}
{{-- ═══ PENDING DISCHARGE ═══ --}}
@if($pending->count()) @foreach($pending as $adm) {{-- Round 12: row click opens the admission record. Discharge button kept (links to #discharge anchor, which jumps straight to the discharge form). --}} @endforeach
Patient MRN Ward / Bed Days Diagnosis Pending Labs Pending Rx Balance Readiness

{{ $adm->patient->full_name ?? '' }}

{{ $adm->patient->phone ?? '' }}

{{ $adm->patient->mrn ?? '' }} {{ $adm->ward->name ?? '' }} · {{ $adm->bed->bed_number ?? '' }} {{ $adm->length_of_stay }} {{ $adm->diagnosis_on_admission ?? $adm->reason ?? '-' }} @if($adm->pending_labs > 0){{ $adm->pending_labs }} @else @endif @if($adm->pending_rx > 0){{ $adm->pending_rx }} @else @endif @if($adm->pending_balance > 0)KES {{ number_format($adm->pending_balance) }} @else Cleared@endif @if($adm->is_ready) Ready @else Pending @endif {{-- Anchor-jump shortcut to the discharge form. --}} Discharge
@else

No patients pending discharge

@endif
{{-- ═══ COMPLETED DISCHARGES ═══ --}}
{{-- Filter --}}
to
@if(request()->hasAny(['search','date_from','date_to']))Clear@endif
@if($completed->count()) @foreach($completed as $adm) {{-- Round 12: row click opens the admission file. Print (if summary exists) and Follow-up are kept as row-level actions because they go to different URLs. --}} @endforeach
Patient MRN Ward Admitted Discharged Stay Dx on Admission Dx on Discharge Condition Total Bill
{{ $adm->patient->full_name ?? '' }} {{ $adm->patient->mrn ?? '' }} {{ $adm->ward->name ?? '-' }} {{ $adm->admission_date->format('d M Y') }} {{ $adm->discharge_date ? $adm->discharge_date->format('d M Y') : '-' }} {{ $adm->length_of_stay }}d {{ $adm->diagnosis_on_admission ?? '-' }} {{ $adm->discharge_diagnosis ?? '-' }} @php $cc = ['improved'=>'badge-success','stable'=>'badge-info','deteriorated'=>'badge-warning','absconded'=>'badge-danger','deceased'=>'badge-danger']; @endphp {{ ucfirst($adm->condition_on_discharge ?? '-') }} @if($adm->visit?->invoice) KES {{ number_format($adm->visit?->invoice?->total_amount) }} @else | @endif
@if($adm->discharge_summary) @endif Follow-up
@if($completed->hasPages())
{{ $completed->links() }}
@endif @else

No completed discharges found.

@endif
@endsection @section('scripts') @endsection