Trim unknown resource types when pre-adopting extensions of type Reference from future versions

This commit is contained in:
Grahame Grieve 2022-05-11 02:14:08 +10:00
parent 0999c8d460
commit be631a5130
2 changed files with 11 additions and 3 deletions

View File

@ -157,9 +157,11 @@ public class XVerExtensionManager {
tr.addTargetProfile("http://hl7.org/fhir/StructureDefinition/Resource");
} else if (p.contains(",")) {
for (String pp : p.split("\\,")) {
tr.addTargetProfile("http://hl7.org/fhir/StructureDefinition/"+pp);
if (isResource(pp)) {
tr.addTargetProfile("http://hl7.org/fhir/StructureDefinition/"+pp);
}
}
} else {
} else if (isResource(p)) {
tr.addTargetProfile("http://hl7.org/fhir/StructureDefinition/"+p);
}
}
@ -171,6 +173,12 @@ public class XVerExtensionManager {
}
}
// todo: translate names
private boolean isResource(String p) {
return context.getResourceNames().contains(p);
}
private boolean hasTargets(String dt) {
return Utilities.existsInList(dt, "canonical", "Reference", "CodeableReference");
}

View File

@ -19,7 +19,7 @@
<properties>
<hapi_fhir_version>5.4.0</hapi_fhir_version>
<validator_test_case_version>1.1.98</validator_test_case_version>
<validator_test_case_version>1.1.99-SNAPSHOT</validator_test_case_version>
<junit_jupiter_version>5.7.1</junit_jupiter_version>
<junit_platform_launcher_version>1.7.1</junit_platform_launcher_version>
<maven_surefire_version>3.0.0-M5</maven_surefire_version>