Registry Mirror
Skip to content

HL7 2.5 QBP^Q22^QBP_Q21 maximum repetitions is only 1 reps for Segment QPD  #276

Closed

Description

@giannisptr

When sending an ITI-21 PDQ message with multiple query parameters in QPD-3 field i receive the following exception when parsing the message:
Can't get repetition 2 from field 3 - maximum repetitions is only 1 reps.: Segment: QPD (rep 0) Field #3

Base on PDQ definition this should be allowed

Sample code

PipeParser parserWithoutValidation = new PipeParser();
IMessage hl7Message = parserWithoutValidation.Parse(message);

Sample HL7

MSH|^~\&|PatientManager|IHE|ICS|FORTH|20220215130712||QBP^Q22^QBP_Q21|5b2e49550924456db9e0844e35348144|P|2.5||||||UNICODE UTF-8
QPD|IHE PDQ Query|20220215130712|@PID.5.2^fname~@PID.7.1^20220202~@PID.8^M|||||^^^IHEFACILITY&1.3.6.1.4.1.21367.3000.1.6&ISO~^^^IHEBLUE&1.3.6.1.4.1.21367.13.20.3000&ISO
RCP|I

Versions
nHapi version: v2.5.0.6
NHapiTools version: v1.11.0.5

How can i solve this problem?

Activity

  1. milkshakeuk commented on Feb 15, 2022

    @milkshakeuk
    Member

    @giannisptr having had a quick look at the hl7 V2.5 specification QPD-3 is not repeatable.

  2. milkshakeuk commented on Feb 15, 2022

    @milkshakeuk
    Member

    @giannisptr you can have multiple QPD segments though, have you tried that?

  3. milkshakeuk commented on Feb 15, 2022

    @milkshakeuk
    Member

    @giannisptr this could still be a valid issue, the hapi test panel seems to parse the message correctly.

  4. milkshakeuk commented on Feb 15, 2022

    @milkshakeuk
    Member

    @giannisptr looks like this is the line causing your issue:

    if (rep > items[number - 1].MaxRepetitions)

    seems that hapi doesn't do this max repetition check, I tested removing this check in nHapi and it seemed to work fine.

    Looks like hapi had the max repetition check in the code base but commented out until this commit on 6 Aug 2012 when they just removed the commented out max repetition check altogether.

  5. added
    bug
    defect
    and removed
    bug
    on Feb 15, 2022
  6. milkshakeuk commented on Feb 15, 2022

    @milkshakeuk
    Member

    @giannisptr this can be fixed but will require a new version of nhapi which will require you to update past v2.5.0.6.

  7. giannisptr commented on Feb 16, 2022

    @giannisptr
    Author

    Yes no problem i can go to the lattest version.
    So are you going to provide an updated version?
    I will get it from nuget?

  8. added a commit that references this issue on Feb 16, 2022
    7bbdbf1
  9. milkshakeuk commented on Feb 16, 2022

    @milkshakeuk
    Member

    @giannisptr before I go ahead with this, I am going to do some more digging around QPD-3 as I'm still not convinced its repeatable.

  10. giannisptr commented on Feb 16, 2022

    @giannisptr
    Author

    Based on the IHE TF (https://www.ihe.net/uploadedFiles/Documents/ITI/IHE_ITI_TF_Rev10.0_Vol2a_FT_2013-09-27.pdf) it should be. It defines for ITI-21 transaction that:
    "Field QPD-3-Demographics Fields consists of one or more repetitions, each of which contains
    two components that together contain the name and value of a distinct parameter to the query. "

  11. added a commit that references this issue on Feb 16, 2022
    42ee157
  12. milkshakeuk commented on Feb 16, 2022

    @milkshakeuk
    Member

    @giannisptr I have included a unit test in the PR, I may still go ahead just to be in line with hapi, but I'm just reaching out to some people to see if according to the hl7 v2.5 specification its repeatable.

    I checked the specification pdf but it's not clear.

  13. added a commit that references this issue on Feb 16, 2022
    91ff36f
  14. milkshakeuk commented on Feb 16, 2022

    @milkshakeuk
    Member

    @giannisptr in case you're interested on the outcome of my digging you should be able to see it here:
    https://chat.fhir.org/#narrow/stream/229447-V2

  15. giannisptr commented on Feb 17, 2022

    @giannisptr
    Author

    I have evaluated this also with IHE tools and it is successful with repeatable QPD-3 as you can see here:
    https://gazelle.ihe.net/EVSClient/hl7v2Result.seam?&oid=1.3.6.1.4.1.12559.11.1.2.1.4.1664549

  16. added a commit that references this issue on Feb 19, 2022
    2f4adc2
  17. milkshakeuk commented on Feb 19, 2022

    @milkshakeuk
    Member

    @giannisptr I have published the changes in nuget package v3.1.1, when you update you might have to fix some namespaces specifically the validation namespace which has been case corrected.

    There is a newer version of nhapitools also which supports nhapi v3.X.

    https://www.nuget.org/packages/nhapi/3.1.1

  18. giannisptr commented on Feb 21, 2022

    @giannisptr
    Author

    ok thank you very much

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    defect

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions