Fix bug checking for implicit value sets

This commit is contained in:
Grahame Grieve 2023-09-21 12:42:36 +10:00
parent 9ef82e7e23
commit 31ea68f69b
2 changed files with 25 additions and 3 deletions

View File

@ -35,6 +35,7 @@ import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.model.StructureDefinition.StructureDefinitionKind;
import org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule;
import org.hl7.fhir.r5.model.ValueSet;
import org.hl7.fhir.r5.terminologies.utilities.TerminologyServiceErrorClass;
import org.hl7.fhir.r5.utils.FHIRPathEngine;
import org.hl7.fhir.r5.utils.ToolingExtensions;
import org.hl7.fhir.utilities.Utilities;
@ -815,7 +816,7 @@ public class StructureDefinitionValidator extends BaseValidator {
private boolean serverSupportsValueSet(String ref) {
ValidationResult vr = context.validateCode(new ValidationOptions().withCheckValueSetOnly().withVsAsUrl().withNoClient(), new Coding("http://loinc.org", "5792-7", null), new ValueSet().setUrl(ref));
return vr.getErrorClass() == null;
return vr.getErrorClass() == null || vr.getErrorClass() == TerminologyServiceErrorClass.UNKNOWN;
}
private boolean validateElementType(List<ValidationMessage> errors, Element type, NodeStack stack, StructureDefinition sd, String path, boolean logical) {

View File

@ -4077,7 +4077,6 @@ v: {
"code" : "34133-9",
"system" : "http://loinc.org",
"version" : "2.74",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
@ -4100,7 +4099,29 @@ v: {
"code" : "18842-5",
"system" : "http://loinc.org",
"version" : "2.74",
"unknown-systems" : "",
"issues" : {
"resourceType" : "OperationOutcome"
}
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://loinc.org",
"code" : "5792-7"
}, "valueSet" :{
"resourceType" : "ValueSet",
"url" : "http://hl7.org/fhir/ValueSet/birthDate"
}, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "valueSetMode":"CHECK_MEMERSHIP_ONLY", "displayWarningMode":"false", "versionFlexible":"true", "profile": {
"resourceType" : "Parameters",
"parameter" : [{
"name" : "profile-url",
"valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891"
}]
}}####
v: {
"severity" : "error",
"error" : "Error from http://tx-dev.fhir.org/r4: Unable to resolve value set \"http://hl7.org/fhir/ValueSet/birthDate\"",
"class" : "SERVER_ERROR",
"issues" : {
"resourceType" : "OperationOutcome"
}