@extends('layouts.app') @section('title', 'Outpatient Visits') @section('content') @include('partials._queue-routing-helper') {{-- Top of page: action buttons and stats removed in Issue #13 May 2 2026. - "+ New OPD Visit" / "+ Direct Lab" / "+ Direct Radiology" duplicate the Queue Management page where they belong operationally. - "Completed Visits" button moved into the search bar row on the right and renamed to "View Completed Visits". - 6-card stats strip removed — the table itself + status filter cover the same information without the visual weight. The ANC Visits fold-in button (Issue #3, May 12 2026) was removed May 14 2026 once Antenatal Care was restored as a top-level sidebar item — duplication, not navigation help. --}} {{-- ── Page header ────────────────────────────────────────────────── Title + subtitle on the left, View Completed Visits button on the top right. Matches the layout convention used on Expenses and other module landings. The button used to sit on the right side of the filter bar below; moved up here (25 May 2026) so it's the first thing the eye lands on, parallel to where the inverse "Return to Today's Visits" button sits on the Completed Visits page. --}}

Outpatient Visits

Today's Visits

View Completed Visits
{{-- Queue Table --}}
@if(request()->hasAny(['search','status','date'])) Clear @endif
{{-- Right side of the filter bar now just shows the visit count. The View Completed Visits button used to live here too but has been promoted up to the page header (see comment above the header block). --}}
{{ $visits->total() }} visit(s)
{{-- Column set unified across the four "visits list" pages on 25 May 2026: Date · Patient · Age/Sex · Phone · Department · Bill Total · Payer · Clinician plus an Actions column on the two completed pages (and Next Appointment on Completed ANC). Pathway, Stage, and Time were dropped — the row click + page scope already convey what those columns conveyed. --}} @forelse($visits as $v) {{-- Entire row navigates to the encounter via the hmis-row-click helper in the layout. Urgent visits get a light red tint so they stand out without losing the standard hover behaviour. --}} {{-- Bill Total and Bal are split into two columns (25 May 2026). Bill Total renders the total amount in green when the invoice is paid in full, red when there's an outstanding balance. Bal sits in its own column so the figure aligns vertically down the page — easier to scan for outstanding debt than the previous stacked layout. --}} @empty @endforelse
Date Patient Age / Sex Phone Department Bill Total Bal Payer Clinician
{{ $v->check_in_at ? $v->check_in_at->format('Y-m-d') : '' }} {{-- Patient name is the primary scan-target; one step larger than the surrounding text-xs cells so it reads as the row's label. --}}

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

{{ $v->patient->age ?? '' }} / {{ ucfirst(substr($v->patient->gender ?? '', 0, 1)) }} {{ $v->patient->phone ?? '' }} {{ $v->department->name ?? '-' }} @if($v->invoice) KES {{ number_format($v->invoice?->total_amount ?? 0) }} @else - @endif @if($v->invoice && ($v->invoice?->balance ?? 0) > 0) {{ number_format($v->invoice->balance) }} @elseif($v->invoice) - @else - @endif {{ $v->payer_label }} {{ $v->clinician->name ?? '-' }}
No visits found. Click "+ New OPD Visit" to create one.
@if($visits->hasPages())
{{ $visits->links() }}
@endif
{{-- ═══ NEW VISIT MODAL ═══ --}} @endsection @section('scripts') @endsection