# `HL7v2.Type.ELD`
[🔗](https://github.com/Balneario-de-Cofrentes/hl7v2/blob/v3.10.1/lib/hl7v2/type/eld.ex#L1)

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 `&`

# `t`

```elixir
@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
}
```

# `encode`

```elixir
@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`

```elixir
@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{}

---

*Consult [api-reference.md](api-reference.md) for complete listing*
