ex_hl7 v1.0.0 HL7.Lexer

Lexer used by the HL7 parser to retrieve tokens from a buffer.

Link to this section Summary

Functions

Create a new Lexer instance

Checks that the characters in the string are printable ASCII and ISO-8859-1 (Latin 1) characters.

Reads a token from a buffer containing an HL7 message

Put back a token into the lexer so that it is the first one to be returned in the next call to Lexer.read/2

Checks that the string is a valid segment ID.

Link to this section Types

Link to this type

option()

option() :: {:input_format, :text | :wire}
Link to this type

state()

state() ::
  :read_segment_id | :read_delimiters | :read_separator | :read_characters
Link to this type

t()

t() :: %HL7.Lexer{
  escape_char: byte(),
  next_tokens: [token()],
  separators: tuple(),
  state: state(),
  terminator: byte()
}
Link to this type

token()

token() ::
  {:separator, HL7.Type.item_type() | :segment}
  | {:literal, binary()}
  | {:value, binary()}

Link to this section Functions

Link to this function

new(options \\ [])

new([option()]) :: t()

Create a new Lexer instance

Link to this function

printable?(arg)

printable?(binary()) :: boolean()

Checks that the characters in the string are printable ASCII and ISO-8859-1 (Latin 1) characters.

Link to this function

read(lexer, buffer)

read(t(), binary()) ::
  {:token, {t(), token(), binary()}}
  | {:incomplete, {t(), binary()}}
  | {:error, any()}

Reads a token from a buffer containing an HL7 message

Link to this function

read_characters(lexer, buffer)

Link to this function

read_delimiters(lexer, buffer)

Link to this function

read_segment_id(lexer, buffer)

Link to this function

read_separator(lexer, buffer)

Link to this function

unread(lexer, token)

unread(t(), token()) :: t()

Put back a token into the lexer so that it is the first one to be returned in the next call to Lexer.read/2

Link to this function

valid_segment_id?(arg1)

valid_segment_id?(binary()) :: boolean()

Checks that the string is a valid segment ID.