Running the HL7 validation utility
The HL7 Validation utility leverages the information in the XSD schemas provided by HL7, and applies the structure and data content rules from the schemas to the EDI data.
First, the delimited HL7 2.x EDI data is transformed into its XML tagged equivalent. Then that XML data (called an XML instance document), is validated against the schema. This leverages the power of an XML parser for error reporting. An HTML formatted error report (with a very XML-centric description of errors) might be produced if desired, as well as an HL7 2.x EDI formatted ACK with a positive or negative acknowledgment indicator.
This utility also provides transformation of XML tagged Instance documents to their delimited EDI equivalents for the versions of HL7 2.x EDI that are supported by this implementation.
- Open the main map source, hl7main, in the Design Server.
- Update Input card 1 to select the HL7 input data to validate. Sample file hl7_edi_example_V2.7 in the hl7\data directory is used in this card as installed. The input can be EDI HL7, or XML HL7. Correct processing of the data is determined by the map through inspection of the data input.
- To modify or review any configurable parameters, edit the file: hl7parms.xml.
- Compile all maps in maps directory:
- In Design Studio: Use compilemaps.bat.
- In Design Server: Create and build a package with all maps.
- Execute hl7main to run the HL7 Validation utility. The following output files are
produced in the hl7\data directory:
- StatusReport.html - Report that summarizes final status for the validation, Message Type, Message Version, XML Scan Status (if input is XML HL7 data), XML Validation Status, and XML > EDI, or EDI > XML Conversion Status.
- HL7Out.xml - If the input file was EDI HL7, this is the UTF-8 converted, XML data.
- EDIOut.edi - If the input file was EDI XML, this is the EDI converted data.
- hl7_edi_ack.out - If the input was HL7 EDI, and acknowledgment was requested, an Original Mode Acknowledgment is generated in HL7 EDI format.
- hl7_xml_ack.out - If the input is HL7 XML and acknowledgment was requested, an Original Mode Acknowledgment is generated in XML format.