Hi, I'm using HAPI 2.0 and this bug seems to be there. Reading the IHE specs, previous results shall have ORC-1=PR (see IHE LAB TF Vol2a, paragraph 1380).
BTW if I create an OML_O21 message from scratch with multiple ORC/OBR and parse back, I get an ambiguous result (only one ORC/OBR and the rest of the ORC/OBRs ans PRIOR RESULTS of the OBSERVATION_REQUEST).
I tried to disambuguate the ORC/OBR using TQ1: MSH ORC TQ1 OBR ORC TQ1 OBR
Prior results doesn't have TQ1 after ORC but it gets parsed and ORC/OBR 2..N still appear as prior results.
Attached my a test class.
Any ideas?
Thanks.
BTW, This is related to ticket 103: https://sourceforge.net/p/hl7api/bugs/103/
A new ParserConfiguration option has been checked in called "setNonGreedyMode" which lets you configure the parser to move up in the structure instead of down when ambiguous choices are encountered like this one.
This will be included in the beta that will be released soon. If you could verify that this corrects your issue that would be great!
Perfect, please let me know when this fix will be available by commenting here and I'll check it right away!
But I think there is a problem also when there is no ambiguity: I've added a TQ1 segment for every ORC 1..N, and ORC 2..N still appear as previous results although previous results ORCs doesn't have TQ1s... please see the static definition for v2.5 here: http://dropbox.anandic.com/jsc/HL7_Doku/std25/ch04.html section 4.4.6
Thanks a lot.
Indeed, the problem reported in Bug #103 (https://sourceforge.net/p/hl7api/bugs/103/) marked as closed, is back again in 2.0