1

We use NHapi 2.4 to parse hl7 ver. 2.3. The problem I faced is NHapi cannot parse hl7 repetitive segments properly in case such segments split by another hl7 segment. When I feed hl7 with IN1 constitutive repetitive segments to Nhapi it works fine:

...
IN1|a1|b1|
IN1|a2|b2|
...

Message.GetAll("IN1") returns 2 items.

However if I split IN1 with IN2 which meets Hl7 standard, Nhapi is able to return first IN1, or first IN2 only:

IN1|a1|b1|
IN2|a2|b2|
IN1|a3|b3|
IN2|a4|b4|

Message.GetAll("IN1") returns first item only (IN1|a1|b1|)

To me seems like a bug in Nhapi.

Cœur
  • 37,241
  • 25
  • 195
  • 267
YMC
  • 4,925
  • 7
  • 53
  • 83
  • 3
    It seems to be by-design. `GetAll` stops at first group with matching name, see https://github.com/duaneedwards/nHapi/blob/master/NHapi20/NHapi.Base/Model/AbstractGroup.cs#L369 – xmojmr Nov 06 '15 at 08:29
  • That's a bad design :) Thank you for the link to source code – YMC Nov 08 '15 at 19:48

0 Answers0