Status: ✅ Implemented
Spec Reference: CL-04-progress-notes-session-documentation.md
Last Updated: 2026-02-18
Last Verified: 2026-02-18
Table of Contents
- Overview
- Quick Reference
- Decision Trees
- Pattern Library
- Integration Points (from Spec)
- API / Data Contracts
- Code Examples
- Event Contracts
- Security and RLS
- Common Mistakes
- Pre-Flight Checklist
- Related Docs
Overview
CL-04 provides progress notes and session documentation per AHCCCS Policy 940, with actual begin/end times, co-signature workflow (HR-19), electronic signatures (PF-33), and encounter-to-billing integration via events (PM-07). It depends on PF for tenancy, RBAC, notifications, and digital signatures; on CL-01/CL-03 for chart and treatment-plan context; and on PM-07 for charge capture when notes are finalized.Quick Reference
Decision Trees
Note finalization flow
- Draft note is authored in chart context.
- Clinician signs (or supervisor co-signs) note.
- If final status is
signed/cosigned, publishclinical_note_finalized. - PM-07 consumes event for charge capture workflow.
Co-signature flow
- Determine whether author role requires supervisory co-sign (HR-19).
- If required, enforce co-sign due window and PF-10 alerts.
- Block billing event publication until required co-sign state is satisfied.
Pattern Library
Integration Points (from Spec)
API / Data Contracts
- Progress notes: Tables
cl_progress_notes,cl_note_treatment_goals,cl_note_templates; all scoped byorganization_id; RLS via SECURITY DEFINER helpers (e.g.cl_fn_check_org_membership). No direct FK topm_encounters;encounter_idvalidated at application layer (core independence). - Event:
clinical_note_finalized— published when note status transitions tosignedorcosigned; payload must includeorganization_id,clinical_note_id,encounter_id,patient_id,finalized_at. See CL-PM-ENCOUNTER-TO-BILLING.md.
Code Examples
Example: clinical_note_finalized payload
Example: org access guard pattern
Event Contracts
- clinical_note_finalized: CL publishes when a progress note is signed or cosigned; PM-07 (charge capture) subscribes. Payload schema and subscription details in CL-PM-ENCOUNTER-TO-BILLING.md.
Security and RLS
- RLS on
cl_progress_notes,cl_note_treatment_goals,cl_note_templates; USING and WITH CHECK use SECURITY DEFINER helpers; no direct queries to RLS-protected tables (constitution §5.7). - UPDATE policies include WITH CHECK for organization_id (constitution §5.2.4).
- Part 2 SUD: restrict via consent check (e.g.
cl_has_sud_consent()SECURITY DEFINER) per CL-11; access logged per HIPAA.
Common Mistakes
Pre-Flight Checklist
- RLS + FORCE RLS enabled on all CL-04 tables.
-
clinical_note_finalizedpayload contract documented and validated. - Co-signature requirements mapped to HR-19 role rules.
- Error messages sanitized for all UI-facing failures.
- Integration tests cover note finalization → PM-07 handoff.