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.

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

TablePurpose
cl_assessment_templatesOrg-level template definitions (name, type, version, status)
cl_assessment_template_sectionsTemplate sections with ordering, required flag
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

KeyPurpose
cl.assessment_template.createCreate new templates
cl.assessment_template.editEdit existing templates
cl.assessment_template.archiveArchive/deactivate templates
cl.assessment_template.viewView template list and details

UI Routes

RouteComponentPermission
/cl/settings/assessment-templatesTemplate list + editorcl.assessment_template.view

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