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_elementsbaseline) - 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:
- Takes jurisdiction-required elements from CL-02-EN-60
- Takes org template sections from
cl_assessment_template_sections - Produces a merged ordered list ensuring jurisdiction requirements cannot be removed
src/cores/cl/shared/validation/ for reuse.
Permissions
UI Routes
Security & Tenant Isolation
- All template reads/writes scoped by
organization_idvia RLS. - Template metadata does not contain PHI.
- Version history tracked via
versioncolumn andupdated_at.
Testing
- 22 unit tests covering merge engine, template CRUD hooks, and UI components.
Related Specs
specs/cl/specs/CL-02-EN-61-configurable-clinical-assessment-templates.mdspecs/cl/specs/CL-02-EN-60-jurisdiction-aware-assessment-requirements.mddocs/architecture/integrations/CL-02-EN-60-jurisdiction-aware-assessment-requirements-INTEGRATION.md