Search in sources :

Example 1 with ResourceValidator

use of org.hl7.fhir.definitions.validation.ResourceValidator in project kindling by HL7.

the class Publisher method validate.

private void validate() throws Exception {
    page.log("Validating", LogMessageType.Process);
    ResourceValidator val = new ResourceValidator(page.getDefinitions(), page.getTranslations(), page.getCodeSystems(), page.getFolders().srcDir, fpUsages, page.getSuppressedMessages(), page.getWorkerContext());
    val.resolvePatterns();
    ProfileValidator valp = new ProfileValidator(page.getWorkerContext(), null);
    for (String n : page.getDefinitions().getTypes().keySet()) page.getValidationErrors().addAll(val.checkStucture(n, page.getDefinitions().getTypes().get(n)));
    val.checkSearchParams(page.getValidationErrors(), page.getDefinitions().getResourceByName("Resource"));
    val.checkSearchParams(page.getValidationErrors(), page.getDefinitions().getResourceByName("DomainResource"));
    for (String n : page.getDefinitions().sortedResourceNames()) if (hasBuildFlag("page-" + n.toLowerCase()))
        page.getValidationErrors().addAll(val.check(n, page.getDefinitions().getResources().get(n)));
    page.getValidationErrors().addAll(val.check("Parameters", page.getDefinitions().getResourceByName("Parameters")));
    for (String rname : page.getDefinitions().sortedResourceNames()) {
        ResourceDefn r = page.getDefinitions().getResources().get(rname);
        checkExampleLinks(page.getValidationErrors(), r);
    }
    for (Compartment cmp : page.getDefinitions().getCompartments()) page.getValidationErrors().addAll(val.check(cmp));
    page.setPatternFinder(val.getPatternFinder());
    val.report();
    val.summariseSearchTypes(page.getSearchTypeUsage());
    val.dumpParams();
    val.close();
    checkAllOk();
}
Also used : ResourceValidator(org.hl7.fhir.definitions.validation.ResourceValidator) Compartment(org.hl7.fhir.definitions.model.Compartment) ResourceDefn(org.hl7.fhir.definitions.model.ResourceDefn) ProfileValidator(org.hl7.fhir.validation.profile.ProfileValidator)

Aggregations

Compartment (org.hl7.fhir.definitions.model.Compartment)1 ResourceDefn (org.hl7.fhir.definitions.model.ResourceDefn)1 ResourceValidator (org.hl7.fhir.definitions.validation.ResourceValidator)1 ProfileValidator (org.hl7.fhir.validation.profile.ProfileValidator)1