diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 83609fe74..457de8b83 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -1,7 +1,8 @@
-* Differential element fields minValue/maxValue are now correctly treated in the snapshot generation process
-* Conversion context added to conversions process
-* Users can now define custom behavior for CodeSystems, Extensions, BundleEntries, and Types by extending BaseAdvisor.
-* Resource Conversions are now thread-safe, each using their own instance of the conversion context that is unique
-* ConversionFactory classes are statically accessed, to minimize changes downstream
-* I need to add more tests, there were very few to begin with, and it's my next task
-* All conversion libraries and no play makes Mark a dull boy
+* Differential element fields minValue/maxValue are now correctly treated in the snapshot generation process
+* Conversion context added to conversions process
+* Users can now define custom behavior for CodeSystems, Extensions, BundleEntries, and Types by extending BaseAdvisor.
+* Resource Conversions are now thread-safe, each using their own instance of the conversion context that is unique
+* ConversionFactory classes are statically accessed, to minimize changes downstream
+* I need to add more tests, there were very few to begin with, and it's my next task
+* All conversion libraries and no play makes Mark a dull boy
+* Exposed showMessagesFromReferences on the command line interface to support reporting validation errors on referenced types (particularly useful when validating messages & documents)
diff --git a/master-branch-pipeline.yml b/master-branch-pipeline.yml
index da4881cca..c19016493 100644
--- a/master-branch-pipeline.yml
+++ b/master-branch-pipeline.yml
@@ -86,6 +86,9 @@ steps:
inputs:
mavenPomFile: '$(System.DefaultWorkingDirectory)/pom.xml'
goals: deploy
+ javaHomeOption: 'JDKVersion'
+ jdkVersionOption: '1.11'
+ jdkArchitectureOption: 'x64'
options: '--settings $(System.DefaultWorkingDirectory)/settings.xml -pl "!org.hl7.fhir.report, !org.hl7.fhir.validation.cli" -DdeployToSonatype'
publishJUnitResults: false
@@ -96,5 +99,8 @@ steps:
inputs:
mavenPomFile: '$(System.DefaultWorkingDirectory)/pom.xml'
goals: deploy
+ javaHomeOption: 'JDKVersion'
+ jdkVersionOption: '1.11'
+ jdkArchitectureOption: 'x64'
options: '--settings $(System.DefaultWorkingDirectory)/settings.xml -pl "!org.hl7.fhir.report, !org.hl7.fhir.validation.cli" -Dmaven.test.skip -DdeployToGitHub'
publishJUnitResults: false
diff --git a/org.hl7.fhir.convertors/pom.xml b/org.hl7.fhir.convertors/pom.xml
index e8429d0e7..7d9ff6293 100644
--- a/org.hl7.fhir.convertors/pom.xml
+++ b/org.hl7.fhir.convertors/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
org.hl7.fhir.core
- 5.4.10-SNAPSHOT
+ 5.4.11-SNAPSHOT
../pom.xml
diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory.java
new file mode 100644
index 000000000..0978cb759
--- /dev/null
+++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory.java
@@ -0,0 +1,25 @@
+package org.hl7.fhir.convertors.factory;
+
+import org.hl7.fhir.convertors.advisors.interfaces.BaseAdvisor;
+import org.hl7.fhir.exceptions.FHIRException;
+import org.hl7.fhir.instance.model.api.IBaseDatatype;
+import org.hl7.fhir.instance.model.api.IBaseResource;
+
+public abstract class VersionConvertorFactory {
+ public static void cleanInputs(IBaseResource res, BaseAdvisor advisor) {
+ checkDataAndAdvisor(res, advisor);
+ }
+
+ public static void cleanInputs(IBaseDatatype res, BaseAdvisor advisor) {
+ checkDataAndAdvisor(res, advisor);
+ }
+
+ private static void checkDataAndAdvisor(Object o, BaseAdvisor advisor) {
+ if (advisor == null) {
+ throw new FHIRException("Null conversion advisor passed to factory method.");
+ }
+ if (advisor.failFastOnNullOrUnknownEntry() && o == null) {
+ throw new FHIRException("ConversionFactory received null input. Conversion advisor set to failFastOnNullInput.");
+ }
+ }
+}
diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_10_30.java
index ee165c3c6..a579df93a 100644
--- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_10_30.java
+++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_10_30.java
@@ -5,14 +5,15 @@ import org.hl7.fhir.convertors.conv10_30.VersionConvertor_10_30;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.utilities.Utilities;
-public final class VersionConvertorFactory_10_30 {
+public final class VersionConvertorFactory_10_30 extends VersionConvertorFactory {
public static org.hl7.fhir.dstu3.model.Resource convertResource(org.hl7.fhir.dstu2.model.Resource src) throws FHIRException {
return convertResource(src, new BaseAdvisor_10_30());
}
public static org.hl7.fhir.dstu3.model.Resource convertResource(org.hl7.fhir.dstu2.model.Resource src, BaseAdvisor_10_30 advisor) throws FHIRException {
- return new VersionConvertor_10_30(advisor).convertResource(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_10_30(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.dstu2.model.Resource convertResource(org.hl7.fhir.dstu3.model.Resource src) throws FHIRException {
@@ -20,7 +21,8 @@ public final class VersionConvertorFactory_10_30 {
}
public static org.hl7.fhir.dstu2.model.Resource convertResource(org.hl7.fhir.dstu3.model.Resource src, BaseAdvisor_10_30 advisor) throws FHIRException {
- return new VersionConvertor_10_30(advisor).convertResource(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_10_30(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.dstu3.model.Type convertType(org.hl7.fhir.dstu2.model.Type src) throws FHIRException {
@@ -28,7 +30,8 @@ public final class VersionConvertorFactory_10_30 {
}
public static org.hl7.fhir.dstu3.model.Type convertType(org.hl7.fhir.dstu2.model.Type src, BaseAdvisor_10_30 advisor) throws FHIRException {
- return new VersionConvertor_10_30(advisor).convertType(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_10_30(advisor).convertType(src) : null;
}
public static org.hl7.fhir.dstu2.model.Type convertType(org.hl7.fhir.dstu3.model.Type src) throws FHIRException {
@@ -36,7 +39,8 @@ public final class VersionConvertorFactory_10_30 {
}
public static org.hl7.fhir.dstu2.model.Type convertType(org.hl7.fhir.dstu3.model.Type src, BaseAdvisor_10_30 advisor) throws FHIRException {
- return new VersionConvertor_10_30(advisor).convertType(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_10_30(advisor).convertType(src) : null;
}
public static boolean convertsResource(String rt) {
diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_10_40.java
index bcde07ed9..392def5ff 100644
--- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_10_40.java
+++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_10_40.java
@@ -5,14 +5,15 @@ import org.hl7.fhir.convertors.conv10_40.VersionConvertor_10_40;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.utilities.Utilities;
-public final class VersionConvertorFactory_10_40 {
+public final class VersionConvertorFactory_10_40 extends VersionConvertorFactory {
public static org.hl7.fhir.r4.model.Resource convertResource(org.hl7.fhir.dstu2.model.Resource src) throws FHIRException {
return convertResource(src, new BaseAdvisor_10_40());
}
public static org.hl7.fhir.r4.model.Resource convertResource(org.hl7.fhir.dstu2.model.Resource src, BaseAdvisor_10_40 advisor) throws FHIRException {
- return new VersionConvertor_10_40(advisor).convertResource(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_10_40(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.dstu2.model.Resource convertResource(org.hl7.fhir.r4.model.Resource src) throws FHIRException {
@@ -20,7 +21,8 @@ public final class VersionConvertorFactory_10_40 {
}
public static org.hl7.fhir.dstu2.model.Resource convertResource(org.hl7.fhir.r4.model.Resource src, BaseAdvisor_10_40 advisor) throws FHIRException {
- return new VersionConvertor_10_40(advisor).convertResource(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_10_40(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.r4.model.Type convertType(org.hl7.fhir.dstu2.model.Type src) throws FHIRException {
@@ -28,7 +30,8 @@ public final class VersionConvertorFactory_10_40 {
}
public static org.hl7.fhir.r4.model.Type convertType(org.hl7.fhir.dstu2.model.Type src, BaseAdvisor_10_40 advisor) throws FHIRException {
- return new VersionConvertor_10_40(advisor).convertType(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_10_40(advisor).convertType(src) : null;
}
public static org.hl7.fhir.dstu2.model.Type convertType(org.hl7.fhir.r4.model.Type src) throws FHIRException {
@@ -36,7 +39,8 @@ public final class VersionConvertorFactory_10_40 {
}
public static org.hl7.fhir.dstu2.model.Type convertType(org.hl7.fhir.r4.model.Type src, BaseAdvisor_10_40 advisor) throws FHIRException {
- return new VersionConvertor_10_40(advisor).convertType(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_10_40(advisor).convertType(src) : null;
}
public static boolean convertsResource(String rt) {
diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_10_50.java
index b675198c8..6fb9f4578 100644
--- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_10_50.java
+++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_10_50.java
@@ -5,14 +5,15 @@ import org.hl7.fhir.convertors.conv10_50.VersionConvertor_10_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.utilities.Utilities;
-public final class VersionConvertorFactory_10_50 {
+public final class VersionConvertorFactory_10_50 extends VersionConvertorFactory {
public static org.hl7.fhir.r5.model.Resource convertResource(org.hl7.fhir.dstu2.model.Resource src) throws FHIRException {
return convertResource(src, new BaseAdvisor_10_50());
}
public static org.hl7.fhir.r5.model.Resource convertResource(org.hl7.fhir.dstu2.model.Resource src, BaseAdvisor_10_50 advisor) throws FHIRException {
- return new VersionConvertor_10_50(advisor).convertResource(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_10_50(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.dstu2.model.Resource convertResource(org.hl7.fhir.r5.model.Resource src) throws FHIRException {
@@ -20,7 +21,8 @@ public final class VersionConvertorFactory_10_50 {
}
public static org.hl7.fhir.dstu2.model.Resource convertResource(org.hl7.fhir.r5.model.Resource src, BaseAdvisor_10_50 advisor) throws FHIRException {
- return new VersionConvertor_10_50(advisor).convertResource(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_10_50(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.r5.model.DataType convertType(org.hl7.fhir.dstu2.model.Type src) throws FHIRException {
@@ -28,7 +30,8 @@ public final class VersionConvertorFactory_10_50 {
}
public static org.hl7.fhir.r5.model.DataType convertType(org.hl7.fhir.dstu2.model.Type src, BaseAdvisor_10_50 advisor) throws FHIRException {
- return new VersionConvertor_10_50(advisor).convertType(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_10_50(advisor).convertType(src) : null;
}
public static org.hl7.fhir.dstu2.model.Type convertType(org.hl7.fhir.r5.model.DataType src) throws FHIRException {
@@ -36,7 +39,8 @@ public final class VersionConvertorFactory_10_50 {
}
public static org.hl7.fhir.dstu2.model.Type convertType(org.hl7.fhir.r5.model.DataType src, BaseAdvisor_10_50 advisor) throws FHIRException {
- return new VersionConvertor_10_50(advisor).convertType(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_10_50(advisor).convertType(src) : null;
}
public static boolean convertsResource(String rt) {
diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_14_30.java
index 98c469922..8eb2ba3ae 100644
--- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_14_30.java
+++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_14_30.java
@@ -5,14 +5,15 @@ import org.hl7.fhir.convertors.conv14_30.VersionConvertor_14_30;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.utilities.Utilities;
-public final class VersionConvertorFactory_14_30 {
+public final class VersionConvertorFactory_14_30 extends VersionConvertorFactory {
public static org.hl7.fhir.dstu3.model.Resource convertResource(org.hl7.fhir.dstu2016may.model.Resource src) throws FHIRException {
return convertResource(src, new BaseAdvisor_14_30());
}
public static org.hl7.fhir.dstu3.model.Resource convertResource(org.hl7.fhir.dstu2016may.model.Resource src, BaseAdvisor_14_30 advisor) throws FHIRException {
- return new VersionConvertor_14_30(advisor).convertResource(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_14_30(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.dstu2016may.model.Resource convertResource(org.hl7.fhir.dstu3.model.Resource src) throws FHIRException {
@@ -20,7 +21,8 @@ public final class VersionConvertorFactory_14_30 {
}
public static org.hl7.fhir.dstu2016may.model.Resource convertResource(org.hl7.fhir.dstu3.model.Resource src, BaseAdvisor_14_30 advisor) throws FHIRException {
- return new VersionConvertor_14_30(advisor).convertResource(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_14_30(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.dstu3.model.Type convertType(org.hl7.fhir.dstu2016may.model.Type src) throws FHIRException {
@@ -28,7 +30,8 @@ public final class VersionConvertorFactory_14_30 {
}
public static org.hl7.fhir.dstu3.model.Type convertType(org.hl7.fhir.dstu2016may.model.Type src, BaseAdvisor_14_30 advisor) throws FHIRException {
- return new VersionConvertor_14_30(advisor).convertType(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_14_30(advisor).convertType(src) : null;
}
public static org.hl7.fhir.dstu2016may.model.Type convertType(org.hl7.fhir.dstu3.model.Type src) throws FHIRException {
@@ -36,7 +39,8 @@ public final class VersionConvertorFactory_14_30 {
}
public static org.hl7.fhir.dstu2016may.model.Type convertType(org.hl7.fhir.dstu3.model.Type src, BaseAdvisor_14_30 advisor) throws FHIRException {
- return new VersionConvertor_14_30(advisor).convertType(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_14_30(advisor).convertType(src) : null;
}
public static boolean convertsResource(String rt) {
diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_14_40.java
index bbba58616..80013fedf 100644
--- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_14_40.java
+++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_14_40.java
@@ -5,14 +5,15 @@ import org.hl7.fhir.convertors.conv14_40.VersionConvertor_14_40;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.utilities.Utilities;
-public final class VersionConvertorFactory_14_40 {
+public final class VersionConvertorFactory_14_40 extends VersionConvertorFactory {
public static org.hl7.fhir.r4.model.Resource convertResource(org.hl7.fhir.dstu2016may.model.Resource src) throws FHIRException {
return convertResource(src, new BaseAdvisor_14_40());
}
public static org.hl7.fhir.r4.model.Resource convertResource(org.hl7.fhir.dstu2016may.model.Resource src, BaseAdvisor_14_40 advisor) throws FHIRException {
- return new VersionConvertor_14_40(advisor).convertResource(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_14_40(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.dstu2016may.model.Resource convertResource(org.hl7.fhir.r4.model.Resource src) throws FHIRException {
@@ -20,7 +21,8 @@ public final class VersionConvertorFactory_14_40 {
}
public static org.hl7.fhir.dstu2016may.model.Resource convertResource(org.hl7.fhir.r4.model.Resource src, BaseAdvisor_14_40 advisor) throws FHIRException {
- return new VersionConvertor_14_40(advisor).convertResource(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_14_40(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.r4.model.Type convertType(org.hl7.fhir.dstu2016may.model.Type src) throws FHIRException {
@@ -28,7 +30,8 @@ public final class VersionConvertorFactory_14_40 {
}
public static org.hl7.fhir.r4.model.Type convertType(org.hl7.fhir.dstu2016may.model.Type src, BaseAdvisor_14_40 advisor) throws FHIRException {
- return new VersionConvertor_14_40(advisor).convertType(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_14_40(advisor).convertType(src) : null;
}
public static org.hl7.fhir.dstu2016may.model.Type convertType(org.hl7.fhir.r4.model.Type src) throws FHIRException {
@@ -36,7 +39,8 @@ public final class VersionConvertorFactory_14_40 {
}
public static org.hl7.fhir.dstu2016may.model.Type convertType(org.hl7.fhir.r4.model.Type src, BaseAdvisor_14_40 advisor) throws FHIRException {
- return new VersionConvertor_14_40(advisor).convertType(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_14_40(advisor).convertType(src) : null;
}
public static boolean convertsResource(String rt) {
diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_14_50.java
index 34c8b0774..d1ea81c6d 100644
--- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_14_50.java
+++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_14_50.java
@@ -5,14 +5,15 @@ import org.hl7.fhir.convertors.conv14_50.VersionConvertor_14_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.utilities.Utilities;
-public final class VersionConvertorFactory_14_50 {
+public final class VersionConvertorFactory_14_50 extends VersionConvertorFactory {
public static org.hl7.fhir.r5.model.Resource convertResource(org.hl7.fhir.dstu2016may.model.Resource src) throws FHIRException {
return convertResource(src, new BaseAdvisor_14_50());
}
public static org.hl7.fhir.r5.model.Resource convertResource(org.hl7.fhir.dstu2016may.model.Resource src, BaseAdvisor_14_50 advisor) throws FHIRException {
- return new VersionConvertor_14_50(advisor).convertResource(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_14_50(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.dstu2016may.model.Resource convertResource(org.hl7.fhir.r5.model.Resource src) throws FHIRException {
@@ -20,7 +21,8 @@ public final class VersionConvertorFactory_14_50 {
}
public static org.hl7.fhir.dstu2016may.model.Resource convertResource(org.hl7.fhir.r5.model.Resource src, BaseAdvisor_14_50 advisor) throws FHIRException {
- return new VersionConvertor_14_50(advisor).convertResource(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_14_50(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.r5.model.DataType convertType(org.hl7.fhir.dstu2016may.model.Type src) throws FHIRException {
@@ -28,7 +30,8 @@ public final class VersionConvertorFactory_14_50 {
}
public static org.hl7.fhir.r5.model.DataType convertType(org.hl7.fhir.dstu2016may.model.Type src, BaseAdvisor_14_50 advisor) throws FHIRException {
- return new VersionConvertor_14_50(advisor).convertType(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_14_50(advisor).convertType(src) : null;
}
public static org.hl7.fhir.dstu2016may.model.Type convertType(org.hl7.fhir.r5.model.DataType src) throws FHIRException {
@@ -36,7 +39,8 @@ public final class VersionConvertorFactory_14_50 {
}
public static org.hl7.fhir.dstu2016may.model.Type convertType(org.hl7.fhir.r5.model.DataType src, BaseAdvisor_14_50 advisor) throws FHIRException {
- return new VersionConvertor_14_50(advisor).convertType(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_14_50(advisor).convertType(src) : null;
}
public static boolean convertsResource(String rt) {
diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_30_40.java
index fc343cf34..86070124b 100644
--- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_30_40.java
+++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_30_40.java
@@ -5,14 +5,15 @@ import org.hl7.fhir.convertors.conv30_40.VersionConvertor_30_40;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.utilities.Utilities;
-public final class VersionConvertorFactory_30_40 {
+public final class VersionConvertorFactory_30_40 extends VersionConvertorFactory {
public static org.hl7.fhir.r4.model.Resource convertResource(org.hl7.fhir.dstu3.model.Resource src) throws FHIRException {
return convertResource(src, new BaseAdvisor_30_40());
}
public static org.hl7.fhir.r4.model.Resource convertResource(org.hl7.fhir.dstu3.model.Resource src, BaseAdvisor_30_40 advisor) throws FHIRException {
- return new VersionConvertor_30_40(advisor).convertResource(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_30_40(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.dstu3.model.Resource convertResource(org.hl7.fhir.r4.model.Resource src) throws FHIRException {
@@ -20,7 +21,8 @@ public final class VersionConvertorFactory_30_40 {
}
public static org.hl7.fhir.dstu3.model.Resource convertResource(org.hl7.fhir.r4.model.Resource src, BaseAdvisor_30_40 advisor) throws FHIRException {
- return new VersionConvertor_30_40(advisor).convertResource(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_30_40(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.r4.model.Type convertType(org.hl7.fhir.dstu3.model.Type src) throws FHIRException {
@@ -28,7 +30,8 @@ public final class VersionConvertorFactory_30_40 {
}
public static org.hl7.fhir.r4.model.Type convertType(org.hl7.fhir.dstu3.model.Type src, BaseAdvisor_30_40 advisor) throws FHIRException {
- return new VersionConvertor_30_40(advisor).convertType(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_30_40(advisor).convertType(src) : null;
}
public static org.hl7.fhir.dstu3.model.Type convertType(org.hl7.fhir.r4.model.Type src) throws FHIRException {
@@ -36,7 +39,8 @@ public final class VersionConvertorFactory_30_40 {
}
public static org.hl7.fhir.dstu3.model.Type convertType(org.hl7.fhir.r4.model.Type src, BaseAdvisor_30_40 advisor) throws FHIRException {
- return new VersionConvertor_30_40(advisor).convertType(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_30_40(advisor).convertType(src) : null;
}
public static boolean convertsResource(String rt) {
diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_30_50.java
index 7252ffbf6..d15b2fdfe 100644
--- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_30_50.java
+++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_30_50.java
@@ -4,14 +4,15 @@ import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_30_50;
import org.hl7.fhir.convertors.conv30_50.VersionConvertor_30_50;
import org.hl7.fhir.exceptions.FHIRException;
-public final class VersionConvertorFactory_30_50 {
+public final class VersionConvertorFactory_30_50 extends VersionConvertorFactory {
public static org.hl7.fhir.r5.model.Resource convertResource(org.hl7.fhir.dstu3.model.Resource src) throws FHIRException {
return convertResource(src, new BaseAdvisor_30_50());
}
public static org.hl7.fhir.r5.model.Resource convertResource(org.hl7.fhir.dstu3.model.Resource src, BaseAdvisor_30_50 advisor) throws FHIRException {
- return new VersionConvertor_30_50(advisor).convertResource(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_30_50(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.dstu3.model.Resource convertResource(org.hl7.fhir.r5.model.Resource src) throws FHIRException {
@@ -19,7 +20,8 @@ public final class VersionConvertorFactory_30_50 {
}
public static org.hl7.fhir.dstu3.model.Resource convertResource(org.hl7.fhir.r5.model.Resource src, BaseAdvisor_30_50 advisor) throws FHIRException {
- return new VersionConvertor_30_50(advisor).convertResource(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_30_50(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.r5.model.DataType convertType(org.hl7.fhir.dstu3.model.Type src) throws FHIRException {
@@ -27,7 +29,8 @@ public final class VersionConvertorFactory_30_50 {
}
public static org.hl7.fhir.r5.model.DataType convertType(org.hl7.fhir.dstu3.model.Type src, BaseAdvisor_30_50 advisor) throws FHIRException {
- return new VersionConvertor_30_50(advisor).convertType(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_30_50(advisor).convertType(src) : null;
}
public static org.hl7.fhir.dstu3.model.Type convertType(org.hl7.fhir.r5.model.DataType src) throws FHIRException {
@@ -35,6 +38,7 @@ public final class VersionConvertorFactory_30_50 {
}
public static org.hl7.fhir.dstu3.model.Type convertType(org.hl7.fhir.r5.model.DataType src, BaseAdvisor_30_50 advisor) throws FHIRException {
- return new VersionConvertor_30_50(advisor).convertType(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_30_50(advisor).convertType(src) : null;
}
}
\ No newline at end of file
diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_40_50.java
index 6eaf55c71..c1dcdf900 100644
--- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_40_50.java
+++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_40_50.java
@@ -4,14 +4,15 @@ import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_40_50;
import org.hl7.fhir.convertors.conv40_50.VersionConvertor_40_50;
import org.hl7.fhir.exceptions.FHIRException;
-public final class VersionConvertorFactory_40_50 {
+public final class VersionConvertorFactory_40_50 extends VersionConvertorFactory {
public static org.hl7.fhir.r5.model.Resource convertResource(org.hl7.fhir.r4.model.Resource src) throws FHIRException {
return convertResource(src, new BaseAdvisor_40_50());
}
public static org.hl7.fhir.r5.model.Resource convertResource(org.hl7.fhir.r4.model.Resource src, BaseAdvisor_40_50 advisor) throws FHIRException {
- return new VersionConvertor_40_50(advisor).convertResource(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_40_50(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.r4.model.Resource convertResource(org.hl7.fhir.r5.model.Resource src) throws FHIRException {
@@ -19,7 +20,8 @@ public final class VersionConvertorFactory_40_50 {
}
public static org.hl7.fhir.r4.model.Resource convertResource(org.hl7.fhir.r5.model.Resource src, BaseAdvisor_40_50 advisor) throws FHIRException {
- return new VersionConvertor_40_50(advisor).convertResource(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_40_50(advisor).convertResource(src) : null;
}
public static org.hl7.fhir.r5.model.DataType convertType(org.hl7.fhir.r4.model.Type src) throws FHIRException {
@@ -27,7 +29,8 @@ public final class VersionConvertorFactory_40_50 {
}
public static org.hl7.fhir.r5.model.DataType convertType(org.hl7.fhir.r4.model.Type src, BaseAdvisor_40_50 advisor) throws FHIRException {
- return new VersionConvertor_40_50(advisor).convertType(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_40_50(advisor).convertType(src) : null;
}
public static org.hl7.fhir.r4.model.Type convertType(org.hl7.fhir.r5.model.DataType src) throws FHIRException {
@@ -35,6 +38,7 @@ public final class VersionConvertorFactory_40_50 {
}
public static org.hl7.fhir.r4.model.Type convertType(org.hl7.fhir.r5.model.DataType src, BaseAdvisor_40_50 advisor) throws FHIRException {
- return new VersionConvertor_40_50(advisor).convertType(src);
+ cleanInputs(src, advisor);
+ return src != null ? new VersionConvertor_40_50(advisor).convertType(src) : null;
}
}
\ No newline at end of file
diff --git a/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_10_30NullHandlingTest.java b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_10_30NullHandlingTest.java
new file mode 100644
index 000000000..6302d7a3e
--- /dev/null
+++ b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_10_30NullHandlingTest.java
@@ -0,0 +1,103 @@
+package org.hl7.fhir.convertors.factory;
+
+import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_10_30;
+import org.hl7.fhir.exceptions.FHIRException;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+
+class VersionConvertorFactory_10_30NullHandlingTest {
+
+ @Test
+ @DisplayName("Check null DSTU2 resource with default advisor throws FHIRException.")
+ void convertResourceWithDefaultAdvisorDSTU2() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_10_30.convertResource((org.hl7.fhir.dstu2.model.Resource) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertResourceWithCustomAdvisorSetToFailFastDSTU2() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_10_30.convertResource((org.hl7.fhir.dstu2.model.Resource) null, new BaseAdvisor_10_30(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2 resource with custom advisor returns null when advisor set to not fail fast.")
+ void convertResourceWithCustomAdvisorSetToNotFailFastDSTU2() {
+ Assertions.assertNull(VersionConvertorFactory_10_30.convertResource((org.hl7.fhir.dstu2.model.Resource) null,
+ new BaseAdvisor_10_30(false)));
+ }
+
+ @Test
+ @DisplayName("Check null DSTU3 resource with default advisor throws FHIRException.")
+ void convertResourceWithDefaultAdvisorDSTU3() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_10_30.convertResource((org.hl7.fhir.dstu3.model.Resource) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU3 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertResourceWithCustomAdvisorSetToFailFastDSTU3() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_10_30.convertResource((org.hl7.fhir.dstu3.model.Resource) null, new BaseAdvisor_10_30(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU3 resource with custom advisor returns null when advisor set to not fail fast.")
+ void convertResourceWithCustomAdvisorSetToNotFailFastDSTU3() {
+ Assertions.assertNull(VersionConvertorFactory_10_30.convertResource((org.hl7.fhir.dstu3.model.Resource) null,
+ new BaseAdvisor_10_30(false)));
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2 type with default advisor throws FHIRException.")
+ void convertTypeWithDefaultAdvisorDSTU2() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_10_30.convertType((org.hl7.fhir.dstu2.model.Type) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2 type with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertTypeWithCustomAdvisorSetToFailFastDSTU2() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_10_30.convertType((org.hl7.fhir.dstu2.model.Type) null, new BaseAdvisor_10_30(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2 type with custom advisor returns null when advisor set to not fail fast.")
+ void convertTypeWithCustomAdvisorSetToNotFailFastDSTU2() {
+ Assertions.assertNull(VersionConvertorFactory_10_30.convertType((org.hl7.fhir.dstu2.model.Type) null,
+ new BaseAdvisor_10_30(false)));
+ }
+
+ @Test
+ @DisplayName("Check null DSTU3 type with default advisor throws FHIRException.")
+ void convertTypeWithDefaultAdvisorDSTU3() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_10_30.convertType((org.hl7.fhir.dstu3.model.Type) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU3 type with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertTypeWithCustomAdvisorSetToFailFastDSTU3() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_10_30.convertType((org.hl7.fhir.dstu3.model.Type) null, new BaseAdvisor_10_30(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU3 type with custom advisor returns null when advisor set to not fail fast.")
+ void convertTypeWithCustomAdvisorSetToNotFailFastDSTU3() {
+ Assertions.assertNull(VersionConvertorFactory_10_30.convertType((org.hl7.fhir.dstu3.model.Type) null,
+ new BaseAdvisor_10_30(false)));
+ }
+
+}
\ No newline at end of file
diff --git a/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_10_40NullHandlingTest.java b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_10_40NullHandlingTest.java
new file mode 100644
index 000000000..566e1b216
--- /dev/null
+++ b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_10_40NullHandlingTest.java
@@ -0,0 +1,103 @@
+package org.hl7.fhir.convertors.factory;
+
+import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_10_40;
+import org.hl7.fhir.exceptions.FHIRException;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+
+class VersionConvertorFactory_10_40NullHandlingTest {
+
+ @Test
+ @DisplayName("Check null DSTU2 resource with default advisor throws FHIRException.")
+ void convertResourceWithDefaultAdvisorDSTU2() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_10_40.convertResource((org.hl7.fhir.dstu2.model.Resource) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertResourceWithCustomAdvisorSetToFailFastDSTU2() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_10_40.convertResource((org.hl7.fhir.dstu2.model.Resource) null, new BaseAdvisor_10_40(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2 resource with custom advisor returns null when advisor set to not fail fast.")
+ void convertResourceWithCustomAdvisorSetToNotFailFastDSTU2() {
+ Assertions.assertNull(VersionConvertorFactory_10_40.convertResource((org.hl7.fhir.dstu2.model.Resource) null,
+ new BaseAdvisor_10_40(false)));
+ }
+
+ @Test
+ @DisplayName("Check null R4 resource with default advisor throws FHIRException.")
+ void convertResourceWithDefaultAdvisorR4() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_10_40.convertResource((org.hl7.fhir.r4.model.Resource) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R4 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertResourceWithCustomAdvisorSetToFailFastR4() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_10_40.convertResource((org.hl7.fhir.r4.model.Resource) null, new BaseAdvisor_10_40(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R4 resource with custom advisor returns null when advisor set to not fail fast.")
+ void convertResourceWithCustomAdvisorSetToNotFailFastR4() {
+ Assertions.assertNull(VersionConvertorFactory_10_40.convertResource((org.hl7.fhir.r4.model.Resource) null,
+ new BaseAdvisor_10_40(false)));
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2 type with default advisor throws FHIRException.")
+ void convertTypeWithDefaultAdvisorDSTU2() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_10_40.convertType((org.hl7.fhir.dstu2.model.Type) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2 type with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertTypeWithCustomAdvisorSetToFailFastDSTU2() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_10_40.convertType((org.hl7.fhir.dstu2.model.Type) null, new BaseAdvisor_10_40(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2 type with custom advisor returns null when advisor set to not fail fast.")
+ void convertTypeWithCustomAdvisorSetToNotFailFastDSTU2() {
+ Assertions.assertNull(VersionConvertorFactory_10_40.convertType((org.hl7.fhir.dstu2.model.Type) null,
+ new BaseAdvisor_10_40(false)));
+ }
+
+ @Test
+ @DisplayName("Check null R4 type with default advisor throws FHIRException.")
+ void convertTypeWithDefaultAdvisorR4() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_10_40.convertType((org.hl7.fhir.r4.model.Type) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R4 type with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertTypeWithCustomAdvisorSetToFailFastR4() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_10_40.convertType((org.hl7.fhir.r4.model.Type) null, new BaseAdvisor_10_40(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R4 type with custom advisor returns null when advisor set to not fail fast.")
+ void convertTypeWithCustomAdvisorSetToNotFailFastR4() {
+ Assertions.assertNull(VersionConvertorFactory_10_40.convertType((org.hl7.fhir.r4.model.Type) null,
+ new BaseAdvisor_10_40(false)));
+ }
+
+}
\ No newline at end of file
diff --git a/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_10_50NullHandlingTest.java b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_10_50NullHandlingTest.java
new file mode 100644
index 000000000..208e04485
--- /dev/null
+++ b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_10_50NullHandlingTest.java
@@ -0,0 +1,103 @@
+package org.hl7.fhir.convertors.factory;
+
+import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_10_50;
+import org.hl7.fhir.exceptions.FHIRException;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+
+class VersionConvertorFactory_10_50NullHandlingTest {
+
+ @Test
+ @DisplayName("Check null DSTU2 resource with default advisor throws FHIRException.")
+ void convertResourceWithDefaultAdvisorDSTU2() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_10_50.convertResource((org.hl7.fhir.dstu2.model.Resource) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertResourceWithCustomAdvisorSetToFailFastDSTU2() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_10_50.convertResource((org.hl7.fhir.dstu2.model.Resource) null, new BaseAdvisor_10_50(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2 resource with custom advisor returns null when advisor set to not fail fast.")
+ void convertResourceWithCustomAdvisorSetToNotFailFastDSTU2() {
+ Assertions.assertNull(VersionConvertorFactory_10_50.convertResource((org.hl7.fhir.dstu2.model.Resource) null,
+ new BaseAdvisor_10_50(false)));
+ }
+
+ @Test
+ @DisplayName("Check null R5 resource with default advisor throws FHIRException.")
+ void convertResourceWithDefaultAdvisorR5() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_10_50.convertResource((org.hl7.fhir.r5.model.Resource) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R5 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertResourceWithCustomAdvisorSetToFailFastR5() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_10_50.convertResource((org.hl7.fhir.r5.model.Resource) null, new BaseAdvisor_10_50(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R5 resource with custom advisor returns null when advisor set to not fail fast.")
+ void convertResourceWithCustomAdvisorSetToNotFailFastR5() {
+ Assertions.assertNull(VersionConvertorFactory_10_50.convertResource((org.hl7.fhir.r5.model.Resource) null,
+ new BaseAdvisor_10_50(false)));
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2 type with default advisor throws FHIRException.")
+ void convertTypeWithDefaultAdvisorDSTU2() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_10_50.convertType((org.hl7.fhir.dstu2.model.Type) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2 type with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertTypeWithCustomAdvisorSetToFailFastDSTU2() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_10_50.convertType((org.hl7.fhir.dstu2.model.Type) null, new BaseAdvisor_10_50(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2 type with custom advisor returns null when advisor set to not fail fast.")
+ void convertTypeWithCustomAdvisorSetToNotFailFastDSTU2() {
+ Assertions.assertNull(VersionConvertorFactory_10_50.convertType((org.hl7.fhir.dstu2.model.Type) null,
+ new BaseAdvisor_10_50(false)));
+ }
+
+ @Test
+ @DisplayName("Check null R5 type with default advisor throws FHIRException.")
+ void convertTypeWithDefaultAdvisorR5() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_10_50.convertType((org.hl7.fhir.r5.model.DataType) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R5 type with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertTypeWithCustomAdvisorSetToFailFastR5() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_10_50.convertType((org.hl7.fhir.r5.model.DataType) null, new BaseAdvisor_10_50(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R5 type with custom advisor returns null when advisor set to not fail fast.")
+ void convertTypeWithCustomAdvisorSetToNotFailFastR5() {
+ Assertions.assertNull(VersionConvertorFactory_10_50.convertType((org.hl7.fhir.r5.model.DataType) null,
+ new BaseAdvisor_10_50(false)));
+ }
+
+}
\ No newline at end of file
diff --git a/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_14_30NullHandlingTest.java b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_14_30NullHandlingTest.java
new file mode 100644
index 000000000..6d83580ae
--- /dev/null
+++ b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_14_30NullHandlingTest.java
@@ -0,0 +1,103 @@
+package org.hl7.fhir.convertors.factory;
+
+import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_14_30;
+import org.hl7.fhir.exceptions.FHIRException;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+
+class VersionConvertorFactory_14_30NullHandlingTest {
+
+ @Test
+ @DisplayName("Check null DSTU2016MAY resource with default advisor throws FHIRException.")
+ void convertResourceWithDefaultAdvisorDSTU2016MAY() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_14_30.convertResource((org.hl7.fhir.dstu2016may.model.Resource) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2016MAY resource with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertResourceWithCustomAdvisorSetToFailFastDSTU2016MAY() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_14_30.convertResource((org.hl7.fhir.dstu2016may.model.Resource) null, new BaseAdvisor_14_30(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2016MAY resource with custom advisor returns null when advisor set to not fail fast.")
+ void convertResourceWithCustomAdvisorSetToNotFailFastDSTU2016MAY() {
+ Assertions.assertNull(VersionConvertorFactory_14_30.convertResource((org.hl7.fhir.dstu2016may.model.Resource) null,
+ new BaseAdvisor_14_30(false)));
+ }
+
+ @Test
+ @DisplayName("Check null DSTU3 resource with default advisor throws FHIRException.")
+ void convertResourceWithDefaultAdvisorDSTU3() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_14_30.convertResource((org.hl7.fhir.dstu3.model.Resource) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU3 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertResourceWithCustomAdvisorSetToFailFastDSTU3() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_14_30.convertResource((org.hl7.fhir.dstu3.model.Resource) null, new BaseAdvisor_14_30(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU3 resource with custom advisor returns null when advisor set to not fail fast.")
+ void convertResourceWithCustomAdvisorSetToNotFailFastDSTU3() {
+ Assertions.assertNull(VersionConvertorFactory_14_30.convertResource((org.hl7.fhir.dstu3.model.Resource) null,
+ new BaseAdvisor_14_30(false)));
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2016MAY type with default advisor throws FHIRException.")
+ void convertTypeWithDefaultAdvisorDSTU2016MAY() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_14_30.convertType((org.hl7.fhir.dstu2016may.model.Type) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2016MAY type with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertTypeWithCustomAdvisorSetToFailFastDSTU2016MAY() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_14_30.convertType((org.hl7.fhir.dstu2016may.model.Type) null, new BaseAdvisor_14_30(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2016MAY type with custom advisor returns null when advisor set to not fail fast.")
+ void convertTypeWithCustomAdvisorSetToNotFailFastDSTU2016MAY() {
+ Assertions.assertNull(VersionConvertorFactory_14_30.convertType((org.hl7.fhir.dstu2016may.model.Type) null,
+ new BaseAdvisor_14_30(false)));
+ }
+
+ @Test
+ @DisplayName("Check null DSTU3 type with default advisor throws FHIRException.")
+ void convertTypeWithDefaultAdvisorDSTU3() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_14_30.convertType((org.hl7.fhir.dstu3.model.Type) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU3 type with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertTypeWithCustomAdvisorSetToFailFastDSTU3() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_14_30.convertType((org.hl7.fhir.dstu3.model.Type) null, new BaseAdvisor_14_30(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU3 type with custom advisor returns null when advisor set to not fail fast.")
+ void convertTypeWithCustomAdvisorSetToNotFailFastDSTU3() {
+ Assertions.assertNull(VersionConvertorFactory_14_30.convertType((org.hl7.fhir.dstu3.model.Type) null,
+ new BaseAdvisor_14_30(false)));
+ }
+
+}
\ No newline at end of file
diff --git a/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_14_40NullHandlingTest.java b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_14_40NullHandlingTest.java
new file mode 100644
index 000000000..14e94ea63
--- /dev/null
+++ b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_14_40NullHandlingTest.java
@@ -0,0 +1,103 @@
+package org.hl7.fhir.convertors.factory;
+
+import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_14_40;
+import org.hl7.fhir.exceptions.FHIRException;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+
+class VersionConvertorFactory_14_40NullHandlingTest {
+
+ @Test
+ @DisplayName("Check null DSTU2016MAY resource with default advisor throws FHIRException.")
+ void convertResourceWithDefaultAdvisorDSTU2016MAY() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_14_40.convertResource((org.hl7.fhir.dstu2016may.model.Resource) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2016MAY resource with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertResourceWithCustomAdvisorSetToFailFastDSTU2016MAY() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_14_40.convertResource((org.hl7.fhir.dstu2016may.model.Resource) null, new BaseAdvisor_14_40(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2016MAY resource with custom advisor returns null when advisor set to not fail fast.")
+ void convertResourceWithCustomAdvisorSetToNotFailFastDSTU2016MAY() {
+ Assertions.assertNull(VersionConvertorFactory_14_40.convertResource((org.hl7.fhir.dstu2016may.model.Resource) null,
+ new BaseAdvisor_14_40(false)));
+ }
+
+ @Test
+ @DisplayName("Check null R4 resource with default advisor throws FHIRException.")
+ void convertResourceWithDefaultAdvisorR4() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_14_40.convertResource((org.hl7.fhir.r4.model.Resource) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R4 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertResourceWithCustomAdvisorSetToFailFastR4() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_14_40.convertResource((org.hl7.fhir.r4.model.Resource) null, new BaseAdvisor_14_40(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R4 resource with custom advisor returns null when advisor set to not fail fast.")
+ void convertResourceWithCustomAdvisorSetToNotFailFastR4() {
+ Assertions.assertNull(VersionConvertorFactory_14_40.convertResource((org.hl7.fhir.r4.model.Resource) null,
+ new BaseAdvisor_14_40(false)));
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2016MAY type with default advisor throws FHIRException.")
+ void convertTypeWithDefaultAdvisorDSTU2016MAY() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_14_40.convertType((org.hl7.fhir.dstu2016may.model.Type) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2016MAY type with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertTypeWithCustomAdvisorSetToFailFastDSTU2016MAY() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_14_40.convertType((org.hl7.fhir.dstu2016may.model.Type) null, new BaseAdvisor_14_40(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2016MAY type with custom advisor returns null when advisor set to not fail fast.")
+ void convertTypeWithCustomAdvisorSetToNotFailFastDSTU2016MAY() {
+ Assertions.assertNull(VersionConvertorFactory_14_40.convertType((org.hl7.fhir.dstu2016may.model.Type) null,
+ new BaseAdvisor_14_40(false)));
+ }
+
+ @Test
+ @DisplayName("Check null R4 type with default advisor throws FHIRException.")
+ void convertTypeWithDefaultAdvisorR4() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_14_40.convertType((org.hl7.fhir.r4.model.Type) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R4 type with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertTypeWithCustomAdvisorSetToFailFastR4() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_14_40.convertType((org.hl7.fhir.r4.model.Type) null, new BaseAdvisor_14_40(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R4 type with custom advisor returns null when advisor set to not fail fast.")
+ void convertTypeWithCustomAdvisorSetToNotFailFastR4() {
+ Assertions.assertNull(VersionConvertorFactory_14_40.convertType((org.hl7.fhir.r4.model.Type) null,
+ new BaseAdvisor_14_40(false)));
+ }
+
+}
\ No newline at end of file
diff --git a/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_14_50NullHandlingTest.java b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_14_50NullHandlingTest.java
new file mode 100644
index 000000000..7f54c4491
--- /dev/null
+++ b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_14_50NullHandlingTest.java
@@ -0,0 +1,103 @@
+package org.hl7.fhir.convertors.factory;
+
+import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_14_50;
+import org.hl7.fhir.exceptions.FHIRException;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+
+class VersionConvertorFactory_14_50NullHandlingTest {
+
+ @Test
+ @DisplayName("Check null DSTU2016MAY resource with default advisor throws FHIRException.")
+ void convertResourceWithDefaultAdvisorDSTU2016MAY() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_14_50.convertResource((org.hl7.fhir.dstu2016may.model.Resource) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2016MAY resource with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertResourceWithCustomAdvisorSetToFailFastDSTU2016MAY() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_14_50.convertResource((org.hl7.fhir.dstu2016may.model.Resource) null, new BaseAdvisor_14_50(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2016MAY resource with custom advisor returns null when advisor set to not fail fast.")
+ void convertResourceWithCustomAdvisorSetToNotFailFastDSTU2016MAY() {
+ Assertions.assertNull(VersionConvertorFactory_14_50.convertResource((org.hl7.fhir.dstu2016may.model.Resource) null,
+ new BaseAdvisor_14_50(false)));
+ }
+
+ @Test
+ @DisplayName("Check null R5 resource with default advisor throws FHIRException.")
+ void convertResourceWithDefaultAdvisorR5() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_14_50.convertResource((org.hl7.fhir.r5.model.Resource) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R5 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertResourceWithCustomAdvisorSetToFailFastR5() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_14_50.convertResource((org.hl7.fhir.r5.model.Resource) null, new BaseAdvisor_14_50(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R5 resource with custom advisor returns null when advisor set to not fail fast.")
+ void convertResourceWithCustomAdvisorSetToNotFailFastR5() {
+ Assertions.assertNull(VersionConvertorFactory_14_50.convertResource((org.hl7.fhir.r5.model.Resource) null,
+ new BaseAdvisor_14_50(false)));
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2016MAY type with default advisor throws FHIRException.")
+ void convertTypeWithDefaultAdvisorDSTU2016MAY() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_14_50.convertType((org.hl7.fhir.dstu2016may.model.Type) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2016MAY type with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertTypeWithCustomAdvisorSetToFailFastDSTU2016MAY() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_14_50.convertType((org.hl7.fhir.dstu2016may.model.Type) null, new BaseAdvisor_14_50(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU2016MAY type with custom advisor returns null when advisor set to not fail fast.")
+ void convertTypeWithCustomAdvisorSetToNotFailFastDSTU2016MAY() {
+ Assertions.assertNull(VersionConvertorFactory_14_50.convertType((org.hl7.fhir.dstu2016may.model.Type) null,
+ new BaseAdvisor_14_50(false)));
+ }
+
+ @Test
+ @DisplayName("Check null R5 type with default advisor throws FHIRException.")
+ void convertTypeWithDefaultAdvisorR5() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_14_50.convertType((org.hl7.fhir.r5.model.DataType) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R5 type with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertTypeWithCustomAdvisorSetToFailFastR5() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_14_50.convertType((org.hl7.fhir.r5.model.DataType) null, new BaseAdvisor_14_50(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R5 type with custom advisor returns null when advisor set to not fail fast.")
+ void convertTypeWithCustomAdvisorSetToNotFailFastR5() {
+ Assertions.assertNull(VersionConvertorFactory_14_50.convertType((org.hl7.fhir.r5.model.DataType) null,
+ new BaseAdvisor_14_50(false)));
+ }
+
+}
\ No newline at end of file
diff --git a/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_30_40NullHandlingTest.java b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_30_40NullHandlingTest.java
new file mode 100644
index 000000000..4b9f548f6
--- /dev/null
+++ b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_30_40NullHandlingTest.java
@@ -0,0 +1,103 @@
+package org.hl7.fhir.convertors.factory;
+
+import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_30_40;
+import org.hl7.fhir.exceptions.FHIRException;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+
+class VersionConvertorFactory_30_40NullHandlingTest {
+
+ @Test
+ @DisplayName("Check null DSTU3 resource with default advisor throws FHIRException.")
+ void convertResourceWithDefaultAdvisorDSTU3() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_30_40.convertResource((org.hl7.fhir.dstu3.model.Resource) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU3 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertResourceWithCustomAdvisorSetToFailFastDSTU3() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_30_40.convertResource((org.hl7.fhir.dstu3.model.Resource) null, new BaseAdvisor_30_40(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU3 resource with custom advisor returns null when advisor set to not fail fast.")
+ void convertResourceWithCustomAdvisorSetToNotFailFastDSTU3() {
+ Assertions.assertNull(VersionConvertorFactory_30_40.convertResource((org.hl7.fhir.dstu3.model.Resource) null,
+ new BaseAdvisor_30_40(false)));
+ }
+
+ @Test
+ @DisplayName("Check null R4 resource with default advisor throws FHIRException.")
+ void convertResourceWithDefaultAdvisorR4() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_30_40.convertResource((org.hl7.fhir.r4.model.Resource) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R4 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertResourceWithCustomAdvisorSetToFailFastR4() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_30_40.convertResource((org.hl7.fhir.r4.model.Resource) null, new BaseAdvisor_30_40(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R4 resource with custom advisor returns null when advisor set to not fail fast.")
+ void convertResourceWithCustomAdvisorSetToNotFailFastR4() {
+ Assertions.assertNull(VersionConvertorFactory_30_40.convertResource((org.hl7.fhir.r4.model.Resource) null,
+ new BaseAdvisor_30_40(false)));
+ }
+
+ @Test
+ @DisplayName("Check null DSTU3 type with default advisor throws FHIRException.")
+ void convertTypeWithDefaultAdvisorDSTU3() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_30_40.convertType((org.hl7.fhir.dstu3.model.Type) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU3 type with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertTypeWithCustomAdvisorSetToFailFastDSTU3() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_30_40.convertType((org.hl7.fhir.dstu3.model.Type) null, new BaseAdvisor_30_40(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU3 type with custom advisor returns null when advisor set to not fail fast.")
+ void convertTypeWithCustomAdvisorSetToNotFailFastDSTU3() {
+ Assertions.assertNull(VersionConvertorFactory_30_40.convertType((org.hl7.fhir.dstu3.model.Type) null,
+ new BaseAdvisor_30_40(false)));
+ }
+
+ @Test
+ @DisplayName("Check null R4 type with default advisor throws FHIRException.")
+ void convertTypeWithDefaultAdvisorR4() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_30_40.convertType((org.hl7.fhir.r4.model.Type) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R4 type with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertTypeWithCustomAdvisorSetToFailFastR4() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_30_40.convertType((org.hl7.fhir.r4.model.Type) null, new BaseAdvisor_30_40(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R4 type with custom advisor returns null when advisor set to not fail fast.")
+ void convertTypeWithCustomAdvisorSetToNotFailFastR4() {
+ Assertions.assertNull(VersionConvertorFactory_30_40.convertType((org.hl7.fhir.r4.model.Type) null,
+ new BaseAdvisor_30_40(false)));
+ }
+
+}
\ No newline at end of file
diff --git a/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_30_50NullHandlingTest.java b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_30_50NullHandlingTest.java
new file mode 100644
index 000000000..7e3069e76
--- /dev/null
+++ b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_30_50NullHandlingTest.java
@@ -0,0 +1,103 @@
+package org.hl7.fhir.convertors.factory;
+
+import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_30_50;
+import org.hl7.fhir.exceptions.FHIRException;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+
+class VersionConvertorFactory_30_50NullHandlingTest {
+
+ @Test
+ @DisplayName("Check null DSTU3 resource with default advisor throws FHIRException.")
+ void convertResourceWithDefaultAdvisorDSTU3() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_30_50.convertResource((org.hl7.fhir.dstu3.model.Resource) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU3 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertResourceWithCustomAdvisorSetToFailFastDSTU3() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_30_50.convertResource((org.hl7.fhir.dstu3.model.Resource) null, new BaseAdvisor_30_50(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU3 resource with custom advisor returns null when advisor set to not fail fast.")
+ void convertResourceWithCustomAdvisorSetToNotFailFastDSTU3() {
+ Assertions.assertNull(VersionConvertorFactory_30_50.convertResource((org.hl7.fhir.dstu3.model.Resource) null,
+ new BaseAdvisor_30_50(false)));
+ }
+
+ @Test
+ @DisplayName("Check null R5 resource with default advisor throws FHIRException.")
+ void convertResourceWithDefaultAdvisorR5() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_30_50.convertResource((org.hl7.fhir.r5.model.Resource) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R5 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertResourceWithCustomAdvisorSetToFailFastR5() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_30_50.convertResource((org.hl7.fhir.r5.model.Resource) null, new BaseAdvisor_30_50(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R5 resource with custom advisor returns null when advisor set to not fail fast.")
+ void convertResourceWithCustomAdvisorSetToNotFailFastR5() {
+ Assertions.assertNull(VersionConvertorFactory_30_50.convertResource((org.hl7.fhir.r5.model.Resource) null,
+ new BaseAdvisor_30_50(false)));
+ }
+
+ @Test
+ @DisplayName("Check null DSTU3 type with default advisor throws FHIRException.")
+ void convertTypeWithDefaultAdvisorDSTU3() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_30_50.convertType((org.hl7.fhir.dstu3.model.Type) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU3 type with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertTypeWithCustomAdvisorSetToFailFastDSTU3() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_30_50.convertType((org.hl7.fhir.dstu3.model.Type) null, new BaseAdvisor_30_50(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null DSTU3 type with custom advisor returns null when advisor set to not fail fast.")
+ void convertTypeWithCustomAdvisorSetToNotFailFastDSTU3() {
+ Assertions.assertNull(VersionConvertorFactory_30_50.convertType((org.hl7.fhir.dstu3.model.Type) null,
+ new BaseAdvisor_30_50(false)));
+ }
+
+ @Test
+ @DisplayName("Check null R5 type with default advisor throws FHIRException.")
+ void convertTypeWithDefaultAdvisorR5() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_30_50.convertType((org.hl7.fhir.r5.model.DataType) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R5 type with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertTypeWithCustomAdvisorSetToFailFastR5() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_30_50.convertType((org.hl7.fhir.r5.model.DataType) null, new BaseAdvisor_30_50(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R5 type with custom advisor returns null when advisor set to not fail fast.")
+ void convertTypeWithCustomAdvisorSetToNotFailFastR5() {
+ Assertions.assertNull(VersionConvertorFactory_30_50.convertType((org.hl7.fhir.r5.model.DataType) null,
+ new BaseAdvisor_30_50(false)));
+ }
+
+}
\ No newline at end of file
diff --git a/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_40_50NullHandlingTest.java b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_40_50NullHandlingTest.java
new file mode 100644
index 000000000..331d10a1e
--- /dev/null
+++ b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/factory/VersionConvertorFactory_40_50NullHandlingTest.java
@@ -0,0 +1,103 @@
+package org.hl7.fhir.convertors.factory;
+
+import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_40_50;
+import org.hl7.fhir.exceptions.FHIRException;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+
+class VersionConvertorFactory_40_50NullHandlingTest {
+
+ @Test
+ @DisplayName("Check null R4 resource with default advisor throws FHIRException.")
+ void convertResourceWithDefaultAdvisorR4() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_40_50.convertResource((org.hl7.fhir.r4.model.Resource) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R4 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertResourceWithCustomAdvisorSetToFailFastR4() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_40_50.convertResource((org.hl7.fhir.r4.model.Resource) null, new BaseAdvisor_40_50(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R4 resource with custom advisor returns null when advisor set to not fail fast.")
+ void convertResourceWithCustomAdvisorSetToNotFailFastR4() {
+ Assertions.assertNull(VersionConvertorFactory_40_50.convertResource((org.hl7.fhir.r4.model.Resource) null,
+ new BaseAdvisor_40_50(false)));
+ }
+
+ @Test
+ @DisplayName("Check null R5 resource with default advisor throws FHIRException.")
+ void convertResourceWithDefaultAdvisorR5() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_40_50.convertResource((org.hl7.fhir.r5.model.Resource) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R5 resource with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertResourceWithCustomAdvisorSetToFailFastR5() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_40_50.convertResource((org.hl7.fhir.r5.model.Resource) null, new BaseAdvisor_40_50(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R5 resource with custom advisor returns null when advisor set to not fail fast.")
+ void convertResourceWithCustomAdvisorSetToNotFailFastR5() {
+ Assertions.assertNull(VersionConvertorFactory_40_50.convertResource((org.hl7.fhir.r5.model.Resource) null,
+ new BaseAdvisor_40_50(false)));
+ }
+
+ @Test
+ @DisplayName("Check null R4 type with default advisor throws FHIRException.")
+ void convertTypeWithDefaultAdvisorR4() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_40_50.convertType((org.hl7.fhir.r4.model.Type) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R4 type with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertTypeWithCustomAdvisorSetToFailFastR4() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_40_50.convertType((org.hl7.fhir.r4.model.Type) null, new BaseAdvisor_40_50(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R4 type with custom advisor returns null when advisor set to not fail fast.")
+ void convertTypeWithCustomAdvisorSetToNotFailFastR4() {
+ Assertions.assertNull(VersionConvertorFactory_40_50.convertType((org.hl7.fhir.r4.model.Type) null,
+ new BaseAdvisor_40_50(false)));
+ }
+
+ @Test
+ @DisplayName("Check null R5 type with default advisor throws FHIRException.")
+ void convertTypeWithDefaultAdvisorR5() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_40_50.convertType((org.hl7.fhir.r5.model.DataType) null);
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R5 type with custom advisor throws FHIRException when advisor is set to fail fast.")
+ void convertTypeWithCustomAdvisorSetToFailFastR5() {
+ Assertions.assertThrows(FHIRException.class, () -> {
+ VersionConvertorFactory_40_50.convertType((org.hl7.fhir.r5.model.DataType) null, new BaseAdvisor_40_50(true));
+ });
+ }
+
+ @Test
+ @DisplayName("Check null R5 type with custom advisor returns null when advisor set to not fail fast.")
+ void convertTypeWithCustomAdvisorSetToNotFailFastR5() {
+ Assertions.assertNull(VersionConvertorFactory_40_50.convertType((org.hl7.fhir.r5.model.DataType) null,
+ new BaseAdvisor_40_50(false)));
+ }
+
+}
\ No newline at end of file
diff --git a/org.hl7.fhir.dstu2/pom.xml b/org.hl7.fhir.dstu2/pom.xml
index 6cd896893..dcf5f98b8 100644
--- a/org.hl7.fhir.dstu2/pom.xml
+++ b/org.hl7.fhir.dstu2/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
org.hl7.fhir.core
- 5.4.10-SNAPSHOT
+ 5.4.11-SNAPSHOT
../pom.xml
diff --git a/org.hl7.fhir.dstu2016may/pom.xml b/org.hl7.fhir.dstu2016may/pom.xml
index 50842ac3e..df49729e8 100644
--- a/org.hl7.fhir.dstu2016may/pom.xml
+++ b/org.hl7.fhir.dstu2016may/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
org.hl7.fhir.core
- 5.4.10-SNAPSHOT
+ 5.4.11-SNAPSHOT
../pom.xml
diff --git a/org.hl7.fhir.dstu3/pom.xml b/org.hl7.fhir.dstu3/pom.xml
index 7b2f02235..b5af82294 100644
--- a/org.hl7.fhir.dstu3/pom.xml
+++ b/org.hl7.fhir.dstu3/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
org.hl7.fhir.core
- 5.4.10-SNAPSHOT
+ 5.4.11-SNAPSHOT
../pom.xml
diff --git a/org.hl7.fhir.r4/pom.xml b/org.hl7.fhir.r4/pom.xml
index 8e61e2a1b..1833ddaba 100644
--- a/org.hl7.fhir.r4/pom.xml
+++ b/org.hl7.fhir.r4/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
org.hl7.fhir.core
- 5.4.10-SNAPSHOT
+ 5.4.11-SNAPSHOT
../pom.xml
diff --git a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/context/TerminologyCache.java b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/context/TerminologyCache.java
index fe21697f9..acd05391e 100644
--- a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/context/TerminologyCache.java
+++ b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/context/TerminologyCache.java
@@ -41,6 +41,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import org.apache.commons.lang3.StringUtils;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4.context.IWorkerContext.ValidationResult;
import org.hl7.fhir.r4.formats.IParser.OutputStyle;
@@ -59,12 +60,12 @@ import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
import org.hl7.fhir.utilities.TextFile;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity;
+import org.hl7.fhir.utilities.validation.ValidationOptions;
import com.google.gson.JsonElement;
import com.google.gson.JsonNull;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
-import org.hl7.fhir.utilities.validation.ValidationOptions;
/**
* This implements a two level cache.
@@ -393,7 +394,10 @@ public class TerminologyCache {
}
private String hashNWS(String s) {
- return String.valueOf(s.replace("\r", "").replace("\n", "").replace(" ", "").hashCode());
+ s = StringUtils.remove(s, ' ');
+ s = StringUtils.remove(s, '\n');
+ s = StringUtils.remove(s, '\r');
+ return String.valueOf(s.hashCode());
}
// management
diff --git a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/FHIRPathEngine.java b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/FHIRPathEngine.java
index 31701df2f..67391afa3 100644
--- a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/FHIRPathEngine.java
+++ b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/FHIRPathEngine.java
@@ -26,34 +26,34 @@ import org.hl7.fhir.utilities.Utilities;
import java.math.BigDecimal;
import java.util.*;
-/*
- Copyright (c) 2011+, HL7, Inc.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modification,
- are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
- * Neither the name of HL7 nor the names of its contributors may be used to
- endorse or promote products derived from this software without specific
- prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-
- */
+/*
+ Copyright (c) 2011+, HL7, Inc.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification,
+ are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the name of HL7 nor the names of its contributors may be used to
+ endorse or promote products derived from this software without specific
+ prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+ */
/**
@@ -4291,11 +4291,11 @@ public class FHIRPathEngine {
focus = sd.getSnapshot().getElementFirstRep();
} else if ("extension".equals(expr.getName())) {
String targetUrl = expr.getParameters().get(0).getConstant().primitiveValue();
-// targetUrl = targetUrl.substring(1,targetUrl.length()-1);
List childDefinitions = ProfileUtilities.getChildMap(sd, element);
for (ElementDefinition t : childDefinitions) {
if (t.getPath().endsWith(".extension") && t.hasSliceName()) {
- StructureDefinition exsd = worker.fetchResource(StructureDefinition.class, t.getType().get(0).getProfile().get(0).getValue());
+ StructureDefinition exsd = (t.getType() == null || t.getType().isEmpty()) ?
+ null : worker.fetchResource(StructureDefinition.class, t.getType().get(0).getProfile().get(0).getValue());
while (exsd!=null && !exsd.getBaseDefinition().equals("http://hl7.org/fhir/StructureDefinition/Extension"))
exsd = worker.fetchResource(StructureDefinition.class, exsd.getBaseDefinition());
if (exsd.getUrl().equals(targetUrl)) {
diff --git a/org.hl7.fhir.r5/pom.xml b/org.hl7.fhir.r5/pom.xml
index 347eb1e56..a74b287b5 100644
--- a/org.hl7.fhir.r5/pom.xml
+++ b/org.hl7.fhir.r5/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
org.hl7.fhir.core
- 5.4.10-SNAPSHOT
+ 5.4.11-SNAPSHOT
../pom.xml
diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TerminologyCache.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TerminologyCache.java
index ae60d7fcc..cabac030d 100644
--- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TerminologyCache.java
+++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TerminologyCache.java
@@ -41,6 +41,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import org.apache.commons.lang3.StringUtils;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.context.IWorkerContext.ValidationResult;
import org.hl7.fhir.r5.formats.IParser.OutputStyle;
@@ -403,7 +404,10 @@ public class TerminologyCache {
}
private String hashNWS(String s) {
- return String.valueOf(s.replace("\r", "").replace("\n", "").replace(" ", "").hashCode());
+ s = StringUtils.remove(s, ' ');
+ s = StringUtils.remove(s, '\n');
+ s = StringUtils.remove(s, '\r');
+ return String.valueOf(s.hashCode());
}
// management
diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java
index 8fe761030..928a86037 100644
--- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java
+++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java
@@ -70,34 +70,34 @@ import org.hl7.fhir.utilities.xhtml.XhtmlNode;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.util.ElementUtil;
-/*
- Copyright (c) 2011+, HL7, Inc.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modification,
- are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
- * Neither the name of HL7 nor the names of its contributors may be used to
- endorse or promote products derived from this software without specific
- prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-
- */
+/*
+ Copyright (c) 2011+, HL7, Inc.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification,
+ are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the name of HL7 nor the names of its contributors may be used to
+ endorse or promote products derived from this software without specific
+ prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+ */
/**
@@ -5493,12 +5493,12 @@ public class FHIRPathEngine {
focus = sd.getSnapshot().getElementFirstRep();
} else if ("extension".equals(expr.getName())) {
String targetUrl = expr.getParameters().get(0).getConstant().primitiveValue();
- // targetUrl = targetUrl.substring(1,targetUrl.length()-1);
List childDefinitions = profileUtilities.getChildMap(sd, element);
for (ElementDefinition t : childDefinitions) {
if (t.getPath().endsWith(".extension") && t.hasSliceName()) {
- StructureDefinition exsd = worker.fetchResource(StructureDefinition.class, t.getType().get(0).getProfile().get(0).getValue());
- while (exsd!=null && !exsd.getBaseDefinition().equals("http://hl7.org/fhir/StructureDefinition/Extension")) {
+ StructureDefinition exsd = (t.getType() == null || t.getType().isEmpty()) ?
+ null : worker.fetchResource(StructureDefinition.class, t.getType().get(0).getProfile().get(0).getValue());
+ while (exsd != null && !exsd.getBaseDefinition().equals("http://hl7.org/fhir/StructureDefinition/Extension")) {
exsd = worker.fetchResource(StructureDefinition.class, exsd.getBaseDefinition());
}
if (exsd != null && exsd.getUrl().equals(targetUrl)) {
diff --git a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/ResourceRoundTripTests.java b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/ResourceRoundTripTests.java
index ba462e423..4d4bcf27e 100644
--- a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/ResourceRoundTripTests.java
+++ b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/test/ResourceRoundTripTests.java
@@ -1,13 +1,19 @@
package org.hl7.fhir.r5.test;
+import static org.junit.Assert.assertTrue;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.util.List;
import org.apache.commons.io.IOUtils;
import org.hl7.fhir.exceptions.FHIRException;
+import org.hl7.fhir.r5.elementmodel.Element;
+import org.hl7.fhir.r5.elementmodel.Manager;
+import org.hl7.fhir.r5.elementmodel.Manager.FhirFormat;
import org.hl7.fhir.r5.formats.IParser;
import org.hl7.fhir.r5.formats.IParser.OutputStyle;
import org.hl7.fhir.r5.formats.JsonParser;
@@ -55,4 +61,22 @@ public class ResourceRoundTripTests {
throw new FHIRException("Bundle was null");
}
+ @Test
+ /**
+ * verify that umlaut like äö etc are not encoded in UTF-8 in attributes
+ */
+ public void testSerializeUmlaut() throws IOException {
+ Element xml = Manager.parse(TestingUtilities.context(), TestingUtilities.loadTestResourceStream("r5", "unicode.xml"),
+ FhirFormat.XML);
+ List concept = xml.getChildrenByName("concept");
+ assertTrue(concept!=null && concept.size()==1);
+ List code = concept.get(0).getChildrenByName("code");
+ assertTrue(code!=null && code.size()==1);
+ code.get(0).setValue("ö");
+ ByteArrayOutputStream baosXml = new ByteArrayOutputStream();
+ Manager.compose(TestingUtilities.context(), xml, baosXml, FhirFormat.XML, OutputStyle.PRETTY, null);
+ String cdaSerialised = baosXml.toString("UTF-8");
+ assertTrue(cdaSerialised.indexOf("ö")>0);
+ }
+
}
\ No newline at end of file
diff --git a/org.hl7.fhir.report/pom.xml b/org.hl7.fhir.report/pom.xml
index b2ae53d0b..277eaba70 100644
--- a/org.hl7.fhir.report/pom.xml
+++ b/org.hl7.fhir.report/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
org.hl7.fhir.core
- 5.4.10-SNAPSHOT
+ 5.4.11-SNAPSHOT
../pom.xml
diff --git a/org.hl7.fhir.utilities/pom.xml b/org.hl7.fhir.utilities/pom.xml
index ceb2c511f..7502aaf29 100644
--- a/org.hl7.fhir.utilities/pom.xml
+++ b/org.hl7.fhir.utilities/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
org.hl7.fhir.core
- 5.4.10-SNAPSHOT
+ 5.4.11-SNAPSHOT
../pom.xml
diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java
index 4a4a53ea3..9a6d306ca 100644
--- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java
+++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java
@@ -1095,7 +1095,9 @@ public class Utilities {
public static boolean isAbsoluteUrl(String ref) {
if (ref != null && ref.contains(":")) {
String scheme = ref.substring(0, ref.indexOf(":"));
- return existsInList(scheme, "http", "https", "urn") || isToken(scheme) || Utilities.startsWithInList(ref, "urn:iso:", "urn:iso-iec:", "urn:iso-cie:", "urn:iso-astm:", "urn:iso-ieee:", "urn:iec:"); // rfc5141
+ String details = ref.substring(ref.indexOf(":")+1);
+ return (existsInList(scheme, "http", "https", "urn") || isToken(scheme) || Utilities.startsWithInList(ref, "urn:iso:", "urn:iso-iec:", "urn:iso-cie:", "urn:iso-astm:", "urn:iso-ieee:", "urn:iec:"))
+ && details != null && details.length() > 0 && !details.contains(" "); // rfc5141
}
return false;
}
diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/FilesystemPackageCacheManager.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/FilesystemPackageCacheManager.java
index 985fce8ce..ddaccd08e 100644
--- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/FilesystemPackageCacheManager.java
+++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/FilesystemPackageCacheManager.java
@@ -88,7 +88,7 @@ import java.util.Map.Entry;
public class FilesystemPackageCacheManager extends BasePackageCacheManager implements IPackageCacheManager {
public static final String PRIMARY_SERVER = "http://packages.fhir.org";
- public static final String SECONDARY_SERVER = "http://packages2.fhir.org/packages";
+ public static final String SECONDARY_SERVER = "https://packages2.fhir.org/packages";
// private static final String SECONDARY_SERVER = "http://local.fhir.org:960/packages";
public static final String PACKAGE_REGEX = "^[a-zA-Z][A-Za-z0-9\\_\\-]*(\\.[A-Za-z0-9\\_\\-]+)+$";
public static final String PACKAGE_VERSION_REGEX = "^[A-Za-z][A-Za-z0-9\\_\\-]*(\\.[A-Za-z0-9\\_\\-]+)+\\#[A-Za-z0-9\\-\\_]+(\\.[A-Za-z0-9\\-\\_]+)*$";
diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/PackageHacker.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/PackageHacker.java
index 928e7d0d3..ae63fbc85 100644
--- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/PackageHacker.java
+++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/PackageHacker.java
@@ -142,7 +142,7 @@ public class PackageHacker {
// https://github.com/HL7/fhir-ig-publisher/issues/295
if (webref.contains("hl7.org/fhir/us/core/STU4.0.0")) {
- webref.replace("hl7.org/fhir/us/core/STU4.0.0", "hl7.org/fhir/us/core/STU4");
+ return webref.replace("hl7.org/fhir/us/core/STU4.0.0", "hl7.org/fhir/us/core/STU4");
}
if (isUseSecureReferences()) {
diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xml/XMLWriter.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xml/XMLWriter.java
index 65753df7f..aa1f06679 100644
--- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xml/XMLWriter.java
+++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xml/XMLWriter.java
@@ -257,7 +257,7 @@ public class XMLWriter extends OutputStreamWriter implements IXMLWriter {
protected String xmlEscape(String s) {
StringBuilder b = new StringBuilder();
for (char c : s.toCharArray()) {
- if (c < ' ' || c > '~') {
+ if (c < ' ') {
b.append("");
b.append(Integer.toHexString(c).toUpperCase());
b.append(";");
@@ -266,7 +266,8 @@ public class XMLWriter extends OutputStreamWriter implements IXMLWriter {
}
return b.toString();
}
- /* (non-Javadoc)
+
+ /* (non-Javadoc)
* @see org.eclipse.ohf.utilities.xml.IXMLWriter#attribute(java.lang.String, java.lang.String, java.lang.String, boolean)
*/
@Override
diff --git a/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/tests/CachingPackageClientTests.java b/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/tests/CachingPackageClientTests.java
index c4534d237..ae1a56bb6 100644
--- a/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/tests/CachingPackageClientTests.java
+++ b/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/tests/CachingPackageClientTests.java
@@ -10,9 +10,13 @@ import java.util.List;
public class CachingPackageClientTests {
+ private static final String SERVER1 = "http://packages.fhir.org";
+ private static final String SERVER2 = "https://packages2.fhir.org/packages";
+// private static final String SERVER2 = "http://local.fhir.org:960/packages";
+
@Test
public void testExists() throws IOException {
- CachingPackageClient client = new CachingPackageClient("http://packages.fhir.org");
+ CachingPackageClient client = new CachingPackageClient(CachingPackageClientTests.SERVER1);
Assertions.assertTrue(client.exists("hl7.fhir.r4.core", "4.0.1"));
Assertions.assertTrue(!client.exists("hl7.fhir.r4.core", "1.0.2"));
Assertions.assertTrue(client.exists("HL7.fhir.r4.core", "4.0.1"));
@@ -21,14 +25,14 @@ public class CachingPackageClientTests {
@Test
public void testCase() throws IOException {
- CachingPackageClient client = new CachingPackageClient("http://packages.fhir.org");
+ CachingPackageClient client = new CachingPackageClient(CachingPackageClientTests.SERVER1);
Assertions.assertTrue(client.exists("kbv.basis", "1.1.3"));
Assertions.assertTrue(client.exists("KBV.Basis", "1.1.3"));
}
@Test
public void testSearch() throws IOException {
- CachingPackageClient client = new CachingPackageClient("http://packages.fhir.org");
+ CachingPackageClient client = new CachingPackageClient(CachingPackageClientTests.SERVER1);
List matches = client.search("core", null, null, false);
for (PackageInfo pi : matches) {
System.out.println(pi.toString());
@@ -38,14 +42,14 @@ public class CachingPackageClientTests {
@Test
public void testSearchNoMatches() throws IOException {
- CachingPackageClient client = new CachingPackageClient("http://packages.fhir.org");
+ CachingPackageClient client = new CachingPackageClient(CachingPackageClientTests.SERVER1);
List matches = client.search("corezxxx", null, null, false);
Assertions.assertTrue(matches.size() == 0);
}
@Test
public void testVersions() throws IOException {
- CachingPackageClient client = new CachingPackageClient("http://packages.fhir.org");
+ CachingPackageClient client = new CachingPackageClient(CachingPackageClientTests.SERVER1);
List matches = client.getVersions("Simplifier.Core.STU3");
for (PackageInfo pi : matches) {
System.out.println(pi.toString());
@@ -55,14 +59,14 @@ public class CachingPackageClientTests {
@Test
public void testVersionsNone() throws IOException {
- CachingPackageClient client = new CachingPackageClient("http://packages.fhir.org");
+ CachingPackageClient client = new CachingPackageClient(CachingPackageClientTests.SERVER1);
List matches = client.getVersions("Simplifier.Core.STU3X");
Assertions.assertTrue(matches.size() == 0);
}
@Test
public void testExists2() throws IOException {
- CachingPackageClient client = new CachingPackageClient("http://packages2.fhir.org/packages");
+ CachingPackageClient client = new CachingPackageClient(CachingPackageClientTests.SERVER2);
Assertions.assertTrue(client.exists("hl7.fhir.r4.core", "4.0.1"));
Assertions.assertTrue(!client.exists("hl7.fhir.r4.core", "1.0.2"));
Assertions.assertTrue(!client.exists("hl7.fhir.nothing", "1.0.1"));
@@ -71,7 +75,7 @@ public class CachingPackageClientTests {
@Test
public void testSearch2() throws IOException {
- CachingPackageClient client = new CachingPackageClient("http://packages2.fhir.org/packages");
+ CachingPackageClient client = new CachingPackageClient(CachingPackageClientTests.SERVER2);
List matches = client.search("core", null, null, false);
for (PackageInfo pi : matches) {
System.out.println(pi.toString());
@@ -81,14 +85,14 @@ public class CachingPackageClientTests {
@Test
public void testSearchNoMatches2() throws IOException {
- CachingPackageClient client = new CachingPackageClient("http://packages2.fhir.org/packages");
+ CachingPackageClient client = new CachingPackageClient(CachingPackageClientTests.SERVER2);
List matches = client.search("corezxxx", null, null, false);
Assertions.assertTrue(matches.size() == 0);
}
@Test
public void testVersions2() throws IOException {
- CachingPackageClient client = new CachingPackageClient("http://packages2.fhir.org/packages");
+ CachingPackageClient client = new CachingPackageClient(CachingPackageClientTests.SERVER2);
List matches = client.getVersions("Simplifier.Core.STU3");
for (PackageInfo pi : matches) {
System.out.println(pi.toString());
@@ -98,7 +102,7 @@ public class CachingPackageClientTests {
@Test
public void testVersions2A() throws IOException {
- CachingPackageClient client = new CachingPackageClient("http://packages2.fhir.org/packages");
+ CachingPackageClient client = new CachingPackageClient(CachingPackageClientTests.SERVER2);
List matches = client.getVersions("hl7.fhir.us.core");
for (PackageInfo pi : matches) {
System.out.println(pi.toString());
@@ -108,7 +112,7 @@ public class CachingPackageClientTests {
@Test
public void testVersionsNone2() throws IOException {
- CachingPackageClient client = new CachingPackageClient("http://packages2.fhir.org/packages");
+ CachingPackageClient client = new CachingPackageClient(CachingPackageClientTests.SERVER2);
List matches = client.getVersions("Simplifier.Core.STU3X");
Assertions.assertTrue(matches.size() == 0);
}
diff --git a/org.hl7.fhir.validation.cli/pom.xml b/org.hl7.fhir.validation.cli/pom.xml
index ca7232039..a3b7f1d61 100644
--- a/org.hl7.fhir.validation.cli/pom.xml
+++ b/org.hl7.fhir.validation.cli/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
org.hl7.fhir.core
- 5.4.10-SNAPSHOT
+ 5.4.11-SNAPSHOT
../pom.xml
diff --git a/org.hl7.fhir.validation/pom.xml b/org.hl7.fhir.validation/pom.xml
index 36ec34a97..b149b619a 100644
--- a/org.hl7.fhir.validation/pom.xml
+++ b/org.hl7.fhir.validation/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
org.hl7.fhir.core
- 5.4.10-SNAPSHOT
+ 5.4.11-SNAPSHOT
../pom.xml
diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidationEngine.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidationEngine.java
index 8f08ad884..d03d0161f 100644
--- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidationEngine.java
+++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidationEngine.java
@@ -149,6 +149,7 @@ public class ValidationEngine implements IValidatorResourceFetcher, IPackageInst
@Getter @Setter private boolean securityChecks;
@Getter @Setter private boolean crumbTrails;
@Getter @Setter private boolean allowExampleUrls;
+ @Getter @Setter private boolean showMessagesFromReferences;
@Getter @Setter private Locale locale;
@Getter @Setter private List igs = new ArrayList<>();
@Getter @Setter private boolean showTimes;
@@ -495,6 +496,7 @@ public class ValidationEngine implements IValidatorResourceFetcher, IPackageInst
validator.setSecurityChecks(securityChecks);
validator.setCrumbTrails(crumbTrails);
validator.setAllowExamples(allowExampleUrls);
+ validator.setShowMessagesFromReferences(showMessagesFromReferences);
validator.getContext().setLocale(locale);
validator.setFetcher(this);
validator.getImplementationGuides().addAll(igs);
diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/model/CliContext.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/model/CliContext.java
index 606c11ec5..ea44a9eca 100644
--- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/model/CliContext.java
+++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/model/CliContext.java
@@ -26,6 +26,8 @@ public class CliContext {
private boolean hintAboutNonMustSupport = false;
@JsonProperty("recursive")
private boolean recursive = false;
+ @JsonProperty("showMessagesFromReferences")
+ private boolean showMessagesFromReferences = false;
@JsonProperty("doDebug")
private boolean doDebug = false;
@JsonProperty("assumeValidRestReferences")
@@ -200,6 +202,17 @@ public class CliContext {
return this;
}
+ @JsonProperty("showMessagesFromReferences")
+ public boolean isShowMessagesFromReferences() {
+ return showMessagesFromReferences;
+ }
+
+ @JsonProperty("showMessagesFromReferences")
+ public CliContext setShowMessagesFromReferences(boolean showMessagesFromReferences) {
+ this.showMessagesFromReferences = showMessagesFromReferences;
+ return this;
+ }
+
@JsonProperty("locale")
public String getLanguageCode() {
return locale;
diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/ValidationService.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/ValidationService.java
index 66d34c653..703be35cf 100644
--- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/ValidationService.java
+++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/services/ValidationService.java
@@ -242,6 +242,7 @@ public class ValidationService {
validator.setLocale(cliContext.getLocale());
validator.setSnomedExtension(cliContext.getSnomedCTCode());
validator.setAssumeValidRestReferences(cliContext.isAssumeValidRestReferences());
+ validator.setShowMessagesFromReferences(cliContext.isShowMessagesFromReferences());
validator.setNoExtensibleBindingMessages(cliContext.isNoExtensibleBindingMessages());
validator.setNoInvariantChecks(cliContext.isNoInvariants());
validator.setWantInvariantInMessage(cliContext.isWantInvariantsInMessages());
diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/utils/Params.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/utils/Params.java
index 650803ce1..63948d855 100644
--- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/utils/Params.java
+++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/utils/Params.java
@@ -24,6 +24,7 @@ public class Params {
public static final String DEBUG = "-debug";
public static final String SCT = "-sct";
public static final String RECURSE = "-recurse";
+ public static final String SHOW_MESSAGES_FROM_REFERENCES = "-showReferenceMessages";
public static final String LOCALE = "-locale";
public static final String STRICT_EXTENSIONS = "-strictExtensions";
public static final String HINT_ABOUT_NON_MUST_SUPPORT = "-hintAboutNonMustSupport";
@@ -148,6 +149,8 @@ public class Params {
cliContext.setSnomedCT(args[++i]);
} else if (args[i].equals(RECURSE)) {
cliContext.setRecursive(true);
+ } else if (args[i].equals(SHOW_MESSAGES_FROM_REFERENCES)) {
+ cliContext.setShowMessagesFromReferences(true);
} else if (args[i].equals(LOCALE)) {
if (i + 1 == args.length) {
throw new Error("Specified -locale without indicating locale");
diff --git a/org.hl7.fhir.validation/src/main/resources/help.txt b/org.hl7.fhir.validation/src/main/resources/help.txt
index bf0d13dbe..5daf15475 100644
--- a/org.hl7.fhir.validation/src/main/resources/help.txt
+++ b/org.hl7.fhir.validation/src/main/resources/help.txt
@@ -41,6 +41,12 @@ The following parameters are supported:
Note: the profile (and it's dependencies) have to be made available
through one of the -ig parameters. Note that package dependencies will
automatically be resolved
+-showReferenceMessages
+ Includes validation messages resulting from validating target resources
+ against profiles defined on a reference. This increases the volume of
+ validationmessages, but may allow easier debugging. If not specified,
+ then only a high-level message indicating that the referenced item wasn't
+ valid against the listed profile(s) will be provided.
-questionnaire mode: what to do with when validating QuestionnaireResponse resources
none (default): just ignore the questionnaire reference
required: check that the QuestionnaireResponse has a questionnaire and validate against it
diff --git a/pom.xml b/pom.xml
index e0c8746b5..621736b85 100644
--- a/pom.xml
+++ b/pom.xml
@@ -14,7 +14,7 @@
HAPI FHIR
-->
org.hl7.fhir.core
- 5.4.10-SNAPSHOT
+ 5.4.11-SNAPSHOT
pom
diff --git a/pull-request-pipeline.yml b/pull-request-pipeline.yml
index d3bf9cc03..ebc0e522f 100644
--- a/pull-request-pipeline.yml
+++ b/pull-request-pipeline.yml
@@ -30,7 +30,7 @@ steps:
mavenPomFile: 'pom.xml'
mavenOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
- jdkVersionOption: '1.8'
+ jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
@@ -41,7 +41,7 @@ steps:
mavenPomFile: 'pom.xml'
mavenOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
- jdkVersionOption: '1.8'
+ jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
options: '-pl org.hl7.fhir.validation.cli'
publishJUnitResults: false
diff --git a/release-branch-pipeline.yml b/release-branch-pipeline.yml
index 3fcf5dc3b..3b477a9a9 100644
--- a/release-branch-pipeline.yml
+++ b/release-branch-pipeline.yml
@@ -58,7 +58,7 @@ steps:
mavenPomFile: 'pom.xml'
mavenOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
- jdkVersionOption: '1.8'
+ jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'