Skip to main content
Compliance: AHCCCS AMPM Policy 320-O, CARF Behavioral Health Standards §§4.A–4.C, 42 CFR Part 2. Last Updated: 2026-05-12

1. Permission setup

CL-31 introduces five permission keys (registered in src/platform/permissions/constants.ts and seeded into pf_module_permissions):

Default role assignments

The seed migration assigns:
  • licensed_clinician — all five permissions.
  • clinical_admin — all five permissions.
  • platform_admin — inherits via the platform admin override.
Custom roles must be granted these keys via pf_role_permissions per your tenant’s role model.

2. Org-level configuration

There are no tenant-level COD settings in Phase 1+2. Phase 3 may add a “COD documentation enabled” feature flag in cl_module_settings.custom_fields.

3. Audit and oversight

  • All access to cl_cod_assessments is governed by RLS (pf_has_org_access); cross-org reads return empty.
  • Mutations are timestamped via created_by / updated_by. The prevent_org_id_change trigger blocks any attempt to move a row between organizations.
  • SUD-content access is checked at every read via the cl_check_sud_consent RPC; default-deny applies on any failure or missing consent.
  • Consent grants are recorded in CL-11 (cl_consents); redisclosure events are logged in cl_consent_redisclosure_log (CL-11-EN-22).

4. Compliance crosswalk

5. Troubleshooting

Consent gate stays in amber-banner state for an authorized clinician.
  • Verify the patient has an active sud_counseling_notes consent in CL-11.
  • Check that the clinician’s role has cl.cod_progress_notes.view_sud.
  • Confirm cl_check_sud_consent RPC is deployed (one of the CL-11 conditions for go-live).
COD indicator prompt never appears.
  • The prompt fires once per browser session per chart. Clear localStorage or use the manual toggle in the chart header.
Assessment row missing from the COD tab.
  • Confirm RLS — the row’s organization_id must match the user’s active org.
  • Filter chips may be applied; reset filters at the top of the tab.
Migration failures referencing cl_moud_enrollments.
  • The moud_episode_id FK is nullable. If CL-21 is not deployed, the column remains unset; UI hides the MOUD callout.

6. Operational checklist before go-live

  • CL-11 consent service deployed (RPC + tables) — required by compliance condition #1.
  • Permission seed migration applied; verify with SELECT * FROM pf_module_permissions WHERE permission_key LIKE 'cl.cod_%';.
  • RLS smoke tests pass: npm run test:rls -- cl-31-cod.
  • Integration tests pass: npm run test:integration -- cl-31-cod-workflow.
  • Legal review of sud_counseling_notes consent type completed (compliance condition #3).
  • Tenant-specific COD documentation policy attached in GR.