Configuring HL7 version validation

Configure an HL7 DFDL model to validate the version of HL7 used by the messages that are received.

Before you start:

There are three versions of the HL7 DFDL model, one for HL7 version 2.7, one for HL7 version 2.6, and one for HL7 version 2.5.1 and earlier. It is recommended that you use the DFDL model that matches the version of HL7 used by the messages that you are processing. However, by default, the models do not check the HL7 version that is used by incoming HL7 messages. If you want to ensure that you are processing messages that are using the expected version of HL7, then you can enable version validation in your model by using the following procedure.
  1. From the Application Development perspective, locate the HL7 DFDL library (HL7v251DFDLLibrary, HL7v26DFDLLibrary or HL7v27DFDLLibrary)
  2. Click the library name and then click Schema Definitions > urn:hl7-org:v2xml.
  3. Right-click GenericHL7.xsd and click Open With > DFDL Editor. The DFDL editor window opens.
  4. In the DFDL editor window, click HL7 > ... sequence > MSH > ... sequence and then select MSH.12.VersionID. The Asserts and Discriminators tab opens.
  5. Click the Asserts and Discriminators tab and click the Add assert link. A new row is added to the Asserts table.
  6. Ensure that the value in the Test Kind column is expression.
  7. Click in the Test Condition column and add the required expression to validate the HL7 version. For example:
    • If you want to check that the HL7 version used by a message is equal to a specific HL7 version then enter the following.
      {./VID.1 eq '<value>'} 
      where <value> is the version of HL7 you expect messages to use. For example, 2.7, 2.6 or 2.5.
    • If you want to check that the HL7 version used by a message is less than a specific HL7 version then enter the following.
      {./VID.1 lt '<value>'} 
      where <value> is the version of HL7 you expect messages to use. For example, 2.7, 2.6 or 2.5.
    For more information about creating valid assertion expressions, see DFDL specification.
  8. Click in the Message column and add an appropriate message to display in the trace if the condition is not met. For example, Incompatible HL7 version.
  9. Then save the DFDL schema, click File > Save and close the DFDL editor.
You updated the DFDL schema.

If you receive any messages that do not match your required HL7 version (when you use the updated DFDL schema definition) then the DFDL parsing stops at the MSH.12 field, and the error message that is defined in the assertion is shown in the toolkit and the trace. For example,

A DFDL assert with condition '{./VID.1 eq '2.7'}' evaluated to false with message 'Incompatible HL7 version' during the parsing of 'MSH.12.VersionID'

Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 2011, 2014Copyright IBM Corporation 2011, 2014.

        
        Last updated
        
        Last updated : 2014-03-27 09:56:13


Task topicTask topic | Version 3.0.0.0 | ha05410