Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt

Use this file to discover all available pages before exploring further.

42 CFR Part 2 Electronic Consent & Redisclosure — Compliance Evidence

Feature ID: CL-11-EN-01
Regulation: 42 CFR Part 2 (Confidentiality of SUD Patient Records)
Status: ✅ Implemented
Date: 2026-04-10
Spec: CL-11-EN-01

1. Regulatory Requirements Addressed

RequirementImplementationEvidence
Written consent with specific elementsConsentCaptureSheet wizard with Zod validation (consent-capture-schema.ts)Schema enforces all required fields before submission
Granular consent categoriesconsent_categories JSONB: treatment, payment, operations, providers, researchConsentCategories type in electronic-consent.ts
Patient identificationpatient_id UUID required on all consent recordsDB NOT NULL constraint
Purpose specificationCategory-level granularity (treatment/payment/operations/providers/research)Checkbox UI with at-least-one validation
Expiration dateexpiration_date DATE column with 30/14/7-day alert thresholdsconsent-expiration.ts utility
Right to revokeRevokeConsentDialog with irreversibility warning; status → ‘revoked’Permission-gated (cl.electronic-consent.revoke)

§ 2.32 — Prohibition on Redisclosure

RequirementImplementationEvidence
Notice must accompany disclosuresgenerateRedisclosureNotice() in redisclosure-notice.tsFull federal prohibition language generated
Notice includes federal confidentiality citationNotice text references “42 CFR Part 2” and prohibition languageUnit tests verify presence of key phrases
Notice includes recipient, date, purposeParameterized notice generation with all fieldsRecordDisclosureSheet shows preview before submission

§ 2.13(d) — Accounting of Disclosures

RequirementImplementationEvidence
Who discloseddisclosed_by UUID in cl_redisclosure_logNOT NULL FK to pf_profiles
When discloseddisclosed_at TIMESTAMPTZNOT NULL, set at creation
To whomrecipient TEXTNOT NULL
Purposepurpose TEXTNOT NULL
What recordsrecords_disclosed JSONBStructured record type/date range metadata

2. Data Model Evidence

Tables Created

TablePurposeImmutability
cl_electronic_consentsSigned consent records with e-signature and categoriesStandard CRUD (revocation via status change)
cl_redisclosure_logAppend-only disclosure audit trailUPDATE/DELETE revoked + immutability trigger

RLS Enforcement

  • Both tables use cl_has_org_access() SECURITY DEFINER helper
  • cl_redisclosure_log: SELECT + INSERT only policies; no UPDATE/DELETE policies
  • Privilege revocation: REVOKE UPDATE, DELETE ON cl_redisclosure_log FROM authenticated
  • Defense-in-depth: trg_cl_redisclosure_log_immutable trigger raises exception on UPDATE/DELETE

3. Permission Controls

Permission KeyPurposeRoles
cl.electronic-consent.viewView consent recordsorg_admin, manager, staff
cl.electronic-consent.createCreate new consentsorg_admin, manager, staff
cl.electronic-consent.revokeRevoke active consentsorg_admin only
cl.redisclosure-log.viewView disclosure audit trailorg_admin, manager, staff
cl.redisclosure-log.createRecord new disclosuresorg_admin, manager, staff
cl.compliance_report.viewView compliance dashboardorg_admin

4. UI Controls

ComponentPermission GateDescription
ElectronicConsentPagecl.electronic-consent.viewTwo-tab layout (Consents + Redisclosure Audit)
ConsentCaptureSheetcl.electronic-consent.createWizard with e-signature and attestation
RevokeConsentDialogcl.electronic-consent.revokeDestructive action with irreversibility warning
RecordDisclosureSheetcl.redisclosure-log.createDisclosure recording with § 2.32 notice preview
Part2ComplianceDashboardPagecl.compliance_report.viewAggregate-only statistics (no patient IDs)

5. Test Evidence

Test SuiteTestsCoverage
consent-expiration.test.ts1230/14/7-day thresholds, status logic
redisclosure-notice.test.ts8§ 2.32 prohibition language validation
electronic-consent-workflow.test.ts16Full lifecycle: draft → active → revoke; disclosure blocking
electronic-consent-compliance.test.ts20§ 2.31 elements, § 2.32 notices, § 2.13(d) accounting
Total56All passing

6. Route Registration

  • Path: /cl/electronic-consents
  • Lazy loaded via React.lazy
  • Permission guard: RequirePermission('cl.electronic-consent.view')

7. References