# `HL7v2.Type.NR`
[🔗](https://github.com/Balneario-de-Cofrentes/hl7v2/blob/v3.10.1/lib/hl7v2/type/nr.ex#L1)

Numeric Range (NR) -- HL7v2 composite data type.

Two components: low value and high value, both NM type.
Specifies an interval between lowest and highest values.

# `t`

```elixir
@type t() :: %HL7v2.Type.NR{
  high: HL7v2.Type.NM.t() | nil,
  low: HL7v2.Type.NM.t() | nil
}
```

# `encode`

```elixir
@spec encode(t() | nil) :: list()
```

Encodes a numeric range to a list of component strings.

## Examples

    iex> HL7v2.Type.NR.encode(%HL7v2.Type.NR{low: "2.5", high: "10"})
    ["2.5", "10"]

    iex> HL7v2.Type.NR.encode(%HL7v2.Type.NR{})
    []

# `parse`

```elixir
@spec parse(list()) :: t()
```

Parses a numeric range from a list of components.

## Examples

    iex> HL7v2.Type.NR.parse(["2.5", "10.0"])
    %HL7v2.Type.NR{low: %HL7v2.Type.NM{value: "2.5", original: "2.5"}, high: %HL7v2.Type.NM{value: "10", original: "10.0"}}

    iex> HL7v2.Type.NR.parse(["", "100"])
    %HL7v2.Type.NR{low: nil, high: %HL7v2.Type.NM{value: "100", original: "100"}}

    iex> HL7v2.Type.NR.parse([])
    %HL7v2.Type.NR{}

---

*Consult [api-reference.md](api-reference.md) for complete listing*
