HL7v2.Type.ELD (HL7v2 v3.10.1)

Copy Markdown View Source

Error Location and Description (ELD) -- HL7v2 composite data type.

Deprecated in v2.5.1 (replaced by ERL + CWE), but retained for backward compatibility with ERR-1 which uses this type.

4 components:

  1. Segment ID (ST)
  2. Segment Sequence (NM)
  3. Field Position (NM)
  4. Code Identifying Error (CE) -- sub-components delimited by &

Summary

Functions

Encodes an ELD to a list of component strings.

Parses an ELD from a list of components.

Types

t()

@type t() :: %HL7v2.Type.ELD{
  code_identifying_error: HL7v2.Type.CE.t() | nil,
  field_position: binary() | nil,
  segment_id: binary() | nil,
  segment_sequence: binary() | nil
}

Functions

encode(eld)

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

Encodes an ELD to a list of component strings.

Examples

iex> HL7v2.Type.ELD.encode(%HL7v2.Type.ELD{segment_id: "PID", segment_sequence: "1", field_position: "4", code_identifying_error: %HL7v2.Type.CE{identifier: "101", text: "Required field missing", name_of_coding_system: "HL70357"}})
["PID", "1", "4", "101&Required field missing&HL70357"]

iex> HL7v2.Type.ELD.encode(%HL7v2.Type.ELD{segment_id: "PID", segment_sequence: "1"})
["PID", "1"]

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

iex> HL7v2.Type.ELD.encode(%HL7v2.Type.ELD{})
[]

parse(components)

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

Parses an ELD from a list of components.

Examples

iex> HL7v2.Type.ELD.parse(["PID", "1", "4", "101&Required field missing&HL70357"])
%HL7v2.Type.ELD{
  segment_id: "PID",
  segment_sequence: "1",
  field_position: "4",
  code_identifying_error: %HL7v2.Type.CE{identifier: "101", text: "Required field missing", name_of_coding_system: "HL70357"}
}

iex> HL7v2.Type.ELD.parse(["PID", "1"])
%HL7v2.Type.ELD{segment_id: "PID", segment_sequence: "1"}

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