Error Location (ERL) -- HL7v2 composite data type.
Identifies the exact location of an error in a received message.
6 components:
- Segment ID (ST)
- Segment Sequence (NM)
- Field Position (NM)
- Component Number (NM)
- Sub-Component Number (NM)
- Source Table (ID)
Summary
Types
@type t() :: %HL7v2.Type.ERL{ component_number: HL7v2.Type.NM.t() | nil, field_position: HL7v2.Type.NM.t() | nil, segment_id: binary() | nil, segment_sequence: HL7v2.Type.NM.t() | nil, source_table: binary() | nil, sub_component_number: HL7v2.Type.NM.t() | nil }
Functions
Encodes an ERL to a list of component strings.
Examples
iex> HL7v2.Type.ERL.encode(%HL7v2.Type.ERL{segment_id: "PID", segment_sequence: "1", field_position: "5"})
["PID", "1", "5"]
iex> HL7v2.Type.ERL.encode(%HL7v2.Type.ERL{segment_id: "PID", segment_sequence: "1", field_position: "5", component_number: "2"})
["PID", "1", "5", "2"]
iex> HL7v2.Type.ERL.encode(nil)
[]
Parses an ERL from a list of components.
Examples
iex> HL7v2.Type.ERL.parse(["PID", "1", "5", "2", "1", "HL70001"])
%HL7v2.Type.ERL{segment_id: "PID", segment_sequence: %HL7v2.Type.NM{value: "1", original: "1"}, field_position: %HL7v2.Type.NM{value: "5", original: "5"}, component_number: %HL7v2.Type.NM{value: "2", original: "2"}, sub_component_number: %HL7v2.Type.NM{value: "1", original: "1"}, source_table: "HL70001"}
iex> HL7v2.Type.ERL.parse(["PID", "1", "5"])
%HL7v2.Type.ERL{segment_id: "PID", segment_sequence: %HL7v2.Type.NM{value: "1", original: "1"}, field_position: %HL7v2.Type.NM{value: "5", original: "5"}}
iex> HL7v2.Type.ERL.parse([])
%HL7v2.Type.ERL{}