@php $open = $encounter->status === 'open'; $diagnoses = $encounter->diagnoses->sortByDesc('is_primary')->sortBy('diagnosis_type'); $activeAllergies = $allergies->where('is_active', true); $activeProblems = $problems->where('status', 'active'); @endphp @if ($encounter->visit?->priority && $encounter->visit->priority !== 'routine') @endif @if ($patient->isRestricted()) Restricted record @endif @can('patients.view') Patient record @endcan @if ($can['amend']) Amend narrative @endif @can('prescriptions.create') Write prescription @endcan @can('encounters.close') @if ($open) @endif @endcan @if ($patient->isRestricted())
Access to this record is limited. You are seeing it because your account holds the restricted-access permission, and this access has been logged.
@endif {{-- ------------------------------------------------------------- context --}}
Patient
{{ $patient->full_name }} @if ($patient->isRestricted()) @endif
{{ $patient->medical_record_number }}
{{ $patient->age_display }} @if ($patient->gender) · {{ $patient->gender_label }} @endif
Clinician
{{ $encounter->doctor?->name ?? 'Unassigned' }}
Opened by {{ $encounter->createdBy?->name ?? 'system' }}
Attendance
@if ($encounter->visit) {{ $encounter->visit->visit_no }} @if ($encounter->visit->token_number) {{ $encounter->visit->token_number }} @endif
@else Not tied to a visit @endif
Timeline
Started {{ $encounter->started_at?->format('d M Y H:i') ?? '—' }}
@if ($encounter->closed_at) Closed {{ $encounter->closed_at->format('d M Y H:i') }} @else Still open @endif
@if ($encounter->visit && $can['clinical'])
@can('queue.view') Queue board @endcan Clinical hub @can('medications.view') Prescribing and the medication list live in the E-Prescription module once the encounter is closed. @endcan
@endif
{{-- ------------------------------------------------------- narrative --}} The story of this consultation. @if ($open) It stays editable until the encounter is closed. @else It is frozen — the encounter has been closed. @endif @if ($can['amend']) Amend @endif
@foreach ([ 'Presenting complaint' => $encounter->chief_complaint, 'History of presenting illness' => $encounter->history_of_presenting_illness, 'Review of systems' => $encounter->review_of_systems, 'Physical examination' => $encounter->physical_examination, 'Plan' => $encounter->plan, ] as $label => $value)
{{ $label }}
{{ filled($value) ? $value : '—' }}
@endforeach
@unless (filled($encounter->chief_complaint) || filled($encounter->history_of_presenting_illness) || filled($encounter->physical_examination) || filled($encounter->plan))
Nothing has been written into the narrative yet. @if ($can['amend']) Write it up. @endif
@endunless
{{-- ---------------------------------------------------------- vitals --}} @if ($can['vitals']) Vital signs taken during this encounter, most recent first. @if ($can['vitalsRecord']) @endif @if ($vitals->isEmpty())

No observations recorded for this encounter yet.

@if ($can['vitalsRecord']) @endif
@else
@foreach ($vitals as $vital) @endforeach
Taken Temp Pulse BP RR SpO₂ Weight / BMI Pain Source By
{{ $vital->recorded_at?->format('d M H:i') }} @if ($vital->is_abnormal)
@endif
{{ $vital->temperature !== null ? number_format((float) $vital->temperature, 1).'°C' : '—' }} {{ $vital->pulse ?? '—' }} @if ($vital->bp_systolic && $vital->bp_diastolic) {{ $vital->bp_systolic }}/{{ $vital->bp_diastolic }} ({{ $vital->mean_arterial_pressure }}) @else — @endif {{ $vital->respiratory_rate ?? '—' }} {{ $vital->spo2 ? $vital->spo2.'%' : '—' }} @if ($vital->weight_kg) {{ number_format((float) $vital->weight_kg, 1) }} kg @if ($vital->bmi)
BMI {{ $vital->bmi }} · {{ $vital->bmi_category }}
@endif @else — @endif
{{ $vital->pain_score !== null ? $vital->pain_score.'/10' : '—' }} {{ $vital->recordedBy?->name ?? '—' }} @if ($can['vitalsRecord'] && $open)
@csrf @method('DELETE')
@endif
@endif
@endif {{-- ------------------------------------------------------- diagnoses --}} @if ($can['diagnoses']) Coded against ICD-10 for the claim that follows. A diagnosis stays revisable after the encounter closes. @if ($can['diagnosesCreate']) @endif @if ($diagnoses->isEmpty())

No diagnosis has been recorded for this encounter.

@if ($can['diagnosesCreate']) @endif
@else
@foreach ($diagnoses as $diagnosis) @endforeach
Code Diagnosis Type Certainty Onset By
{{ $diagnosis->code_text ?? $diagnosis->icd10Code?->code ?? '—' }}
{{ $diagnosis->description }} @if ($diagnosis->is_primary) @endif @if ($diagnosis->is_chronic) @endif
@if ($diagnosis->notes)
{{ $diagnosis->notes }}
@endif
{{ $diagnosis->onset_date?->format('d M Y') ?? '—' }} {{ $diagnosis->diagnosedBy?->name ?? '—' }}
{{ $diagnosis->diagnosed_at?->format('d M Y') }}
@if ($can['diagnosesEdit'])
@csrf @method('DELETE')
@endif
@endif
@endif {{-- ----------------------------------------------------------- notes --}} @if ($can['notes']) SOAP and progress documentation. A signed note is locked and stands as written. @if ($can['notesCreate']) @endif @if ($notes->isEmpty())

No notes have been written for this encounter.

@else
    @foreach ($notes as $note) @php $editable = $can['notesEdit'] && ! $note->is_locked && $note->status !== 'signed'; @endphp
  1. @if ($note->is_locked) locked @endif
    {{ $note->author?->name ?? 'Unknown author' }} · {{ $note->authored_at?->format('d M Y H:i') }} @if ($note->signed_at) · signed by {{ $note->signedBy?->name ?? '—' }} {{ $note->signed_at->format('d M Y H:i') }} @endif
    @if ($editable) @endif @if ($can['notesSign'] && ! $note->is_locked && $note->status !== 'signed')
    @csrf @method('PATCH')
    @endif
    @foreach ([ 'Subjective' => $note->subjective, 'Objective' => $note->objective, 'Assessment' => $note->assessment, 'Plan' => $note->plan, ] as $label => $value) @if (filled($value))
    {{ $label }}
    {{ $value }}
    @endif @endforeach @if (filled($note->content))
    {{ $note->content }}
    @endif
  2. @endforeach
@endif
@endif
{{-- ------------------------------------------------------------ aside --}}
@if ($can['clinical']) Carried on the patient, not the encounter. {{ $activeAllergies->count() }} active. @if ($allergies->isEmpty())
No allergies recorded.
@else
    @foreach ($allergies as $allergy)
  • {{ $allergy->allergen }} @unless ($allergy->is_active) @endunless
    {{ $allergy->allergen_type_label }} @if ($allergy->reaction) · {{ $allergy->reaction }} @endif
    @if ($can['allergies'])
    @csrf @method('DELETE')
    @endif
  • @endforeach
@endif @if ($can['allergies']) @endif
The standing problem list. {{ $activeProblems->count() }} active. @if ($problems->isEmpty())
Nothing on the problem list.
@else
    @foreach ($problems as $problem)
  • {{ $problem->description }} @if ($problem->priority !== 'routine') @endif
    @if ($problem->onset_date) Since {{ $problem->onset_date->format('M Y') }} @endif @if ($problem->resolved_date) · resolved {{ $problem->resolved_date->format('M Y') }} @endif
  • @endforeach
@endif @if ($can['problems']) @endif

Past history, the full problem list, allergies and every recorded observation live on the patient's clinical hub.

@else

Your account does not hold the clinical permissions for this encounter's standing record. The encounter itself is shown to you for the purpose your role holds.

@endif
{{-- -------------------------------------------------------------- modals --}} @if ($can['vitalsRecord'] && $open)
@csrf

Record observations

Fill in whatever was measured — a single temperature is a valid set.

@error('temperature')

{{ $message }}

@enderror
@endif @if ($can['diagnosesCreate'])
@csrf

Record a diagnosis

Search the ICD-10 catalogue, or write the diagnosis in your own words.

Selected —

Nothing in the catalogue matches that — describe the diagnosis below instead.

@error('description')

{{ $message }}

@enderror
@endif @if ($can['diagnosesEdit']) @foreach ($diagnoses as $diagnosis)
@csrf @method('PUT')

Amend diagnosis

@endforeach @endif @if ($can['notesCreate'])
@csrf

Write a note

A SOAP note, a progress note, or a single free-text entry — fill in what applies.

@if ($can['notesSign'])
@endif
@error('subjective')

{{ $message }}

@enderror
@endif @if ($can['notesEdit']) @foreach ($notes as $note) @continue($note->is_locked || $note->status === 'signed')
@csrf @method('PUT')

Amend draft note

@endforeach @endif @if ($can['allergies'])
@csrf

Record an allergy

Allergies sit on the patient's record and are checked on every future prescription.

@endif @if ($can['problems'])
@csrf

Add a problem

@endif @can('encounters.close') @if ($open)
@csrf @method('PATCH')

Close this encounter?

The narrative becomes read-only and the record stands as written. Diagnoses can still be added or revised afterwards; further narrative comes as a progress note. @if ($encounter->visit) If this is the last open encounter on visit {{ $encounter->visit->visit_no }}, the visit is completed and the queue entry closed. @endif

@endif @endcan @push('scripts') @endpush