SchematronOutputType results = SchematronHelper.applySchematron(sch, source);
if (results == null) {
return;
}
IResourceErrorGroup errors = SchematronHelper.convertToResourceErrorGroup(results, theCtx.getFhirContext().getResourceDefinition(theCtx.getResource()).getBaseDefinition().getName());
if (errors.getAllErrors().containsOnlySuccess()) {
return;
}
for (IResourceError next : errors.getAllErrors().getAllResourceErrors()) {
Issue issue = theCtx.getOperationOutcome().addIssue();
switch (next.getErrorLevel()) {
case ERROR:
issue.setSeverity(IssueSeverityEnum.ERROR);
break;