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.

Audience: Clinical administrators, compliance leads Status: Draft (WS5 pending — content subject to refinement) Last Updated: 2026-05-08

Feature Flag

CL-44 is gated by cl_module_settings.order_sets_enabled (boolean, default true). Disable it to hide order set navigation, the chart quick action, and the management pages. The standing order protocol UI remains independent of this flag.

Module Settings

SettingDefaultPurpose
order_sets_enabledtrueMaster feature flag
order_set_max_items50Soft cap enforced in the template editor
standing_order_default_expiry_days365Default protocol expiration when none is supplied

Permissions Mapping

Seeded by migration 20260508131517_*:
RolePermissions granted
platform_adminAll seven CL-44 permissions
staffcl.order_sets.view, cl.order_sets.activate, cl.standing_orders.view, cl.standing_orders.execute
readonlycl.order_sets.view, cl.standing_orders.view
Adjust per-role mappings via the platform permission management UI as needed.

Database Surface (Phase 1)

  • cl_order_set_templates — versioned templates (status: draft, approved, retired)
  • cl_order_set_activations — per-patient activation log; references cl_charts and pm_patients
  • cl_clinical_standing_orders — protocol definitions with parameter ranges and effective/expiration dates
  • cl_standing_order_executions — append-only execution log (no UPDATE/DELETE policy by design)
All tables are tenant-scoped via cl_has_org_access(organization_id, auth.uid()) with FORCE ROW LEVEL SECURITY enabled.

Operational Notes

  • Append-only executions: corrections must be issued as compensating executions; do not attempt UPDATE/DELETE — RLS will reject them.
  • Frequency enforcement is implemented client-side in useStandingOrderExecutions (frequencyLimit: { count, windowHours }) before insertion. A future migration will add a server-side trigger if abuse is observed.
  • CL-09 EN-30 coexistence: the legacy lab-only cl_standing_order_protocols and StandingOrderProtocolsPage remain unchanged at /cl/settings/standing-orders. CL-44’s cross-category protocols live at /cl/standing-orders.
  • Spec: specs/cl/specs/CL-44-clinical-order-sets-standing-orders.md
  • User guide: order-sets-user-guide.md
  • Tasks: specs/cl/tasks/CL-44-TASKS.md