Search in sources :

Example 1 with SchemaBaseValidator

use of ca.uhn.fhir.validation.SchemaBaseValidator in project integration-adaptor-111 by nhsconnect.

the class FhirJsonValidator method isValid.

public boolean isValid(String message) {
    FhirValidator validator = ctx.newValidator();
    IValidatorModule module = new SchemaBaseValidator(ctx);
    validator.registerValidatorModule(module);
    ValidationResult result = validator.validateWithResult(message);
    return result.getMessages().isEmpty();
}
Also used : IValidatorModule(ca.uhn.fhir.validation.IValidatorModule) SchemaBaseValidator(ca.uhn.fhir.validation.SchemaBaseValidator) FhirValidator(ca.uhn.fhir.validation.FhirValidator) ValidationResult(ca.uhn.fhir.validation.ValidationResult)

Aggregations

FhirValidator (ca.uhn.fhir.validation.FhirValidator)1 IValidatorModule (ca.uhn.fhir.validation.IValidatorModule)1 SchemaBaseValidator (ca.uhn.fhir.validation.SchemaBaseValidator)1 ValidationResult (ca.uhn.fhir.validation.ValidationResult)1