ex_hl7 v0.4.2 HL7.Composite

Generic functions used by HL7 composite field macros

Link to this section Summary

Functions

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

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

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

Link to this section Types

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

Link to this section Functions

Link to this function decode(composite, descriptor, tuple)
decode(t, [descriptor], binary | tuple) :: t | no_return

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

Link to this macro empty?(value) (macro)

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

Link to this function encode(composite, descriptor)
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.

Link to this function encode(composite, list, acc)
Link to this function maybe_decode_value(value, type)
Link to this function maybe_encode_value(value, type)
Link to this function new(composite_id)
new(HL7.Type.composite_id) :: {module :: atom, t}
Link to this function to_iodata(composite, descriptor, options)
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.