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();
}
Aggregations