Merge pull request #763 from hapifhir/R4B-fixes

R4 b fixes
This commit is contained in:
Grahame Grieve 2022-03-15 06:13:13 +11:00 committed by GitHub
commit fa75f7d79a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 93 additions and 81 deletions

View File

@ -227,6 +227,12 @@ public class Enumerations40_50 {
case _4_1_0:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._4_1_0);
break;
case _4_3_0_CIBUILD:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._4_3_0CIBUILD);
break;
case _4_3_0_SNAPSHOT1:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._4_3_0SNAPSHOT1);
break;
default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion.NULL);
break;
@ -312,6 +318,12 @@ public class Enumerations40_50 {
case _4_1_0:
tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._4_1_0);
break;
case _4_3_0CIBUILD:
tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._4_3_0_CIBUILD);
break;
case _4_3_0SNAPSHOT1:
tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._4_3_0_SNAPSHOT1);
break;
default:
tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion.NULL);
break;

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

@ -7158,7 +7158,7 @@ public String toCode(int len) {
public boolean isR4B() {
return toCode().startsWith("4.1") ||toCode().startsWith("4.3");
return toCode().startsWith("4.1") || toCode().startsWith("4.3");
}
// end addition

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")) {