0

I have wrote a simple HL7 message parser which is capable of parsing any message type. What it can't do is to validate the message.

The result of the message parsing is a tree which is easily traversable.

Now I want to improve the parser. I want it to be able to apply validation rules to the received message. I am thinking of using XML as a message definition. I am stuck on which approach to take. I am not sure if this makes sense.

Have you ever written a parser not necessarily for HL7 message where you had to apply schema to the message? How did you do that?

Thank you

svager
  • 769
  • 5
  • 13
  • 32

1 Answers1

0

You could roll your own solution. However there is a library out there that already does this quite well: https://hapifhir.github.io/hapi-hl7v2/ Usually those home-made solutions have all kinds of problems with intricacies of HL7 (quoting, non-standard delimiters, etc).

ThomasW
  • 475
  • 3
  • 15
  • I am aware of hapi. I don't want to use hapi. I want to write my own. In order to do that I need to be able to define HL7 messages and for that I picked XML. – svager Mar 28 '18 at 14:35