---
title: "ReferenceRange"
description: "The interval a reading is being compared against, and who says so."
url: "https://opsinjs.pensievelabs.org/reference/api/ReferenceRange"
source: "https://opsinjs.pensievelabs.org/reference/api/ReferenceRange.md"
section: "Reference"
kind: "reference"
---

> Elements written as `<PascalCase … />` below are opsinjs documentation
> components. Their attributes are the content: the values they render are
> generated from `tokens/*.json` and `registry/catalogue.ts` and are
> published separately at https://opsinjs.pensievelabs.org/r/index.json and under the Reference
> section.
> Nothing is missing from this page. The data simply does not live in
> the prose.

{/* GENERATED - do not edit. Source: the declaration named in the table below.
    Script: scripts/build-reference.mts. Change the doc comment on the symbol. */}

<PageTemplate kind="reference" />

## How this is generated [#how-this-is-generated]

Source: `lib/opsinjs.ts`. Script: `scripts/build-reference.mts`. Command:
`pnpm run generate`.

Everything below is copied from the symbol, so a page is improved by improving
its doc comment. The [API index](./index.mdx) says why there is a page per
symbol and what these pages still do not carry.

{/* opsinjs:generated:begin - everything below is replaced by scripts/build-reference.mts */}

## ReferenceRange [#referencerange]

The interval a reading is being compared against, and who says so.

Both bounds are optional because a one-sided range is a real range: some measurements have a floor and no ceiling, and rendering a bound the product did not supply would invent a threshold. An omitted bound renders as an open end, never as zero and never as an assumed limit.

`source` is required, and it is required because opsinjs does not own a single clinical number. A range arriving with no attribution is the consuming product asking this system to vouch for a threshold it has never seen, which is the one thing it must not do; a component handed a range with no `source` reports OPSIN-0004 rather than drawing it.

| Kind      | Declared in      |
| --------- | ---------------- |
| interface | `lib/opsinjs.ts` |

```ts
export interface ReferenceRange {
  low?: number
  high?: number
  source: string
  asOf?: string
}
```

{/* opsinjs:generated:end */}
