How to validate HL7 message using Python-HL7 tool?
I am using Python-HL7 tool.
After receiving message from server, I want to validate the message and send back acknowledge message if message received is valid or not.
hl7.ishl7() method only does a cursory check and does not fully validate the message. How can I actually validate the message?
Parsing and Validating are two different things. You mentioned
hl7.ishl7()which just parse the HL7 message.
Following is from documentation:
Determines whether a line looks like an HL7 message. This method only does a cursory check and does not fully validate the message.
Many HL7 tool kits (in other languages I know) provide feature for validating the message; but apparently, this specific toolkit does not.
Validating the HL7 message may be personal choice as well in addition to specifications. Generally, you should first parse the message (using
hl7.ishl7(line)) and then should implement validation code on your own. This way, you may include the validations specific to your application/need.