HL7v2.Type.WVS (HL7v2 v3.10.1)

Copy Markdown View Source

Waveform Source (WVS) -- HL7v2 composite data type.

Identifies the source(s) of a waveform channel. Used in CD (Channel Definition).

2 components:

  1. Source One Name (ST)
  2. Source Two Name (ST)

Summary

Functions

Encodes a WVS to a list of component strings.

Parses a WVS from a list of components.

Types

t()

@type t() :: %HL7v2.Type.WVS{
  source_one_name: binary() | nil,
  source_two_name: binary() | nil
}

Functions

encode(wvs)

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

Encodes a WVS to a list of component strings.

Examples

iex> HL7v2.Type.WVS.encode(%HL7v2.Type.WVS{source_one_name: "RA", source_two_name: "LA"})
["RA", "LA"]

iex> HL7v2.Type.WVS.encode(%HL7v2.Type.WVS{source_one_name: "V1"})
["V1"]

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

parse(components)

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

Parses a WVS from a list of components.

Examples

iex> HL7v2.Type.WVS.parse(["RA", "LA"])
%HL7v2.Type.WVS{source_one_name: "RA", source_two_name: "LA"}

iex> HL7v2.Type.WVS.parse(["V1"])
%HL7v2.Type.WVS{source_one_name: "V1"}

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