Class FhirCamelValidators


  • public final class FhirCamelValidators
    extends Object

    Factory class for creating validating processors for FHIR resources. For schematron validation you need to have the phloc-schematron library in the classpath.

    The FHIR validators are used as processors, e.g.:

         ...
         .process(FhirResourceValidators.itiRequestValidator())
         ...
     
    An instance of UnprocessableEntityException is thrown if validation fails. A FHIR Consumer will automatically process the exception for a 400 response.

    Validation is executed depending on the presence of FhirContext in the message header. The kind of validation is determined by the integer value in the VALIDATION_MODE message header, i.e. which of the following bits are set:

    • header not present : schema validation
    • OFF (0) : no validation
    • SCHEMA (1) : schema validation
    • SCHEMATRON (2) : schematron validation
    • MODEL (4) : resource model validation

    Higher value result in an higher performance impact due to the validation. Model-based validation can slow down processing significantly.

    Since:
    3.2
    Author:
    Christian Ohr
    • Method Detail

      • itiRequestValidator

        public static org.apache.camel.Processor itiRequestValidator()
        Returns:
        instance of FHIR validator processor that checks the FHIR resource belonging to the request of the FHIR transaction
      • itiResponseValidator

        public static org.apache.camel.Processor itiResponseValidator()
        Returns:
        instance of FHIR validator processor that checks the FHIR resource belonging to the response of the FHIR transaction