HL7v2.Type.SCV (HL7v2 v3.10.1)

Copy Markdown View Source

Scheduling Class Value Pair (SCV) -- HL7v2 composite data type.

Associates a scheduling parameter class with its value. Used in APR segment.

2 components:

  1. Parameter Class (CWE) -- sub-components, Table 0294
  2. Parameter Value (ST)

Summary

Functions

Encodes an SCV to a list of component strings.

Parses an SCV from a list of components.

Types

t()

@type t() :: %HL7v2.Type.SCV{
  parameter_class: HL7v2.Type.CWE.t() | nil,
  parameter_value: binary() | nil
}

Functions

encode(scv)

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

Encodes an SCV to a list of component strings.

Examples

iex> HL7v2.Type.SCV.encode(%HL7v2.Type.SCV{parameter_class: %HL7v2.Type.CWE{identifier: "PREFDAY"}, parameter_value: "MON"})
["PREFDAY", "MON"]

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

parse(components)

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

Parses an SCV from a list of components.

Examples

iex> HL7v2.Type.SCV.parse(["PREFDAY&Preferred Day&HL70294", "MON"])
%HL7v2.Type.SCV{
  parameter_class: %HL7v2.Type.CWE{identifier: "PREFDAY", text: "Preferred Day", name_of_coding_system: "HL70294"},
  parameter_value: "MON"
}

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