I've been parsing and sending HL7 messages for several years. Our applications interact with several HIS & RIS systems in the facility. While HL7 is a "STANDARD", each vendor's messages may not be in the same format. That is why I parse each message segment/field, extract the data I need and dump the rest. This has allowed me to create a parsing rules table, based off which vendor I'm receiving the data from, and apply those to the parsing process. If you lock your code logic too much, then you end up with a different process for each vendor.
Just my 2 cents
Kirk