149.10. HL7 Validation predicate
通常最好首先解析 HL7v2 消息,并在单独的步骤中根据 HAPI ValidationContext 验证它。
示例:
import static org.apache.camel.component.hl7.HL7.messageConformsTo; import ca.uhn.hl7v2.validation.impl.DefaultValidation; // Use standard or define your own validation rules ValidationContext defaultContext = new DefaultValidation(); // Throws PredicateValidationException if message does not validate from("direct:test1") .validate(messageConformsTo(defaultContext)) .to("mock:test1");