ex_hl7 v0.3.0 HL7.Composite

Generic functions used by HL7 composite field macros

Summary

Functions

Creates the map corresponding to the underlying struct in a composite field

Converts the struct holding the composite field data into the tuple format accepted by the functions in HL7.Writer

Converts a composite field into an iolist suitable to send over a socket or write to a file

Macros

Checks if a composite field is empty. This function is implemented as a macro so that it can be used in guards

Types

descriptor :: {name :: atom, type :: atom}
option ::
  {:separators, [{key :: atom, separator :: byte}]} |
  {:trim, boolean}
t :: map

Functions

decode(composite, descriptor, tuple)

Specs

decode(t, [descriptor], binary | tuple) ::
  t |
  no_return

Creates the map corresponding to the underlying struct in a composite field.

encode(composite, descriptor)

Specs

encode(t, [descriptor]) ::
  HL7.Type.field |
  no_return

Converts the struct holding the composite field data into the tuple format accepted by the functions in HL7.Writer.

encode(composite, list, acc)
id(composite)

Specs

maybe_decode_value(value, type)
maybe_encode_value(value, type)
module(id)

Specs

module(HL7.Type.composite_id) :: atom
new(composite_id)

Specs

new(HL7.Type.composite_id) :: {module :: atom, t}
to_iodata(composite, descriptor, options)

Specs

to_iodata(t, [descriptor], [option]) ::
  iodata |
  no_return

Converts a composite field into an iolist suitable to send over a socket or write to a file.

Macros

empty?(value)

Checks if a composite field is empty. This function is implemented as a macro so that it can be used in guards.