I am trying to use HAPI to parse HL7 (v2.3) messages generated by an external system. These messages include user Z segments, including a second message segment (between MSH and EVN).
MSH
Z
EVN
...
The problem is that for any segments analyzed after colliding with this first Z-segment, HAPI will generate a message structure, but all the data in this structure is zero. So, I will still have an EVN segment object, but it will not have any data.
I tried:
- Nothing, just parse the message with the ready HAPI and ignore this segment.
- HAPI extension by creating my own ADT message classes (default extension of classes) connecting in the Z segment with:
- addNonstandardSegment ()
- add () with a custom implementation of AbstractSegment
My current solution is to pre-parse the message before the HAPI receives it and cuts out this segment, but this is certainly the wrong approach. Does anyone have any ideas on what I should do?
source
share