Registry Mirror
Skip to content

HL7 2.5.1: Failure to parse ORDER group repetitions in OML_O33 #232

Closed

Description

Describe the bug
When using the PipeParser to parse an OML_O33 message with ORDER group repetitions, the repetitions are not in the parsed message structure. Only the first ORDER group is present.

To Reproduce

var parser = new PipeParser();
var parsedMessage = parser.Parse( /* sample message below */ ) as NHapi.Model.V251.Message.OML_O33;
var orderReps = orderMessage.SPECIMENs.ElementAt(0).ORDERRepetitionsUsed;

Expected behaviour
Expect that orderReps is 2, and that both ORC and OBR segments can be queried.

Actual behaviour
orderReps is 1, and only the first ORC and OBR segments exist.

Sample HL7

MSH|^~\&|||||20210921154451+1000||OML^O33^OML_O33|20210921154451|P|2.5.1|||NE|AL||UNICODE UTF-8|||LAB-28^IHE
SPM|1|||SER^Serum^HL70487|||||||P^Patient^HL70369
SAC|||Found_TT1_TT2_SER_098
ORC|NW||||||||20210921154451
OBR|1|AWOS_ID_Found_TT1_TT2_SER_098_0||TT1^Test Type 1^99000
ORC|NW||||||||20210921154451
OBR|2|AWOS_ID_Found_TT1_TT2_SER_098_1||TT2^Test Type 2^99000

Environmental Details (please complete the following information):

  • OS: Windows 10.0.19043
  • Target Framework: netcoreapp3.1
  • HL7 Version: 2.5.1
  • nHapi Version: 3.0.4

Additional context
It looks like this problem also existed for the Java implementation (https://sourceforge.net/p/nhapi/discussion/569648/thread/3e0c39b1/).

Activity

  1. milkshakeuk commented on Sep 23, 2021

    @milkshakeuk
    Member

    @iangralinski-invetech thank you for this, I will look into this as soon as I can.

  2. milkshakeuk commented on Oct 4, 2021

    @milkshakeuk
    Member

    @iangralinski-invetech I think this and #65 are related.

    It seems that this is due to the message structure and ambiguous choice of where nhapi should put a segment, the java hapi library uses a configuration option NonGreedyMode to deal with these messages which have ambiguous message structures.

    See hapi docs here.

    We could look to bring that configuration into hapi. I don't suppose you are interested or have time to contribute to nhapi and maybe pick this feature up?

  3. milkshakeuk commented on Nov 9, 2021

    @milkshakeuk
    Member

    @iangralinski-invetech hi, same process as most repos i.e. fork the repo then create a pull request.

    I think we should follow the pattern of newtonsoft or the new System.Text.JSON as an example in terms of how nhapi should do "settings" or "options".

    Then over time we can add more options nhapi doesn't have which hapi does.

    There can be global (default) settings and ones you choose at Parse time for circumstances like the one you mentioned.

  4. ghost added a commit that references this issue on Nov 10, 2021
  5. ghost added a commit that references this issue on Nov 16, 2021
  6. ghost added a commit that references this issue on Nov 16, 2021
  7. ghost added a commit that references this issue on Nov 18, 2021
  8. added a commit that references this issue on Nov 20, 2021
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