@php $activeAllergies = $allergies->where('is_active', true); $activeProblems = $problems->where('status', 'active'); $openEncounters = $openEncounters ?? collect(); $latestOpen = $openEncounters->first(); $canIcd = auth()->user()->can('icd10.view'); $recordLink = auth()->user()->can('patients.view') ? route('patients.show', $patient) : null; $lastSeen = $encounters->first()?->started_at; @endphp {{ $patient->medical_record_number }} {{ $patient->age_display }} · {{ $patient->gender_label }} @if ($patient->patient_category !== 'general') @endif @if ($patient->isRestricted()) Restricted @endif @if ($can['encountersCreate']) @if ($latestOpen) Resume {{ $latestOpen->encounter_no }} @else Open encounter @endif @endif @if ($patient->isRestricted()) This patient is flagged as {{ $patient->category_label }}. Access is limited to staff cleared for this category, and every view has been written to the access trail. @endif
{{-- ------------------------------------------------------ allergies --}}

Allergies @if ($activeAllergies->isNotEmpty()) {{ $activeAllergies->count() }} active @endif

What must never be given, and what happened last time.

@if ($can['allergies']) @endif
@if ($allergies->isEmpty()) @else
@if ($can['allergies'])@endif @foreach ($allergies as $allergy) @if ($can['allergies']) @endif @endforeach
Allergen Type Reaction Severity Since StatusActions
{{ $allergy->allergen }}
@if ($allergy->notes)
{{ $allergy->notes }}
@endif
{{ $allergy->allergen_type_label }} {{ $allergy->reaction ?: '—' }} {{ $allergy->onset_date?->format('M Y') ?? '—' }} @if ($allergy->is_active) @else @endif
@csrf @method('DELETE')
@endif
{{-- -------------------------------------------------------- problems --}}

Problem list

The running list of what is being managed, and since when.

@if ($can['problems']) @endif
@if ($problems->isEmpty()) @else
@if ($can['problems'])@endif @foreach ($problems as $problem) @if ($can['problems']) @endif @endforeach
Problem Code Priority Onset StatusActions
{{ $problem->description }}
@if ($problem->notes)
{{ $problem->notes }}
@endif
{{ $problem->icd10Code?->code ?? '—' }} @if ($problem->priority !== 'routine') @else Routine @endif {{ $problem->onset_date?->format('M Y') ?? '—' }} @if ($problem->resolved_date)
to {{ $problem->resolved_date->format('M Y') }}
@endif
@csrf @method('DELETE')
@endif
{{-- ------------------------------------------------------- histories --}}

Past history

Medical, surgical, family and social background.

@if ($can['histories']) @endif
@if ($histories->isEmpty()) @else
    @foreach ($histories as $history)
  • {{ $history->description }}

    @if ($history->notes)

    {{ $history->notes }}

    @endif

    {{ $history->onset_date?->format('d M Y') ?? 'Onset unknown' }} @if ($history->resolution_date) · resolved {{ $history->resolution_date->format('d M Y') }} @endif @if ($history->recordedBy) · recorded by {{ $history->recordedBy->name }} @endif

    @if ($can['histories'])
    @csrf @method('DELETE')
    @endif
  • @endforeach
@endif
{{-- ------------------------------------------------------ diagnoses --}} @if ($can['diagnoses'])

Recent diagnoses

The last 20 conclusions recorded across encounters.

@if ($diagnoses->isEmpty()) @else
@foreach ($diagnoses as $diagnosis) @endforeach
Diagnosis Code Type Certainty When
{{ $diagnosis->description }}
@if ($diagnosis->is_chronic) @endif @if ($diagnosis->encounter) {{ $diagnosis->encounter->encounter_no }} @endif
{{ $diagnosis->code_text ?? '—' }} @if ($diagnosis->is_primary) @endif {{ $diagnosis->diagnosed_at?->format('d M Y') ?? '—' }} @if ($diagnosis->diagnosedBy)
{{ $diagnosis->diagnosedBy->name }}
@endif
@endif
@endif {{-- -------------------------------------------------- prescriptions --}} @if ($can['medications'])

Medication still open

Prescriptions not yet fully dispensed. Prescribing itself belongs to the E-Prescription module.

@can('prescriptions.view') All scripts @endcan @can('prescriptions.create') Write prescription @endcan
@if ($prescriptions->isEmpty()) @else
    @foreach ($prescriptions as $prescription)
  • @can('prescriptions.view') {{ $prescription->prescription_no }} @else {{ $prescription->prescription_no }} @endcan @if ($prescription->is_controlled) @endif
    {{ $prescription->prescribed_at?->format('d M Y H:i') }} @if ($prescription->prescribedBy) · {{ $prescription->prescribedBy->name }} @endif
      @foreach ($prescription->items as $item)
    • {{ $item->drug_name }} {{ $item->dose }} {{ $item->dose_unit }} {{ $item->route_label }} {{ $item->frequency }} @if ($item->duration) × {{ $item->duration }} @endif · {{ $item->quantity }} {{ $item->quantity_unit }} @if ($item->is_stat) @endif @if ($item->is_prn) @endif
    • @endforeach
  • @endforeach
@endif
@endif {{-- ---------------------------------------------------------- vitals --}} @if ($can['vitals'])

Recent observations

The last 20 sets recorded, newest first.

@if ($can['vitalsRecord'] && $openEncounters->isNotEmpty()) @endif
@if ($vitals->isEmpty()) @if ($can['vitalsRecord'] && $latestOpen) Chart on {{ $latestOpen->encounter_no }} @endif @else
@foreach ($vitals as $vital) $vital->is_abnormal])> @endforeach
Taken Temp Pulse BP RR SpO₂ Weight By
{{ $vital->recorded_at?->format('d M Y H:i') }} @if ($vital->encounter) {{ $vital->encounter->encounter_no }} @endif {{ $vital->temperature !== null ? number_format((float) $vital->temperature, 1) . '°C' : '—' }} {{ $vital->pulse ?? '—' }} {{ $vital->bp_systolic && $vital->bp_diastolic ? $vital->bp_systolic . '/' . $vital->bp_diastolic : '—' }} {{ $vital->respiratory_rate ?? '—' }} {{ $vital->spo2 !== null ? $vital->spo2 . '%' : '—' }} {{ $vital->weight_kg !== null ? number_format((float) $vital->weight_kg, 1) . ' kg' : '—' }} @if ($vital->bmi !== null) BMI {{ $vital->bmi }} @endif {{ $vital->recordedBy?->name ?? '—' }} @if ($vital->is_abnormal) @endif
@endif
@endif {{-- ------------------------------------------- laboratory & imaging --}} @if ($can['labs'])

Laboratory & imaging

The last 8 diagnostic requests on this chart, newest first.

@can('lab-orders.create') Request tests @endcan
@if ($labOrders->isEmpty()) @else
@foreach ($labOrders as $order) @php $lines = $order->items; $verified = $lines->where('status', 'verified')->count(); $criticals = $lines->filter( fn ($i) => in_array($i->flag, ['critical_high', 'critical_low'], true) || $i->radiologyReport?->is_critical, ); @endphp $criticals->isNotEmpty()])> @endforeach
Request Tests Results Status
{{ $order->order_no }} {{ $order->ordered_at?->format('d M Y H:i') }} @if ($order->orderedBy) · {{ $order->orderedBy->name }} @endif {{ $lines->pluck('test_name')->implode(', ') ?: '—' }} @if ($lines->isEmpty()) — @else {{ $verified }}/{{ $lines->count() }} verified @if ($criticals->isNotEmpty()) critical ×{{ $criticals->count() }} @endif @if ($order->released_at) released @endif @endif Open
@endif
@endif {{-- ------------------------------------------------------ encounters --}} @if ($can['encounters'])

Encounters

The last 10 clinical records opened for this patient.

All encounters
@if ($encounters->isEmpty()) @else
@foreach ($encounters as $encounter) @endforeach
Encounter Type Clinician Started Status
{{ $encounter->encounter_no }} {{ $encounter->doctor?->name ?? 'Unassigned' }}
{{ $encounter->department?->name }}
{{ $encounter->started_at?->format('d M Y H:i') }} Open
@endif
@endif
{{ Str::of($patient->first_name)->substr(0, 1)->upper() }}{{ Str::of($patient->last_name)->substr(0, 1)->upper() }}
@if ($recordLink) {{ $patient->full_name }} @else {{ $patient->full_name }} @endif
{{ $patient->medical_record_number }}
{{ $patient->age_display }} · {{ $patient->gender_label }}
@if ($patient->blood_group_display && $patient->blood_group !== 'unknown')
Blood group {{ $patient->blood_group_display }}
@endif
@if ($openEncounters->isNotEmpty())
    @foreach ($openEncounters as $entry)
  • {{ $entry->encounter_no }}
    {{ $entry->encounter_type_label }} · started {{ $entry->started_at?->diffForHumans() }}
  • @endforeach

Observations and notes recorded from here land on the open encounter.

@endif
  • Allergies, problems and past history follow the patient between visits; everything else belongs to an encounter.
  • Panels you are not entitled to see are not loaded at all, so nothing here leaks beyond your role.
  • Opening this page is written to the patient's access trail.
{{-- ------------------------------------------------------------- modals --}} @if ($can['allergies'])
@csrf

Record an allergy

An allergy is a safety fact — it is never inferred. Record only what was observed or reported.

@foreach ($allergies as $allergy)
@csrf @method('PUT')

Edit allergy

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

Add to the problem list

This list is for conditions that persist — hypertension, diabetes, asthma — not for the findings of a single visit.

@if ($canIcd)

Searching…

Coded as .

@endif
@foreach ($problems as $problem)
@csrf @method('PUT')

Edit problem

@if ($problem->icd10Code)

Coded as {{ $problem->icd10Code->code }} — {{ $problem->icd10Code->description }}. The code cannot be changed here; remove the entry and add it again to recode it.

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

Add past history

@foreach ($histories as $history)
@csrf @method('PUT')

Edit history entry

@endforeach @endif @if ($can['vitalsRecord'] && $openEncounters->isNotEmpty())
@csrf

Record observations

Charted against an open encounter. Values outside the adult resting range are flagged for the clinician to read.

@endif @push('scripts') @if ($can['problems'] && $canIcd) @endif @if ($can['vitalsRecord'] && $openEncounters->isNotEmpty()) @endif @endpush