This document provides information and instructions for working with the Sun Adapter for TCP/IP HL7. It is divided into the topics listed below.
What You Need to Know
These topics provide information that is useful to know before you start working with the TCP/IP HL7 Adapter:
What You Need to Do
These links provide information and instructions for working with the TCP/IP HL7 Adapter in Java CAPS projects:
Adding a TCP/IP HL7 External Application to a Connectivity Map
Modifying the TCP/IP HL7 Adapter Properties in the Connectivity Map
Additional Information
These links provide additional information that is useful to know when working with the TCP/IP HL7 Adapter:
The following topics provide information about HL7 and the TCP/IP HL7 Adapter:
The Sun Adapter for TCP/IP HL7 is a component of the Sun Java Composite Application Suite (Java CAPS) that enables the Java CAPS ESB system to exchange data with an external TCP/IP application using the HL7 data protocol. The Sun Java CAPS ESB with the TCP/IP HL7 Adapter provides:
Macro functionality, providing ease of use and productivity.
Prebuilt standards-compliant inbound and outbound template Collaborations that you can use as is or that you can modify for your specific needs.
A complete set of configurable properties that allow you to customize the functionality of the Adapter. The functions can further be customized by modifying the Collaborations.
Journaling and error messaging to JMS queues and topics. This is in addition to Sun Java CAPS ESB’s standard alert and debug logging.
Support for HL7 Standard versions 2.1, 2.2, 2.3, 2.3.1, 2.4, 2.5, 2.5.1, 2.6 and V3.
Throughout this document the term “JMS queue” is used in the generic sense and actually denotes JMS queues or topics.
The TCP/IP HL7 Adapter includes the following features:
Bidirectional processing, including client or server mode in either direction (to or from Sun Java CAPS ESB).
Handles both HL7 HLLP and MLLP protocols and envelopes.
Provides a wide variety of recourse action configurations.
Non-blocking I/O.
Recovery and retry logic.
Debug levels and error logging.
Journaling of HL7 messages and associated acknowledgements.
HL7 acknowledgement levels.
Fully supports the HL7 sequence numbering protocol.
Full support for HL7 ACK and NAK generation and validation.
Supports delayed ACK in both directions.
The TCP/IP HL7 Adapter incorporates three components:
The HL7 TCP/IP Resource Adapter that implements the lower layer HL7 protocol over TCP/IP.
Default inbound and outbound Collaborations that implement the HL7 messaging protocol, sequence numbering, and recourse actions.
Generic HL7 Message Libraries that provide the structures necessary to parse and create the data messages and ACKs used by the protocol.
The TCP/IP HL7 Message Library, also known as an Object Type Definition (OTD) Library, enables the creation of HL7 interfaces capable of running over TCP/IP, and also utilizes the common Adapter services available in Java CAPS. The TCP/IP HL7 Adapter works hand in hand with the Sun Java CAPS HL7 Message Libraries, versions 2.1 through 2.5.1.
The TCP/IP HL7 Adapter properties allow the user to easily configure the operation of the TCP/IP HL7 Adapter. The Adapter includes a set of properties that are configured in the Connectivity Map and only apply to that Adapter in the Project. It also includes a set of properties that are configured in the Environment and apply to all TCP/IP HL7 Adapters in the Project. These properties are adopted into the Message Library’s functions.
The Message Library handles all of the lower-layer protocol. The Message Library’s behavior is customized using the Adapter configuration properties. These Adapter properties are used by the resource adapter, but are also accessed and used by the prebuilt Collaborations.
HL7 is a standard for exchanging information between medical applications and is an abbreviation of Health Level Seven. Level Seven refers to the seventh OSI layer protocol for the health environment. HL7 defines the format and the content of the messages that applications must use when exchanging data with each other under various circumstances.
Hospitals and other medical institutions typically use many different types of systems to communicate with one another. Everything, from patient records to billing information, is tracked and recorded in computer systems. In order for these different types of systems to communicate with each other, they use a standard like HL7.
In the computer world, a protocol is a formal, well-defined standard for exchanging information between computer applications.
An important part of the HL7 standard is the ACKnowledgment protocol, also known as an ACK. Every time an application accepts a message and consumes the data, it is expected to send an ACKnowledgment message back to the sending application. The sending application is expected to keep on sending a message until it has received an ACK message.
The TCP/IP HL7 Adapter's functionality comes from a combination of the TCP/IP HL7 Resource Adapter (RA), the predefined inbound and outbound HL7 Collaborations, and the generic HL7 Message Libraries.
The TCP/IP HL7 Resource Adapter communicates with external HL7 systems, establishes and maintains the TCP/IP socket, manages message enveloping, maintains the sequence numbering file, and provides the HL7 protocol state to the Collaboration. The RA (Resource Adapter) is configured from the Adapter Properties Editor.
The inbound and outbound HL7 Collaborations provide message validation, sequence numbering, ACK and NAK generation, and recourse actions. The predefined HL7 Collaborations are designed to implement the HL7 standard protocol and inter-operate with similar standard compliant systems by simply changing the Adapter property configuration.
If a system does not conform to the HL7 specification, the Collaborations can be modified for that transaction by changing the Java code using the Collaboration Editor. The Collaborations Java code is designed to be available and “transparent” so you can easily reference the predefined Java code to see how it currently handles HL7 transactions and make the appropriate modifications.
The Collaboration Editor allows you to create and edit Java code to modify a Collaboration for your specific needs. In many cases this code can be created graphically (drag and drop), using the Collaboration Editor’s Business Rules Designer. If you need to change the code of a prebuilt Collaboration, you should duplicate the Collaboration first and then modify it.
The Collaborations are designed to target one unit of work at a time, meaning the resolution of one message at a time. Once the current message transaction is resolved, the Collaboration is free to process the next HL7 message. The general form of the Collaborations is a state machine. Based on the state of the connection, the Collaboration performs the appropriate action. Additional Collaborations can be added to a Project to increase message flow.
The generic HL7 Message Libraries are version-agnostic structures used to send and receive HL7 messages, acknowledgements, and negative acknowledgements (NAKs). They provide the Collaboration with only the essential fields for implementing the HL7 protocol. If you need to perform functions that are specific to a version or message type, you can add the appropriate Message Library to the Collaboration.
The TCP/IP HL7 Adapter takes advantage of the Java CAPS facilities to provide journaling and error messaging, as well as monitoring, alerting, and logging. journaling and error messages are sent to JMS queues, which allow flexibility for postprocessing. For example, invalid messages and their negative acknowledgements (NAKs) are sent to a JMS queue. This JMS queue can then be set up to allow the invalid HL7 messages to be viewed, corrected, and resubmitted automatically to the same Adapter.
Error Queues
Each Collaboration automatically sends invalid messages that have incorrect data, have invalid formatting, or are deemed unacceptable to a JMS error queue. The error generated by the message and, if appropriate, its associated NAK, are written as JMS properties of that message for later processing. You can send errors to one common queue, to a specified queue for each Adapter, or to a combination of both.
Journaling Queues
When journaling is enabled, the HL7 message and its related acknowledgement (ACK) are written to a JMS journal queue. You determine the number of JMS error queues or journal queues used by a Project. From the JMS queue, these messages can be accessed and written to file, sent to a database, sent to a Web application for processing, and so forth.
Monitoring
The Enterprise Manager provides a real-time picture of the Adapter's state and status. The monitoring facilities display the following information:
Adapter up or down
Connected to external
Current sequence number
Date and time of the last transaction
Adapter properties
Alerts
Alerts are sent from the RA and the Collaborations when conditions are identified that endanger or stop the interface. You can add your own custom alert messages to the Collaborations.
Logging
Log messages are written from both the RA and the Collaborations. You can also configure your own log messages. The level is set in the Enterprise Manager. For more information on monitoring, alerting and logging, see Using Enterprise Manager Management Application in Java CAPS and Alert Codes for Java CAPS Adapters.
The TCP/IP HL7 Adapter can operate in two modes: standard and delayed ACK. Standard mode is the typical message exchange in HL7 where an HL7 message is sent and an HL7 ACK is received, or the other way around. In delayed ACK mode, the exchange of a message requires two acknowledgements: one to confirm the message was received and the other from the external system that actually received the message to verify that it was received.
In these two modes, the Adapter and the ESB have a number of roles they play within certain scenarios; that is, certain components can fulfill different responsibilities within a protocol. For example, the outbound Collaboration can fulfill two roles in the delayed ACK mode: one as the “sender of messages” that expects two delayed ACKS, and another as the “forwarder of ACKS” from the external system.
Delayed ACK mode is deprecated as of HL7 version 2.2 and was removed from the HL7 standard as of version 2.5.
In standard mode, the HL7 Adapter can assume two roles, sender and receiver. These are implemented in the outbound and inbound Collaborations respectively.
The outbound Collaboration is the implementation of the Sender and the RA is configured for an outbound data flow. A Java CAPS Service forwards the data to the Adapter, which in turn forwards the data to the accepting HL7 external system. The External System responds with an ACK or NAK response.
The inbound Collaboration is the implementation of the Receiver role in conjunction with the RA being configured for inbound direction. The Adapter accepts a message from the sending HL7 external system, forwards the data to a Java CAPS Service, and responds to the sending system with an ACK or a NAK response.
Delayed ACK mode is an extension to the basic HL7 message exchange mode, where there is some middleware component between the Sender and the Receiver. The sending system expects to receive the ACK from the receiving system in addition to the middleware component. In this mode, the ESB can assume two roles in the protocol: as the Sender and as the Receiver.
ESB Sender Role
In this role, the ESB acts as the Sender in the exchange. The HL7 RA is configured for the outbound direction, and the HL7 outbound Collaboration is configured so the Sends App Ack property is set to True. This parameter is used even though the ESB technically does not send an application ACK. Rather, it receives the application ACK and provides the compliment behavior to the ACK sent by the inbound configured Adapter. The two are related in the protocol.
The purpose of this role is for the ESB to act as if it is a system that requires the Delayed ACKs so that it can communicate with a system that operates in the Delayed ACK Receiver role. An example implementation of this role is available in the HL7Outbound sample Project.
ESB Receiver and Forwarder Role
To perform this role, the ESB is configured with two instances of the HL7 Adapter , each performing its own role as Receiver or Forwarder.
For Delayed ACK, the Receiver and Forwarder must be on the same integration server.
The following steps convey the steps taken in this scenario.
The Receiver accepts the HL7 message. It then returns the first ACK, with an MSH - 5, value “D” (for the Delayed ACK), to the Sender.
The Receiver sends the message to the Forwarder.
The Forwarder sends the message to the receiving External System.
The receiving External System sends an ACK to the Forwarder.
The Forwarder receives the ACK from the External and forwards it on to the Receiver.
The Receiver then forwards the ACK, with an MSH - 5, value “F” indicating that it is the receiving External System’s ACK, to the Sender.
In the Receiver role, the HL7 RA is configured for inbound, and the inbound Collaboration is used with the parameter Sends App Ack set to true. In the Forwarder role, the RA is set to outbound, the parameter Forward External Acks to eGate, is set to true, and the outbound Collaboration is selected.
This configuration table presents the necessary parameters used to configure the Adapter to assume the Delayed ACK roles
Table 1 Adapter Delayed ACK Configuration
Role |
Direction |
Sends App Ack Property |
Forward External Acks |
---|---|---|---|
Sender |
Out |
True |
N/A |
Receiver |
In |
True |
N/A |
Forwarder |
Out |
N/A |
True |
An example of the receiver role is provided in the prjHL7Inbound sample Project. The prjHL7Outbound Project provides a sample implementation of the Forwarder role.
The inbound TCP/IP HL7 Adapter Project, prjHL7Inbound, provides a sample implementation of an inbound flow using the Adapter. It can be configured for standard inbound mode or for forward message mode.
The inbound TCP/IP HL7 Adapter Project receives HL7 messages from an external system, sends an acknowledgement of the message to the external, provides sequence numbering, writes the HL7 message to a JMS data queue, and also writes the HL7 message and ACK to a JMS journal queue. Any error messages and NAKs are sent to a JMS error queue.
The HL7 data is processed so all the fields in the MSH segment of the message are stored in an internal structure to generate an HL7 response. Non-HL7 data, including HL7 acknowledgments, automatically generate warnings in the Adapter’s log file and send an HL7 NAK to the external system.
The following steps describe the flow of data for an inbound Adapter:
The external system sends the HL7 message to the Adapter.
The Collaboration receives the HL7 message.
The Collaboration validates the message (if validate is enabled). If it fails, the Collaboration takes the configured recourse action. If the recourse action is stripped and the maximum number of retries has been exceeded, the message and error are written to the error queue.
The Collaboration writes the message to the data queue.
The Collaboration then creates the appropriate ACK and sends it to the RA.
The RA envelopes the ACK and sends it to the External System.
If journaling is enabled, the message and its ACK are written to the journal queue.
The Inbound Receiver Message mode is used when the Delayed ACK is configured to fulfill the role of the Receiver in the Delayed ACK scenario. It accepts the message and acknowledges the External and then forwards the message to the component fulfilling the Forwarder role. It then accepts the ACK from the Forwarder and passes it on to the External that sent the message.
The following steps describe the Inbound Forward Message Role:
The Sender External, sends an HL7 message to the Inbound Adapter, which is configured as a Receiver (Sends App Acks is enabled).
The Inbound Adapter receives the HL7 message and returns the first Acknowledgement to the External with an MSA - 5, value “D” for Delayed Acknowledgement. The External receives the ACK, validates the ACK (verifying that it is a Delayed ACK), and waits for another ACK.
The Inbound Adapter creates a JMS message with the HL7 message as the payload, creates a “reply to” destination, and forwards the HL7 message to the Outbound Forwarder (to a JMS destination).
The Outbound Forwarder gets the HL7 message and forwards the message to the External System.
The External System receives the HL7 message and returns the HL7 ACK message to the Outbound Forwarder.
The Outbound Forwarder gets the HL7 ACK message and sends it to the Inbound Receiver Adapter using the “reply to” destination.
The Receiver External reads the HL7 ACK message and forwards the second HL7 ACK message with an MSA - 5, value “F”to the Sender External. The Sender External then takes the appropriate action: for example, journaling the HL7 message and the HL7 ACK.
Message verification begins with reading the message from the external system. The message is expected to match the MLLP envelope, since both HLLP and MLLP envelopes have the Start of Block (SOB), End of Data (EOD), and a Carriage Return (CR) in common.
If a message fails the read verification, it is considered bad data. If read by an inbound Adapter, this failure causes the Adapter to generate a Canned HL7 NAK. An outbound Adapter ignores the message and logs a warning, reporting the nature of the problem to the log file.
An HLLP envelope needs further verification as to whether it is data or a NAK, as well as the Block Checksum and Block Size. The Adapter behaves as described above if the HLLP envelope verification fails.
After stripping the message envelope, the RA hands the de-enveloped message to the inbound Collaboration where it is parsed into the generic event Message Library. This ensures that the general form and MSH segment are valid. If the MSH property is set, the Collaboration verifies that the fields specified in the HL7 segment section are the same as those of the received MSH, otherwise, a NAK is returned.
Adapter Generates HL7 Acknowledgment
In this scenario, the Adapter generates an HL7 ACK after receiving and successfully storing the message in a queue; otherwise, it generates an HL7 NAK. The HL7 ACK or NAK is placed in the proper envelope and sent to the external system.
ESB Sends HL7 Acknowledgement
In this scenario, the Adapter acts as a receiver in a Delayed ACK scenario, as described in Inbound Receiver Message Mode.
Canned HL7 NAK
A canned HL7 NAK is created when a read error occurs or when an message cannot be identified as an HL7 message. The initial test ensures that the message conforms to the lower-layer protocol. The Resource Adapter uses the MSH section parameters to create an appropriate NAK.
Recourse actions can be configured for an inbound Adapter for the following conditions. For more information, see Recourse Actions.
The empty read limit is reached.
The maximum number of NAKs are received by the Adapter.
The maximum number of NAKs are sent by the Adapter.
The maximum number of response timeouts is reached.
A NAK response is received.
No response is received after a message is sent the maximum number of times.
The outbound TCP/IP HL7 Adapter Project, prjHL7Outbound, can be implemented in standard outbound mode or in two forward message modes: outbound delayed ACK or outbound forwarder.
In outbound mode, the Adapter receives HL7 messages from a JMS queue. Each message is verified to ensure it contains HL7 data only. Legitimate HL7 data is enveloped into its configured format and sent to the external system.
A message in the JMS queue triggers the outbound Collaboration. The outbound Collaboration is provided with an HL7 message to send to the external system
The Adapter waits for a configurable number of milliseconds for an incoming HL7 ACK or NAK from the external system. After receiving an HL7 response from the external system, the Adapter strips the message from its envelope and verifies its integrity.
Any non-HL7 acknowledgment received from the external system causes the Adapter to resend the same message. If the incoming response is an HL7 ACK or NAK, the Adapter might do either of the following, as dictated by its configuration:
Recourse action on NAK received.
Recourse action on Max NAK received.
If journaling is set, these messages and their ACKs are placed in the journal file.
The following steps describe the process for the Outbound Standard Message Mode:
An HL7 message triggers the Collaboration. The outbound Collaboration is designed to accept the HL7 messages.
The Collaboration maps the received message into the Generic Event Message Library and validates the MSH segment. If validation is enabled, the Collaboration checks the MSH segment of the outbound messages against MSH values configured in the Adapter properties file. If the validation fails or the message cannot be parsed, the message and its error are written to the error queue. Note that the HL7 message is always checked for structural correctness.
The Collaboration sends the message to the RA.
The RA envelopes the message and sends it to the External System and waits for an ACK.
The Collaboration receives and validates the ACK, and then journals the ACK and the HL7 message (if journaling is enabled). If the Collaboration receives a NAK, the NAK and the HL7 message are sent to the error queue.
Finally, the Collaboration commits the JMS receive.
The outbound Adapter can fulfill two roles in a delayed ACK scenario. The outbound delayed acknowledgement mode is used to communicate with an external system that is configured to receive messages in a delayed ACK way; that is, it receives two ACKs. One confirms the message was received, and the other is from the application that accepts the message. For delayed ACK mode, the process is similar to that of the standard outbound mode, except that it receives two ACKs. The initial ACK comes from the receiving system.
The following steps describe the outbound delayed acknowledgement role process displayed:
The outbound Adapter, which is configured as Delayed Acknowledgement role, receives a message from JMS, and sends the message to the External System.
The External System receives the message and returns the first Acknowledgement to the outbound Adapter with an MSA - 5, value “D” for Delayed Acknowledgement. The outbound Adapter receives the ACK, validates the ACK (verifying that it is a Delayed ACK), and waits for another ACK.
The outbound Adapter receives another HL7 ACK message (the second) and validates that the second HL7 ACK message is an MSA - 5, with a value of “F.” If the second ACK is valid, the Adapter commits the message, otherwise it resends the message.
The Outbound Forward Message role is used in conjunction with the with the inbound Adapter, which is also configured to handle delayed ACKs. No validation is preformed: the Adapter acts as a “pass-through.”
The following steps describe the Outbound Forwarder Role processing:
Data is received by the Collaboration, from the JMS queue.
The Collaboration extracts the JMS property “reply to” destination from the message, but does no validation, and sends the message to the External System.
The Adapter receives the ACK from the External System.
The Collaboration sends the ACK to the temporary topic that was contained in the “reply to.”
For Delayed ACK, the Receiver and Forwarder must be on the same integration server.
The only verification that the outbound Adapter does is to ensure that the message parses into the generic Event Message Library, and that the MSH uses the correct fields. The acknowledge is verified to ensure that the sent message is valid.
Adapter Generates HL7 Acknowledgment
In this scenario, the Adapter generates an HL7 ACK after receiving and successfully storing the message in a queue; otherwise, it generates an HL7 NAK. The HL7 ACK or NAK is placed in the proper envelope and sent to the external system.
ESB Sends HL7 Acknowledgement
In this scenario, the Adapter acts as a sender in a Delayed ACK scenario, as described in Delayed ACK Mode.
Canned HL7 NAK
A Canned HL7 NAK is created when a read error occurs, or when an message cannot be identified as an HL7 message. The initial test ensures that the message conforms to the lower-layer protocol. The Resource Adapter uses the MSH section parameters to create an appropriate NAK.
Recourse actions can be configured for the outbound Adapter for the following conditions:
The Adapter sends the maximum number of canned negative acknowledgments.
The Adapter attempts to read data the maximum number of times from the external system after a read or receive operation returns nothing.
The Adapter receives the maximum number of negative acknowledgments.
HL7 message validation fails prior to the sending of the HL7 message to the external system.
The Adapter reaches the maximum number of response timeouts while waiting for data from the external system.
The Adapter receives an HL7 Application NAK from the external system.
The Adapter waits for a response from the external system for the configured amount of time (in milliseconds).
For more information on the available recourse actions, see Recourse Actions.
The TCP/IP HL7 Adapter includes internal counters that keep track of all error conditions.
This section explains the Adapter’s general functions and features. It includes the following topics:
The non-blocking I/O feature prevents the Adapter from locking up when attempting to read or write data blocks, allowing the Adapter to continue its operation in case of any communication errors. If the read attempt fails for a configurable number of times, the Adapter exits or resets its connection to the external system, depending on its configuration. In the event of a failed write, the Adapter can resume its write operation to pick up where it previously left off until the entire message is successfully sent.
Without this feature, the Adapter might lock up when a read or write failure occurs and be unresponsive to all external messages, including requests from the user or the Enterprise Monitor (for status).
The Adapter can be configured to use HL7 sequence numbering. The negotiation and incrementation of this number is automatically performed by the Adapter. For more details on HL7 sequence numbering, refer to Appendix C (Lower Layer Protocols) of the HL7 Standard for the HL7 version you are using.
When the Adapter is configured for HL7 sequence numbering, the sequence number file opens when the Adapter starts up. If the sequence number file does not exist, one is created and populated with a zero sequence number. The sequence number file is updated on the inbound Adapter when the Adapter generates the HL7 ACK (this process is transparent to the user), and when the outbound Adapter receives the HL7 ACK from the external system.
If you want to change the sequence number at runtime, you need to suspend the Adapter, edit and save the sequence number file, and reactivate the Adapter. To force the Adapter to resynchronize its sequence number with the external system, you need to suspend the Adapter, edit the file so it contains a “-1”, and then reactivate the Adapter.
The minimum HL7 sequence number is 1. The maximum HL7 sequence number is 2 billion. A sequence number of “0“ is used to start a session. If the sequence numbers between the Adapter and the external cannot be reconciled during start or when exchanging messages, the Adapter shuts down and wait for human intervention as dictated by the HL7 Standard.
The Adapter can be configured 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 and HLLP validation. These are automatically NAKed and not passed to the Collaboration, but are logged to the Adapter’s log file.
The failed or skipped message is written to the JMS queue and the error type and message are written as the JMS properties:
Error: the actual error message or NAK
Error Type: the type of error, such as HL7_NAK_error or HL7_Validation_error.
Skipped messages are those which are continuously NAKed by the external system and thus are skipped if the Adapter is configured accordingly. If the Adapter is configured for any other recourse action other than skip, the message remains in the queue.
The TCP/IP HL7 Adapter recourse actions include Reset, Resend, Skip Message, and Exit.
On Reset, the Adapter drops its connection and then attempts to reconnect.
On Resend, the sequence number file and journal file are opened again (provided the newly loaded configuration parameters are set for sequence numbering and journaling).
On Skip Message, the Adapter remains connected, but writes the message to an error queue.
On Exit, the Adapter closes its journal file and sequence number file (provided these were configured for use). The Adapter terminates its connection with the external system and shuts down. This allows you to modify these files and resolve any errors. Once the corrections are made, the Adapter can be reactivated from the Enterprise Manager.
When the Exit recourse action is triggered it logs the error that caused the action. It also shuts down the Collaboration, which in turn causes the HL7 message to roll back, and then sends an alert to the Enterprise Manager.
The Exit Recourse Action calls the fatal alerter in the Collaboration:
alerter.fatal(’’error message’’,’’HL7’’); |
The argument error message is the user-configured alert message. The argument HL7 is the source component (this must be “HL7”).
The alerter.fatal("error msg", "HL7") method is only applicable to the packaged TCP/IP HL7 Collaborations.
The Exit recourse action should be applied to any error condition that requires human intervention to correct an error. Once the error condition is resolved, the Collaboration can be restarted from the Enterprise Manager.
The following topics explain the basic elements of the TCP/IP HL7 Adapter’s general operation:
The TCP/IP HL7 Adapter can be configured as either HL7 inbound or HL7 outbound. This option is determined automatically by the Adapter’s binding (link) in the Connectivity Map.
The connection type indicates how the Adapter establishes a TCP/IP connection. The role can be as a Client, where the RA connects to the external, or as a Server, where the RA waits for a connection.
Connected as a TCP/IP HL7 Client
As a TCP/IP HL7 client, the Adapter connects to external server (host/port) and establishes a connection (in active mode).
Connected as a TCP/IP HL7 Server
The Adapter waits and listens to a specific port for incoming connection requests from an external client. Once a request is received, the Adapter accepts the request and establishes a connection (in passive mode).
This section describes the two supported envelope types used in the HL7 protocol:
Both envelope types use the following configuration parameters. For more information on these parameters, see Lower Layer Protocol — TCP/IP HL7 V2 Inbound Adapter or Lower Layer Protocol — TCP/IP HL7 V2 Outbound Adapter.
Start Block Character
End Data Character
End Block Character
The MLLP envelope consists of a Start of Block component, a Data component, an End of Data component, and an End of Block component. The size of the HL7 Data field is determined by the length of the data (number of bytes between start and end), with a maximum size of 99999 Bytes.
The HLLP envelope consists of a Start of Block component, a ”D’ (Data) or ”N’ (NAK) indicator, an HL7 Version component, a Carriage Return, a Data component, a Block Size component, a Block Checksum component, an End of Data component, and an End of Block component. The size of the HL7 Data field is determined by the length of the data (number of bytes between start and end), with a maximum size of 99999 Bytes.
The Adapter supports sending and receiving both HL7 acknowledgement types:
Application acknowledgment: This acknowledgement is sent when the message is successfully received.
Commit (accept) acknowledgment: This acknowledgement is sent after the message is successfully and functionally processed by one receiving system.
The Adapter provides the option to journal successfully received or sent messages and their corresponding ACKs. The messages are sent to a JMS queue or topic, depending on how you configure the Adapter, and the ACKs are stored as a JMS property, HL7_ACK, of that message.
It is expected that, when enabled, the journal queue has one or more subscribers that process the contents of the queue so that it remains manageable. For example, the Batch Adapter or a database Adapter could periodically consume the messages by writing them to a file or a database.
The Adapter provides a mechanism to store failed or stripped messages in a JMS queue or topic. The advantage of this is that the messages are then saved in a form readily usable by the other data flows, that can automatically process these messages or make them available to some type of human intervention or message repair, using tools like the JMS queue editor or an eVision application.
If the Adapter loses the connection to the external system in any direction or connection type, due to a crash, shutdown, or suspension (including recourse actions), an alert is generated. The monitor’s status of that Adapter is changed to “down” and the Adapter’s icon is encased in a red warning box. The monitor also displays the number of messages it has processed along with the date and time of the last message sent.
HL7 version 2.5 adds a new SFT segment to every message. The Adapter not only sends and receives messages with the new segment, it can automatically create and populate them, using information from the Adapter properties, for the outbound message and the ACK sent from the inbound mode. This feature is only available when the Version ID property is set to 2.5 or later.
The Adapter supports delayed acknowledgements in either direction and in a number of roles. This functionality is described in detail in Outbound Adapter Roles for Delayed ACK Scenarios.
You can monitor the status of the HL7 Adapter in the deployed Projects that include the adapter. This includes viewing alerts and log messages, checking connector details, and monitoring external connections. This is done on the Enterprise Manager. For more information about using the Enterprise Manager Monitor, see Using Enterprise Manager Management Application in Java CAPS.
For outbound HL7 Adapters, periodic monitoring for external connections is performed. The time period is based on the value defined in the HL7 Adapter web application's deployment descriptor file, web.xml. Below is an excerpt from the file defining the time period.
<web-app> ... ... <!-- Default monitoring period used in monitoring the external system connection --> <context-param> <param-name>monitorperiod</param-name> <param-value>2000</param-value> </context-param> ... </web-app> |
Schematron is supported for HL7 V3 Message Libraries. The Schematron uses the concept of finding tree patterns in the parsed document rather than the grammar. This approach allows representation of numerous structures that are inconvenient and difficult in grammar-based schema languages.
For example, the following file defines a Person element that includes a Name field and a Gender field:
<?xml version="1.0" encoding="UTF-8"?> <Person> <Name>Eddie</Name> <Gender>Male</Gender> <Person> |
The above XML document can be validated against the below schematron, which defines a test for a Title field, a test for Name and Gender, and a test for the order of fields:
<?xml version="1.0" encoding="UTF-8"?> <sch:schema xmlns:sch="http://www.ascc.net/xml/schematron"> <sch:pattern name="Check structure"> <sch:rule context="Person"> <sch:assert test="@Title">The element Person must have a Title attribute<sch:assert> <sch:assert test="count(*) = 2 and count(Name) = 1 and count(Gender) = 1">The element Person should have the child elements Name and Gender.<sch:assert> <sch:assert test="*[1] = Name">The element Name must appear before element Gender.</sch:assert> </sch:rule> </sch:pattern> </sch:schema> |
In the HL7 Adapter, this schematron is useful for validating an HL7 V3 document against predefined schematron schemas that you write. You can also obtain schemas from organizations such as NHS and HL7.org. For example, NHS provides schemas for CDA documents.
You configure the schematron validation from the Connectivity Map Properties Editor. The Properties Editor includes two properties to support schematron validation:
Schematron Validation: Selecting true enables schematron validation. You then need to enter an LDAP reference.
Schematron Files: The list of schematron validation files. Use commas to separate multiple files.
The HL7 Adapter includes an API specific to schematron validation. This API is a wrapper of the Open source XSLT-based API available at http://xml.ascc.net/schematron/1.5. The API is an XSL file called metastylesheet (skeleton1-5.xsl). Applying the metastylesheet to the schematron XML document generates another XSL file. This XSL file can be applied to the input XML document to validate, which produces the output XML document that contains the results of the validation. This document can be embedded inside the V3 acknowledgement and can be sent to the original sender.
The metastylesheet can be extended and overridden so that you can customize the output XML document.
Example,
The following is an example of an output document generated after invoking the API using the XML input document and the schematron validation document described above.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <schematron-output phase="#ALL" schemaVersion="" title="" xmlns: sch="http://www.ascc.net/xml/schematron"> <active-pattern name="Check structure"/> <fired-rule context="Person" id="" role=""/> <failed-assert id="" role="" test="@Title" location="/@Person[1]"> <text>The element Person must have a Title attribute</text> </failed-assert> <schematron-output> |
Perform the following to invoke the schematron API from a Java Collaboration:
Obtaining the Factory Object
Obtaining the Validator Object
Performing the Validation
Below is a sample call to the getSchematronValidatorFactory method.
com.stc.connector.hl7.schematron.SchematronValidatorFactory factory = com.stc.connector.hl7.schematron.SchematronValidatorFactory. getSchematronValidatorFactory(); |
Below is a sample call to the getDefaultValidator method.
com.stc.connector.hl7.schematron.SchematronValidator validator = factory.getDefaultValidator( domSource ); |
In the above example, domSource is the DOMSource object of the schematron XML.
Below is a sample call to the validate method.
com.stc.connector.hl7.schematron.ValidationOutput output = validator.validate( dataSrc ); |
In the above example, dataSrc is the source of the payload. The payload can be an entire V3 XML document or a CDA document.
The ValidationOutput object contains the resulting XML document as well as a method isValid(), which returns values when the validation has passed or failed.
All Adapters contain a set of properties that are unique to that Adapter type. When you add a TCP/IP HL7 Adapter to a Connectivity Map, you can modify the properties for that specific Adapter. When you add a TCP/IP HL7 External System in the Project’s Environment, you can modify the properties for that Adapter type for all Projects that use that Environment.
You can configure the TCP/IP HL7 Adapter properties in the following locations:
Connectivity Map: These properties most commonly apply to a specific component Adapter, and may vary from other Adapters of the same type in the Project.
Environment Explorer: These properties are commonly global, applying to all Adapters of the same type in the Project. The properties are shared by all Adapters in the TCP/IP HL7 External System window.
Collaboration: Many TCP/IP HL7 Adapter properties can also be set from a Collaboration, in which case the settings override the corresponding properties in the Adapter’s configuration file. Any properties that are not overridden retain their configured default settings.
To create a TCP/IP HL7 Adapter you must first add a TCP/IP HL7 External Application to the Connectivity Map. A TCP/IP HL7 Adapter is automatically created when you link a TCP/IP HL7 External Application and a Service. Services are containers for Java Collaborations, Business Processes, Data Integrator processes, and so on.
Create a Connectivity Map for the Project, and add a Service to the Connectivity Map.
On the Connectivity Map toolbar, click the External Applications icon.
Select HL7 External Application from the menu.
A TCP/IP HL7 External Application icon appears on the Connectivity Map toolbar.
Drag the new HL7 External Application icon from the toolbar onto the Connectivity Map canvas.
To bind the External Application with the Service, do one of the following:
If messages are entering from the HL7 system, drag a link from the HL7 External Application to the Service.
If messages are being sent from the Service to the HL7 system, drag a link from the Service to the HL7 External Application.
The TCP/IP HL7 Adapter appears on the link.
Modify the Adapter properties, as described in Modifying the TCP/IP HL7 Adapter Properties in the Connectivity Map.
You can modify an Adapter's properties after it is created in the Connectivity Map. The properties you modify in the Connectivity Map apply only to the specific Adapter you are configuring. For information on modifying system-wide Adapter properties, see Configuring Sun Adapter for TCP/IP HL7 Environment Properties.
A description of each parameter is displayed in the Description box when that parameter is selected, providing an explanation of any required settings or options. Properties are also described in the following topics:
From the Connectivity Map, double-click the Adapter icon located in the link between the TCP/IP HL7 External Application and the Service.
The Adapter Properties Editor appears, and displays either inbound or outbound properties depending on the link to the Service.
In the explorer panel on the left of the Properties Editor, expand the tree until you see the category you want to modify and then select that category.
For example, to modify server port binding properties, expand TCPIP Inbound Settings and then select Server Port Binding.
Modify a property by either selecting a new value from a drop-down list (if available) or by typing a new value in the property field.
Click on the ellipsis button next to a property field to open a separate configuration dialog box. This is helpful for large values that cannot be fully displayed in the property field. Enter the property value in the dialog box and click OK. The value appears in the parameter’s property field.
(Optional) To record notes and information about the currently selected property, click inside the Comments box in the lower left of the editor and enter the text.
This information is saved for future reference.
When you are done configuring the properties, click OK.
The TCP/IP HL7 V2 inbound adapter configuration properties are organized into the following sections on the Properties Editor accessed from the Connectivity Map:
TCPIP Inbound Settings - Server Port Binding — TCP/IP HL7 V2 Inbound Adapter
TCPIP Inbound Settings - Client Connection Establishment — TCP/IP HL7 V2 Inbound Adapter
TCPIP Inbound Settings - Inbound Connection Management — TCP/IP HL7 V2 Inbound Adapter
TCPIP Inbound Schedules - Listener Schedule — TCP/IP HL7 V2 Inbound Adapter
TCPIP Inbound Schedules - Service Schedule TCP/IP HL7 V2 Inbound Adapter
The following table lists and describes the TCP/IP HL7 V2 inbound adapter properties that appear on the General Inbound Settings page of the Properties Editor accessed from the Connectivity Map.
Table 2 Connectivity Map - General Inbound Settings
The following table lists and describes the properties on the TCPIP Inbound Settings page of the Properties Editor accessed from the Connectivity Map. These properties configure the Java socket and server socket options.
Table 3 Connectivity Map - TCPIP Inbound Settings
The following table lists and describes the properties that appear on the Server Port Binding page of the Properties Editor accessed from the Connectivity Map. The properties define the server port binding retry options. This section is only used when the Connection Type under TCPIP Inbound Settings is set to Server.
Table 4 Connectivity Map - TCPIP Inbound Settings - Server Port Binding
Name |
Description |
---|---|
The maximum number of times the adapter attempts to bind to the specified TCP/IP port on the localhost. This value must be an integer. |
|
The length of time (in milliseconds) the adapter waits between attempts to bind to the specified TCP/IP port on the localhost. |
The following table lists and describes the property that appears on the Client Connection Establishment page of the Properties Editor accessed from the Connectivity Map. This property defines a wait time before connecting to the external system. This section is only used when the Connection Type under TCPIP Inbound Settings is set to Client.
Table 5 Connectivity Map - TCPIP Inbound Settings - Client Connection Establishment
Name |
Description |
---|---|
The length of time (in milliseconds) that the adapter waits before attempting to connect to the external system. |
The following table lists and describes the properties that appear on the Inbound Connection Management page of the Properties Editor accessed from the Connectivity Map. These properties manage the connection to inbound systems. For example, these properties include the connection pool and the life cycle of the accepted connection.
Table 6 Connectivity Map - TCPIP Inbound Settings - Inbound Connection Management
The following table lists and describes the properties that appear on the Listener Schedule page of the Properties Editor accessed from the Connectivity Map. These properties configure the scheduler used by the inbound TCP/IP server. The server waits for a new client connection establishment request. These parameters are used to configure the listener.
Two Java EE schedulers are available, both of which provide the functionality required by the inbound TCP/IP Server.
Timer Service – Available for Java EE, this scheduler is configured using the At Fixed Rate, Delay, and Period properties.
Work Manager – Available for Java EE (JCA 1.5 and above), this scheduler is configured using the Delay and Period properties.
The following table lists and describes the properties that appear on the Service Schedule page of the Properties Editor accessed from the Connectivity Map. These properties configure the scheduler used by the TCP/IP server that executes the business tasks (Collaboration rules) over the existing connection. This scheduler affects the actual business rules you define.
You can use either of the following two Java EE schedulers, both of which provide the functionality required by the inbound TCP/IP server.
Timer Service – Available for Java EE, this scheduler is configured using the At Fixed Rate, Delay, Period, and Schedule Typeproperties.
Work Manager – Available for Java EE (JCA 1.5 and above), this scheduler is configured using the Delay, Period, and Schedule Typeproperties.
The following table lists and describes the properties that appear on the HL7 Acknowledgment page of the Properties Editor accessed from the Connectivity Map. These properties define how the application acknowledgment events are handled.
Table 9 Connectivity Map - HL7 Acknowledgment
The following table lists and describes the properties that appear on the Lower Layer Protocol page of the Properties Editor accessed from the Connectivity Map. These properties define the Lower Layer Protocol (LLP) configuration.
Table 10 Connectivity Map - Lower Layer Protocol
Name |
Description |
---|---|
The lower layer protocol (LLP) type. Select one of the following options:
For more information on the available envelope types, see Lower Layer Protocol. |
|
The first envelope marker character in the HL7 envelope, as a decimal ASCII number. Enter a number from 1 to 127. Unless there is a conflict, the value should be ASCII VT (decimal 11). |
|
The second to the last envelope marker character in the HL7 envelope, as a decimal ASCII number. Enter a number from 1 to 127. Unless there is a conflict, the value should be ASCII FS (decimal 28). |
|
The last envelope marker character in the HL7 envelope, as a decimal ASCII number. Enter a number from 1 to 127. To strictly comply with the HL7 Standard, this property must be set to a carriage return (decimal 13). |
|
An indicator of whether the HLLP Checksum is enabled or disabled. Select true to enable checksum values; otherwise select false. |
|
The maximum number of times the adapter tries to send a message upon receiving the MLLP v2.0 Negative Commit Acknowledgement from the peer before giving up. This property is used by the adapter in outbound mode. Enter any integer. |
The following table lists and describes the property that appears on the Sequence Number Protocol page of the Properties Editor accessed from the Connectivity Map. This property enables or disables HL7 sequence numbering, which is used to help prevent duplication of data.
Table 11 Connectivity Map - Sequence Number Protocol
Name |
Description |
---|---|
An indicator of whether sequence numbering is enabled or disabled. Enabling sequence numbering helps prevent duplication of data. Select true to enable sequence numbering; otherwise select false. |
The following table lists and describes the properties that appear on the HL7 MSH Segment page of the Properties Editor accessed from the Connectivity Map. These properties define the configuration of the MSH segment of the HL7 message. For more information about this segment, refer to the HL7 specification (http://www.hl7.org).
Table 12 Connectivity Map - HL7 MSH Segment
The following table lists and describes the properties that appear on the HL7 SFT Segment page of the Properties Editor accessed from the Connectivity Map. These properties define the configuration of the SFT segment of the HL7 message, which provides additional information about one or more software products used as sending applications. The primary purpose of this segment is for diagnostic use. There may be additional uses per site-specific agreements. For more information about this segment, refer to the HL7 specification (http://www.hl7.org).
The SFT segment is available starting with HL7 version 2.5.
Name |
Description |
---|---|
An indicator of whether the SFT optional segment is enabled in the ACK. Select true to enable the segment; otherwise select false. Note – If Enable is set to true, and the HL7 version is not configured as 2.5, the adapter will error upon startup. |
|
Software Vendor Organization |
The name of the company that publishes or distributes the sending software that created the transaction. This field identifies the vendor responsible for maintaining the application. The purpose of this field, along with the remaining fields in this segment, is to provide a more complete profile of the sending applications. This is the first field in the HL7 SFT segment (SFT-01). |
The latest software version number or release number for the sending system, which helps provide a more complete profile of the application that is sending or receiving HL7 messages. Version numbers are important in identifying the specific release of an application. In some situations, the receiving application validates the software certified version or release number against a list of certified versions or releases of the particular software. This helps determine whether the sending application adheres to specific business rules required by the receiving application. Alternatively, the software may perform different processing, depending on the version of the sending software. This is the second field in the HL7 SFT segment (SFT-02). |
|
The name of the software product that submitted the transaction. The default value is Sun TCP/IP HL7 adapter Intelligent Adapter. This is the third field in the HL7 SFT segment (SFT-03). |
|
The unique software binary ID. Software binary IDs are issued by a vendor for each unique software version instance. These IDs are used to differentiate between multiple versions of the same software. Identical primary IDs indicate that the software is identical at the binary level, but configuration settings may differ. This is the fourth field in the HL7 SFT segment (SFT-04). |
|
Any additional information about the sending application for more complete identification. This could include a description of the software application, configuration settings, modifications made to the software, and so on. This information is used for diagnostic purposes and provides greater flexibility in identifying the application software. This is the fifth field in the HL7 SFT segment (SFT-05). |
|
The date on which the submitting software was installed at the sending site. The software installation date on its own can often provide key information about the behavior of the application. This is the sixth field in the HL7 SFT segment (SFT-06). |
The following table lists and describes the properties that appears on the Communication Control page of the Properties Editor accessed from the Connectivity Map. These properties define how data is transferred (that is, sent and received) over the TCP/IP connection.
Table 14 Connectivity Map - Communication Control
Name |
Description |
---|---|
The amount of time (in milliseconds) that the adapter waits for a response from the external system before taking recourse action (see Action on No Response in HL7 Recourse Action). Any data from the external system is considered a response. This property corresponds to the initial read/receive operation timeout. Once a response is received, the subsequent read/receive operation uses the value specified for SoTimeout ( see TCPIP Inbound Settings). A value of 0 (zero) indicates an infinite timeout. |
|
The maximum number of times the adapter attempts to read data from the external system after the read/receive operation returns nothing. This applies to the read or receive operation after a response starts to arrive. Empty Read means that a timeout occurs on the read/receive operation, which uses the SoTimeout parameter in the TCPIP Server Base Settings section as the timeout setting (see TCPIP Inbound Settings). The corresponding recourse action is specified by the Action on Max Failed Read Retry (see HL7 Recourse Action). |
|
The maximum number of response timeouts the adapter allows while waiting for data from the external system before taking recourse action (see Action on Max No Response in HL7 Recourse Action). This property is used in the inbound Collaboration code. It is only used by outbound adapters and works in conjunction with the Resend option of the Action on No Response property. It configures the adapter to resend the last message for the specified maximum number of times before the subsequent recourse action is taken. |
|
The maximum number of negative acknowledgments (NAKs) the adapter receives before taking recourse action (see Action on Max Nak Received in HL7 Recourse Action). This property is used for the inbound Collaboration code. |
|
The maximum number of negative acknowledgments (NAKs) the adapter sends before taking recourse action (see Action on Max Nak Sent in HL7 Recourse Action). This property is used in the inbound Collaboration code. |
|
The maximum number of canned negative acknowledgments that the adapter sends before taking recourse action (see Action on Max Nak Sent in HL7 Recourse Action). A value of 0 (zero) indicates that the adapter will not attempt to create or send a canned NAK. |
|
An indicator of whether message journaling is enabled. To enable message journaling, select true; otherwise select false. This property is used for inbound Collaboration code. |
The following table lists and describes the properties that appear on the HL7 Recourse Action page of the Properties Editor accessed from the Connectivity Map. These properties define the actions the adapter takes when operations occur outside the configured constraints.
Table 15 Connectivity Map - HL7 Recourse Action
Name |
Description |
---|---|
The action the adapter takes when no ACK is received from the external system in the allotted time. The amount of time is determined by the Time To Wait For A Response property (see Communication Control). Select one of the following options:
|
|
The action the adapter takes when it attempts to send a message to the external system the maximum allowed number of times and does not receive any response (HL7 Application Acknowledgement) from the external system. The maximum number times the adapter sends a message without receiving a response is determined by the Max No Response property (see Communication Control). Select one of the following options:
|
|
The action the adapter takes after it has reached the empty read limit set by the Max Empty Read Retry property. This property is used by inbound adapters only. Select one of the following recourse options:
|
|
The action the adapter takes when it receives an HL7 Application NAK from the external system. Select one of the following options:
|
|
The action the adapter takes when the maximum number of HL7 Application NAKs have been received from the external system, as set by the Max NAK Receive Retry property (see Communication Control). Select one of the following options:
|
|
The action the adapter takes when it has sent the maximum allowed number of NAKs to the external system, as set by the Max NAK Send Retry parameter (see Communication Control). Select one of the following options:
|
The TCP/IP HL7 V2 server outbound adapter configuration properties are organized into the following sections on the Properties Editor accessed from the Connectivity Map:
TCPIP Outbound Settings - Client Connection Establishment — TCP/IP HL7 V2 Outbound Adapter
TCPIP Outbound Settings - Server Port Binding — TCP/IP HL7 V2 Outbound Adapter
The following table lists and describes the TCP/IP HL7 V2 outbound adapter properties that appear on the General Outbound Settings page of the Properties Editor accessed from the Connectivity Map.
Table 16 Connectivity Map - General Outbound Settings
The following table lists and describes the properties on the TCPIP Outbound Settings page of the Properties Editor accessed from the Connectivity Map. These properties configure the Java socket and server socket options. For more information, see the Javadocs for Java SDK.
Table 17 Connectivity Map - TCPIP Outbound Settings
The following table lists and describes the properties that appear on the Client Connection Establishment page of the Properties Editor accessed from the Connectivity Map. These properties configure how connections are established. This section is only used when the Connection Type under TCPIP Outbound Settings is set to Client.
Table 18 Connectivity Map - TCPIP Outbound Settings - Client Connection Establishment
The following table lists and describes the properties that appear on the Server Port Binding page of the Properties Editor accessed from the Connectivity Map. The properties define the server port binding retry options. This section is only used when the Connection Type under TCPIP Outbound Settings is set to Server.
Table 19 Connectivity Map - TCPIP Outbound Settings - Server Port Binding
Name |
Description |
---|---|
The maximum number of times the adapter will attempt to bind to the specified TCP/IP port on the localhost before giving up. |
|
The amount of time (in milliseconds) that the adapter waits between attempts to bind to the specified TCP/IP port on the localhost. |
The following table lists and describes the properties that appear on the HL7 Acknowledgment page of the Properties Editor accessed from the Connectivity Map. These properties define how the application acknowledgment events are handled.
Table 20 Connectivity Map - HL7 Acknowledgement
The following table lists and describes the properties that appear on the Lower Layer Protocol page of the Properties Editor accessed from the Connectivity Map. These properties define the Lower Layer Protocol (LLP) configuration.
Table 21 Connectivity Map - Lower Layer Protocol
Name |
Description |
---|---|
MLLP is the configured default value. The lower layer protocol (LLP) type. Select one of the following options:
For more information on the available envelope types, see Lower Layer Protocol. |
|
The first envelope marker character in the HL7 envelope, as a decimal ASCII number. Enter a number from 1 to 127. Unless there is a conflict, the value should be ASCII VT (decimal 11). |
|
The second to the last envelope marker character in the HL7 envelope, as a decimal ASCII number. Enter a number from 1 to 127. Unless there is a conflict, the value should be ASCII FS (decimal 28). |
|
The last envelope marker character in the HL7 envelope, as a decimal ASCII number. Enter a number from 1 to 127. To strictly comply with the HL7 Standard, this property must be set to a carriage return (decimal 13). |
|
An indicator of whether the HLLP Checksum is enabled or disabled. Select true to enable checksum values; otherwise select false. |
|
The maximum number of times the adapter tries to send a message upon receiving the MLLP v2.0 Negative Commit Acknowledgement from the peer before giving up. This property is used by the adapter in outbound mode. Enter any integer. |
The following table lists and describes the property that appears on the Sequence Number Protocol page of the Properties Editor accessed from the Connectivity Map. This property enables or disables HL7 sequence numbering, which is used to help prevent duplication of data.
Table 22 Connectivity Map - Sequence Number Protocol
Name |
Description |
---|---|
An indicator of whether sequence numbering is enabled or disabled. Enabling sequence numbering helps prevent duplication of data. Select true to enable sequence numbering; otherwise select false. |
The following table lists and describes the properties that appear on the HL7 MSH Segment page of the Properties Editor accessed from the Connectivity Map. These properties define the configuration of the MSH segment of the HL7 message. For more information about this segment, refer to the HL7 specification (http://www.hl7.org).
Table 23 Connectivity Map - HL7 MSH Segment
The following table lists and describes the properties that appear on the HL7 SFT Segment page of the Properties Editor accessed from the Connectivity Map. These properties define the configuration of the SFT segment of the HL7 message, which provides additional information about one or more software products used as sending applications. The primary purpose of this segment is for diagnostic use. There may be additional uses per site-specific agreements. For more information about this segment, refer to the HL7 specification (http://www.hl7.org).
The SFT segment is available starting with HL7 version 2.5.
Name |
Description |
---|---|
An indicator of whether the SFT optional segment is enabled in the ACK. Select true to enable the segment; otherwise select false. Note – If Enable is set to true, and the HL7 version is not configured as 2.5, the adapter will error upon startup. |
|
The name of the company that publishes or distributes the sending software that created the transaction. This field identifies the vendor responsible for maintaining the application. The purpose of this field, along with the remaining fields in this segment, is to provide a more complete profile of the sending applications. This is the first field in the HL7 SFT segment (SFT-01). |
|
The latest software version number or release number for the sending system, which helps provide a more complete profile of the application that is sending or receiving HL7 messages. Version numbers are important in identifying the specific release of an application. In some situations, the receiving application validates the software certified version or release number against a list of certified versions or releases of the particular software. This helps determine whether the sending application adheres to specific business rules required by the receiving application. Alternatively, the software may perform different processing, depending on the version of the sending software. This is the second field in the HL7 SFT segment (SFT-02). |
|
The name of the software product that submitted the transaction. The default value is Sun TCP/IP HL7 adapter Intelligent Adapter. This is the third field in the HL7 SFT segment (SFT-03). |
|
The unique software binary ID. Software binary IDs are issued by a vendor for each unique software version instance. These IDs are used to differentiate between multiple versions of the same software. Identical primary IDs indicate that the software is identical at the binary level, but configuration settings may differ. This is the fourth field in the HL7 SFT segment (SFT-04). |
|
Any additional information about the sending application for more complete identification. This could include a description of the software application, configuration settings, modifications made to the software, and so on. This information is used for diagnostic purposes and provides greater flexibility in identifying the application software. This is the fifth field in the HL7 SFT segment (SFT-05). |
|
The date on which the submitting software was installed at the sending site. The software installation date on its own can often provide key information about the behavior of the application. This is the sixth field in the HL7 SFT segment (SFT-06). |
The following table lists and describes the properties that appear on the Communication Control page of the Properties Editor accessed from the Connectivity Map. These properties define how data is transferred (that is, sent and received) over the TCP/IP connection.
Table 25 Connectivity Map - Communication Control
Name |
Description |
---|---|
The amount of time (in milliseconds) that the adapter waits for a response from the external system before taking recourse action (see Action on No Response in HL7 Recourse Action). Any data from the external system is considered a response. This property corresponds to the initial read/receive operation timeout. Once a response is received, the subsequent read/receive operation uses the value specified for SoTimeout (see Table 17). A value of 0 (zero) indicates an infinite timeout. |
|
The maximum number of times the adapter attempts to read data from the external system after the read/receive operation returns nothing. This applies to the read or receive operation after a response starts to arrive. Empty Read means that a timeout occurs on the read/receive operation, which uses the SoTimeout parameter in the TCPIP Outbound Settings section as the timeout setting (see TCPIP Outbound Settings). The corresponding recourse action is specified by the Action on Max Failed Read Retry (see HL7 Recourse Action). |
|
The maximum number of response timeouts the adapter allows while waiting for data from the external system before taking recourse action (see Action on Max No Response in HL7 Recourse Action). This property is used in the Collaboration code. It is only used by outbound adapters and works in conjunction with the Resend option of the Action on No Response property. |
|
The maximum number of negative acknowledgments (NAKs) the adapter receives before taking recourse action (see Action on Max Nak Received in HL7 Recourse Action). This property is used for the outbound Collaboration code. |
|
The maximum number of negative acknowledgments (NAKs) the adapter sends before taking recourse action (see Action on Max Nak Sent in HL7 Recourse Action). |
|
The maximum number of canned negative acknowledgments that the adapter sends before taking recourse action (see Action on Max Nak Sent in HL7 Recourse Action). A value of 0 (zero) indicates that the adapter will not attempt to create or send a canned NAK. |
|
An indicator of whether message journaling is enabled. To enable message journaling, select true; otherwise select false. This property is used for outbound Collaboration code. |
The following table lists and describes the properties that appear on the HL7 Recourse Action page of the Properties Editor accessed from the Connectivity Map. These properties define the actions the adapter takes when operations occur outside the configured constraints.
Table 26 Connectivity Map - HL7 Recourse Action
Name |
Description |
---|---|
The action the adapter takes when no ACK is received from the external system in the allotted time. The amount of time is determined by the Time To Wait For A Response property (see Communication Control). Select one of the following options:
|
|
The action the adapter takes when it attempts to send a message to the external system the maximum allowed number of times and does not receive any response (HL7 Application Acknowledgement) from the external system. The maximum number times the adapter sends a message without receiving a response is determined by the Max No Response property (see Communication Control). Select one of the following options:
|
|
The action the adapter takes after it has reached the empty read limit set by the Max Empty Read Retry property. Select one of the following recourse options:
|
|
The action the adapter takes when it receives an HL7 Application NAK from the external system. Select one of the following options:
|
|
The action the adapter takes when the maximum number of HL7 Application NAKs have been received from the external system, as set by the Max NAK Receive Retry property (see Communication Control). Select one of the following options:
|
|
The action the adapter takes when it has sent the maximum allowed number of NAKs to the external system, as set by the Max NAK Send Retry parameter (see Communication Control). Select one of the following options:
|
The TCP/IP HL7 V3 Server inbound adapter configuration properties are organized into the following sections on the Properties Editor accessed from the Connectivity Map:
TCPIP Inbound Settings - Server Port Binding — TCP/IP HL7 V3 Inbound Adapter
TCPIP Inbound Settings - Client Connection Establishment — TCP/IP HL7 V3 Inbound Adapter
TCPIP Inbound Settings - Inbound Connection Management — TCP/IP HL7 V3 Inbound Adapter
TCPIP Inbound Schedules - Listener Schedule — TCP/IP HL7 V3 Inbound Adapter
TCPIP Inbound Schedules - Service Schedule — TCP/IP HL7 V3 Inbound Adapter
The following table lists and describes the TCP/IP HL7 V3 inbound adapter properties that appear on the General Inbound Settings page of the Properties Editor accessed from the Connectivity Map.
Table 27 Connectivity Map - General Inbound Settings (V3)
The following table lists and describes the properties on the TCPIP Inbound Settings page of the Properties Editor accessed from the Connectivity Map. These properties configure the Java socket and server socket options.
Table 28 Connectivity Map - TCPIP Inbound Settings (V3)
The following table lists and describes the properties that appear on the Server Port Binding page of the Properties Editor accessed from the Connectivity Map. The properties define the server port binding retry options. This section is only used when the Connection Type under TCPIP Inbound Settings is set to Server.
Table 29 Connectivity Map - TCPIP Inbound Settings (V3) - Server Port Binding
Name |
Description |
---|---|
The maximum number of times the adapter attempts to bind to the specified TCP/IP port on the localhost. This value must be an integer. |
|
The length of time (in milliseconds) the adapter waits between attempts to bind to the specified TCP/IP port on the localhost. |
The following table lists and describes the property that appears on the Client Connection Establishment page of the Properties Editor accessed from the Connectivity Map. This property defines a wait time before connecting to the external system. This section is only used when the Connection Type under TCPIP Inbound Settings is set to Client.
Table 30 Connectivity Map - TCPIP Inbound Settings (V3) - Client Connection Establishment
Name |
Description |
---|---|
The length of time (in milliseconds) that the adapter waits before attempting to connect to the external system. |
The following table lists and describes the properties that appear on the Inbound Connection Management page of the Properties Editor accessed from the Connectivity Map. These properties manage the connection to inbound systems. For example, these properties include the connection pool and the life cycle of the accepted connection.
Table 31 Connectivity Map - TCPIP Inbound Settings (V3) - Inbound Connection Management
The following table lists and describes the properties that appear on the Listener Schedule page of the Properties Editor accessed from the Connectivity Map. These properties configure the scheduler used by the inbound TCP/IP server. The server waits for a new client connection establishment request. These parameters are used to configure the listener.
Two Java EE schedulers are available, both of which provide the functionality required by the inbound TCP/IP Server.
Timer Service – Available for Java EE, this scheduler is configured using the At Fixed Rate, Delay, and Period properties.
Work Manager – Available for Java EE (JCA 1.5 and above), this scheduler is configured using the Delay and Period properties.
The following table lists and describes the properties that appear on the Service Schedule page of the Properties Editor accessed from the Connectivity Map. These properties configure the scheduler used by the TCP/IP server that executes the business tasks (Collaboration rules) over the existing connection. This scheduler affects the actual business rules you define.
You can use either of the following two Java EE schedulers, both of which provide the functionality required by the inbound TCP/IP server.
Timer Service – Available for Java EE, this scheduler is configured using the At Fixed Rate, Delay, Period, and Schedule Typeproperties.
Work Manager – Available for Java EE (JCA 1.5 and above), this scheduler is configured using the Delay, Period, and Schedule Typeproperties.
The following table lists and describes the property that appears on the HL7 Acknowledgment page of the Properties Editor accessed from the Connectivity Map. This property defines how the application acknowledgment events are handled.
Table 34 Connectivity Map - HL7 Acknowledgment (V3)
Name |
Description |
Required Value |
---|---|---|
The acknowledgment type provided by the Java Collaboration. Select one of the following types:
|
The following table lists and describes the properties that appear on the Lower Layer Protocol page of the Properties Editor accessed from the Connectivity Map. These properties define the Lower Layer Protocol (LLP) configuration.
Table 35 Connectivity Map - Lower Layer Protocol (V3)
Name |
Description |
---|---|
The lower layer protocol (LLP) type. The supported option is MLLP v2.0 (Minimal Lower Layer Protocol v2.0). For more information on MLLP v2.0, see Lower Layer Protocol. |
|
The first envelope marker character in the HL7 envelope, as a decimal ASCII number. Enter a number from 1 to 127. Unless there is a conflict, the value should be ASCII VT (decimal 11). |
|
The second to the last envelope marker character in the HL7 envelope, as a decimal ASCII number. Enter a number from 1 to 127. Unless there is a conflict, the value should be ASCII FS (decimal 28). |
|
The last envelope marker character in the HL7 envelope, as a decimal ASCII number. Enter a number from 1 to 127. To strictly comply with the HL7 Standard, this property must be set to a carriage return (decimal 13). |
|
The maximum number of times the adapter tries to send a message upon receiving the MLLP v2.0 Negative Commit Acknowledgement from the peer before giving up. This property is used by the adapter in outbound mode. Enter any integer. |
The following table lists and describes the property that appears on the Sequence Number Protocol page of the Properties Editor accessed from the Connectivity Map. This property enables or disables HL7 sequence numbering, which is used to help prevent duplication of data.
Table 36 Connectivity Map - Sequence Number Protocol (V3)
Name |
Description |
---|---|
An indicator of whether sequence numbering is enabled or disabled. Enabling sequence numbering helps prevent duplication of data. Select true to enable sequence numbering; otherwise select false. |
The following table lists and describes the properties that appear on the HL7 Transmission Wrapper page of the Properties Editor accessed from the Connectivity Map. The HL7 transmission wrapper includes information a sending application or message handling service needs to package and route the message to the specified receiving applications or message handling services. The transmission wrapper is a cluster of classes and identifies the sender and receiver of the message and the particular kind of message being communicated.
Table 37 Connectivity Map - HL7v3 Transmission Wrapper
The following table lists and describes the properties that appears on the Communication Control page of the Properties Editor accessed from the Connectivity Map. These properties define how data is transferred (that is, sent and received) over the TCP/IP connection.
Table 38 Connectivity Map - Communication Control (V3)
Name |
Description |
---|---|
The amount of time (in milliseconds) that the adapter waits for a response from the external system before taking recourse action (see Action on No Response in HL7 Recourse Action). Any data from the external system is considered a response. This property corresponds to the initial read/receive operation timeout. Once a response is received, the subsequent read/receive operation uses the value specified for SoTimeout (see TCPIP Inbound Settings). A value of 0 (zero) indicates an infinite timeout. |
|
The maximum number of times the adapter attempts to read data from the external system after the read/receive operation returns nothing. This applies to the read or receive operation after a response starts to arrive. Empty Read means that a timeout occurs on the read/receive operation, which uses the SoTimeout parameter in the TCPIP Server Base Settings section as the timeout setting (see TCPIP Inbound Settings). The corresponding recourse action is specified by the Action on Max Failed Read Retry (see HL7 Recourse Action). |
|
The maximum number of response timeouts the adapter allows while waiting for data from the external system before taking recourse action (see Action on Max No Response in HL7 Recourse Action). This property is used in the inbound Collaboration code. |
|
The maximum number of negative acknowledgments (NAKs) the adapter receives before taking recourse action (see Action on Max Nak Received in HL7 Recourse Action). This property is used for the inbound Collaboration code. |
|
The maximum number of negative acknowledgments (NAKs) the adapter sends before taking recourse action (see Action on Max Nak Sent in HL7 Recourse Action). This property is used in the inbound Collaboration code. |
|
The maximum number of canned negative acknowledgments that the adapter sends before taking recourse action (see Action on Max Nak Sent in HL7 Recourse Action). A value of 0 (zero) indicates that the adapter will not attempt to create or send a canned NAK. |
|
An indicator of whether message journaling is enabled. To enable message journaling, select true; otherwise select false. This property is used for inbound Collaboration code. |
The following table lists and describes the properties that appear on the HL7 Recourse Action page of the Properties Editor accessed from the Connectivity Map. These properties define the actions the adapter takes when operations occur outside the configured constraints.
Table 39 Connectivity Map - HL7 Recourse Action (V3)
Name |
Description |
---|---|
The action the adapter takes when no ACK is received from the external system in the allotted time. The amount of time is determined by the Time To Wait For A Response property (see Communication Control). Select one of the following options:
|
|
The action the adapter takes when it attempts to send a message to the external system the maximum allowed number of times and does not receive any response (HL7 Application Acknowledgement) from the external system. The maximum number times the adapter sends a message without receiving a response is determined by the Max No Response property (see Communication Control). Select one of the following options:
|
|
The action the adapter takes after it has reached the empty read limit set by the Max Empty Read Retry property. This property is used by inbound adapters only. Select one of the following recourse options:
|
|
The action the adapter takes when it receives an HL7 Application NAK from the external system. Select one of the following options:
|
|
The action the adapter takes when the maximum number of HL7 Application NAKs have been received from the external system, as set by the Max NAK Receive Retry property (see Communication Control). Select one of the following options:
|
|
The action the adapter takes when it has sent the maximum allowed number of NAKs to the external system, as set by the Max NAK Send Retry parameter (see Communication Control). Select one of the following options:
|
The following table lists and describes the properties that appears on the Schematron Validation page of the Properties Editor accessed from the Connectivity Map. The schematron uses the concept of finding tree patterns in a parsed document rather than grammar patterns.
Table 40 Connectivity Map - Communication Control (V3)
Name |
Description |
---|---|
An indicator of whether schematron validation is enabled. Select true to validate a document's tree patterns; otherwise select false. Click the ellipsis button next to this property to display a dialog box that allows you to enter an LDAP reference. Prefix the LDAP reference with ldap:// or ldaps://. |
|
One or more files containing a predefined schema to validate an HL7 V3 document against. These files must have an .xml extension. Separate file names by commas. You can create these files or obtain files from organizations such as HL7.org. |
The TCP/IP HL7 V3 server outbound adapter configuration properties are organized into the following sections on the Properties Editor accessed from the Connectivity Map:
TCPIP Outbound Settings - Client Connection Establishment — TCP/IP HL7 V3 Outbound Adapter
TCPIP Outbound Settings - Server Port Binding — TCP/IP HL7 V3 Outbound Adapter
The following table lists and describes the TCP/IP HL7 V3 outbound adapter properties that appear on the General Outbound Settings page of the Properties Editor accessed from the Connectivity Map.
Table 41 Connectivity Map - General Outbound Settings (V3)
The following table lists and describes the properties on the TCPIP Outbound Settings page of the Properties Editor accessed from the Connectivity Map. These properties configure the Java socket and server socket options. For more information, see the Javadocs for Java SDK.
Table 42 Connectivity Map - TCPIP Outbound Settings (V3)
The following table lists and describes the properties that appear on the Client Connection Establishment page of the Properties Editor accessed from the Connectivity Map. These properties configure how connections are established. This section is only used when the Connection Type under TCPIP Outbound Settings is set to Client.
Table 43 Connectivity Map - TCPIP Outbound Settings (V3) - Client Connection Establishment
The following table lists and describes the properties that appear on the Server Port Binding page of the Properties Editor accessed from the Connectivity Map. The properties define the server port binding retry options. This section is only used when the Connection Type under TCPIP Outbound Settings is set to Server.
Table 44 Connectivity Map - TCPIP Outbound Settings (V3) - Server Port Binding
Name |
Description |
---|---|
The maximum number of times the adapter will attempt to bind to the specified TCP/IP port on the localhost before giving up. |
|
The amount of time (in milliseconds) that the adapter waits between attempts to bind to the specified TCP/IP port on the localhost. |
The following table lists and describes the properties that appear on the HL7 Acknowledgment page of the Properties Editor accessed from the Connectivity Map. These properties define how the application acknowledgment events are handled.
Table 45 Connectivity Map - HL7 Acknowledgement (V3)
Name |
Description |
---|---|
The acknowledgment type provided by the Java Collaboration. Select one of the following types:
|
The following table lists and describes the properties that appear on the Lower Layer Protocol page of the Properties Editor accessed from the Connectivity Map. These properties define the Lower Layer Protocol (LLP) configuration.
Table 46 Connectivity Map - Lower Layer Protocol (V3)
Name |
Description |
---|---|
The lower layer protocol (LLP) type. The supported option is MLLP v2.0 (Minimal Lower Layer Protocol v2.0). For more information on MLLP v2.0, see Lower Layer Protocol. |
|
The first envelope marker character in the HL7 envelope, as a decimal ASCII number. Enter a number from 1 to 127. Unless there is a conflict, the value should be ASCII VT (decimal 11). |
|
The second to the last envelope marker character in the HL7 envelope, as a decimal ASCII number. Enter a number from 1 to 127. Unless there is a conflict, the value should be ASCII FS (decimal 28). |
|
The last envelope marker character in the HL7 envelope, as a decimal ASCII number. Enter a number from 1 to 127. To strictly comply with the HL7 Standard, this property must be set to a carriage return (decimal 13). |
|
The maximum number of times the adapter tries to send a message upon receiving the MLLP v2.0 Negative Commit Acknowledgement from the peer before giving up. This property is used by the adapter in outbound mode. Enter any integer. |
The following table lists and describes the property that appears on the Sequence Number Protocol page of the Properties Editor accessed from the Connectivity Map. This property enables or disables HL7 sequence numbering, which is used to help prevent duplication of data.
Table 47 Connectivity Map - Sequence Number Protocol (V3)
Name |
Description |
---|---|
An indicator of whether sequence numbering is enabled or disabled. Enabling sequence numbering helps prevent duplication of data. Select true to enable sequence numbering; otherwise select false. |
The following table lists and describes the properties that appear on the HL7 Transmission Wrapper page of the Properties Editor accessed from the Connectivity Map. The HL7 transmission wrapper includes information a sending application or message handling service needs to package and route the message to the specified receiving applications or message handling services. The transmission wrapper is a cluster of classes and identifies the sender and receiver of the message and the particular kind of message being communicated.
Table 48 Connectivity Map - HL7v3 Transmission Wrapper
The following table lists and describes the properties that appear on the Communication Control page of the Properties Editor accessed from the Connectivity Map. These properties define how data is transferred (that is, sent and received) over the TCP/IP connection.
Table 49 Connectivity Map - Communication Control (V3)
Name |
Description |
---|---|
The amount of time (in milliseconds) that the adapter waits for a response from the external system before taking recourse action (see Action on No Response in HL7 Recourse Action). Any data from the external system is considered a response. This property corresponds to the initial read/receive operation timeout. Once a response is received, the subsequent read/receive operation uses the value specified for SoTimeout (see TCPIP Outbound Settings). A value of 0 (zero) indicates an infinite timeout. |
|
The maximum number of times the adapter attempts to read data from the external system after the read/receive operation returns nothing. This applies to the read or receive operation after a response starts to arrive. Empty Read means that a timeout occurs on the read/receive operation, which uses the SoTimeout property in the TCPIP Outbound Settings section as the timeout setting (see TCPIP Outbound Settings). The corresponding recourse action is specified by the Action on Max Failed Read Retry (see HL7 Recourse Action). |
|
The maximum number of response timeouts the adapter allows while waiting for data from the external system before taking recourse action (see Action on Max No Response in HL7 Recourse Action). This property is used in the Collaboration code. It works in conjunction with the Resend option of the Action on No Response property (see HL7 Recourse Action table). |
|
The maximum number of negative acknowledgments (NAKs) the adapter receives before taking recourse action (see Action on Max Nak Received in HL7 Recourse Action). This property is used for the outbound Collaboration code. |
|
The maximum number of negative acknowledgments (NAKs) the adapter sends before taking recourse action (see Action on Max Nak Sent in HL7 Recourse Action). |
|
The maximum number of canned negative acknowledgments that the adapter sends before taking recourse action (see Action on Max Nak Sent in HL7 Recourse Action). A value of 0 (zero) indicates that the adapter will not attempt to create or send a canned NAK. |
|
An indicator of whether message journaling is enabled. To enable message journaling, select true; otherwise select false. This property is used for outbound Collaboration code. |
The following table lists and describes the properties that appear on the HL7 Recourse Action page of the Properties Editor accessed from the Connectivity Map. These properties define the actions the adapter takes when operations occur outside the configured constraints.
Table 50 Connectivity Map - HL7 Recourse Action (V3)
Name |
Description |
---|---|
The action the adapter takes when no ACK is received from the external system in the allotted time. The amount of time is determined by the Time To Wait For A Response property (see Communication Control - TCP/IP). Select one of the following options:
|
|
The action the adapter takes when it attempts to send a message to the external system the maximum allowed number of times and does not receive any response (HL7 Application Acknowledgement) from the external system. The maximum number times the adapter sends a message without receiving a response is determined by the Max No Response property (see Communication Control - TCP/IP). Select one of the following options:
|
|
The action the adapter takes after it has reached the empty read limit set by the Max Empty Read Retry property. Select one of the following recourse options:
|
|
The action the adapter takes when it receives an HL7 Application NAK from the external system. Select one of the following options:
|
|
The action the adapter takes when the maximum number of HL7 Application NAKs have been received from the external system, as set by the Max NAK Receive Retry property (see Communication Control - TCP/IP). Select one of the following options:
|
|
The action the adapter takes when it has sent the maximum allowed number of NAKs to the external system, as set by the Max NAK Send Retry parameter (see Communication Control - TCP/IP). Select one of the following options:
|
The adapter environment configuration properties define how the adapter connects to and interacts with other Java CAPS components within the environment. The environment properties are accessed from the NetBeans IDE Services window. The following sections provide instructions on how to configure Java CAPS component environment properties and lists the environment properties for the various communications adapters.
The adapter environment configuration properties contain parameters that define how the adapter connects to and interacts with other Java CAPS components within the environment. The environment properties are accessed from the NetBeans IDE Services window.
From the NetBeans Services window, expand the CAPS Environments node.
Expand the environment created for your project and locate the External System for your specific adapter.
Right-click the External System and select Properties.
The Environment Configuration Properties window appears.
On the Properties Editor, click on any folder in the left panel to display the properties for that section.
For information about the folders and properties on the Properties Editor, see TCP/IP HL7 Inbound Adapter Environment Properties and TCP/IP HL7 Inbound Adapter Environment Properties.
Click on any property field to modify it.
Once you have finished modifying the properties, click OK to save your changes and close the editor.
The TCP/IP HL7 Adapter configuration parameters accessed from the Environment tree apply to both the inbound and outbound Adapters, and are the same for HL7 v2 and HL7 v3 Adapters.
The inbound TCP/IP HL7 Adapter’s Environment properties are divided into the following sections:
The following table lists and describes the TCP/IP HL7 inbound adapter properties that appear on the TCPIP Inbound Settings page of the Properties Editor accessed from the Environment. These properties configure the Java socket and server socket options. For more information, see the Javadocs provided with Java SDK.
Table 51 Environment - HL7 Inbound Adapter - TCPIP Inbound Settings
Name |
Description |
---|---|
The host name or IP address used to establish a TCP/IP connection. This property is only used when the Connection Type is set to Client. |
|
The port number of the TCP/IP destination. This is dependent on the value set for Connection Type. If Connection Type is set to Server, it indicates the port number on the local host; if Connection Type is set to Client, it indicates the port number of the external host. Enter an integer between 0 and 65535. |
|
Backlog |
An integer indicating the maximum length of the queue for incoming connection requests when creating the server socket. When a connection indication arrives and the queue is full, the connection is refused. This parameter is only used when Connection Type is set to Server. |
The following table lists and describes the properties that appear on the MDB Pool Setting page of the Properties Editor accessed from the Environment. These properties are specific to the message–driven bean (MDB) pool of the GlassFish Server or Sun Runtime Server. These properties settings are packaged into sun-ejb-jar.xml.
Table 52 Environment - HL7 Inbound Adapter - TCPIP Inbound Settings
Name |
Description |
---|---|
Steady Pool Size |
An integer indicating the minimum number of message–driven beans to maintain. When the value is set to a number greater than 0 (zero), the container pre-populates the MDB pool with the specified number and tries to ensure that there are always this number of beans in the free pool. This ensures that there are enough MDB beans in the ready-to-serve state to process user requests. This property does not necessarily guarantee that no more than steady-pool-size instances exist at a given time. It only governs the number of instances that are pooled over a long period of time. For example, if an idle stateless session container has a fully-populated pool with a steady-pool-size of 10 and 20 concurrent requests arrive for the MDB component, the container creates 10 additional instances to satisfy the burst of requests. The advantage of this is that it prevents the container from blocking any of the incoming requests. However, if the activity is reduced to 10 or fewer concurrent requests, the additional 10 instances are discarded. |
Max Pool Size |
An integer indicating the maximum number of message–driven beans in the pool. A value of 0 (zero) indicates that the pool is unbounded. |
Pool Idle Timeout in Seconds |
The maximum amount of time (in seconds) that an MDB instance can remain idle in the pool. When an MDB has exceeded the configured timeout, a timer thread removes the unused MDB. This property defines the interval at which this thread runs. A value greater than 0 indicates that the container removes or destroys any MDB instance that is idle at this specified duration. A value of 0 (zero) specifies that idle MDB instances can remain in the pool indefinitely. |
The following table lists and describes the property that appears on the Sequence Number Protocol page of the Properties Editor accessed from the Environment. Sequence numbering helps prevent duplication of data.
Table 53 Environment - HL7 Inbound Adapter - Sequence Number Protocol
Name |
Description |
---|---|
Sequence Number File Location |
The location of the sequence number file (a local directory). This is required when the Sequence Number Protocol is enabled. The sequence number folder is a nonvolatile directory that stores the sequence number files used to persist the HL7 sequence number. The unique base file name is automatically generated according to project or Collaboration information. For the inbound Adapter the file names are created as follows: ProjectName + DeploymentName + ExternalApplicationName + CollaborationName + .seqno For example, prjHL7Inbound_dpIn_eaHL7Inbound_ jcdHL7inbound1.seqno The default setting is /temp/hl7inbound/seq. |
The following table lists and describes the property that appears on the Database Settings page of the Properties Editor accessed from the Environment. These properties are used for storing HL7 messages as part of MLLP v2 support.
Table 54 Environment - HL7 Inbound Adapter - Database Settings
Name |
Description |
---|---|
JNDI Name of the JDBC Datasource |
The JNDI name of the JDBC data source as defined in the application server. This data source is used by MLLP v2 protocol to persist the HL7 messages before sending a commit acknowledgment. For more information, see MLLP V2 and the Sample Projects. |
The TCP/IP HL7 Adapter configuration parameters accessed from the Environment tree apply to both the inbound and outbound Adapters, and are the same for HL7 v2 and HL7 v3 Adapters.
The onbound TCP/IP HL7 Adapter’s Environment properties are divided into the following sections:
The following table lists and describes the properties that appear on the MDB Pool Setting page of the Properties Editor accessed from the Environment. These properties configure the Java socket and server socket options. For more information, see the Javadocs provided with Java SDK.
Table 55 Environment - HL7 Outbound Adapter - TCPIP Outbound Settings
The following table lists and describes the properties that appear on the Connection Pool Setting page of the Properties Editor accessed from the Environment. These properties are specific to the resource adapter pool of the GlassFish Server or Sun Runtime Server. These properties settings are packaged into sun-ra.xml.
Table 56 Environment - HL7 Outbound Adapter - Connection Pool Settings
Name |
Description |
---|---|
Steady Pool Size |
An integer indicating the minimum number of resource adapter connections to be maintained. When the value is set to a number greater than 0 (zero), the container pre-populates the RA connection pool with the specified number and tries to ensure that there are always this many connections in the free pool. This ensures that there are enough connections in the ready-to-serve state to process user requests. This property does not necessarily guarantee that no more than steady-pool-size instances exist at a given time. It only governs the number of instances that are pooled over a long period of time. For example, if an idle stateless session container has a fully-populated pool with a steady-pool-size of 10 and 20 concurrent requests arrive for the resource adapter connection component, the container creates 10 additional instances to satisfy the burst of requests. The advantage of this is that it prevents the container from blocking any of the incoming requests. However, if the activity is reduced to 10 or fewer concurrent requests, the additional 10 instances are discarded. |
Max Pool Size |
An integer indicating the maximum number of resource adapter connections in the pool. A value of 0 (zero) indicates that the pool is unbounded. |
Pool Idle Timeout in Seconds |
The maximum amount of time (in seconds) that a resource adapter connection instance can remain idle in the pool. When a connection has exceeded the configured timeout, a timer thread removes the unused connection. This property defines the interval at which this thread runs. A value greater than 0 (zero) indicates that the container removes or destroys any resource adapter connection instance that is idle at this specified duration. A value of 0 (zero) specifies that idle connections can remain in the pool indefinitely. |
The following table lists and describes the property that appears on the Sequence Number Protocol page of the Properties Editor accessed from the Environment. Sequence numbering helps prevent duplication of data.
Table 57 Environment - HL7 Outbound Adapter - Sequence Number Protocol
Name |
Description |
---|---|
Sequence Number File Location |
The location of the sequence number file (a local directory). This is required when the Sequence Number Protocol is enabled. The sequence number folder is a nonvolatile directory that stores the sequence number files used to persist the HL7 sequence number. The unique base file name is automatically generated according to project or Collaboration information. For the outbound Adapter the file names are created as follows: ProjectName + DeploymentName + CollaborationName + ExternalApplicationName + .seqno For example, prjHL7Outbound_dpOut_jcolHL7Outbound_ eaHL7Outbound.seqno The default setting is /temp/hl7outbound/seq. |
The TCP/IP HL7 Adapter provides several sample Projects to help you customize a solution using either HL7 V2.x or HL7 V3 messaging. In addition to the HL7 Adapter, these Projects include several Collaborations that define processing logic in addition to the rules configured for the Adapter. You can use these Collaborations as a template for the Projects you create for your own HL7 system.
The following topics provide instructions for copying and customizing HL7 Collaborations:
The following topics provide information about how the Collaborations are defined and the functional flow of the Collaborations:
The predefined Collaborations are designed to be extended and modified, however, for HL7 V3 compliant systems this is not necessary. If you need to modify an HL7 V3 Collaboration, it is strongly suggested that you use these template Collaborations as the basis for any new Collaborations. Therefore, it is important to maintain the original predefined jcdHL7V3Inbound and jcdHL7V3Outbound Collaborations in their initial form for future use.
Before working with the HL7 V3 sample Projects, be sure that the required HL7 V3 SAR files are uploaded to the repository. The required files are listed below:
HL7eWay.sar
HL7OTDLibrary.sar
HL7V32006ACCTBilling.sar
HL7V32006ClaimsAndReimb.sar
HL7V32006ClinicalGenomics.sar
HL7V32006MedicalRecords.sar
HL7V32006MsgContActInfra.sar
HL7V32006PatientAdmin.sar
HL7V32006PersonnelManagement.sar
HL7V32006PublicHealthRepot.sar
HL7V32006QueryInfra.sar
HL7V32006RegulateStudies.sar
HL7V32006Scheduling.sar
HL7V32006SharedMessages.sar
HL7V32006TransInfra.sar
It is recommended that you retain the sample Projects as they are and create copies of the Projects to use as a basis for your new customized Projects. To create a copy of a Project, you first export the original Project to a file, change the name of the original Project, and import the exported Project back into the Repository.
Start the CAPS Repository.
Start the NetBeans IDE.
On the NetBeans toolbar, click Tools, point to CAPS Repository, and then select Connect.
The Connect to CAPS Repository dialog box appears.
Enter the connection information and click Connect.
When connected the icon in the status bar turns from red to green.
Export the Project you want to copy:
On the Projects window, right-click the Project to copy, click Export, and then click Project.
The Export Manager dialog box appears.
Select the Projects and Environments to export.
The selected Project appears in the Selected Projects: pane of the Export Manager.
Select the Project or the Environment from the left pane and click the right-arrow button to add the Project to the Selected Projects pane.
Click the left-arrow button , if you want to move the selected projects from the right pane to the left pane.
Click Browse and select an appropriate directory to save the exported Project.
Click Export.
The Project is compressed and saved to the specified directory and file name.
Rename the original Project in the NetBeans IDE.
The NetBeans IDE will not import identically named Projects to the same root, so you must perform this step before importing the Project back in.
On the NetBeans IDE, click Save All.
Import the Project back in to the Repository.
On the NetBeans menu bar, select Tools, point to CAPS Repository, and then select Import Project from the drop-down menu.
A confirmation dialog box appears asking if you need to save any changes.
Click Yes to proceed with importing a project.
The Import Manager appears.
Click Browse, navigate to the location you specified for the export, and select the Project you just exported.
Click Import.
It may take a few seconds to import the project. When the project is imported, the Import Status dialog box appears.
Click OK on the dialog box.
The CAPS Repository is refreshed, and you now have two copies of the same Project in the Repository.
The predefined Collaborations are designed to be extended and modified, however, for HL7 compliant systems this is not necessary. If you need to modify an HL7 Collaboration, it is strongly suggested that you use the template Collaborations as the basis for any new Collaborations. You should always keep a copy of the sample Projects in their original form for this use.
The following steps describe creating copies of the HL7 Collaborations and adding a new Message Library to an existing Collaboration:
Production Projects contain several Collaborations. To create multiple copies of the HL7 Collaborations for your Project, copy and paste the original Collaborations into your project.
On the Projects window of the NetBeans IDE, expand the Project containing the Collaboration you want to copy until you see the Collaboration.
Right-click the Collaboration you want to copy, and select Copy.
Right-click the Project to which you want to copy the Collaboration, and select Paste.
A copy of the Collaboration appears in your Project. The Collaboration can be copied within the Project or to another Project. If you copy it to the same Project, a number is appended to the Collaboration name.
Repeat this step for additional copies of the Collaboration.
To add each new Collaboration to a Project's Connectivity Map, drag and drop the Collaboration from the Projects Explorer tree to the Connectivity Map Editor.
The new Collaborations can now be associated with the Project's components.
In some cases, a specific HL7 message or messages might need to be added to the Collaboration. Perform the following to add a HL7 Message Library to an existing Collaboration.
Make sure you are using the correct version of the Message Library for the Collaboration you are working with.
On the NetBeans Project window, right-click the Collaboration to which you want to add the HL7 Message Library.
Select Properties from the drop-down menu.
The Collaboration Definition (Java) Properties dialog box appears.
Select Keep Current Operation as the value for the Operation Configuration field.
Click Add to select the object type definition.
A dialog box appears where you can select the Message Library to add.
In the Look In field, navigate to the location of the Message Library.
The HL7 Message Libraries are located in CAPS Components Library > Message Library > HL7.
Select the Message Library and then click Select.
The Message Library is added to the list.
You can also modify an existing HL7 V2 Message Library by clicking the Message Library to change, clicking the ellipsis that appears, and selecting the appropriate Message Library.
On the Collaboration Definition Properties dialog box, click OK.
This section provides an overview and description of the structure and functionality of the inbound and outbound Collaborations provided as part of the TCP/IP HL7 Adapter for V2.x.
The following topics provide information about the sample V2 Collaborations and provide instructions for copying and customizing them:
Several sample Projects are provided with the TCP/IP HL7 Adapter to illustrate different scenarios for connecting with external HL7 systems. You can download the sample Projects from the Downloads page of the Java CAPS Suite Installer.
While this section focuses on the standard inbound and outbound HL7 scenarios, you can choose from any of the following HL7 V2 samples:
HL7 Adapter Inbound Collaboration Projects
HL7 Adapter Outbound Collaboration Projects
HL7 Adapter Inbound Collaboration Projects With XML Support Over MLLPV2
HL7 Adapter Outbound Collaboration Projects With XML Support Over MLLPV2
HL7 Adapter Inbound Collaboration Projects With XML Support Over MLLPV1
HL7 Adapter Outbound Collaboration Projects With XML Support Over MLLPV1
This section describes the inbound Collaboration (jcdHL7Inbound) and the outbound Collaboration (jcdHL7Outbound), provided within the standard sample Projects for inbound and outbound HL7 V2 messaging. These Collaborations are designed to work as is for HL7 V2 compliant interfaces, and can be configured for your specific needs using only the property configuration files. If an interface requires special functionality, the Collaboration's Java code is easily accessible for modification, much of which can be created graphically using the Collaboration Editor's Business Rules Designer.
The Collaborations contain a number of Message Libraries that extend functionality for HL7 V2 message handling, logging, error messaging, journaling, and sequence numbering. These include both generic HL7 Message Libraries for HL7 ACK/NAK generation or verification, and the Resource Adapter that communicates to the external system and offers services to the application server. The Collaborations control messaging protocol and all business logic.
The Collaborations are designed to target one unit of work at a time, meaning the resolution of one message at a time. The basic structure of both Collaborations is a state machine implemented in a Java switch statement. The state machine keeps track of the messaging protocol so when a Collaboration is invoked, it can retrieve the state of the connection just handed to it by the RA, and then execute the proper actions based on the state machine.
At the end of each action, the state is set for the next execution of the Collaboration. There are three main states:
To Establish: A new or reset connection needs to have an HL7 session established. If sequence numbering is used, the sequence numbers need to be negotiated.
Messaging: This is where the exchange of messages and ACKs takes place.
Shutdown: This is where any cleanup can happen before the connection is closed, or to close the connection.
Additional Collaborations can be added to a Project to increase message flow.
The TCP/IP HL7 V2 inbound Collaboration publishes received data as a Byte message in JMS using the sendBytes() method. However, the HL7 V2 outbound Collaboration expects a Text message from JMS. The adapter is not designed for the HL7 V2 outbound Collaboration to subscribe to a JMS data queue created by the HL7 V2 inbound Collaboration directly. HL7 V2 inbound and outbound Collaborations are designed to communicate through an HL7 V2 TCP/IP adapter connection.
The inbound HL7 V2 Collaboration, jcdHL7inbound, contains Message Libraries for the HL7 Resource Adapter, JMS Data, HL7 ACK, JMS Journal, and JMS Error, as well as the Generic HL7 Event. The Collaboration works with its own internal code and the properties configuration files.
This following topics describe the business logic defined in the jcdHL7Inbound Collaboration:
The inbound Collaboration is triggered by an HL7 V2 message received from an external system or an outbound HL7 V2 client. The Collaboration calls the HL7 V2 user Collaboration rule by executing receive().
The receive method is the entry point to the HL7 V2 user Collaboration, with the following signature:
public void receive(com.stc.connector.appconn.tcpip.hl7.HL7ServerApplication input, com.stc.connectors.jms.JMS otdJMS_DATA, com.stc.SeeBeyond.OTD_Library.HL7.Generic.HL7_GENERIC_EVT.GENERIC_EVT otdHL7_GENERIC_EVT_1, com.stc.SeeBeyond.OTD_Library.HL7.Generic.HL7_ACK.AC K otdHL7_ACK_1,com.stc.connectors.jms.JMS otdJMS_JOURNAL, com.stc.connectors.jms.JMS otdJMS_ERROR) throws Throwable |
The above text has been wrapped to fit the page.
Once the message is received, the Collaboration determines whether the message needs to be validated. The HL7 V2 message is then validated making sure that the message structure is correct. Various fields in the MSH segment of the message are also validated, such as Version ID and Sending Facility. If these fields do not match the configuration, a NAK is returned.
If sequence numbering is enabled the Collaboration checks to see if the messages sequence number is valid. If the sequence number is not valid, the adapter sends a NAK.
The validated HL7 V2 message moves on to processInitialHandshake() and the sequence numbers are synchronized. The sequence number within the message is checked against the expected sequence number. If the numbers match, the Collaboration sends an ACK, if not it sends a NAK. The ACK or NAK includes information from various fields of the incoming MSH segment. The ACKs level of acknowledgement is set to A (acknowledgement is sent after the message is successfully processed) or C (acknowledgement is sent when the message is successfully received).
The Collaboration receives the HL7 V2 message from the external using receiveHL7message(). If an exception occurs due to incomplete data and the adapter fails to read the data within the configured number of retries, the associated recourse action is taken. If the exception is due to no response, the associated recourse action is taken.
If no exception occurs, validateHL7Message() is called, which validates the message to determine whether to ACK or NAK the message. Other helper methods are also called to validate the HL7 V2 message.
If the HL7 V2 message does not pass validation, the Collaboration calls makeNak() and sendHL7Nak() to create and send the NAK to the external system. The HL7 V2 message, with the NAK, is archived to the error queue. If the number of consecutive NAKs sent surpasses the maximum number of retries, the associated recourse action is taken.
If the HL7 V2 message passes validation, the Collaboration calls makeAck() and sendHL7Ack() to create and send the ACK to the external.
After the ACK is sent, the HL7 V2 message and the ACK are journaled to the JMS queue Journal destination. If the message fails to journal, the associated recourse action is taken.
If sequence numbering is enabled, the processAckNakSequenceNumbering method calculates the next sequence number and stores the number in the sequence number file by calling the updateSequenceNumberFile method to persist the next sequence number.
The outbound HL7 V2 Collaboration, jcdHL7Outbound, contains Message Libraries for the HL7 Resource Adapter, JMS Data, HL7 ACK, JMS Journal, and JMS Error, as well as the Generic HL7 Event. The Collaboration works with its own internal code and the properties configuration files. The outbound Collaboration assumes that it is reading valid HL7 V2 messages, so the data flow that feeds this Collaboration must ensure this.
The following topics describe the business logic defined in the jcdHL7Outbound Collaboration:
The Collaboration is triggered by a JMS HL7 V2 message. The Collaboration then calls the HL7 User Collaboration Rule by executing the receive method. Receive is the entry point to the HL7 User Collaboration, with the following signature,
receive (input, otdHL7eWay_1, otdJMS_JOURNAL, otdJMS_ERROR, otdHL7_ACK_1, otdHL7_GENERIC_EVT_1) |
The incoming HL7 V2 message is then validated, making sure that the message structure is correct. Various fields of the message are also validated, such as Sending Facility, Version ID, and MSH.
If the message does not pass validation, an error occurs and the associated recourse action is applied. If the HL7 V2 message passes validation, the message moves on to processInitialHandshake() to receive a sequence number (if sequences numbering is enabled). The Collaboration takes the sequence number from the sequence numbering file and determines the next number to use. This number is then inserted into the HL7 V2 message.
Next, the message moves on to processMessage(), which calls the helper method, sendAndReceive(). The sendAndReceive method sends the HL7 message, waits for an HL7 ACK message, and processes the ACK or NAK. The validation also checks the message structure to see if the message is unmarshaled. If a valid ACK is not received, it continues to send the HL7 V2 message up to the configured number of retries, at which time an error occurs and the associated recourse action is taken. If a valid ACK is received, the message moves on to insertSequenceNumber().
If sequence numbering is enabled, the insertSequenceNumber method inserts the sequence number and calls sendHL7Message(). The sendHL7Message method sends the HL7 V2 message to the external using the HL7 adapter Message Library.
The Collaboration receives the HL7 ACK or NAK from the external system using receiveHL7AckNak(). If an exception occurs due to incomplete data and the adapter fails to read the data within the configured number of retries, the associated recourse action is taken. If the exception is due to no response, the associated recourse action is taken. If no exception occurs, the ACK or NAK message moves on to isAckMessage(), which validates the message to determine whether the message is an ACK or a NAK.
Next the validateAckNak method unmarshals the message to the ACK Message Library and validates the MSH/MSA data. It also calls other helper methods such as checkSendingReceivingApplication() and checkSendingReceivingFacility() to validate the ACK message.
If the message does not pass validation it is handled as a NAK, the associated recourse action is taken, and the message is archived in the error queue.
If the message is a NAK, the associated recourse action is taken, and the message is archived in the error queue, along with the NAK message, as a JMS property.
If the message is an ACK and passes validation, the message is sent on to the journalMessage method
If the ACK message passes validation, the HL7 V2 message and ACK message are sent to the JMS journal destination. If the message fails to journal, the associated recourse action is taken.
If sequence numbering is enabled, the processAckNakSequenceNumbering method calculates the next sequence number and stores the number in the sequence number file, calling updateSequenceNumberFile to persist the next sequence number.
In addition to the inbound and outbound HL7 V2 Collaborations, an outbound test Collaboration, jcdHL7OutboundTestDriver, is provided to test the HL7 V2 outbound and HL7 V2 outbound delayed ACK samples.
The jcdHL7OutboundTestDriver Collaboration simply picks up HL7 V2 messages from the File Adapter and sends the message to the JMS queue. This is used by the sample Projects to test the number of HL7 V2 messages processed per minute.
The following topics provide a brief overview of HL7 V3, and describe the HL7 V3 Collaborations and provide instructions on copying and customizing the Collaborations:
For more information about HL7 V3, refer to the HL7 V3 Guide.
HL7 V3, like V2.x, is a standard for exchanging messages among healthcare information systems. However, HL7 V3 is not compatible with V2. V3 defines a more fully-specified data model with less flexibility for customization. This presents a tighter standard that is easier to use, and provides a higher level of formal modeling, complexity, and internal consistency.
HL7 V3 is based on information models, which define the specifications of sets of data that are specific to one area of interest. There are different types of information models, including:
Reference Information Model (RIM) – Defines the information content for a domain.
Domain Information Model (D-MIM) – Defines a set of class clones, attributes, and relationships, and is a subset of the RIM. Domains include the following:
Domains under Administrative Management:
Accounting and Billing
Claims & Reimbursements
Patient Administration
Personnel Management
Scheduling
Domains under Health and Clinical Management:
Clinical Document Architecture
Medical Records
Public Health Reporting
Clinical Genomics
Specimen Domain
Regulated Studies
Refined Message Information Model (R-MIM) – Defines message-specific content, and is a subset of the D-MIM).
The V3 standard also includes interactions, such as Create Patient Billing Account.
There are three modes of Acknowledgement process in HL7 V3:
Immediate Mode
Deferred Mode
Queued Mode
Several HL7 V3 sample Projects are provided with the TCP/IP HL7 Adapter to illustrate different scenarios for connecting with external HL7 systems. You can download the sample Projects from the Downloads page of the Java CAPS Suite Installer.
While this section focuses on the standard inbound and outbound HL7 scenarios, you can choose from any of the following samples:
HL7 Adapter Inbound Collaboration Project for HL7V3 PRPA_IN403001UV01 Interaction over MLLPV2
HL7 Adapter Outbound Collaboration Project for HL7V3 PRPA_PRPA_IN403001UV01 Interaction over MLLPV2
HL7 Adapter Inbound Collaboration Project for HL7V3 PRPA_IN403001UV01 With Schematron Validation Enabled
HL7 Adapter Collaboration Project for HL7 V2 to V3 Conversion and ebXML Wrapper on HL7V3 Message
HL7 Adapter Inbound Collaboration Project That Invokes Sub Collaborations for HL7V3
This section describes two inbound Collaboration (jcdHL7V3Inbound and jcdHL7V3DefrdInbound) and an outbound Collaboration (jcdHL7v3Outbound), provided within the standard sample Projects for inbound and outbound HL7 V3 messaging. These Collaborations are designed to work as is for HL7 V3 compliant interfaces, and can be configured for your specific needs using the property configuration files. If an interface requires special functionality, the Collaboration's Java code is easily accessible for modification, much of which can be created graphically using the Collaboration Editor's Business Rules Designer.
The Collaborations contain a number of Message Libraries that extend functionality for HL7 V3 message handling, logging, error messaging, journaling, and sequence numbering. These include both HL7 Message Libraries for the V3 domains, and the Resource Adapter that communicates to the external system and offers services to the application server. The Collaborations control messaging protocol and all business logic.
There are four inbound Collaborations in the prjHL7V3Inbound Project:
Inbound HL7 V3 Immediate Collaboration
Inbound HL7 V3 Deferred Collaboration
Inbound HL7 V3 Queue Manager
Inbound HL7 V3 Message Publisher
The Inbound HL7 V3 Collaboration, jcdHL7V3Inbound, contains Message Libraries for the HL7 V3 Resource Adapter, JMS Data, JMS Journal, and JMS Error, as well as the HL7 V3 Patient Administration Domain Interaction Event (PRPA_IN403001UV01) and the corresponding HL7 V3 Acknowledgements (MCCI_IN000004UV01). The Collaboration works with its own internal code and the properties configuration files.
Immediate mode contains only one type of Acknowledgement Message Library, MCCI_IN000004UV01.
The following topics describe the business logic defined in the jcdHL7V3Inbound Collaboration:
HL7 V3 Standard Inbound Message Mode Data Flow (For Immediate Mode of ACK Process) — Part 1
HL7 V3 Standard Inbound Message Mode Data Flow (For Immediate Mode of ACK Process) — Part 2
An HL7 V3 message triggers an inbound Collaboration received from an external system or an outbound HL7 V3 client. The Collaboration calls the HL7 V3 user Collaboration rule by executing receive().
The receive method is the entry point to the HL7 V3 User Collaboration, with the following signature:
public void receive(com.stc.connector.appconn.tcpip.hl7.HL7ServerApplication input, com.stc.connectors.jms.JMS otdJMS_DATA, xsd.hl7v3.PRPA_IN403001UV01.PRPA_IN403001UV01_ otd_PRPA_IN403001UV01_1 xsd.hl7v3.MCCI_IN000004UV01.MCCI_IN000004UV01_ otd_MCCI_IN000004UV01 otdHL7_ACK_1,com.stc.connectors.jms.JMS otdJMS_JOURNAL, com.stc.connectors.jms.JMS otdJMS_ERROR) throws Throwable. |
The above text has been wrapped to fit the page.
Once the message is received, the Collaboration determines whether the message needs to be validated. The HL7 V3 message is then validated, making sure that the message structure is correct. Various fields in the Transmission Wrapper of the message are also validated, such as Version Code, Processing Code, Processing Mode Code, and Interaction ID. If these fields do not match the configuration, a NAK is returned.
The Collaboration receives the HL7 V3 message from the external using receiveHL7Message(). If an exception occurs due to incomplete data, and the adapter fails to read the data within the configured number of retries, the associated recourse action is taken. If the exception is due to no response, the associated recourse action is taken.
If no exception occurs, validateHL7Message() is called, which validates the message to determine whether to ACK or NAK the message. Other helper methods are also called to validate the HL7 V3 message.
If the HL7 V3 message does not pass validation, the Collaboration calls makeNak() and sendHL7Nak() to create and send the NAK to the external. The HL7 V3 message, with the NAK, is archived to the error queue. If the number of consecutive NAKs sent surpasses the maximum number of retries, the associated recourse action is taken.
If the HL7 V3 message passes validation, the Collaboration calls makeAck() and sendHL7Ack() to create and send the ACK to the external.
After the ACK is sent, the HL7 V3 message and the ACK are journaled to the JMS queue journal destination. If the message fails to journal the associated recourse action is taken.
The Inbound HL7 V3 Collaboration, jcdHL7V3DeferredInbound, contains Message Libraries for the HL7 V3 Resource Adapter, JMS Data, JMS Journal, JMS Error, and JMS APP ACK as well as the HL7 V3 Patient Administration Domain Interaction Event (PRPA_IN403001UV01) and the corresponding HL7 V3 Commit Acknowledgement (MCCI_IN000006UV01) and Application Acknowledgement (MCCI_IN000007UV01). The Collaboration works with its own internal code and the Properties Configuration files.
Deferred mode contains the following two types of Acknowledgement Message Libraries:
Commit Acknowledgement (MCCI_IN000006UV01)
Application Acknowledgement (MCCI_IN000007UV01)
The above JCD (jcdHL7V3DeferredInbound) will also work for both immediate mode and deferred mode.
The following topics describe the business logic defined in the jcdHL7V3DeferredInbound Collaboration:
HL7 V3 Standard Inbound Message Mode Data Flow (For Deferred Mode of ACK Process) — Part 1
HL7 V3 Standard Inbound Message Mode Data Flow (For Deferred Mode of ACK Process) — Part 2
HL7 V3 Standard Inbound Message Mode Data Flow (For Deferred Mode of ACK Process) — Part 3
A HL7 V3 message triggers an inbound Collaboration received from an external system or an outbound HL7 V3 Client. The Collaboration calls the HL7 V3 user Collaboration rule by executing receive().
The receive method is the entry point to the HL7 V3 User Collaboration, with the following signature:
public void receive(com.stc.connector.appconn.tcpip.hl7.HL7ServerApplication input, com.stc.connectors.jms.JMS otdJMS_DATA, xsd.hl7v3.PRPA_IN403001UV01.PRPA_IN403001UV01_ otd_PRPA_IN403001UV01_1 xsd.hl7v3.MCCI_IN000004UV01.MCCI_IN000004UV01_ otd_MCCI_IN000004UV01 xsd.hl7v3.MCCI_IN000006UV01.MCCI_IN000006UV01_ otd_MCCI_IN000006UV01 xsd.hl7v3.MCCI_IN000007UV01.MCCI_IN000007UV01_ otd_MCCI_IN000007UV01 com.stc.connectors.jms.JMS otdJMS_APPACK otdHL7_ACK_1,com.stc.connectors.jms.JMS otdJMS_JOURNAL, com.stc.connectors.jms.JMS otdJMS_ERROR) throws Throwable. |
The above text is wrapped to fit the page.
Once the message is received, the Collaboration determines whether the message needs to be validated. The HL7 V3 message is then validated, making sure that the message structure is correct. Various fields in the Transmission Wrapper of the message are also validated, such as Version Code, Processing Code, Processing Mode Code, and Interaction ID. If these fields do not match the configuration, a NAK is returned.
If sequence numbering is enabled the Collaboration checks to see if the messages sequence number is valid. If the sequence number is not valid, the adapter sends a NAK. The validated HL7 V3 message moves on to processInitialHandshake().
The Collaboration receives the HL7 V3 message from the external using receiveHL7message(). If an exception occurs due to incomplete data, and the adapter fails to read the data within the configured number of retries, the associated recourse action is taken. If the exception is due to no response, the associated recourse action is taken.
If no exception occurs, validateHL7Message() is called, which validates the message to determine whether to ACK or NAK the message. Other helper methods are also called to validate the HL7 V3 message.
If the HL7 V3 message passes validation, the Collaboration calls makeCommitAck() and sendHL7CommitAck() to create and send the Commit ACK (MCCI_IN000006UV01) to the external. It then calls journalHL7AppAck() to create Application ACK (MCCI_IN000007UV01) and store it into the JMS.
After the Commit ACK is sent and the Application ACK is stored in JMS, the HL7 V3 message and the ACKs are journaled to the JMS queue journal destination. If the message fails to journal the associated recourse action is taken.
The Outbound HL7 V3 Collaboration, jcdHL7V3Outbound, contains Message Libraries for the HL7 V3 Resource Adapter, JMS Data, JMS Journal, and JMS Error, as well as the HL7 V3 Patient Administration Domain Interaction Event (PRPA_IN403001UV01) and the corresponding HL7 V3 Acknowledgements. MCCI_IN000004UV01 for Immediate Mode and MCCI_IN000006UV01 for Deferred Mode. The Collaboration works with its own internal code and the Properties Configuration files. The outbound Collaboration assumes that it is reading valid HL7 V3 messages, so the data flow that feeds this Collaboration must ensure this.
The Outbound Collaboration is for both immediate and deferred mode.
The following topics describe the processing logic defined in the jcdHL7V3Outbound Collaboration:
The Collaboration is triggered by a JMS HL7 V3 message. The Collaboration then calls the HL7 V3 User Collaboration Rule by executing the receive method. Receive is the entry point to the HL7 V3 User Collaboration, with the following signature:
receive (input, otdHL7eWay_1, otdJMS_JOURNAL, otdJMS_ERROR, otd_MCCI_IN000004UV01_1, otd_MCCI_IN000006UV01_1, otd_PRPA_IN403001UV01_1) |
The incoming HL7 V3 message is then validated, making sure that the message structure is correct. Various fields in the Transmission Wrapper of the message are also validated, such as Version Code, Processing Code, Processing Mode Code, and Interaction ID.
If the message does not pass validation, an error occurs and the associated recourse action is applied. If the HL7 V3 message passes validation, the message moves on to processInitialHandshake() to receive a sequence number (if sequences numbering is enabled only for Deferred Mode). The Collaboration takes the sequence number from the sequencing numbering file and determines the next number to use. This number is then inserted into the HL7 V3 message.
Next, the message moves on to processMessage(), which calls the helper method, sendAndReceive(). The sendAndReceive method sends the HL7 V3 message, waits for an HL7 V3 ACK message, and processes the ACK or NAK. The validation also checks the message structure to see if the message is unmarshaled. If a valid ACK is not received, it continues to send the HL7 V3 message up to the configured number of retries, at which time an error occurs and the associated recourse action is taken.
In processMessage(), the message moves on to insertSequenceNumber(). If sequence numbering is enabled and is in Deferred Mode, the insertSequenceNumber method inserts the sequence number and call sendHL7Message(). The sendHL7Message method sends the HL7 V3 message to the external using the HL7 V3 adapter Message Library
The Collaboration receives the HL7 V3 ACK or NAK from the external using receiveHL7AckNak(). If an exception occurs due to incomplete data, and the adapter fails to read the data within the configured number of retries, the associated recourse action is taken. If the exception is due to no response, the associated recourse action is taken. If no exception occurs, the ACK or NAK message moves on to isAckMessage(), which validates the message to determine whether the message is an ACK or a NAK.
Next, the validateAckNak method unmarshals the message to the ACK Message Library in MCCI_IN000004UV01 Message Library for Immediate Mode and MCCI_IN000006UV01 Message Library for Deferred Mode.
If the message does not pass validation it is handled as a NAK, the associated recourse action is taken, and the message is archived in the error queue.
If the message is a NAK, the associated recourse action is taken, and the message is archived in the error queue, along with the NAK message, as a JMS property
If the message is an ACK and passes validation, the message is sent on to the journalMessage method.
If the ACK message validates, the HL7 V3 message and ACK message are sent to the JMS journal Destination. If the message fails to journal, the associated recourse action is taken.
If sequencing numbering is enabled for Deferred Mode, the processAckNakSequenceNumbering method calculates the next sequence number and stores the number in the sequence number file, calling updateSequenceNumberFile to persist the next sequence number.
For information, see HL7 V2 Outbound Test Collaboration.
Minimal Lower Layer Protocol Release 2 (MLLP V2.0) is a message transport protocol, and is required for all message transport protocols used to transport HL7 Version 3 content. This protocol wraps the HL7 message to indicate the beginning and end of each message.
The following topics provide instruction on how to set up the MLLP database, and describe MLLP V2.0 and the MLLP V2.0 sample Project provided with the TCP/IP HL7 Adapter:
Using the HL7 Adapter with MLLP V2.0 transport scenarios requires an MLLP database. This topic describes the steps to connect to Sun's Java Database (based on the Apache Derby database) and run the MLLP V2.0 database scripts.
The TCP/IP HL7 Adapter supports the following database platforms for the MLLP database:
DB2
Java DB (Derby)
Oracle
Microsoft SQL Server
Sybase
Perform the following steps in the order given to set up the MLLP database:
Create a database instance using your database platform tools. If you are using a Java DB database, perform the following steps to create the database:
On the NetBeans Services window, expand Databases.
Right-click Java DB, and then click Create Database.
The Create Java DB Database dialog box appears.
Enter a name for the database, along with a login user name and password.
Click OK.
The database appears in the list of databases on the Services window.
Make sure your database instance is running.
For Oracle, DB2, SQL Server, and Sybase databases, do the following:
Copy the database driver file to JavaCAPS_Home/appserver/lib.
Under Databases on the NetBeans Services window, right-click Drivers and then select New Driver.
The New JDBC Driver dialog box appears.
Click Add, and then brows to and select the database driver file.
Select or look for the driver class to use.
Accept the default name or enter a name for the driver.
Click OK.
In the Drivers list on the Services window, right-click the driver you just added and click Connect Using.
The New Database Connection dialog box appears.
Enter the connection information for the database instance you created for MLLP and then click OK.
The new database connection appears in the Databases list.
On the NetBeans Services window, right-click the MLLP database, and click Connect.
NetBeans connects to the database and the icon changes for that database. The following figure illustrates a Java DB connection.
A broken icon represents that the database is not connected.
You can either run the MLLP database scripts from NetBeans or from a SQL editor. The following steps take you through running the scripts from NetBeans.
On the NetBeans IDE, click the Projects tab.
Expand CAPS Components Library > Adapters > HL7 > Database Scripts.
Right-click db_platform_install.sql; for example, derby_install.sql.
Click Open.
This opens the SQL Editor window along with the SQL Statement.
CREATE TABLE HL7MESSAGELOG (MESSAGEID VARCHAR(250), APPLICATIONID VARCHAR(250) , REQUESTMESSAGE CLOB, RESPONSEMESSAGE CLOB, STATUS SMALLINT, CREATEDTIME TIMESTAMP, LASTUPDATEDTIME TIMESTAMP) |
In the SQL Editor toolbar, click in the Connection field and select the database connection from the drop-down list.
In the toolbar, click Run SQL.
A message appears in the Output panel indicating whether the script was run successfully.
To view the new tables, return to the Services window, right-click the database connection, and then click Refresh. Expand the database connection and then Tables to view the database.
In order to connect to the database, you need to define a JDBC connection pool and JDBC resource using the GlassFish Admin Console or the command-line interface.
Start the GlassFish server.
To create the connection pool and JDBC resource, follow the instructions under Creating a JDBC Connection Pool in Sun GlassFish Enterprise Server 2.1 Administration Guide.
Use the information from the database connection you created earlier in To Create and Connect to the Database.
Once you create the MLLP database, you can connect to it from the inbound TCP/IP HL7 Adapter. You do this in the HL7 External Systems properties located in the CAPS Environment you create for the HL7 Project. This procedure assumes you have already created the Environment and that it includes an HL7 External System.
On the NetBeans Services window, expand CAPS Environments, and then expand the HL7 Environment you created for your Project.
Right-click the HL7 External System, and select Properties.
The Properties Editor appears.
In the left pane, expand HL7 Inbound eWay.
Select Database Settings.
In the JNDI Name of the JDBC Datasource property, enter the JNDI name of the JDBC Resource you created under To Create the Connection Pool and JDBC Resource.
Click OK.
MLLP Release 2 is a reliable message transport protocol. It guarantees in order delivery and at least once delivery of HL7 content. HL7 content is framed in a block and sent to the destination system. The destination system acknowledges the receipt of the message by returning a commit acknowledgement message. The MLLP V2 acknowledgement protocol is synchronous: the source system will not send new HL7 content until an acknowledgement for the previous HL7 content has been received.
If the HL7 content (a query in the example below) triggers the sending of HL7 content (a response) by the destination system, then this HL7 content is framed in a block and sent. MLLP has no knowledge of the HL7 content, nor does it base any part of its behavior on HL7 content. With the TCP/IP HL7 Adapter, a database is used to persist the message.
In inbound mode, once the message is received by the HL7 Adapter, it is persisted into the database and a commit acknowledgement is sent to the sender before the HL7 message is passed to the Collaboration level. If the persistence fails, a negative acknowledgement is sent to the sender and the Collaboration receives null as its message. Inside the Collaboration, the message received is null and the Collaboration returns without proceeding.
If the message received is a duplicate message and if an ACK/NAK is already available in the persistence database, the same is retrieved from the database and sent to the sender. The Collaboration receives null as the received message.
In outbound mode, the message is sent to the sender and waits for the commit acknowledgement or negative acknowledgement from the receiver. If the adapter receives a negative acknowledgement, the message is sent again until the configured maximum number of retries is made.
In the MLLP V2 sample Projects, the inbound HL7 V2 Collaboration, jcdHL7Inbound, contains Message Libraries (previously called OTDs) for the HL7 Resource Adapter, JMS Data, HL7 ACK, JMS Journal, and JMS Error, as well as the Generic HL7 Event. The Collaboration works with its own internal code and the properties configuration files.
The following topics describe the business logic defined in the jcdHL7Inbound Collaboration for MLLP V2:
HL7 V2 Standard Inbound Message Mode Data Flow over MLLPV2 — Part 1
HL7 V2 Standard Inbound Message Mode Data Flow over MLLPV2 — Part 2
HL7 V2 Standard Inbound Message Mode Data Flow over MLLPV2 — Part 3
Once the message is received, the Collaboration determines whether the message needs to be validated. The HL7 V2 message is then validated making sure that the message structure is correct. Various fields in the MSH segment of the message are also validated, such as Version ID and Sending Facility. If these fields do not match the configuration, a NAK is returned.
If sequence numbering is enabled the Collaboration checks to see if the messages sequence number is valid. If the sequence number is not valid, the adapter sends a NAK.
The validated HL7 V2 message moves on to processInitialHandshake() and the sequence numbers are synchronized. The sequence number within the message is checked against the expected sequence number. If the numbers match, the Collaboration sends an ACK, if not it sends a NAK. The ACK or NAK includes information from various fields of the incoming MSA segment. The ACKs level of acknowledgement is set to A (acknowledgement is sent when the message is successfully received) or C (acknowledgement is sent after the message is successfully processed).
The Collaboration receives the HL7 V2 message from the external using receiveHL7message(). If an exception occurs due to incomplete data, and the adapter fails to read the data within the configured number of retries, the associated recourse action is taken. If the exception is due to no response, the associated recourse action is taken.
If no exception occurs, validateHL7Message() is called, which validates the message to determine whether to ACK or NAK the message. Other helper methods are also called to validate the HL7 message.
If the HL7 message does not pass validation, the Collaboration calls makeNak() and sendHL7Nak() to create and send the NAK to the external system. The HL7 message, with the NAK, is archived to the error queue. If the number of consecutive NAKs sent surpasses the maximum number of retries, the associated recourse action is taken.
If the HL7 message passes validation, the Collaboration calls makeAck() and sendHL7Ack() to create and send the ACK to the external system. The HL7 ACK/NAK messages are stored in the persistent database. This ACK/NAK is stored against the inbound HL7 message received.
After the ACK is sent, the HL7 message and the ACK are journaled to the JMS queue journal destination. If the message fails to journal the associated recourse action is taken.
If sequencing numbering is enabled, the processAckNakSequenceNumbering method calculates the next sequence number and stores the number in the sequence number file by calling the updateSequenceNumberFile method to persist the next sequence number.