HL7v2.Type.RFR (HL7v2 v3.10.1)

Copy Markdown View Source

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)

Summary

Functions

Encodes an RFR to a list of component strings.

Parses an RFR from a list of components.

Types

t()

@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
}

Functions

encode(rfr)

@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(components)

@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{}