HL7v2.Type.VID (HL7v2 v3.10.1)

Copy Markdown View Source

Version Identifier (VID) -- HL7v2 composite data type.

Used in MSH-12 to identify the HL7 version.

3 components:

  1. Version ID (ID) -- Table 0104: 2.5, 2.5.1, etc.
  2. Internationalization Code (CE)
  3. International Version ID (CE)

Summary

Functions

Encodes a VID to a list of component strings.

Parses a VID from a list of components.

Types

t()

@type t() :: %HL7v2.Type.VID{
  international_version_id: HL7v2.Type.CE.t() | nil,
  internationalization_code: HL7v2.Type.CE.t() | nil,
  version_id: binary() | nil
}

Functions

encode(vid)

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

Encodes a VID to a list of component strings.

Examples

iex> HL7v2.Type.VID.encode(%HL7v2.Type.VID{version_id: "2.5.1"})
["2.5.1"]

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

parse(components)

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

Parses a VID from a list of components.

Components 2 and 3 are CE types, which when embedded use & sub-components.

Examples

iex> HL7v2.Type.VID.parse(["2.5.1"])
%HL7v2.Type.VID{version_id: "2.5.1"}

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