Mirth HL7 ACK ERROR: Message control Ids do not match
Asked Answered
A

2

6

I'm starting out with Mirth and HL7 and I'm trying to send a message to a remote server. My MSH looks as follows:

MSH|^~\&|EPIC|EPIC|IMG_SCHEDULE_APPT|REMOTE|20170328193318|PERSONNAME|ORM^O01|12345678|T|2.4||||||||||

The response looks as follows:

MSH|^~\&|IMG_SCHEDULE_APPT|REMOTE|EPIC|EPIC|20170328193318||ACK|12345678|T|2.4|
MSA|AA|||

and I get an error saying ERROR: Message control Ids do not match.

As far as I understand this error means that the Message Control Id which is returned in the ACK message is not the same.

From what I can see, the number 12345678 is the Message Control Id, and I see that number both in the message I send as well as the in the ACK which is returned. So what is wrong here? And who is at fault? Me or the remote party?

Does anybody know how I can solve or debug this?

Avera answered 28/3, 2017 at 17:57 Comment(0)
N
2

If you don't want to validate the message control ID, you can open the Response Validation properties and uncheck "Validate Message Control Id":

Channel Summary Tab -> Set Data Types

If the remote system cannot change their logic and you still want to validate the control ID, you can do that in a response transformer:

if (responseStatus == ERROR) {
    // msg here is the ACK, origMsg is the encoded data that was sent outbound
    var origMsg = new XML(SerializerFactory.getSerializer('HL7V2').toXML(connectorMessage.getEncodedData()));
    if (origMsg.MSH['MSH.10']['MSH.10.1'].toString() == msg.MSH['MSH.10']['MSH.10.1'].toString()) {
        responseStatus = SENT;
    }
}
Niggard answered 7/4, 2017 at 16:9 Comment(0)
E
1

MSA.2 (Message Control ID) is required and should be the same as the ControlId in the former message that the ACK message acknowleges..

Eolith answered 29/3, 2017 at 8:55 Comment(1)
Strictly speaking, MSH-10 on the ACK message could be some other value than what the original sending system sends (think for example a system that responds to queries from multiple systems, and uses a counter to populate the message IDs it sends back as ACKs). As sqlab mentions, the sending system's message ID should be sent back in MSA-2, which per section 2.15.8 (I'm looking at HL7 v2.5 US) is a required field in the MSA segment.Beech

© 2022 - 2024 — McMap. All rights reserved.