User Guide : Integrating Health Care Data : Health Care Components, Connectors, and Schema : HL7 Message Structure Validator
 
Share this page             
HL7 Message Structure Validator
The HL7 Message Structure Validator validates the structure of the HL7 Message against the applicable schema for a given version. Version 2.0.0 of the HL7 Message Structure Validator includes support for v2.6 HL7 messages.
The information in this section applies to version 2.0.0 of the HL7 Message Structure Validator component. This component is similar, but not identical to the HL7 Message Structure Validation Invoker. Make sure you use the correct component.
Note:  The HL7 version 2.6 schema does not contain custom table fields. HL7 messages that use this schema version cannot be validated using the 2.0.0 version of the HL7 Message Structure Validator.
The HL7 Message Structure Validator process is as follows:
1. The message is parsed to retrieve the message type and version from the message header (MSH) segment of the incoming message.
2. The validator loads the schema based on information from the previous step and validates the message structure using the schema.
3. After successful validation, the message is saved in the cache memory as a value object.
4. The target message of the Execute action is populated with the Message Control ID of the message as a key. This key is used to retrieve the value object from the cache.
Step Actions
This validator supports the Execute action, which runs any expression that you specify.
Instance Properties
This validator has the following instance properties.
Property
Description
Schema Location
Required. Location of the schema. You have the choice of using a master schema or a subset schema that is based on the master.
If you want to use a subset schema, specify the complete path or browse to the subset schema file.
If you want to use a master schema, specify the complete path or browse to the directory containing the master schema. The validator loads the master schema for a specific schema version and message type. The name and location of the master schema directory does not matter. However, the sub-directories and master schema file must adhere to the following:
Sub-directories must appear in ascending order (2.1, 2.2, 2.3)
The ending string of the master schema file name must be .master.ds.schema (for example, HL726.master.ds.schema)
The sub-directory must contain only one master schema with the required .master.ds.schema ending string.
Example
The following is an example master schema directory structure:
Master schema directory
2.1
HL721.master.ds.schema
2.2
HL722.master.ds.schema
2.3
HL723.master.ds.schema
2.3.1
HL7231.master.ds.schema
Step Action Parameters
This validator has the following step action parameters.
Property
Supported Actions
Description
SourceMessage
Execute
Required. Path and name of the source message.
TargetMessage
Execute
Required. Path and name of the target message.
Error Conditions
This validator uses the following error conditions to populate the target message.
Code
Description
Reason
100
Incorrect message type
The message type is incorrect for the subset schema validation.
101
MSH element not first
MSH is not the first segment of the message.
102
Version undefined
The version of the schema is not defined in the data file.
103
Undefined version
The version number is undefined in the data file.
104
Missing delimiters
One or more delimiters are missing.
105
Missing required segment
One or more mandatory segments are missing.
106
Extra segment
An undefined segment is in the data file.
107
Repeating segment
A segment repeats more times than the value specified for maxOccurs.
108
Cannot repeat segment
The segment cannot repeat.
109
Segment not in choice
The segment is not contained in the Choice element.
110
Incorrect segment field count
The segment field count is incorrect.
111
Cannot repeat field
The segment contains one or more invalid fields that cannot repeat.
112
Missing required field
A mandatory field is missing in the segment.
113
Expected max field length
The length of the segment field is greater than the maximum length specified in the data file.
114
Expected composite count
A segment field was encountered when a Composite count was expected.
115
Missing required composite
A mandatory composite is missing.
116
Expected subcomposite count
A field Composite was encountered when a Subcomposite count was expected.
118
Unsupported event code
The specified event code is not supported for this version of HL7.
119
Field repeats more than maxOccurs
The segment field repeats more times than the value specified for maxOccurs.
120
Required subcomposite missing/not included
A mandatory subcomposite is missing in the composite.
121
Error loading json schema file
The specified schema cannot be found.
122
Group repeats more than maxOccurs
The group repeats more times than the value specified for maxOccurs.
123
Required group is missing/not included
A mandatory segment is missing in the group.
998
Invalid data file
An invalid data file was encountered.
999
Application internal error
An internal error occurred during validation. For example, the invoker could not find the schema library file for the specified message type and version.
The validator returns these error messages.
Error Code
Error Name
Description
Reason
89
ERR_ HEADERDER_VALIDATION
Error at the time of header validation.
An exception was encountered at the time of structure validation of a message.
85
ERR_SYNTAXCHECK
Error at the time of syntax check.
An exception was encountered at the time of checking the syntax of a message.
88
ERR_STRUCTURAL_VALIDATION
Error at the time of structure validation.
An exception was encountered at the time of structure validation of a message.
87
ERR_MSG_CONTINUATION
Error on receiving incomplete message parts.
The present message part is not the last part of a Message sequence
50
ERR_UNSPECIFIED
Unspecified error.
Unknown error condition.
4
ERR_READERR
Error during reading of file or table.
The component cannot locate the schema.
0
ERR_OK
Error on structure validation.
An HL7 message was passed against any kind of validation.
See Also
For information on adding an instance of the component and associating the instance with the step, see these sections:
Instance and Session Types
Setting Up Processes