HL7v2.Type.CNE (HL7v2 v3.10.1)

Copy Markdown View Source

Coded with No Exceptions (CNE) -- HL7v2 composite data type.

Like CWE but requires a valid code. Free text alone (component 9 only) is NOT permitted. Component 1 (Identifier) is required.

9 components (same layout as CWE):

  1. Identifier (ST) -- REQUIRED
  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
  7. Coding System Version ID (ST)
  8. Alternate Coding System Version ID (ST)
  9. Original Text (ST)

Summary

Functions

Encodes a CNE to a list of component strings.

Parses a CNE from a list of components.

Types

t()

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

Functions

encode(cne)

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

Encodes a CNE to a list of component strings.

Examples

iex> HL7v2.Type.CNE.encode(%HL7v2.Type.CNE{identifier: "F", text: "Female", name_of_coding_system: "HL70001"})
["F", "Female", "HL70001"]

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

parse(components)

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

Parses a CNE from a list of components.

Examples

iex> HL7v2.Type.CNE.parse(["F", "Female", "HL70001"])
%HL7v2.Type.CNE{identifier: "F", text: "Female", name_of_coding_system: "HL70001"}

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