Status: ✅ Complete — 2026-02-25
Spec Reference: CL-29-discharge-aftercare-planning.md
Last Updated: 2026-02-24
Overview
CL-29 formalizes discharge planning and aftercare workflows: discharge assessment at admission, structured aftercare plans, warm handoff documentation, 7-day/30-day follow-up tracking (HEDIS FUH), readmission risk assessment, and family/caregiver and SDOH linkage. Integrations: CL-12 (transitions), CL-03 (treatment plan), CL-07 (safety), CL-10 (HEDIS FUH), CL-18 (SDOH), RH (housing coordination).Quick Reference
- Purpose: Discharge planning and aftercare workflows (assessment, aftercare plan, warm handoff, 7/30-day follow-up, readmission risk, RH housing coordination).
- Scope: Four tables (cl_aftercare_plans, cl_follow_up_contacts, cl_readmission_risk_scores, cl_warm_handoffs); CL-12 transition_id link; CL-10 HEDIS FUH; RH event/API.
- Key links: Spec, CL-12 Care Coordination & Transitions, CROSS_CORE_INTEGRATIONS.md.
Decision Tree
- Trigger: Discharge planned or aftercare plan finalized.
- Actor: Clinician / care coordinator (CL-29); RH for placement; reporting for FUH.
- Discharge assessment at admission → Create/update aftercare plan; link transition_id (CL-12).
- Aftercare plan finalized → Publish Discharge.AftercarePlan.Finalized (platform layer); RH and reporting subscribe.
- RH referral status change → RH.Referral.Status event (or API); CL-29 may consume for housing_plan sync.
- 7-day / 30-day follow-up → cl_follow_up_contacts; CL-10 HEDIS FUH consumes (query or event TBD).
Pattern Library
- Discharge assessment: Form/workflow at admission; store in cl_aftercare_plans; link to cl_care_transitions via transition_id.
- Warm handoff: Document caller, receiver, acceptance, time in cl_warm_handoffs; PHI; RLS via cl_has_org_access.
- Follow-up tracking: cl_follow_up_contacts with contact_type 7_day | 30_day; feed HEDIS FUH per CL-10; use platform layer (message broker or REST) for reporting.
Common Mistakes
Pre-Flight Checklist
- Phase 0: DB check that cl_has_org_access exists; fail deployment if missing.
- Migration: four tables, indexes, updated_at triggers (pf_set_updated_at), RLS + FORCE RLS.
- Permission keys seeded; roles assigned.
- Event contracts (below) documented; CROSS_CORE_INTEGRATIONS.md updated.
- RLS tests pass; cross-tenant isolation verified.
Integration Points (from Spec)
API / Data Contracts
- CL-12 transition link:
cl_aftercare_plans.transition_idreferencescl_care_transitions(id); optional when transition record exists. - CL-10 HEDIS FUH: Follow-up contact records (
cl_follow_up_contactswithcontact_type7_day/30_day) feed HEDIS FUH logic per CL-10; contract TBD (query or event). - RH housing: Coordination documented in aftercare plan (
housing_plan); placement owned by RH; integration contract TBD (event or API for referral status).
Event Contracts
- Planned: Discharge completed or aftercare plan finalized may publish events for RH or reporting. Explicit contract placeholders:
RH.Referral.Status (event or REST)
These contracts are listed in CROSS_CORE_INTEGRATIONS.md; integration owners: CL team (CL-29), RH team (referral status).
Security and RLS
- All CL-29 tables use
organization_id(andsite_idoncl_follow_up_contacts,cl_readmission_risk_scores). RLS via SECURITY DEFINER (e.g.cl_has_org_access); UPDATE policies include WITH CHECK (constitution §5.2.4). Plans, assessments, and handoffs are PHI; no RLS policy may query RLS-protected tables directly (§5.7).
Related Docs
- CL-12 — Care coordination & transitions
- CROSS_CORE_INTEGRATIONS.md — Integration matrix (CL ↔ RH)
CL-29-EN-67 — discharge-summary block (CL-75, shipped 2026-07-02)
The R9-10-709 discharge summary ships as a CL-75 composition block (blocks/discharge) over the CL-29 cl_transitions / cl_discharge_checklists / cl_aftercare_plans tables (PR #2213), resolved onto surfaces via getResolvedSurfaceBlocks.