More fixes for SearchParameter validation
This commit is contained in:
parent
289a74301d
commit
166cb445f8
|
@ -264,6 +264,7 @@ public class ToolingExtensions {
|
||||||
public static final String EXT_ARTIFACT_NAME = "http://hl7.org/fhir/StructureDefinition/artifact-name";
|
public static final String EXT_ARTIFACT_NAME = "http://hl7.org/fhir/StructureDefinition/artifact-name";
|
||||||
public static final String EXT_ARTIFACT_DESC = "http://hl7.org/fhir/StructureDefinition/artifact-description";
|
public static final String EXT_ARTIFACT_DESC = "http://hl7.org/fhir/StructureDefinition/artifact-description";
|
||||||
public static final String EXT_ED_SUPPRESS = "http://hl7.org/fhir/StructureDefinition/elementdefinition-suppress";
|
public static final String EXT_ED_SUPPRESS = "http://hl7.org/fhir/StructureDefinition/elementdefinition-suppress";
|
||||||
|
public static final String EXT_SEARCH_PARAMETER_BASE = "http://hl7.org/fhir/tools/StructureDefinition/searchparameter-base-type";;
|
||||||
|
|
||||||
// specific extension helpers
|
// specific extension helpers
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ import org.hl7.fhir.r5.fhirpath.ExpressionNode.Kind;
|
||||||
import org.hl7.fhir.r5.fhirpath.ExpressionNode.Operation;
|
import org.hl7.fhir.r5.fhirpath.ExpressionNode.Operation;
|
||||||
import org.hl7.fhir.r5.fhirpath.FHIRPathEngine.IssueMessage;
|
import org.hl7.fhir.r5.fhirpath.FHIRPathEngine.IssueMessage;
|
||||||
import org.hl7.fhir.r5.model.SearchParameter;
|
import org.hl7.fhir.r5.model.SearchParameter;
|
||||||
|
import org.hl7.fhir.r5.utils.ToolingExtensions;
|
||||||
import org.hl7.fhir.utilities.Utilities;
|
import org.hl7.fhir.utilities.Utilities;
|
||||||
import org.hl7.fhir.utilities.i18n.I18nConstants;
|
import org.hl7.fhir.utilities.i18n.I18nConstants;
|
||||||
import org.hl7.fhir.utilities.validation.ValidationMessage;
|
import org.hl7.fhir.utilities.validation.ValidationMessage;
|
||||||
|
@ -45,9 +46,13 @@ public class SearchParameterValidator extends BaseValidator {
|
||||||
if (cs.hasChild("expression", false)) {
|
if (cs.hasChild("expression", false)) {
|
||||||
List<String> bases = new ArrayList<>();
|
List<String> bases = new ArrayList<>();
|
||||||
for (Element b : cs.getChildrenByName("base")) {
|
for (Element b : cs.getChildrenByName("base")) {
|
||||||
bases.add(b.primitiveValue());
|
if (b.hasExtension(ToolingExtensions.EXT_SEARCH_PARAMETER_BASE)) {
|
||||||
|
bases.add(b.getExtensionValue(ToolingExtensions.EXT_SEARCH_PARAMETER_BASE).primitiveValue());
|
||||||
|
} else {
|
||||||
|
bases.add(b.primitiveValue());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!bases.isEmpty()) {
|
if (!bases.isEmpty()) { // that'd be an error somewhere else
|
||||||
ok = checkExpression(errors, stack.push(cs.getNamedChild("expression", false), -1, null, null), cs.getNamedChildValue("expression", false), bases) && ok;
|
ok = checkExpression(errors, stack.push(cs.getNamedChild("expression", false), -1, null, null), cs.getNamedChildValue("expression", false), bases) && ok;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue