HL7.Segment (elixir_hl7 v0.8.0) View Source

Filter, parse and modify individual HL7 segments and their fragments.

Link to this section Summary

Functions

Extracts content from a parsed HL7 segment, returning nested data by applying each supplied index in turn. Please note that HL7 indices start at 1.

Updates content within a parsed HL7 segment, returning a modified segment whose data has been transformed at the given indices (starting at 1 as with HL7's convention). The transform can be either a string, list or fn old_data -> new_data.

Link to this section Types

Specs

content_hl7() :: raw_hl7() | parsed_hl7()

Specs

fragment_hl7() :: String.t() | [list() | String.t()]

Specs

parsed_hl7() :: [segment_hl7()] | HL7.Message.t()

Specs

raw_hl7() :: String.t() | HL7.RawMessage.t()

Specs

segment_hl7() :: [fragment_hl7()]

Link to this section Functions

Link to this function

get_part(data, field, repetition \\ nil, component \\ nil, subcomponent \\ nil)

View Source

Specs

get_part(
  segment_hl7() | fragment_hl7(),
  field :: pos_integer(),
  repetition :: pos_integer() | nil,
  component :: pos_integer() | nil,
  subcomponent :: pos_integer() | nil
) :: nil | list() | binary()

Extracts content from a parsed HL7 segment, returning nested data by applying each supplied index in turn. Please note that HL7 indices start at 1.

Link to this function

replace_part(segment, transform, field, repetition \\ nil, component \\ nil, subcomponent \\ nil)

View Source

Specs

replace_part(
  segment_hl7(),
  fragment_hl7() | (fragment_hl7() -> fragment_hl7()),
  pos_integer(),
  pos_integer() | nil,
  pos_integer() | nil,
  pos_integer() | nil
) :: segment_hl7() | String.t()

Updates content within a parsed HL7 segment, returning a modified segment whose data has been transformed at the given indices (starting at 1 as with HL7's convention). The transform can be either a string, list or fn old_data -> new_data.