@php $patient = $summary->patient; $isDeath = $summary->is_death_summary; $canEditPaper = in_array($summary->status, ['draft', 'amended'], true) && auth()->user()->can('discharge-summaries.edit'); @endphp Print @if ($canEditPaper) Edit @endif
    @php $steps = [ ['label' => 'Draft', 'done' => ! in_array($summary->status, ['draft'], true) || $summary->prepared_at !== null, 'meta' => $summary->preparedBy?->name], ['label' => 'Prepared', 'done' => $summary->prepared_at !== null, 'meta' => $summary->preparedBy?->name.' · '.$summary->prepared_at?->format('d M H:i')], ['label' => 'Approved', 'done' => $summary->approved_at !== null, 'meta' => $summary->approvedBy?->name.' · '.$summary->approved_at?->format('d M H:i')], ['label' => 'Issued', 'done' => $summary->issued_at !== null, 'meta' => $summary->issuedBy?->name.' · '.$summary->issued_at?->format('d M H:i')], ]; @endphp @foreach ($steps as $step)
  1. {{ $step['label'] }}

    {{ $step['meta'] ?? '—' }}

  2. @endforeach
@if ($summary->amendment_count > 0)

Amended {{ number_format($summary->amendment_count) }} time(s) — the record carries every correction.

@endif
@if ($summary->status === 'draft' && auth()->user()->can('discharge-summaries.create'))
@csrf
@endif @if ($summary->status === 'prepared' && auth()->user()->can('discharge-summaries.approve'))
@csrf
@endif @if ($summary->status === 'approved' && auth()->user()->can('discharge-summaries.issue'))
@csrf @if ($outstanding > 0) @endif
@endif @if ($summary->status === 'issued' && auth()->user()->can('discharge-summaries.amend'))
@csrf
@endif
@if ($isDeath)
Date of death
{{ $summary->death_datetime?->format('d M Y H:i') ?? '—' }}
Cause of death
{{ $summary->cause_of_death ?? '—' }}
Immediate
{{ $summary->immediate_cause ?? '—' }}
Antecedent
{{ $summary->antecedent_cause ?? '—' }}
Underlying
{{ $summary->underlying_cause ?? '—' }}
Autopsy
{{ $summary->autopsy_requested ? 'Requested' : 'Not requested' }}
Next of kin
{{ $summary->notified_next_of_kin ? 'Notified' : 'Not recorded as notified' }}
@endif
Final diagnosis
{{ $summary->final_diagnosis }}
@if ($summary->icd10Code)
ICD-10
{{ $summary->icd10Code->code }} — {{ $summary->icd10Code->description }}
@endif
On admission
{{ $summary->admission_diagnosis ?? '—' }}
@if ($summary->presenting_complaints)
Presenting
{{ $summary->presenting_complaints }}
@endif
@foreach ([ 'Significant findings' => $summary->significant_findings, 'Investigations' => $summary->investigations_summary, 'Procedures' => $summary->procedures_performed, 'Course' => $summary->course_in_hospital, 'Treatment given' => $summary->treatment_given, ] as $label => $value) @if ($value)
{{ $label }}
{{ $value }}
@endif @endforeach
Condition on leaving
@if ($summary->medications->isEmpty())

Nothing goes home with the patient.

@else
@foreach ($summary->medications as $med) @endforeach
Medicine Dose Route Frequency Duration Instructions
{{ $med->drug_name }} {{ $med->dose ?? '—' }} {{ $med->route ?? '—' }} {{ $med->frequency ?? '—' }} {{ $med->duration ?? '—' }} {{ $med->instructions ?? '—' }}
@endif @if ($summary->discharge_medications_note)

{{ $summary->discharge_medications_note }}

@endif
@if (! $isDeath)
Follow-up
{{ $summary->follow_up_date?->format('d M Y') ?? 'No follow-up date recorded' }} @if ($summary->follow_up_instructions) {{ $summary->follow_up_instructions }} @endif
Diet
{{ $summary->diet_advice ?? '—' }}
Activity
{{ $summary->activity_advice ?? '—' }}
Wound care
{{ $summary->wound_care ?? '—' }}
Danger signs
{{ $summary->danger_signs ?? '—' }}
@endif @if ($summary->referred_to)
Referred to
{{ $summary->referred_to }} @if ($summary->referral_reason) {{ $summary->referral_reason }} @endif
@endif
@if ($summary->notes)
{{ $summary->notes }}
@endif

{{ $patient->full_name }}

{{ $patient->medical_record_number }}

{{ $patient->age_display }} · {{ $patient->gender_label }} @if ($patient->phone) · {{ $patient->phone }} @endif

@if ($patient->isRestricted())

Restricted record — access is logged.

@endif
Admission
{{ $summary->admission->admission_no }}
Admitted
{{ $summary->admission_date?->format('d M Y') ?? '—' }}
Ward
{{ $summary->ward?->name ?? '—' }}
Bed
{{ $summary->bed?->bed_number ?? '—' }}
Admitting
{{ $summary->admittingDoctor?->name ?? '—' }}
Attending
{{ $summary->attendingDoctor?->name ?? '—' }}
Discharged
{{ $summary->discharge_date?->format('d M Y H:i') ?? 'Not yet issued' }}
@if ($outstanding > 0)

Kshs {{ number_format($outstanding, 2) }} outstanding on this admission.

Final clearance to leave the ward waits on the bill — cash, SHIF or insurer.

@endif