Skip to main content
Feature ID: CL-02-EN-61
Core: CL
Status: ✅ Complete
Spec: CL-02-EN-61
Last Updated: 2026-04-09

Summary

CL-02-EN-61 adds organization-configurable clinical assessment templates that merge with jurisdiction-required elements from CL-02-EN-60. Templates allow orgs to add custom sections beyond the jurisdiction baseline while ensuring regulatory minimums are always met.

Integration Pattern

  • Upstream: PF-96 (jurisdiction profiles via CL-02-EN-60 useClinicalRules())
  • Internal: CL-02-EN-60 (provides required_assessment_elements baseline)
  • Pattern: Platform Layer (PF-96 read) + CL-internal merge engine

Data Model

Both tables have standard RLS with organization_id scoping.

Merge Engine

mergeAssessmentSections(jurisdictionRequired, templateSections) — Pure function that:
  1. Takes jurisdiction-required elements from CL-02-EN-60
  2. Takes org template sections from cl_assessment_template_sections
  3. Produces a merged ordered list ensuring jurisdiction requirements cannot be removed
Exported from src/cores/cl/shared/validation/ for reuse.

Permissions


UI Routes


Security & Tenant Isolation

  • All template reads/writes scoped by organization_id via RLS.
  • Template metadata does not contain PHI.
  • Version history tracked via version column and updated_at.

Testing

  • 22 unit tests covering merge engine, template CRUD hooks, and UI components.

  • specs/cl/specs/CL-02-EN-61-configurable-clinical-assessment-templates.md
  • specs/cl/specs/CL-02-EN-60-jurisdiction-aware-assessment-requirements.md
  • docs/architecture/integrations/CL-02-EN-60-jurisdiction-aware-assessment-requirements-INTEGRATION.md