Search in sources :

Example 1 with ShExValidator

use of org.hl7.fhir.rdf.ShExValidator in project kindling by HL7.

the class ExampleInspector method prepare.

public void prepare() throws Exception {
    validator = new InstanceValidator(context, hostServices, null);
    validator.setSuppressLoincSnomedMessages(true);
    validator.setResourceIdRule(IdStatus.REQUIRED);
    validator.setBestPracticeWarningLevel(BestPracticeWarningLevel.Warning);
    validator.getExtensionDomains().add("http://hl7.org/fhir/us");
    validator.setFetcher(this);
    validator.setAllowExamples(true);
    validator.setDebug(false);
    xml = new XmlValidator(errorsInt, loadSchemas(), loadTransforms());
    if (VALIDATE_BY_JSON_SCHEMA) {
        String source = TextFile.fileToString(Utilities.path(rootDir, "fhir.schema.json"));
        JSONObject rawSchema = new JSONObject(new JSONTokener(source));
        jschema = SchemaLoader.load(rawSchema);
    }
    if (VALIDATE_RDF) {
        shex = new ShExValidator(Utilities.path(rootDir, "fhir.shex"));
    }
    fpe = new FHIRPathEngine(context);
    checkJsonLd();
}
Also used : JSONTokener(org.json.JSONTokener) InstanceValidator(org.hl7.fhir.validation.instance.InstanceValidator) XmlValidator(org.hl7.fhir.definitions.validation.XmlValidator) JSONObject(org.json.JSONObject) FHIRPathEngine(org.hl7.fhir.r5.utils.FHIRPathEngine) ShExValidator(org.hl7.fhir.rdf.ShExValidator)

Aggregations

XmlValidator (org.hl7.fhir.definitions.validation.XmlValidator)1 FHIRPathEngine (org.hl7.fhir.r5.utils.FHIRPathEngine)1 ShExValidator (org.hl7.fhir.rdf.ShExValidator)1 InstanceValidator (org.hl7.fhir.validation.instance.InstanceValidator)1 JSONObject (org.json.JSONObject)1 JSONTokener (org.json.JSONTokener)1