While the use of segment filtering is a good idea when you
only need to parse a couple of segments, it is
not so great when you are attempting to parse the entire message.
The reason is that HL7 is order dependent. Consider this scenario:
You are expecting a sequence of the following two segments: PID [EVN].
However, you encounter EVN PID instead.
If you have selected Ignore Segments not in Grammar then the parser
will ignore the EVN segment and only parse the PID segment resulting in
data being lost.
For this reason, when you are configuring your message definition
file you should switch segment filtering off. When you are satisfied
that your parsing is working correctly you might consider switching it on again
for a production system.