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

# Notification Policies

> Configure severity rules, SLA timing, dedup windows, and escalation chains for each clinical signal type.

This screen is the Notification Policies administration page, accessible at `/cl/notifications/policies`. It manages rows in `cl_notification_policies` and `cl_notification_escalation_chains`.

## Overview

The Notification Policies page lists all `cl_notification_policies` rows for the current organization, ordered by `signal_type`. Each row displays the signal type, SLA (formatted as seconds, minutes, or hours), dedup window, and an active/inactive toggle. Administrators can create a new policy via a sheet editor (`PolicyEditorSheet`), edit an existing one by clicking **Edit**, or permanently delete a policy after a confirmation dialog. Below the policy table, an `EscalationChainEditor` section lets administrators configure ordered recipient roles that are notified when an SLA is breached.

Toggling the **Active** switch calls `useUpsertNotificationPolicy` immediately; no separate save step is required. Deletion is permanent and confirmed by a destructive dialog.

Both the route and the in-page `PermissionGate` enforce `cl.notification_policy.manage`. The route also wraps the page in a `FeatureFlagGate` for `cl.notification_service_enabled` — if that flag is off, a `NotificationServiceDisabledBanner` is shown instead.

## Who it's for

Requires permission: `cl.notification_policy.manage`

## Before you start

* You must hold the `cl.notification_policy.manage` permission.
* The feature flag `cl.notification_service_enabled` must be **enabled** for this route to render. If it is disabled, a `NotificationServiceDisabledBanner` is displayed and the policy list is not accessible.

## Steps

<Steps>
  <Step title="Navigate to Notification Policies">
    Go to `/cl/notifications/policies`. If you see a disabled-service banner, contact an administrator to enable the `cl.notification_service_enabled` feature flag.
  </Step>

  <Step title="Create a new policy">
    Click **New Policy**. The `PolicyEditorSheet` opens. Fill in the signal type, SLA, dedup window, and severity rules, then save.
  </Step>

  <Step title="Edit an existing policy">
    Click **Edit** on any row. The same sheet opens pre-populated with that policy's values. Save to apply changes.
  </Step>

  <Step title="Toggle a policy active or inactive">
    Use the **Active** toggle in the Status column. The change is saved immediately via `useUpsertNotificationPolicy`.
  </Step>

  <Step title="Delete a policy">
    Click the trash icon on a row. Confirm the destructive dialog. Deletion is permanent and cannot be undone.
  </Step>

  <Step title="Manage escalation chains">
    Scroll to the **Escalation Chains** section. Use `EscalationChainEditor` to configure ordered recipient roles for SLA-breach escalation.
  </Step>
</Steps>

## Key concepts

<AccordionGroup>
  <Accordion title="Signal type">
    A free-text identifier stored in `cl_notification_policies.signal_type` that categorizes the clinical event triggering the notification. SME: confirm the canonical list of valid signal type values.
  </Accordion>

  <Accordion title="SLA (sla_seconds)">
    The number of seconds within which a notification must be acknowledged before escalation begins. Displayed as seconds (`s`), minutes (`m`), or hours (`h`).
  </Accordion>

  <Accordion title="Dedup window (dedup_window_seconds)">
    A window during which duplicate events of the same signal type are suppressed. Displayed in the same `s`/`m`/`h` format as SLA.
  </Accordion>

  <Accordion title="Escalation chains">
    Ordered sequences of recipient roles stored in `cl_notification_escalation_chains`. When an SLA is breached, the next step's role is notified.
  </Accordion>

  <Accordion title="Empty state">
    When no policies exist, an empty state with a **Create policy** action is displayed. When data fails to load, an error empty state shows a sanitized error message.
  </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/notifications/NotificationPoliciesPage.tsx
  * src/cores/cl/hooks/useNotificationPolicy.ts
</Accordion>
