Skip to main content
Spec: specs/cl/specs/CL-04-EN-66-note-quality-pre-submission-validation.md
Core: 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’s validatePolicy940 service. 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 to cl_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 in public.org_compliance_configs with config_key = 'org_config_940_validation' and config_value JSON:
Resolved (Clarification #6): Phase 1 uses block | warn | disabled. EN-66 owns this enum. If CL-36 Phase 2 needs draft-warn-final-block, it will be added as a fourth value via Phase 2 migration. No duplicate enums. Config key: Use org_config_940_validation as the config_key value consistently across spec, tasks, and integration doc (per Clarification #11). Do not use the shorter 940_validation key.

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’s validatePolicy940 service (or a shared function called by EN-66). Resolution details:
  • Single config source: org_config_940_validation in org_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 request draft-warn-final-block as 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_contracted column 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.
See spec Clarifications #4, #5, #6, #7.

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 add draft-warn-final-block
  • AHCCCS-contracted detection resolved (Clarification #7) — pf_organizations.ahcccs_contracted column
  • CROSS_CORE_INTEGRATIONS.md entry added
  • REGULATORY_COMPLIANCE_TRACKER.md AHCCCS 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