Merge branch 'master' into i18n

# Conflicts:
#	org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java
This commit is contained in:
patrick-werner 2020-03-01 14:50:52 +01:00
commit d84f93e8a8
15 changed files with 5332 additions and 5248 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>4.2.3-SNAPSHOT</version> <version>4.2.4-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>4.2.3-SNAPSHOT</version> <version>4.2.4-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>4.2.3-SNAPSHOT</version> <version>4.2.4-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>4.2.3-SNAPSHOT</version> <version>4.2.4-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>4.2.3-SNAPSHOT</version> <version>4.2.4-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>4.2.3-SNAPSHOT</version> <version>4.2.4-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -26,6 +26,7 @@ import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -41,6 +42,7 @@ import org.hl7.fhir.r5.model.Parameters;
import org.hl7.fhir.utilities.CSFile; import org.hl7.fhir.utilities.CSFile;
import org.hl7.fhir.utilities.TextFile; import org.hl7.fhir.utilities.TextFile;
import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.VersionUtilities;
import org.hl7.fhir.utilities.cache.PackageCacheManager; import org.hl7.fhir.utilities.cache.PackageCacheManager;
import org.hl7.fhir.utilities.cache.ToolsVersion; import org.hl7.fhir.utilities.cache.ToolsVersion;
@ -59,22 +61,28 @@ import com.google.gson.JsonSyntaxException;
public class TestingUtilities { public class TestingUtilities {
private static final boolean SHOW_DIFF = true; private static final boolean SHOW_DIFF = true;
static public IWorkerContext fcontext; static public Map<String, IWorkerContext> fcontexts;
public static IWorkerContext context() { public static IWorkerContext context() {
if (fcontext == null) { return context("4.0.1");
}
public static IWorkerContext context(String version) {
if (fcontexts == null) {
fcontexts = new HashMap<>();
}
if (!fcontexts.containsKey(version)) {
PackageCacheManager pcm; PackageCacheManager pcm;
try { try {
pcm = new PackageCacheManager(true, ToolsVersion.TOOLS_VERSION); pcm = new PackageCacheManager(true, ToolsVersion.TOOLS_VERSION);
fcontext = SimpleWorkerContext.fromPackage(pcm.loadPackage("hl7.fhir.r4.core", "4.0.1")); IWorkerContext fcontext = SimpleWorkerContext.fromPackage(pcm.loadPackage(VersionUtilities.packageForVersion(version), version));
fcontext.setUcumService(new UcumEssenceService(TestingUtilities.loadTestResourceStream("ucum", "ucum-essence.xml"))); fcontext.setUcumService(new UcumEssenceService(TestingUtilities.loadTestResourceStream("ucum", "ucum-essence.xml")));
fcontext.setExpansionProfile(new Parameters()); fcontext.setExpansionProfile(new Parameters());
fcontexts.put(version, fcontext);
} catch (Exception e) { } catch (Exception e) {
throw new Error(e); throw new Error(e);
} }
} }
return fcontext; return fcontexts.get(version);
} }
static public boolean silent; static public boolean silent;

View File

@ -108,6 +108,8 @@ public class SnapShotGenerationTests {
private boolean fail; private boolean fail;
private boolean newSliceProcessing; private boolean newSliceProcessing;
private boolean debug; private boolean debug;
private String version;
private List<Rule> rules = new ArrayList<>(); private List<Rule> rules = new ArrayList<>();
private StructureDefinition source; private StructureDefinition source;
private StructureDefinition included; private StructureDefinition included;
@ -121,6 +123,11 @@ public class SnapShotGenerationTests {
fail = "true".equals(test.getAttribute("fail")); fail = "true".equals(test.getAttribute("fail"));
newSliceProcessing = !"false".equals(test.getAttribute("new-slice-processing")); newSliceProcessing = !"false".equals(test.getAttribute("new-slice-processing"));
debug = "true".equals(test.getAttribute("debug")); debug = "true".equals(test.getAttribute("debug"));
if (test.hasAttribute("version")) {
version = test.getAttribute("version");
} else {
version = "4.0.1";
}
id = test.getAttribute("id"); id = test.getAttribute("id");
include = test.getAttribute("include"); include = test.getAttribute("include");
@ -493,7 +500,7 @@ public class SnapShotGenerationTests {
throw new Exception("URL mismatch on base: "+base.getUrl()+" wanting "+test.getSource().getBaseDefinition()); throw new Exception("URL mismatch on base: "+base.getUrl()+" wanting "+test.getSource().getBaseDefinition());
StructureDefinition output = test.getSource().copy(); StructureDefinition output = test.getSource().copy();
ProfileUtilities pu = new ProfileUtilities(TestingUtilities.context(), messages , new TestPKP()); ProfileUtilities pu = new ProfileUtilities(TestingUtilities.context(test.version), messages , new TestPKP());
pu.setNewSlicingProcessing(test.isNewSliceProcessing()); pu.setNewSlicingProcessing(test.isNewSliceProcessing());
pu.setThrowException(false); pu.setThrowException(false);
pu.setDebug(test.isDebug()); pu.setDebug(test.isDebug());

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

View File

@ -118,7 +118,10 @@ public class ValidationTestSuite implements IEvaluationContext, IValidatorResour
} }
vCurr = ve.get(v); vCurr = ve.get(v);
vCurr.setFetcher(this); vCurr.setFetcher(this);
TestingUtilities.fcontext = vCurr.getContext(); if (TestingUtilities.fcontexts == null) {
TestingUtilities.fcontexts = new HashMap<>();
}
TestingUtilities.fcontexts.put(v, vCurr.getContext());
if (content.has("use-test") && !content.get("use-test").getAsBoolean()) if (content.has("use-test") && !content.get("use-test").getAsBoolean())
return; return;

View File

@ -13,11 +13,11 @@
each other. It is fine to bump the point version of this POM without affecting each other. It is fine to bump the point version of this POM without affecting
HAPI FHIR. HAPI FHIR.
--> -->
<version>4.2.3-SNAPSHOT</version> <version>4.2.4-SNAPSHOT</version>
<properties> <properties>
<hapi_fhir_version>4.2.0</hapi_fhir_version> <hapi_fhir_version>4.2.0</hapi_fhir_version>
<validator_test_case_version>1.0.43-SNAPSHOT</validator_test_case_version> <validator_test_case_version>1.0.44-SNAPSHOT</validator_test_case_version>
</properties> </properties>
<artifactId>org.hl7.fhir.core</artifactId> <artifactId>org.hl7.fhir.core</artifactId>

View File

@ -1,7 +1,7 @@
@echo off @echo off
set oldver=4.2.2 set oldver=4.2.3
set newver=4.2.3 set newver=4.2.4
echo .. echo ..
echo ========================================================================= echo =========================================================================