As creation of HL7 message is completed, we are looking towards tools which can help us validate the message against PAM profile.
After which we will move to the next phase which is sending of the message to OpenHIE. We will be sending the message over MLLP, as PAM structure supports MLLP protocol. We will use HAPI library to send the message. Here are the steps of how HAPI works to send out HL7 message.
Sending message using HAPI
1. A server to listen to messages.
2. Register with the application to handle ADT_A05 message.
3. Create ConnectionHub object to connect to the the listening servers.
4. Next create a Connection object to connect to HL7 server.
5. An initiator object will be needed to transmit the message.
6. A response will be received on successful transmission of message.
Here the server which needs to listen to message is a HIE endpoint. We will now look into how the OpenHIE will receive these messages.

1. The Point-of-Care(PoC) will save the patient in the Interoperability Layer (IL).
2. The IL will then directly save the patient in the Client Registry (CR).
3. The CR sends a response message, HL7 ACK to IL.
4. The message from the CR is passed directly through to the PoC by the IL.
Here OpenMRS will be acting as the Point-of-Care (PoC).