MLLP.Ack (mllp v0.9.4)

Handles all Ack message operations including getting ack messages for a given HL7 message, creating the ack for a given message, and handling the return value for different ack codes.

Link to this section Summary

Functions

Gets the ack message for a given message and its application status

Verifies the ack code in the ack message against the original HL7 message. Possible valid codes and their values include: AA -- Application Accept CA -- Application Accept AR -- Application Reject CR -- Application Reject AE -- Application Error CE -- Application Error

Link to this section Types

Link to this type

ack_verification_result()

Specs

ack_verification_result() ::
  {:ok, atom(), t()}
  | {:error, atom(), t()}
  | {:error, :bad_ack_code, String.t()}
  | {:error, :bad_message_control_id, String.t()}
  | {:error, :invalid_message, String.t()}
  | {:error, :invalid_ack_message, String.t()}
Link to this type

dispatcher_result()

Specs

dispatcher_result() ::
  {:ok, :application_accept | :application_error | :application_reject}

Specs

t() :: %MLLP.Ack{
  acknowledgement_code: nil | String.t(),
  hl7_ack_message: nil | HL7.Message.t(),
  text_message: String.t()
}

Link to this section Functions

Link to this function

get_ack_for_message(message, code, text_message \\ "")

Specs

get_ack_for_message(
  message :: HL7.Message.t() | String.t(),
  acknowledgement_code :: atom() | String.t(),
  text_message :: String.t()
) :: HL7.Message.t()

Gets the ack message for a given message and its application status

Link to this function

verify_ack_against_message(bad_message, bad_ack)

Specs

verify_ack_against_message(
  message :: String.t() | HL7.Message.t(),
  ack_message :: String.t() | HL7.Message.t()
) :: ack_verification_result()

Verifies the ack code in the ack message against the original HL7 message. Possible valid codes and their values include: AA -- Application Accept CA -- Application Accept AR -- Application Reject CR -- Application Reject AE -- Application Error CE -- Application Error

All other possible codes would be considered bad ack codes and the method returns :error