Class FhirCamelValidators
- java.lang.Object
-
- org.openehealth.ipf.platform.camel.ihe.fhir.core.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 ofUnprocessableEntityException
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 theVALIDATION_MODE
message header, i.e. which of the following bits are set:- header not present : schema validation
OFF
(0) : no validationSCHEMA
(1) : schema validationSCHEMATRON
(2) : schematron validationMODEL
(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
-
-
Field Summary
Fields Modifier and Type Field Description static int
MODEL
static int
OFF
static int
SCHEMA
static int
SCHEMATRON
static String
VALIDATION_MODE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.apache.camel.Processor
itiRequestValidator()
static org.apache.camel.Processor
itiResponseValidator()
-
-
-
Field Detail
-
VALIDATION_MODE
public static final String VALIDATION_MODE
- See Also:
- Constant Field Values
-
MODEL
public static final int MODEL
- See Also:
- Constant Field Values
-
SCHEMATRON
public static final int SCHEMATRON
- See Also:
- Constant Field Values
-
SCHEMA
public static final int SCHEMA
- See Also:
- Constant Field Values
-
OFF
public static final int OFF
- See Also:
- Constant Field Values
-
-
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
-
-