Ruby makes working with things like HL7 super easy. Check out the super extensible HL7 ruby parser I wrote here: https://github.com/sufyanadam/simple_hl7_parser. It currently focuses on parsing ORU messages but can be easily extended to support any HL7 segment. Feel free to submit a PR :)