@extends('layouts.app') @section('title', __('consultations::messages.encounters.title')) @php use App\Modules\Consultations\Enums\EncounterStatus; use App\Modules\Consultations\Models\Encounter; $isToday = $date->isSameDay($today); /* | The brief's palette names four states; the record only has three. | There is no "in progress" encounter — a consultation is open until it is | closed — so blue is left for the duration chip rather than invented as a | status nothing can ever be in. */ $statusPill = static fn (EncounterStatus $status): string => match ($status) { EncounterStatus::Open => 'px-pill--amber', EncounterStatus::Closed => 'px-pill--green', EncounterStatus::Cancelled => 'px-pill--red', }; $cards = [ [ 'key' => 'total', 'label' => __('consultations::messages.encounters.card_total'), 'icon' => 'bi-clipboard2-pulse-fill', 'tone' => 'violet', 'suffix' => '', ], [ 'key' => 'open', 'label' => __('consultations::messages.encounters.card_open'), 'icon' => 'bi-folder2-open', 'tone' => 'blue', 'suffix' => '', ], [ 'key' => 'completed', 'label' => __('consultations::messages.encounters.card_completed'), 'icon' => 'bi-check2-circle', 'tone' => 'green', 'suffix' => '', ], [ 'key' => 'minutes', 'label' => __('consultations::messages.encounters.card_duration'), 'icon' => 'bi-stopwatch-fill', 'tone' => 'pink', 'suffix' => __('consultations::messages.encounters.minutes_short'), ], ]; /* | Whether anything is actually narrowing the day. | | search_field is excluded: it always carries a value — the pill shown as | selected — so counting it would make a screen nobody has filtered offer | to clear filters that were never applied. It narrows nothing on its own; | it only says where the term beside it is aimed. */ $hasFilters = collect($filters) ->except(['search_field']) ->filter(fn ($v): bool => $v !== '') ->isNotEmpty(); @endphp @section('content') {{-- ── Page head ──────────────────────────────────────────────────────── --}}
{{ __('consultations::messages.encounters.subtitle') }}
{{ $card['label'] }}
{{ number_format($value) }}{{ $card['suffix'] }}
@if ($delta !== 0) @endif {{ __('consultations::messages.encounters.vs_previous', [ 'delta' => $delta > 0 ? '+'.$delta : (string) $delta, ]) }}
{{ __('consultations::messages.encounters.title') }}
{{ __('consultations::messages.encounters.showing', [ 'from' => number_format($encounters->firstItem() ?? 0), 'to' => number_format($encounters->lastItem() ?? 0), 'total' => number_format($encounters->total()), ]) }}
{{ __('consultations::messages.encounters.empty_title') }}
{{ $hasFilters ? __('consultations::messages.encounters.empty_filtered') : __('consultations::messages.encounters.empty_text') }}
| {{ __('consultations::messages.encounters.patient') }} | {{ __('consultations::messages.encounters.clinician') }} | {{ __('consultations::messages.encounters.department') }} | {{ __('consultations::messages.encounters.started') }} | {{ __('consultations::messages.encounters.duration') }} | {{ __('consultations::messages.encounters.diagnosis') }} | {{ __('consultations::messages.encounters.disposition') }} | {{ __('common.status') }} | {{ __('common.actions') }} |
|---|---|---|---|---|---|---|---|---|
|
{{-- No avatar. Coloured initials next to every
name were decoration competing with the
allergy marker, which is the one thing here
that genuinely needs to catch the eye. --}}
@if ($patient !== null && Route::has('patients.show'))
{{ $patientName }}
@else
{{ $patientName }}
@endif
{{-- Guarded: a walk-in recorded before the
patient was matched has no MRN, and an
unconditional line left a blank gap
between the name and the reference. --}}
@if ($patient?->mrn)
{{ $patient->mrn }}
@if ($patient->ageLabel)
· {{ $patient->ageLabel }}
@endif
@endif
{{ $encounter->reference }}
@if (($patient?->activeAllergyCount ?? 0) > 0)
{{ $patient->activeAllergyCount }}
@endif
|
{{ $doctor?->name ?? '—' }} | @if ($doctor?->specialty) {{ $doctor->specialty }} @else — @endif | {{ $encounter->started_at->format('d M Y') }} {{ $encounter->started_at->format('H:i') }} | {{ $encounter->durationMinutes() }}{{ __('consultations::messages.encounters.minutes_short') }} | @if ($primary !== null) {{ $primary->name }} @elseif ($encounter->diagnoses_count > 0) {{ trans_choice('consultations::messages.encounters.diagnoses_count', $encounter->diagnoses_count, ['count' => $encounter->diagnoses_count]) }} @else — @endif | @if ($encounter->disposition) {{ $encounter->disposition->label() }} @else — @endif | {{ $encounter->status->label() }} |
|