{{-- ANC Patient History drawer. Slides in from the right. Opens with read-only summary of what's known. "Edit" button reveals the full history form which posts to the same visit-draft endpoint (history fields get saved onto the current draft visit, same as they would have in the inline form). Expected vars: $registration, $priorVisit (nullable — the most recent finalized visit, which carries the latest history state) --}} @php // Prefer priorVisit (finalized) for history display; fall back to draft. $h = $priorVisit ?? $draftVisit; $hasAny = $h && ( $h->abortions || $h->living_children || $h->previous_cs || $h->hx_hypertension || $h->hx_diabetes || $h->hx_hiv || $h->family_hx_hypertension || $h->social_smoking || $h->social_alcohol || $h->drug_allergies || $h->current_medications || $h->surgical_history ); @endphp