Theminimum HL7 sequence number is 1. The maximum HL7 sequence number is 2 billion. A
sequencenumber of “0“ is used to start a session. If the sequence numbers between the Adapter
andthe external cannot be reconciled during start or when exchanging messages, the Adapter
shutsdown and wait for human intervention as dictated by the HL7 Standard.
FailedMessage Handling
TheAdapter can be congured to send failed or skipped messages (destined for the external
system)to a JMS-based error queue. Messages that fail validation are also written to the error
queue.Note that the inbound mode of the Adapter will not write messages that fail the MLLP
andHLLP validation. These are automatically NAKed and not passed to the Collaboration, but
arelogged to the Adapter’slog le.
Thefailed or skipped message is written to the JMS queue and the error type and message are
writtenas the JMS properties:
Error:the actual error message or NAK
ErrorType: the type of error, such as HL7_NAK_error or HL7_Validation_error.
Skippedmessages are those which are continuously NAKed by the external system and thus are
skippedif the Adapter is congured accordingly. If the Adapter is congured for any other
recourseaction other than skip, the message remains in the queue.
RecourseActions
TheTCP/IP HL7 Adapter recourse actions include Reset, Resend, Skip Message, and Exit.
OnReset, the Adapter drops its connection and then attempts to reconnect.
OnResend, the sequence number le and journal le are opened again (provided the newly
loadedconguration parameters are set for sequence numbering and journaling).
OnSkip Message, the Adapter remains connected, but writes the message to an error queue.
OnExit, the Adapter closes its journal le and sequence number le (provided these were
conguredfor use). The Adapter terminates its connection with the external system and
shutsdown. This allows you to modify these les and resolve any errors. Once the
correctionsare made, the Adapter can be reactivated from the Enterprise Manager.

Stoppingthe Collaboration with a Fatal Alert

Whenthe Exit recourse action is triggered it logs the error that caused the action. It also shuts
downthe Collaboration, which in turn causes the HL7 message to roll back, and then sends an
alertto the Enterprise Manager.
TheExit Recourse Action calls the fatal alerter in the Collaboration:
alerter.fatal(’’error message’’,’’HL7’’);
SunAdapterfor TCP/IP HL7 Overview
SunAdapterfor TCP/IP HL7 User's Guide 21