Skip to main content

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

Permissions Mapping

Seeded by migration 20260508131517_*: 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