fix bug validating profiles on bundle.entry.resource

This commit is contained in:
Grahame Grieve 2021-06-24 21:48:27 +10:00
parent 309dbba9b6
commit b0c1f2b129
1 changed files with 3 additions and 3 deletions

View File

@ -291,8 +291,8 @@ public class StructureDefinitionValidator extends BaseValidator {
StructureDefinition t = determineBaseType(sd);
if (t == null) {
rule(errors, IssueType.EXCEPTION, stack.getLiteralPath(), false, I18nConstants.SD_ED_TYPE_PROFILE_NOTYPE, p);
} else {
rule(errors, IssueType.EXCEPTION, stack.getLiteralPath(), isInstanceOf(t, code), I18nConstants.SD_ED_TYPE_PROFILE_WRONG, p, t, code, path);
} else if (!isInstanceOf(t, code)) {
rule(errors, IssueType.EXCEPTION, stack.getLiteralPath(), false, I18nConstants.SD_ED_TYPE_PROFILE_WRONG, p, t, code, path);
}
}
}
@ -343,7 +343,7 @@ public class StructureDefinitionValidator extends BaseValidator {
}
private StructureDefinition determineBaseType(StructureDefinition sd) {
while (sd != null && !sd.hasType() && sd.getDerivation() == TypeDerivationRule.CONSTRAINT) {
while (sd != null && sd.getDerivation() == TypeDerivationRule.CONSTRAINT) {
sd = context.fetchResource(StructureDefinition.class, sd.getBaseDefinition());
}
return sd;