Replaced hard-coded extension reference with constant value

This commit is contained in:
Lloyd McKenzie 2022-03-13 20:56:40 -06:00
parent 4c82c9c738
commit 335800c932
4 changed files with 7 additions and 7 deletions

View File

@ -249,8 +249,8 @@ public class Analyser {
}
protected String getTypename(TypeRefComponent type) throws Exception {
if (type.hasExtension("http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type")) {
return type.getExtensionString("http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type");
if (type.hasExtension(ToolingExtensions.EXT_FHIR_TYPE)) {
return type.getExtensionString(ToolingExtensions.EXT_FHIR_TYPE);
} else {
return getTypeName(type.getCode());
}

View File

@ -172,8 +172,8 @@ public class JavaBaseGenerator extends OutputStreamWriter {
}
protected String getTypename(TypeRefComponent type) throws Exception {
if (type.hasExtension("http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type")) {
return type.getExtensionString("http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type");
if (type.hasExtension(ToolingExtensions.EXT_FHIR_TYPE)) {
return type.getExtensionString(ToolingExtensions.EXT_FHIR_TYPE);
} else {
return getTypeName(type.getCode());
}

View File

@ -1871,7 +1871,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
for (StructureDefinitionContextComponent ctxt : list) {
res.add(ctxt.copy());
}
if ("http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type".equals(extUrl)) {
if (ToolingExtensions.EXT_FHIR_TYPE.equals(extUrl)) {
list.get(0).setExpression("ElementDefinition.type");
}
// the history of this is a mess - see https://jira.hl7.org/browse/FHIR-13328

View File

@ -133,8 +133,8 @@ public class StructureDefinitionValidator extends BaseValidator {
typeMustSupport = true;
}
String tc = type.getChildValue("code");
if (type.hasExtension("http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type")) {
tc = type.getExtensionValue("http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type").primitiveValue();
if (type.hasExtension(ToolingExtensions.EXT_FHIR_TYPE)) {
tc = type.getExtensionValue(ToolingExtensions.EXT_FHIR_TYPE).primitiveValue();
}
if (Utilities.noString(tc) && type.hasChild("code")) {
if (type.getNamedChild("code").hasExtension("http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type")) {