> ## 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.

# Standing Orders

> Manage clinical standing-order protocols available for execution; create, edit, renew, and delete standing orders.

The Standing Orders screen manages clinical standing-order protocols available for execution, accessible at `/cl/settings/standing-orders`.

## Overview

The page reads `cl_module_settings.order_sets_enabled` via `useClModuleSettings`; if false, it renders an empty state: "Standing orders are disabled / Ask an administrator to enable order sets in CL module settings." When enabled, it fetches standing orders via `useClinicalStandingOrders` and renders them through the `StandingOrderList` component with search filtering by `name` and `order_type`. The "New Standing Order" button (gated to `cl.standing_orders.manage`) opens `StandingOrderDialog`. Row actions from `StandingOrderList` include Edit (re-opens `StandingOrderDialog` pre-filled), Delete (opens `ConfirmationDialog`), and Renew (opens `StandingOrderRenewDialog` with `defaultExpiryDays` from module settings).

## Who it's for

Requires permission: `cl.standing_orders.view` (read); `cl.standing_orders.manage` (create/edit/delete)

## Before you start

* You must hold `cl.standing_orders.view` to access this route.
* `order_sets_enabled` must be `true` in CL module settings for the list to display; otherwise the disabled state is shown.
* Creating, editing, or deleting requires `cl.standing_orders.manage`.

## Steps

<Steps>
  <Step title="Navigate to Standing Orders">
    Go to `/cl/settings/standing-orders`. If order sets are disabled, an empty state is shown instead of the list.
  </Step>

  <Step title="Search standing orders">
    Use the search input (placeholder: "Search standing orders…") to filter by `name` or `order_type`.
  </Step>

  <Step title="Create a new standing order">
    Click "New Standing Order" (requires `cl.standing_orders.manage`). The `StandingOrderDialog` opens with empty fields.
  </Step>

  <Step title="Edit a standing order">
    Select "Edit" from a row action. The `StandingOrderDialog` opens pre-filled.
  </Step>

  <Step title="Renew a standing order">
    Select "Renew" from a row action. The `StandingOrderRenewDialog` opens with `defaultExpiryDays` pre-filled from module settings.
  </Step>

  <Step title="Delete a standing order">
    Select "Delete" from a row action. A confirmation dialog ("Delete standing order {name}? This action cannot be undone.") is shown. Confirm to delete.
  </Step>
</Steps>

## Key concepts

<AccordionGroup>
  <Accordion title="Feature gate: order_sets_enabled">
    The entire list is gated behind `cl_module_settings.order_sets_enabled`. When false, the page shows: "Standing orders are disabled / Ask an administrator to enable order sets in CL module settings."
  </Accordion>

  <Accordion title="Empty state (enabled)">
    When the feature is enabled but no orders exist or match the search: "No standing orders yet / Create your first standing order protocol."
  </Accordion>

  <Accordion title="Default expiry">
    `StandingOrderRenewDialog` receives `defaultExpiryDays` from `cl_module_settings.standing_order_default_expiry_days` (default: 365 if not set).
  </Accordion>
</AccordionGroup>

## Related

<Columns cols={2}>
  <Card title="Clinical" icon="stethoscope" href="/cl/overview">
    Overview of the Clinical core.
  </Card>

  <Card title="Governance & parity" icon="scale-balanced" href="/governance/index">
    Documentation coverage and governance.
  </Card>
</Columns>

<Note>
  This page documents shipped product behavior. It is not medical, legal, or
  billing advice. Verify against your organization's policies and applicable
  regulations before using it for clinical, compliance, or billing decisions.
  Protected health information (PHI) shown in the product is governed by your
  tenant's access controls and is never exposed in this documentation.
</Note>

<Accordion title="Documentation sources">
  * src/routes/cl.tsx
  * src/cores/cl/pages/StandingOrderManagementPage.tsx
  * src/cores/cl/hooks/useClinicalStandingOrders.ts
  * src/cores/cl/hooks/useClModuleSettings.ts
</Accordion>
