This commit is contained in:
Grahame Grieve 2022-03-15 06:45:18 +11:00
commit 79d6c7034d
21 changed files with 178 additions and 167 deletions

View File

@ -1,12 +1,7 @@
## Validator Changes ## Validator Changes
* fix handling of xver extensions with choice sub-extensions * no changes
* validate consistency of extension modifier flag with extension use in a profile
## Other code changes ## Other code changes
* more presenting extensions when rendering. * Fix for FHIRPathEngine.funcReplaceMatches() incorrectly returning Boolean in DSTU2 & DSTU3
* Get package id from 'package' field when 'npm-package' unavailable
* Ignore META-INF contents from other dependencies while building Validator jar
* Fix to r5 TestingUtilities to allow NarrativeGenerationTests to pass.
* fix handling to xver extensions generating snapshots

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId> <artifactId>org.hl7.fhir.core</artifactId>
<version>5.6.37-SNAPSHOT</version> <version>5.6.38-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -227,6 +227,12 @@ public class Enumerations40_50 {
case _4_1_0: case _4_1_0:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._4_1_0); tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion._4_1_0);
break; 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: default:
tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion.NULL); tgt.setValue(org.hl7.fhir.r5.model.Enumerations.FHIRVersion.NULL);
break; break;
@ -312,6 +318,12 @@ public class Enumerations40_50 {
case _4_1_0: case _4_1_0:
tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._4_1_0); tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion._4_1_0);
break; 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: default:
tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion.NULL); tgt.setValue(org.hl7.fhir.r4.model.Enumerations.FHIRVersion.NULL);
break; break;

View File

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

View File

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

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId> <artifactId>org.hl7.fhir.core</artifactId>
<version>5.6.37-SNAPSHOT</version> <version>5.6.38-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -2112,12 +2112,14 @@ public class FHIRPathEngine {
private List<Base> funcReplaceMatches(ExecutionContext context, List<Base> focus, ExpressionNode exp) throws PathEngineException { private List<Base> funcReplaceMatches(ExecutionContext context, List<Base> focus, ExpressionNode exp) throws PathEngineException {
List<Base> result = new ArrayList<Base>(); List<Base> result = new ArrayList<Base>();
String sw = convertToString(execute(context, focus, exp.getParameters().get(0), true)); String regex = convertToString(execute(context, focus, exp.getParameters().get(0), true));
String repl = convertToString(execute(context, focus, exp.getParameters().get(1), true));
if (focus.size() == 1 && !Utilities.noString(sw)) if (focus.size() == 1 && !Utilities.noString(regex)) {
result.add(new BooleanType(convertToString(focus.get(0)).contains(sw))); result.add(new StringType(convertToString(focus.get(0)).replaceAll(regex, repl)));
else } else {
result.add(new BooleanType(false)); result.add(new StringType(convertToString(focus.get(0))));
}
return result; return result;
} }

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId> <artifactId>org.hl7.fhir.core</artifactId>
<version>5.6.37-SNAPSHOT</version> <version>5.6.38-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId> <artifactId>org.hl7.fhir.core</artifactId>
<version>5.6.37-SNAPSHOT</version> <version>5.6.38-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -2244,12 +2244,14 @@ public class FHIRPathEngine {
private List<Base> funcReplaceMatches(ExecutionContext context, List<Base> focus, ExpressionNode exp) throws FHIRException { private List<Base> funcReplaceMatches(ExecutionContext context, List<Base> focus, ExpressionNode exp) throws FHIRException {
List<Base> result = new ArrayList<Base>(); List<Base> result = new ArrayList<Base>();
String sw = convertToString(execute(context, focus, exp.getParameters().get(0), true)); String regex = convertToString(execute(context, focus, exp.getParameters().get(0), true));
String repl = convertToString(execute(context, focus, exp.getParameters().get(1), true));
if (focus.size() == 1 && !Utilities.noString(sw)) if (focus.size() == 1 && !Utilities.noString(regex)) {
result.add(new BooleanType(convertToString(focus.get(0)).contains(sw))); result.add(new StringType(convertToString(focus.get(0)).replaceAll(regex, repl)));
else } else {
result.add(new BooleanType(false)); result.add(new StringType(convertToString(focus.get(0))));
}
return result; return result;
} }

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId> <artifactId>org.hl7.fhir.core</artifactId>
<version>5.6.37-SNAPSHOT</version> <version>5.6.38-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId> <artifactId>org.hl7.fhir.core</artifactId>
<version>5.6.37-SNAPSHOT</version> <version>5.6.38-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId> <artifactId>org.hl7.fhir.core</artifactId>
<version>5.6.37-SNAPSHOT</version> <version>5.6.38-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

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

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId> <artifactId>org.hl7.fhir.core</artifactId>
<version>5.6.37-SNAPSHOT</version> <version>5.6.38-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId> <artifactId>org.hl7.fhir.core</artifactId>
<version>5.6.37-SNAPSHOT</version> <version>5.6.38-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId> <artifactId>org.hl7.fhir.core</artifactId>
<version>5.6.37-SNAPSHOT</version> <version>5.6.38-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.core</artifactId> <artifactId>org.hl7.fhir.core</artifactId>
<version>5.6.37-SNAPSHOT</version> <version>5.6.38-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -1871,7 +1871,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
for (StructureDefinitionContextComponent ctxt : list) { for (StructureDefinitionContextComponent ctxt : list) {
res.add(ctxt.copy()); 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"); list.get(0).setExpression("ElementDefinition.type");
} }
// the history of this is a mess - see https://jira.hl7.org/browse/FHIR-13328 // 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; typeMustSupport = true;
} }
String tc = type.getChildValue("code"); String tc = type.getChildValue("code");
if (type.hasExtension("http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type")) { if (type.hasExtension(ToolingExtensions.EXT_FHIR_TYPE)) {
tc = type.getExtensionValue("http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type").primitiveValue(); tc = type.getExtensionValue(ToolingExtensions.EXT_FHIR_TYPE).primitiveValue();
} }
if (Utilities.noString(tc) && type.hasChild("code")) { if (Utilities.noString(tc) && type.hasChild("code")) {
if (type.getNamedChild("code").hasExtension("http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type")) { if (type.getNamedChild("code").hasExtension("http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type")) {

View File

@ -14,7 +14,7 @@
HAPI FHIR HAPI FHIR
--> -->
<artifactId>org.hl7.fhir.core</artifactId> <artifactId>org.hl7.fhir.core</artifactId>
<version>5.6.37-SNAPSHOT</version> <version>5.6.38-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<properties> <properties>