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

Reference Range (RFR) -- HL7v2 composite data type.

Specifies a reference range for an observation with optional demographic qualifiers.

7 components:
1. Numeric Range (NR) -- sub-components (low & high)
2. Administrative Sex (IS) -- Table 0001
3. Age Range (NR) -- sub-components
4. Gestational Age Range (NR) -- sub-components
5. Species (ST)
6. Race/Subspecies (ST)
7. Conditions (TX)

# `t`

```elixir
@type t() :: %HL7v2.Type.RFR{
  administrative_sex: binary() | nil,
  age_range: HL7v2.Type.NR.t() | nil,
  conditions: binary() | nil,
  gestational_age_range: HL7v2.Type.NR.t() | nil,
  numeric_range: HL7v2.Type.NR.t() | nil,
  race_subspecies: binary() | nil,
  species: binary() | nil
}
```

# `encode`

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

Encodes an RFR to a list of component strings.

## Examples

    iex> HL7v2.Type.RFR.encode(%HL7v2.Type.RFR{numeric_range: %HL7v2.Type.NR{low: %HL7v2.Type.NM{value: "3.5", original: "3.5"}, high: %HL7v2.Type.NM{value: "5.5", original: "5.5"}}, administrative_sex: "M"})
    ["3.5&5.5", "M"]

    iex> HL7v2.Type.RFR.encode(nil)
    []

# `parse`

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

Parses an RFR from a list of components.

## Examples

    iex> HL7v2.Type.RFR.parse(["3.5&5.5", "M"])
    %HL7v2.Type.RFR{
      numeric_range: %HL7v2.Type.NR{
        low: %HL7v2.Type.NM{value: "3.5", original: "3.5"},
        high: %HL7v2.Type.NM{value: "5.5", original: "5.5"}
      },
      administrative_sex: "M"
    }

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

---

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