> ## 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 Order Protocols

> Admin page for creating and managing standing order protocols that automate recurring lab orders; activate, deactivate, or delete protocols.

The Standing Order Protocols screen is the admin page for managing standing order protocol definitions, accessible at `/cl/standing-orders`.

## Overview

The page fetches standing order protocols via `useStandingOrderProtocols` and displays them in a table inside a Card. Each row shows `template_id` (or "Custom" if null), `status` (Active/Inactive badge), and `order_items` count. Each row has a toggle button (using a `Power` icon) that calls `useToggleStandingOrderProtocol` to flip `is_active`, and a delete button that calls `useDeleteStandingOrderProtocol` immediately. The "New Protocol" button (gated to `cl.standing_orders.manage`) opens the `StandingOrderForm` dialog.

## Who it's for

Requires permission: `cl.standing_orders.manage`

## Before you start

* You must hold `cl.standing_orders.manage` to access and modify protocols.
* Deleting a protocol is immediate — no confirmation prompt.

## Steps

<Steps>
  <Step title="Navigate to Standing Order Protocols">
    Go to `/cl/standing-orders`. All protocols for your organization load.
  </Step>

  <Step title="Create a new protocol">
    Click "New Protocol" (requires `cl.standing_orders.manage`). The `StandingOrderForm` dialog opens.
  </Step>

  <Step title="Activate or deactivate a protocol">
    Click the power icon button on a row (`aria-label`: "Activate protocol" / "Deactivate protocol") to toggle `is_active`.
  </Step>

  <Step title="Delete a protocol">
    Click the trash icon button on a row (`aria-label`: "Delete protocol"). Deletion is immediate.
  </Step>
</Steps>

## Key concepts

<AccordionGroup>
  <Accordion title="Loading state">
    Three skeleton rows are shown while protocols load.
  </Accordion>

  <Accordion title="Empty state">
    When no protocols exist: "No standing order protocols / Create a protocol to automate recurring lab orders."
  </Accordion>

  <Accordion title="Status badge">
    `is_active = true` renders a "default" variant badge labeled "Active"; `is_active = false` renders a "secondary" badge labeled "Inactive."
  </Accordion>

  <Accordion title="Template column">
    The "Template" column displays `template_id` if set, or "Custom" if null.
  </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/StandingOrderProtocolsPage.tsx
  * src/cores/cl/hooks/useStandingOrderProtocols.ts
  * src/cores/cl/hooks/useStandingOrderMutations.ts
</Accordion>
