Merge branch 'master' into gg-202110-CVE-2021-42574

This commit is contained in:
Grahame Grieve 2021-11-03 10:36:29 +11:00 committed by GitHub
commit e8ead0696b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 48 additions and 30 deletions

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.5.9-SNAPSHOT</version> <version>5.5.10-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.5.9-SNAPSHOT</version> <version>5.5.10-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.5.9-SNAPSHOT</version> <version>5.5.10-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.5.9-SNAPSHOT</version> <version>5.5.10-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.5.9-SNAPSHOT</version> <version>5.5.10-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.5.9-SNAPSHOT</version> <version>5.5.10-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.5.9-SNAPSHOT</version> <version>5.5.10-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.5.9-SNAPSHOT</version> <version>5.5.10-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.5.9-SNAPSHOT</version> <version>5.5.10-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.5.9-SNAPSHOT</version> <version>5.5.10-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -5384,57 +5384,76 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
// this is a hack work around for past publication of wrong FHIRPath expressions // this is a hack work around for past publication of wrong FHIRPath expressions
// R4 // R4
// waiting for 4.0.2 // waiting for 4.0.2
//TODO is this expression below correct? @grahamegrieve
if ("probability is decimal implies (probability as decimal) <= 100".equals(expr)) { if ("probability is decimal implies (probability as decimal) <= 100".equals(expr)) {
return "probablility.empty() or ((probability is decimal) implies ((probability as decimal) <= 100))"; return "probablility.empty() or ((probability is decimal) implies ((probability as decimal) <= 100))";
} }
if ("enableWhen.count() > 2 implies enableBehavior.exists()".equals(expr)) { if ("enableWhen.count() > 2 implies enableBehavior.exists()".equals(expr)) {
return "enableWhen.count() >= 2 implies enableBehavior.exists()"; return "enableWhen.count() >= 2 implies enableBehavior.exists()";
} }
if ("txt-2".equals(key)) { if ("txt-2".equals(key)) {
return "htmlChecks2()"; return "htmlChecks2()";
} }
// handled in 4.0.1 // handled in 4.0.1
if ("(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)".equals(expr)) if ("(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)".equals(expr)) {
return "(component.empty() and hasMember.empty()) implies (dataAbsentReason.exists() or value.exists())"; return "(component.empty() and hasMember.empty()) implies (dataAbsentReason.exists() or value.exists())";
if ("isModifier implies isModifierReason.exists()".equals(expr)) }
if ("isModifier implies isModifierReason.exists()".equals(expr)) {
return "(isModifier.exists() and isModifier) implies isModifierReason.exists()"; return "(isModifier.exists() and isModifier) implies isModifierReason.exists()";
if ("(%resource.kind = 'logical' or element.first().path.startsWith(%resource.type)) and (element.tail().not() or element.tail().all(path.startsWith(%resource.differential.element.first().path.replaceMatches('\\\\..*','')&'.')))".equals(expr)) }
if ("(%resource.kind = 'logical' or element.first().path.startsWith(%resource.type)) and (element.tail().not() or element.tail().all(path.startsWith(%resource.differential.element.first().path.replaceMatches('\\\\..*','')&'.')))".equals(expr)) {
return "(%resource.kind = 'logical' or element.first().path.startsWith(%resource.type)) and (element.tail().empty() or element.tail().all(path.startsWith(%resource.differential.element.first().path.replaceMatches('\\\\..*','')&'.')))"; return "(%resource.kind = 'logical' or element.first().path.startsWith(%resource.type)) and (element.tail().empty() or element.tail().all(path.startsWith(%resource.differential.element.first().path.replaceMatches('\\\\..*','')&'.')))";
if ("differential.element.all(id) and differential.element.id.trace('ids').isDistinct()".equals(expr)) }
if ("differential.element.all(id) and differential.element.id.trace('ids').isDistinct()".equals(expr)) {
return "differential.element.all(id.exists()) and differential.element.id.trace('ids').isDistinct()"; return "differential.element.all(id.exists()) and differential.element.id.trace('ids').isDistinct()";
if ("snapshot.element.all(id) and snapshot.element.id.trace('ids').isDistinct()".equals(expr)) }
if ("snapshot.element.all(id) and snapshot.element.id.trace('ids').isDistinct()".equals(expr)) {
return "snapshot.element.all(id.exists()) and snapshot.element.id.trace('ids').isDistinct()"; return "snapshot.element.all(id.exists()) and snapshot.element.id.trace('ids').isDistinct()";
}
// R3 // R3
if ("(code or value.empty()) and (system.empty() or system = 'urn:iso:std:iso:4217')".equals(expr)) if ("(code or value.empty()) and (system.empty() or system = 'urn:iso:std:iso:4217')".equals(expr)) {
return "(code.exists() or value.empty()) and (system.empty() or system = 'urn:iso:std:iso:4217')"; return "(code.exists() or value.empty()) and (system.empty() or system = 'urn:iso:std:iso:4217')";
if ("value.empty() or code!=component.code".equals(expr)) }
if ("value.empty() or code!=component.code".equals(expr)) {
return "value.empty() or (code in component.code).not()"; return "value.empty() or (code in component.code).not()";
if ("(code or value.empty()) and (system.empty() or system = %ucum) and (value.empty() or value > 0)".equals(expr)) }
if ("(code or value.empty()) and (system.empty() or system = %ucum) and (value.empty() or value > 0)".equals(expr)) {
return "(code.exists() or value.empty()) and (system.empty() or system = %ucum) and (value.empty() or value > 0)"; return "(code.exists() or value.empty()) and (system.empty() or system = %ucum) and (value.empty() or value > 0)";
if ("element.all(definition and min and max)".equals(expr)) }
if ("element.all(definition and min and max)".equals(expr)) {
return "element.all(definition.exists() and min.exists() and max.exists())"; return "element.all(definition.exists() and min.exists() and max.exists())";
if ("telecom or endpoint".equals(expr)) }
if ("telecom or endpoint".equals(expr)) {
return "telecom.exists() or endpoint.exists()"; return "telecom.exists() or endpoint.exists()";
if ("(code or value.empty()) and (system.empty() or system = %ucum) and (value.empty() or value > 0)".equals(expr)) }
if ("(code or value.empty()) and (system.empty() or system = %ucum) and (value.empty() or value > 0)".equals(expr)) {
return "(code.exists() or value.empty()) and (system.empty() or system = %ucum) and (value.empty() or value > 0)"; return "(code.exists() or value.empty()) and (system.empty() or system = %ucum) and (value.empty() or value > 0)";
if ("searchType implies type = 'string'".equals(expr)) }
if ("searchType implies type = 'string'".equals(expr)) {
return "searchType.exists() implies type = 'string'"; return "searchType.exists() implies type = 'string'";
if ("abatement.empty() or (abatement as boolean).not() or clinicalStatus='resolved' or clinicalStatus='remission' or clinicalStatus='inactive'".equals(expr)) }
if ("abatement.empty() or (abatement as boolean).not() or clinicalStatus='resolved' or clinicalStatus='remission' or clinicalStatus='inactive'".equals(expr)) {
return "abatement.empty() or (abatement is boolean).not() or (abatement as boolean).not() or (clinicalStatus = 'resolved') or (clinicalStatus = 'remission') or (clinicalStatus = 'inactive')"; return "abatement.empty() or (abatement is boolean).not() or (abatement as boolean).not() or (clinicalStatus = 'resolved') or (clinicalStatus = 'remission') or (clinicalStatus = 'inactive')";
if ("(component.empty() and related.empty()) implies (dataAbsentReason or value)".equals(expr)) }
if ("(component.empty() and related.empty()) implies (dataAbsentReason or value)".equals(expr)) {
return "(component.empty() and related.empty()) implies (dataAbsentReason.exists() or value.exists())"; return "(component.empty() and related.empty()) implies (dataAbsentReason.exists() or value.exists())";
}
if ("reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids'))".equals(expr)) { if ("reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids'))".equals(expr)) {
return "(reference = '#') or reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids'))"; return "(reference = '#') or reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids'))";
} }
if ("reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))".equals(expr)) { if ("reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))".equals(expr)) {
return "(reference = '#') or reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids'))"; return "(reference = '#') or reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids'))";
} }
if ("".equals(expr)) if ("probability is decimal implies probability.as(decimal) <= 100".equals(expr)) {
if (key.equals("ras-2")) {
return "probability.empty() or (probability is decimal implies probability.as(decimal) <= 100)";
}
}
if ("".equals(expr)) {
return ""; return "";
}
return expr; return expr;
} }

View File

@ -100,7 +100,6 @@ public class ValidationTests implements IEvaluationContext, IValidatorResourceFe
List<Object[]> objects = new ArrayList<Object[]>(examples.size()); List<Object[]> objects = new ArrayList<Object[]>(examples.size());
for (String id : names) { for (String id : names) {
//if (id.equals("bundle-documentation-miss-last-updated"))
objects.add(new Object[]{id, examples.get(id)}); objects.add(new Object[]{id, examples.get(id)});
} }
return objects; return objects;

View File

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