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

# Reference Ranges

> Configure custom lab result reference ranges by LOINC code, sex, age band, and critical thresholds for result interpretation.

The Reference Ranges screen lets administrators define custom lab result interpretation thresholds, accessible at `/cl/settings/reference-ranges`.

## Overview

The page fetches reference ranges for the organization via `useReferenceRanges` and displays them in a table inside a Card component. Each row shows `loinc_code` (monospace), `display_name`, `sex` (badged, defaulting to "All"), age band (`age_min_years`–`age_max_years`, defaulting to "Any"), normal range (`low_value`–`high_value`), critical range (`critical_low`–`critical_high`, shown in destructive color), and `units`. The "Add Range" button (gated to `cl.reference_ranges.manage`) opens the `ReferenceRangeForm` dialog. Each row has a delete button (also gated to `cl.reference_ranges.manage`) that calls `useDeleteReferenceRange` directly without a confirmation dialog.

## Who it's for

Requires permission: `cl.reference_ranges.manage`

## Before you start

* You must hold `cl.reference_ranges.manage` to access this page.
* Deleting a range is immediate — no confirmation prompt.

## Steps

<Steps>
  <Step title="Navigate to Reference Ranges">
    Go to `/cl/settings/reference-ranges`. All configured ranges for your organization load.
  </Step>

  <Step title="Add a new reference range">
    Click "Add Range" (requires `cl.reference_ranges.manage`). The `ReferenceRangeForm` dialog opens.
  </Step>

  <Step title="Review existing ranges">
    Review the table for LOINC code, sex, age band, normal range, critical range, and units.
  </Step>

  <Step title="Delete a reference range">
    Click the trash icon button on a row (requires `cl.reference_ranges.manage`). Deletion is immediate.
  </Step>
</Steps>

## Key concepts

<AccordionGroup>
  <Accordion title="Loading state">
    While ranges load, two skeleton rows are shown.
  </Accordion>

  <Accordion title="Empty state">
    When no ranges exist: "No reference ranges configured" / "Add custom reference ranges for lab result interpretation."
  </Accordion>

  <Accordion title="Age band display">
    `age_min_years` and `age_max_years` are rendered as `{min}–{max}`. If both are null, "Any" is displayed. A null max is shown as "∞".
  </Accordion>

  <Accordion title="Critical range display">
    `critical_low` and `critical_high` are rendered in destructive (red) color. If both are null, "—" is shown.
  </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/ReferenceRangeManagementPage.tsx
  * src/cores/cl/hooks/useReferenceRanges.ts
  * src/cores/cl/hooks/useReferenceRangeMutations.ts
</Accordion>
