@extends('layouts.app') @section('title', 'Maternity Discharge Summary | ' . ($maternityAdmission->patient->full_name ?? '')) @section('styles') {{-- ── Round 16: Maternity discharge summary rewritten to match the IPD discharge summary visually (browser-rendered, _document-header letterhead, same demographic-strip + ds-section styling). The previous DomPDF template had its own pink-themed look that didn't match the rest of the document family — clinicians flagged that the maternity discharge summary lacked the letterhead and didn't feel like an official CRH document. This template extends layouts.app so the logo and flex layouts render correctly. ── --}} @endsection @section('content') @php $ma = $maternityAdmission; $patient = $ma->patient; $visit = $ma->visit; $delivery = $ma->resolvedDelivery; $newborns = $delivery?->newborns ?? collect(); // Only dispensed take-home meds appear on the summary (mirrors IPD). $dispDrugs = $visit?->prescriptions ->where('status', 'dispensed') ->where('is_take_home', true) ?? collect(); // If no take-home flag is in use yet, fall back to all dispensed meds // so old records don't print blank. Clinicians can mark items as // take-home from the Orders tab once the workflow rolls out. if (! $dispDrugs->count()) { $dispDrugs = $visit?->prescriptions->where('status', 'dispensed') ?? collect(); } $los = $ma->length_of_stay ?? '-'; $cond = $ma->condition_on_discharge ?? ''; $condLabel = [ 'improved' => 'Improved', 'stable' => 'Stable', 'deteriorated' => 'Deteriorated', 'absconded' => 'Absconded', 'deceased' => 'Deceased', ][$cond] ?? '-'; @endphp
| Name: | {{ $patient->full_name ?? '' }} | Patient ID: | {{ $patient->mrn ?? '' }} | Age: | {{ $patient->age ?? '—' }} | Phone: | {{ $patient->phone ?? '—' }} |
| G/A on Admission: | {{ $ma->gestational_age_weeks ? $ma->gestational_age_weeks.' wk' : '—' }} | Admitted: | {{ $ma->admission_date?->format('d M Y H:i') ?? '-' }} | Discharged: | {{ $ma->discharge_date?->format('d M Y H:i') ?? 'Pending' }} |
| Length of Stay: | {{ $los }} {{ $los == 1 ? 'day' : 'days' }} | Condition on Discharge: | {{ $condLabel }} | Attending Provider: | {{ $ma->attendingProvider->name ?? '-' }} |
Reason for Admission
{{ $ma->reason_for_admission ?? '-' }}
Diagnosis on Admission
{{ $ma->diagnosis ?? '-' }}
Discharge Diagnosis
{{ $ma->discharge_diagnosis ?? '-' }}
Delivery Details
| Date / Time | {{ $delivery->delivery_date?->format('d M Y') ?? '-' }} {{ $delivery->delivery_time ?? '' }} | Mode of Delivery | {{ ucfirst(str_replace('_',' ', $delivery->mode_of_delivery ?? '-')) }} |
| G/A at Delivery | {{ $delivery->gestational_age_at_delivery ? $delivery->gestational_age_at_delivery.' wk' : '-' }} | Duration of Labour | {{ $delivery->duration_of_labour ?? '-' }} |
| Blood Loss | {{ $delivery->blood_loss ? $delivery->blood_loss.' ml' : '-' }} | Placenta | {{ $delivery->placenta_complete === null ? '-' : ($delivery->placenta_complete ? 'Complete' : 'Incomplete') }} |
| Perineum | {{ $delivery->perineum ?? '-' }} | Delivered By | {{ $delivery->deliveredBy->name ?? '-' }} |
| Mother Outcome | {{ ucfirst(str_replace('_',' ', $delivery->mother_outcome ?? '-')) }} | Baby Outcome | {{ ucfirst(str_replace('_',' ', $delivery->baby_outcome ?? '-')) }} |
| Intrapartum Notes | {{ is_array($delivery->complications) ? implode(', ', $delivery->complications) : $delivery->complications }} | ||
| Delivery Notes | {{ $delivery->notes }} | ||
Newborn(s) — {{ $newborns->count() }}
@foreach($newborns as $i => $nb)| APGAR (1/5/10) | {{ $nb->apgar_1min ?? '-' }} / {{ $nb->apgar_5min ?? '-' }} / {{ $nb->apgar_10min ?? '-' }} | Resuscitation | {{ $nb->resuscitation ? 'Yes' : 'No' }} |
| Vitamin K | {{ $nb->vitamin_k ? '✓ Given' : '✗ Not given' }} | BCG / OPV | {{ $nb->bcg ? 'BCG ✓' : 'BCG ✗' }} · {{ $nb->opv ? 'OPV ✓' : 'OPV ✗' }} |
| Breastfeeding | {{ $nb->breastfeeding_initiated ? 'Initiated' : 'Not initiated' }} | Abnormalities | {{ $nb->abnormalities ?: 'None noted' }} |
| Notes | {{ $nb->notes }} | ||
Maternal Complications
| When | Type | Severity | Management | Outcome |
|---|---|---|---|---|
| {{ $c->occurred_at?->format('d M H:i') ?? '-' }} | {{ ucwords(str_replace('_',' ', $c->complication_type)) }} | {{ ucfirst($c->severity ?? '-') }} | {{ $c->management ?: '-' }} | {{ ucfirst($c->outcome ?: '-') }}{{ $c->referred_out ? ' (Referred)' : '' }} |
Hospital Course / Summary
{{ $ma->discharge_summary ?? '-' }}
Investigations & Results
@if($visit->labOrders->count())| Lab Test | Result | Status |
|---|---|---|
| {{ $lo->test_name }} | @if($lo->result && is_array($lo->result->results)) @php $res = $lo->result->results; @endphp @if(isset($res['generic'])) {{ $res['generic']['value'] ?? '-' }} {{ $res['generic']['unit'] ?? '' }} @else @foreach($res as $param) @if(is_array($param) && isset($param['name'])) {{ $param['short_code'] ?? $param['name'] }}: {{ $param['value'] ?? '-' }} {{ $param['unit'] ?? '' }}@if(!$loop->last), @endif @endif @endforeach @endif @elseif($lo->result) {{ $lo->result->results ?? '-' }} @else — @endif | {{ ucfirst($lo->status) }} |
| Imaging | Findings | Impression |
|---|---|---|
| {{ $ir->imaging_type }} | {{ $ir->report ? \Illuminate\Support\Str::limit($ir->report->findings, 150) : '—' }} | {{ $ir->report->impression ?? '-' }} |
Medications on Discharge
| Medication | Dose | Route | Frequency | Duration | Qty |
|---|---|---|---|---|---|
| {{ $rx->drug_name }} | {{ $rx->dosage ?? '-' }} | {{ $rx->route ?? '-' }} | {{ $rx->frequency ?? '-' }} | {{ $rx->duration ?? '-' }} | {{ $rx->quantity ?? '-' }} |
| Instructions: {{ $rx->instructions }} | |||||
Discharge Instructions to Mother
{{ $ma->discharge_instructions ?? '-' }}
Follow-up Plan
{{ $ma->follow_up_plan ?? '-' }} @if($ma->postnatal_review_date) {{ "\n" }}Postnatal review: {{ $ma->postnatal_review_date->format('d M Y') }} @endif
Discharged By:
{{ $ma->attendingProvider->name ?? auth()->user()->name ?? '-' }}
{{ $ma->discharge_date?->format('d M Y H:i') ?? '' }}
Mother / Next of Kin Signature:
Acknowledged receipt of discharge summary & medications