HL7 parser with segment code generators in Erlang