HL7v2.Type.NA (HL7v2 v3.10.1)

Copy Markdown View Source

Numeric Array (NA) -- HL7v2 composite data type.

Contains a variable number of numeric (NM) values. Used in OBX for waveform data (single-channel numeric arrays).

Variable components (4+ per HL7 spec):

  1. Value 1 (NM)
  2. Value 2 (NM)
  3. Value 3 (NM)
  4. Value 4 (NM) ... additional values as needed

Summary

Functions

Encodes an NA to a list of component strings.

Parses an NA from a list of components.

Types

t()

@type t() :: %HL7v2.Type.NA{values: [binary()]}

Functions

encode(arg1)

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

Encodes an NA to a list of component strings.

Examples

iex> HL7v2.Type.NA.encode(%HL7v2.Type.NA{values: ["10", "20", "30", "40"]})
["10", "20", "30", "40"]

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

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

parse(components)

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

Parses an NA from a list of components.

All components are stored as a list of string values.

Examples

iex> HL7v2.Type.NA.parse(["10", "20", "30", "40"])
%HL7v2.Type.NA{values: ["10", "20", "30", "40"]}

iex> HL7v2.Type.NA.parse(["100"])
%HL7v2.Type.NA{values: ["100"]}

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