FHIR-38789 SD_Dependencies extension needs work

This commit is contained in:
Grahame Grieve 2023-02-15 12:12:28 +11:00
parent 5c413822bd
commit 26f7b3a803
2 changed files with 5 additions and 5 deletions

View File

@ -208,7 +208,7 @@ public class ToolingExtensions {
public static final String EXT_REND_MD = "http://hl7.org/fhir/StructureDefinition/rendering-markdown"; public static final String EXT_REND_MD = "http://hl7.org/fhir/StructureDefinition/rendering-markdown";
public static final String EXT_CAP_STMT_EXPECT = "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation"; public static final String EXT_CAP_STMT_EXPECT = "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation";
public static final String EXT_ED_HEIRARCHY = "http://hl7.org/fhir/StructureDefinition/elementdefinition-heirarchy"; public static final String EXT_ED_HEIRARCHY = "http://hl7.org/fhir/StructureDefinition/elementdefinition-heirarchy";
public static final String EXT_SD_DEPENDENCY = "http://hl7.org/fhir/StructureDefinition/structuredefinition-dependencies"; public static final String EXT_SD_IMPOSE_PROFILE = "http://hl7.org/fhir/StructureDefinition/structuredefinition-imposeProfile";
public static final String EXT_XML_NO_ORDER = "http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-no-order"; public static final String EXT_XML_NO_ORDER = "http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-no-order";
public static final String EXT_DEF_TYPE = "http://hl7.org/fhir/StructureDefinition/elementdefinition-defaulttype"; public static final String EXT_DEF_TYPE = "http://hl7.org/fhir/StructureDefinition/elementdefinition-defaulttype";
public static final String EXT_TYPE_SPEC = "http://hl7.org/fhir/tools/StructureDefinition/type-specifier"; public static final String EXT_TYPE_SPEC = "http://hl7.org/fhir/tools/StructureDefinition/type-specifier";

View File

@ -863,8 +863,8 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
int i = 0; int i = 0;
while (i < profiles.size()) { while (i < profiles.size()) {
StructureDefinition sd = profiles.get(i); StructureDefinition sd = profiles.get(i);
if (sd.hasExtension(ToolingExtensions.EXT_SD_DEPENDENCY)) { if (sd.hasExtension(ToolingExtensions.EXT_SD_IMPOSE_PROFILE)) {
for (Extension ext : sd.getExtensionsByUrl(ToolingExtensions.EXT_SD_DEPENDENCY)) { for (Extension ext : sd.getExtensionsByUrl(ToolingExtensions.EXT_SD_IMPOSE_PROFILE)) {
StructureDefinition dep = context.fetchResource( StructureDefinition.class, ext.getValue().primitiveValue(), sd); StructureDefinition dep = context.fetchResource( StructureDefinition.class, ext.getValue().primitiveValue(), sd);
if (dep == null) { if (dep == null) {
warning(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, element.line(), element.col(), stack.getLiteralPath(), false, I18nConstants.VALIDATION_VAL_PROFILE_DEPENDS_NOT_RESOLVED, ext.getValue().primitiveValue(), sd.getVersionedUrl()); warning(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, element.line(), element.col(), stack.getLiteralPath(), false, I18nConstants.VALIDATION_VAL_PROFILE_DEPENDS_NOT_RESOLVED, ext.getValue().primitiveValue(), sd.getVersionedUrl());
@ -4794,8 +4794,8 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
if (pctOwned) { if (pctOwned) {
pct.done(); pct.done();
} }
if (sd.hasExtension(ToolingExtensions.EXT_SD_DEPENDENCY)) { if (sd.hasExtension(ToolingExtensions.EXT_SD_IMPOSE_PROFILE)) {
for (Extension ext : sd.getExtensionsByUrl(ToolingExtensions.EXT_SD_DEPENDENCY)) { for (Extension ext : sd.getExtensionsByUrl(ToolingExtensions.EXT_SD_IMPOSE_PROFILE)) {
StructureDefinition sdi = context.fetchResource(StructureDefinition.class, ext.getValue().primitiveValue()); StructureDefinition sdi = context.fetchResource(StructureDefinition.class, ext.getValue().primitiveValue());
if (sdi == null) { if (sdi == null) {
warning(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, element.line(), element.col(), stack.getLiteralPath() + ".meta.profile[" + i + "]", false, I18nConstants.VALIDATION_VAL_PROFILE_DEPENDS_NOT_RESOLVED, ext.getValue().primitiveValue(), sd.getVersionedUrl()); warning(errors, NO_RULE_DATE, IssueType.BUSINESSRULE, element.line(), element.col(), stack.getLiteralPath() + ".meta.profile[" + i + "]", false, I18nConstants.VALIDATION_VAL_PROFILE_DEPENDS_NOT_RESOLVED, ext.getValue().primitiveValue(), sd.getVersionedUrl());