I think having the 3rd component in MSH-9 makes the parse create the message type specified there.
Is it possible to omit the MDM_T01 in MSH-9? Ian Vowles Integration Specialist, Metro North Integration Centre Metro North IT Citilink Lobby 1, Level 3 153 Campbell St, Bowen Hills QLD 4006 P: 07 3646 2557 E: ian.vow...@health.qld.gov.au<mailto:ian.vow...@health.qld.gov.au> metronorth.health.qld.gov.au<https://metronorth.health.qld.gov.au/> [Description: Description: Putting people first]<http://qheps.health.qld.gov.au/metronorth/html/email-signature.htm> [Values in Action] [Description: Description: Facebook]<http://www.facebook.com/metronorthhhs> [Description: Description: Twitter] <http://www.twitter.com/MetroNorthHHS> [Description: Description: LinkedIn] <http://www.linkedin.com/company/metro-north-hospital-and-health-service> follow us on social media From: Andrew Ring via Hl7api-devel <hl7api-devel@lists.sourceforge.net> Sent: Wednesday, 15 January 2020 3:28 PM To: hl7api-devel@lists.sourceforge.net Subject: [HAPI-devel] Error parsing ACK message I'm new to hapi, and am trying to check the ACK response from having sent a message. The message is received properly, and the response appears well formed, however when I attempt to parse the ACK message, it's being interpreted as the type of the original message. (NB: The original message, as well as the response, are generated by HL7 Soup) final Message response = initiator.sendAndReceive(message); // Convert message into most recent version format, since they're backwards // compatible final HapiContext versionedContext = new DefaultHapiContext(); final CanonicalModelClassFactory modelClassFactory = new CanonicalModelClassFactory("2.8.1"); versionedContext.setModelClassFactory(modelClassFactory); final Message versionedResponse = versionedContext.getPipeParser().parse(response.toString()); if (!(versionedResponse instanceof ACK)) { final String errorMessage = String.format("Response invalid message type;\n expected %s\n found %s:\n%s", ACK.class.getName(), versionedResponse.getClass().getName(), HL7Utils.forPrinting(versionedResponse)); recordSendAttempt(hl7DestinationInfo, false, errorMessage); } results in Error sending hl7 message with id '8': Response invalid message type; expected ca.uhn.hl7v2.model.v281.message.ACK found ca.uhn.hl7v2.model.v281.message.MDM_T01: MSH|^~\&|HL7Soup|Instance2|HL7Soup|Instance1|200911021022||ACK^T01^MDM_T01|64322|P|2.5.1 MSA|AA|64322 Can anyone point out what I'm doing wrong? Thanks, Andrew ******************************************************************************** This email, including any attachments sent with it, is confidential and for the sole use of the intended recipient(s). This confidentiality is not waived or lost, if you receive it and you are not the intended recipient(s), or if it is transmitted/received in error. Any unauthorised use, alteration, disclosure, distribution or review of this email is strictly prohibited. The information contained in this email, including any attachment sent with it, may be subject to a statutory duty of confidentiality if it relates to health service matters. If you are not the intended recipient(s), or if you have received this email in error, you are asked to immediately notify the sender by telephone collect on Australia +61 1800 198 175 or by return email. You should also delete this email, and any copies, from your computer system network and destroy any hard copies produced. If not an intended recipient of this email, you must not copy, distribute or take any action(s) that relies on it; any form of disclosure, modification, distribution and/or publication of this email is also prohibited. Although Queensland Health takes all reasonable steps to ensure this email does not contain malicious software, Queensland Health does not accept responsibility for the consequences if any person's computer inadvertently suffers any disruption to services, loss of information, harm or is infected with a virus, other malicious computer programme or code that may occur as a consequence of receiving this email. Unless stated otherwise, this email represents only the views of the sender and not the views of the Queensland Government. **********************************************************************************
_______________________________________________ Hl7api-devel mailing list Hl7api-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hl7api-devel