You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was parsing this message but the property ORDERRepetitionsUsed return me 1 when should be 3. This happend with all versionsof library including the latest 2.5.0.6. PFOMSGID999999999.txt
I'm having the same issue parsing OML^O21 v251 messages with multiple orders. I found a possible walk around to process the order on this thread on StackOverflow. I also found a possible solution in the javadocs of HAPI using: setNonGreedyMode but seems that this isn't supported in NHAPI yet. There is any feedback on this issue? I'm using Terser to write and read documents. Seems like if the parser only recognize the first order and the rest of them are placed in the PriorResults collection.
@yoliva, I opened this issue three months ago and I have not received any feedback from NHAPI developers, a little disappointing. My temporal solution due to unable use HAPI with java was splitting the OML^O21 with multiple OBR segments (you can use regular expressions) on to multiples OML^O21 messages with only one ORC and OBR segments using the common information in MSH, PV1 and PID segments and parse each message formed individually. It is not the best solution or the most transparent but it solves the problem and I did not have much time to look for an elegant solution. Feel free to contact me by email.
@josephrodriguez thanks for the feedback. I'm trying to find a walk around to process the orders in the right way. I will let you know if I find a solution.
This solution is a bit of a hack but it does work for us. We added an FT1 segment to disambiguate it during as part of our "Preprocessing" routine. Perhaps this method would be suitable for you...
// nHapi cannot disambiguate OML_OXX messages...
// https://sourceforge.net/p/nhapi/discussion/569648/thread/3e0c39b1/
// Unfortunately HL7 OML_OXX messages have an ambiguous structure. The HL7 parser recognizes only
// one ORC/OBR/OBX (ORDER) group and the rest the ORC/OBRs repetitions are parsed as PRIOR_RESULTs
// of the OBSERVATION_REQUEST. The Hapi (Java) library has added a parser configuration mode
// (setNonGreedyMode) that allows to choice the earlier presence of the segment as a part of a
// repetition group. However, NHapi does not have it.
string stringToReplace = "ORC|";
hl7 = hl7.Replace(stringToReplace, "FT1|\n\rORC|"); // Prepend it with a Financial Transaction (FT1) segment to disambiguate it (hack)
We ended up rolling back to ORM_O01 to process orders groups. We tried to use OML_O21 because is the recommended one by the standard for v 2.5.1 but isn't a required for now. Using ORM_O01 we get all the orders in the .ORDERs collection as expected without any hack.
@josephrodriguez the information is in the message just not as a separate order but as a PRIOR_RESULT as described by @yoliva and @rutzelt.
Hapi's default behaviour is identical which is why they have configuration options such as setNonGreedyMode to cater for this.
I have add the tag enhancement for this ticket as it requires support for additional configuration.
Activity
yoliva commentedon Feb 27, 2017
I'm having the same issue parsing
OML^O21 v251messages with multiple orders. I found a possible walk around to process the order on this thread on StackOverflow. I also found a possible solution in the javadocs ofHAPIusing:setNonGreedyModebut seems that this isn't supported inNHAPIyet. There is any feedback on this issue? I'm usingTerserto write and read documents. Seems like if the parser only recognize the first order and the rest of them are placed in thePriorResultscollection.yoliva commentedon Feb 27, 2017
@josephrodriguez did you realize how to solve the issue? Jus asking because I see that this issue was open some time ago. thanks
josephrodriguez commentedon Feb 27, 2017
@yoliva, I opened this issue three months ago and I have not received any feedback from NHAPI developers, a little disappointing. My temporal solution due to unable use HAPI with java was splitting the
OML^O21with multipleOBRsegments (you can use regular expressions) on to multiplesOML^O21messages with only oneORCandOBRsegments using the common information inMSH,PV1andPIDsegments and parse each message formed individually. It is not the best solution or the most transparent but it solves the problem and I did not have much time to look for an elegant solution. Feel free to contact me by email.yoliva commentedon Feb 28, 2017
@josephrodriguez thanks for the feedback. I'm trying to find a walk around to process the orders in the right way. I will let you know if I find a solution.
rutzelt commentedon Mar 1, 2017
This solution is a bit of a hack but it does work for us. We added an FT1 segment to disambiguate it during as part of our "Preprocessing" routine. Perhaps this method would be suitable for you...
// nHapi cannot disambiguate OML_OXX messages...
// https://sourceforge.net/p/nhapi/discussion/569648/thread/3e0c39b1/
// Unfortunately HL7 OML_OXX messages have an ambiguous structure. The HL7 parser recognizes only
// one ORC/OBR/OBX (ORDER) group and the rest the ORC/OBRs repetitions are parsed as PRIOR_RESULTs
// of the OBSERVATION_REQUEST. The Hapi (Java) library has added a parser configuration mode
// (setNonGreedyMode) that allows to choice the earlier presence of the segment as a part of a
// repetition group. However, NHapi does not have it.
yoliva commentedon Mar 1, 2017
We ended up rolling back to
ORM_O01to process orders groups. We tried to useOML_O21because is the recommended one by the standard forv 2.5.1but isn't a required for now. UsingORM_O01we get all the orders in the.ORDERscollection as expected without any hack.degr commentedon Jul 12, 2019
still not work. It return 1 order repetition
milkshakeuk commentedon Apr 16, 2021
@josephrodriguez the information is in the message just not as a separate order but as a PRIOR_RESULT as described by @yoliva and @rutzelt.
Hapi's default behaviour is identical which is why they have configuration options such as
setNonGreedyModeto cater for this.I have add the tag enhancement for this ticket as it requires support for additional configuration.
Add unit test for #65
milkshakeuk commentedon Nov 22, 2021
@josephrodriguez hi there is a unit test for your attached example message now.
This will be in the v3.1.0 release