Cannot parse valid HL7 message
I'm having problems with an HL7 message that is not properly parsed by IRIS (any version, including Ensemble).
The message is a OML_O21 and is valid, in fact is similar of what is described in the document "IHE Laboratory Technical Framework, Volume 2a (LAB TF-2a) version 6.0".
This is the sample from the IHE document (paragraph 2315):
MSH|^~\&|OF|Chemistry|AM|Automation|200309060825||OML^O21^OML_O21|msgOF101|T|2.5|123||||USA||EN
PID|1||12345^5^M10^Memphis_Hosp^PI||EVERYMAN^ADAM^^JR^^^L|19800101|M 2320
PV1|1|O|Ward|||||||||||||||12345
ORC|NW|||666^gastric|||||200309060824|222221^NURSE^NANCY|||||||||||Entero-gastric^^^^^^FI^^^EG02
TQ1|||||||||A
OBR||555_1^chemistry||GLUC^GLUCOSE^L||||||1234^BLEEDER|S|||||222222^PHYSICIAN^^^^DR|822325 1
SPM|1|123456781^gastric ||SER|||||||P||||||200309060735|200309060821||||||||1
ORC|NW|||666^gastric|||||200309060710|222221^NURSE^NANCY|||||||||||Entero-gastric^^^^^^FI^^^EG02
TQ1|||||||||A 2330
OBR||555_2^chemistry||GLUC^GLUCOSE^L||||||1234^BLEEDER|S||||| 222222^PHYSICIAN^^^^DR|821
SPM|1|123456782^gastric||SER|||||||P||||||200309060755|200309060821||||||||1
Shell SessionShell Session
The result in IRIS is:
Is the IHE document sample an invalid message?
Because of this issue I cannot handle this message in rules and DTL
There is a Schema issue, it is not liking the way you're grouping several segments together which is resulting in the error.
Hello Scott, thank you very much for the response. What do you mean by schema issue? I'm not grouping anything; the message used was taken from the official IHE Laboratory Technical Framework. I'm having the issue with a message I receive that is similar (virtually identical) to the IHE document message.
Looking through the HL7 2.5 OML_O21 structure as supplied by InterSystems, you'll find that there's a nested PIDgrpgrp() under ORCgrp().OBRgrp() that has a subordinate ORCgrp(). It looks like the parse is attempting to match on the required OBR segment in the nested PIDgrpgrp().ORCgrp().
You have a couple of options ... both of which require a custom schema to match your message.
The first is to make the OBR segment in the PIDGrpgrp().ORCgrp() optional; the second is to remove the PIDgrpgrp() grouping entirely in the custom schema.EDIT: The first option doesn't work since the ORC matches on the optional ORC segment in the nested PIDgrpgrp.ORCgrp(), which makes it attempt to match on the required PIDgrpgrp.ORCgrp().OBXgrp().
Thank you, Jeffrey, I had eventually resolved it this way. However, I didn't like using this method; in fact, the system is declaring a document that is actually valid and standard as invalid. Creating a custom schema to handle a standard HL7 honestly doesn't appeal to me much. Anyway, thank you very much for the response; indeed, that's exactly what I did, and it's working! :)
The message is not valid as per HL7 v2.5 section 4.4.6.
The second ORC...TQ1...OBR is invalid, it should be ORC...OBR...TQ1 : in the ORDER_PRIOR group, ORC is optionnal and must be followed by OBR followed by optional NTE and then TQ1 group.
Keep in mind : IRIS HL7 schemas are based on formal grammars published by HL7.org.
So, this imply that the sample message published in the document "IHE Laboratory Technical Framework, Volume 2a (LAB TF-2a)" is actually an invalid message?