Configuring the Message Router: Validation
We have configured TutorialFileService_Router to validate messages that are sent to it. Here are some more details about validation:
If the router's Validation configuration setting is non-0 the router validates. If the setting is 0 the router does not validate.
The router passes valid messages to its routing rules for evaluation. If a message fails validation, the router does not pass the message to the routing rules. If the router is not set to validate then it passes all messages to the routing rules.
The router validates against the message's DocType. The DocType combines the HL7 Version, for example, 2.3 or 2.5, with the HL7 structure, for example, ADT_A01 or ORM_O01. The HL7 Version is read from the Message Schema Category setting of the Business Service that accepted the data into Ensemble—in this case TutorialFileService. The HL7 message structure is derived from the MSH:9 field of the HL7 message.
The default Validation setting is blank, which is equivalent to 0, but a setting of 1 is equivalent dm-z. Briefly, these flags mean the following:
d—The message must have a DocType value. This value is set in part according to the value of the Message Schema Category setting of the associated Business Service. If there is no value for this setting and the d flag is set, then all messages from the service are invalid.
m—If the message is missing a required segment or has extra segments the message is invalid.
-z—Extra trailing z-segments, that is z-segments occurring after the rest of the message, are accepted. If the z rather than -z flag is used, then trailing z-segments are invalid.
A Validation setting of 1 is synonymous with a setting of dm-z.
Messages that fail validation are automatically sent to the component named in the Bad Message Handler setting.