@extends('layouts.app') @section('title', 'Consultation | ' . ($visit->patient->full_name ?? '')) @section('content') @include('partials._encounter-styles') @php $readOnly = in_array($visit->status, ['completed','cancelled','discharged']); $c = $visit->consultation ?? null; $p = $visit->patient ?? null; $t = $visit->triage ?? null; @endphp
{{-- ════════════ PATIENT HEADER STRIP ════════════ --}}
{{ $p->full_name ?? '-' }}
Patient # {{ $p->mrn ?? '-' }}
Age {{ $p->age ?? '-' }} {{ $p->gender ? '· '.ucfirst($p->gender) : '' }}
Visit # {{ $visit->visit_number }}
Date {{ $visit->check_in_at?->format('d M Y H:i') ?? $visit->created_at->format('d M Y H:i') }}
@if($readOnly)Completed@endif @if($p && $p->allergies && count($p->allergies))
⚠ Allergies: {{ implode(', ', $p->allergies) }}
@endif
{{-- ════════════ 1. TRIAGE / VITALS ════════════ --}}

1 Triage / Vitals

@if($t)Recorded @elsePending@endif
@if($t)
Date / TimeHeightWeightBMI TempBPPulseRR SpO₂Pain
{{ $t->created_at?->format('d M Y H:i') ?? '-' }} {{ $t->height ?? '-' }} {{ $t->weight ?? '-' }} {{ ($t->height && $t->weight) ? number_format(($t->weight / (($t->height/100) * ($t->height/100))),1) : '-' }} {{ $t->temperature ?? '-' }} {{ ($t->blood_pressure_systolic ?? '-') }}/{{ $t->blood_pressure_diastolic ?? '-' }} {{ $t->pulse ?? '-' }} {{ $t->respiratory_rate ?? '-' }} {{ $t->oxygen_saturation ?? '-' }} {{ $t->pain_score ?? '-' }}
@else

No vitals recorded for this visit.

@endif
{{-- ════════════ 2. CLINICAL DETAILS ════════════ --}} @if(!$c && !$readOnly) {{-- ---- Create mode ---- --}}
@csrf

2 Clinical Notes

History, Examination & Treatment

3 Diagnosis (ICD-10)

@include('partials._icd10_picker', ['consultation' => null])
@else {{-- ---- Edit / Read-only mode ---- --}}
@csrf @if($c) @method('PUT') @endif

2 Clinical Notes

@if($c)Saved@endif
History, Examination & Treatment

3 Diagnosis (ICD-10)

@if($c && $c->diagnoses && $c->diagnoses->count()) @foreach($c->diagnoses as $d) @endforeach
Primary ICD-10 Code Diagnosis
@if($d->is_primary)Primary@else@endif {{ $d->icd10Code->code ?? '' }} {{ $d->icd10Code->description ?? '' }}
@endif @if(!$readOnly) @include('partials._icd10_picker', ['consultation' => $c]) @endif
@if(!$readOnly) @endif
@endif
@stack('scripts') @endsection