HL7v2.Type.CE (HL7v2 v3.10.1)

Copy Markdown View Source

Coded Element (CE) -- HL7v2 composite data type.

Deprecated as of v2.5. Retained for backward compatibility. Use CWE or CNE for new implementations.

6 components:

  1. Identifier (ST)
  2. Text (ST)
  3. Name of Coding System (ID) -- Table 0396
  4. Alternate Identifier (ST)
  5. Alternate Text (ST)
  6. Name of Alternate Coding System (ID) -- Table 0396

Summary

Functions

Encodes a CE to a list of component strings.

Parses a CE from a list of components.

Types

t()

@type t() :: %HL7v2.Type.CE{
  alternate_identifier: binary() | nil,
  alternate_text: binary() | nil,
  identifier: binary() | nil,
  name_of_alternate_coding_system: binary() | nil,
  name_of_coding_system: binary() | nil,
  text: binary() | nil
}

Functions

encode(ce)

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

Encodes a CE to a list of component strings.

Examples

iex> HL7v2.Type.CE.encode(%HL7v2.Type.CE{identifier: "784.0", text: "Headache", name_of_coding_system: "I9C"})
["784.0", "Headache", "I9C"]

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

parse(components)

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

Parses a CE from a list of components.

Examples

iex> HL7v2.Type.CE.parse(["784.0", "Headache", "I9C"])
%HL7v2.Type.CE{identifier: "784.0", text: "Headache", name_of_coding_system: "I9C"}

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