specs/cl/specs/CL-04-EN-66-note-quality-pre-submission-validation.mdCore: CL (Clinical & EHR)
Status: ✅ Complete
Last Updated: 2026-04-03
Version: 1.0 (Clarifications #4–7 resolved)
Resolved (Clarification #4): EN-66 is the canonical Policy 940 validator. CL-36 Phase 2 delegates to EN-66’svalidatePolicy940service. Single org config source (org_config_940_validation). See spec Clarifications #4–7 for full resolution.
Purpose
CL-04-EN-66 adds a pre-submission validation gate to the note finalize/sign workflow in CL-04. It checks Policy 940 required elements before a progress note is finalized and provides a configurable enforcement path (block | warn | override).Integration Points
CL-04 Schema Extension
EN-66 adds the following columns tocl_progress_notes (multi-step backfill migration required):
New Table: cl_note_940_override_audit
INSERT-only immutable audit table for override events. Org-scoped with RLS.
Permission Keys
Seed locations:
src/platform/permissions/constants.ts, migration seeding pf_module_permissions and pf_role_permissions.
Platform Layer Usage
Validation Logic (Policy 940 Elements)
EN-66 Phase 1 implements 6 high-risk elements; Phase 2 expands to all 12 required categories per AHCCCS AMPM Policy 940 and CL-36 FR-4. The table below is the authoritative checklist for the canonical validator; use a config flag for phased rollout. Terminology aligned with CL-36 (e.g. “service description/treatment linkage” not “presenting problem”; “signature with credentials” not “clinician credential eligibility”).
Resolved: EN-66 is the single canonical Policy 940 validator. CL-36 Phase 2 delegates to EN-66’s
validatePolicy940 service (Clarification #4). No duplicate validation logic.
Configuration
Stored inpublic.org_compliance_configs with config_key = 'org_config_940_validation' and config_value JSON:
Resolved (Clarification #6): Phase 1 usesblock | warn | disabled. EN-66 owns this enum. If CL-36 Phase 2 needsdraft-warn-final-block, it will be added as a fourth value via Phase 2 migration. No duplicate enums. Config key: Useorg_config_940_validationas theconfig_keyvalue consistently across spec, tasks, and integration doc (per Clarification #11). Do not use the shorter940_validationkey.
CL-36 Overlap Resolution (Resolved)
Decision: Option A — EN-66 is the canonical standalone Policy 940 validator. CL-36 Phase 2 delegates to EN-66’svalidatePolicy940 service (or a shared function called by EN-66). Resolution details:
- Single config source:
org_config_940_validationinorg_compliance_configs(owned by EN-66); CL-36 reads enforcement mode from the same config. - Enforcement mode enum: EN-66 owns
block | warn | disabled. CL-36 Phase 2 may requestdraft-warn-final-blockas a fourth value; if so, a Phase 2 migration adds it to the shared enum. No duplicate enums. - AHCCCS-contracted flag: Single
pf_organizations.ahcccs_contractedcolumn used by both EN-66 and CL-36. - Phase scope: EN-66 Phase 1 = 6 elements; Phase 2 = 12 elements; CL-36 consumes the same validator at each phase.
Regulatory Compliance
Contract Validation Checklist
- Platform layer exports for PF-02, PF-30, PF-70, PF-10 documented in
PLATFORM_INTEGRATION_LAYERS.md - CL-36 overlap decision resolved (Clarification #4) — EN-66 is canonical; CL-36 delegates
- Policy 940 element count finalized (Clarification #5) — Phase 1 = 6 elements; Phase 2 = 12
- EN-66 confirmed as single canonical validator; CL-36 delegates to shared
validatePolicy940 - Enforcement mode aligned (Clarification #6) — EN-66 owns
block|warn|disabled; CL-36 Phase 2 may adddraft-warn-final-block - AHCCCS-contracted detection resolved (Clarification #7) —
pf_organizations.ahcccs_contractedcolumn -
CROSS_CORE_INTEGRATIONS.mdentry added -
REGULATORY_COMPLIANCE_TRACKER.mdAHCCCS row updated
References
- Spec:
specs/cl/specs/CL-04-EN-66-note-quality-pre-submission-validation.md - CL-36 spec:
specs/cl/specs/CL-36-ai-assisted-clinical-documentation.md - Parent spec:
specs/cl/specs/CL-04-progress-notes-session-documentation.md - AHCCCS AMPM: https://azahcccs.gov/shared/MedicalPolicyManual/
- Compliance Tracker:
docs/compliance/REGULATORY_COMPLIANCE_TRACKER.md - Cross-Core Integrations:
docs/architecture/integrations/CROSS_CORE_INTEGRATIONS.md