Registry Mirror
Skip to content

Incorrect OML_O21 message parsed #65

Closed

Description

@josephrodriguez

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

Activity

  1. yoliva commented on Feb 27, 2017

    @yoliva

    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.

  2. yoliva commented on Feb 27, 2017

    @yoliva

    @josephrodriguez did you realize how to solve the issue? Jus asking because I see that this issue was open some time ago. thanks

  3. josephrodriguez commented on Feb 27, 2017

    @josephrodriguez
    Author

    @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.

  4. yoliva commented on Feb 28, 2017

    @yoliva

    @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.

  5. rutzelt commented on Mar 1, 2017

    @rutzelt

    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)
    
  6. yoliva commented on Mar 1, 2017

    @yoliva

    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.

  7. degr commented on Jul 12, 2019

    @degr

    still not work. It return 1 order repetition

  8. milkshakeuk commented on Apr 16, 2021

    @milkshakeuk
    Member

    @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.

  9. added a commit that references this issue on Nov 22, 2021
  10. milkshakeuk commented on Nov 22, 2021

    @milkshakeuk
    Member

    @josephrodriguez hi there is a unit test for your attached example message now.

    This will be in the v3.1.0 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions