Merge branch 'master' into issue-555

This commit is contained in:
Grahame Grieve 2021-08-24 06:00:27 +10:00 committed by GitHub
commit b5723bab50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
49 changed files with 1206 additions and 147 deletions

View File

@ -5,3 +5,4 @@
* 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)

View File

@ -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

View File

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

View File

@ -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.");
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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)));
}
}

View File

@ -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)));
}
}

View File

@ -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)));
}
}

View File

@ -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)));
}
}

View File

@ -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)));
}
}

View File

@ -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)));
}
}

View File

@ -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)));
}
}

View File

@ -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)));
}
}

View File

@ -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)));
}
}

View File

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

View File

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

View File

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

View File

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

View File

@ -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

View File

@ -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<ElementDefinition> 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)) {

View File

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

View File

@ -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

View File

@ -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<ElementDefinition> 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)) {

View File

@ -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<Element> concept = xml.getChildrenByName("concept");
assertTrue(concept!=null && concept.size()==1);
List<Element> 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);
}
}

View File

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

View File

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

View File

@ -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;
}

View File

@ -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\\-\\_]+)*$";

View File

@ -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()) {

View File

@ -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("&#x");
b.append(Integer.toHexString(c).toUpperCase());
b.append(";");
@ -266,6 +266,7 @@ public class XMLWriter extends OutputStreamWriter implements IXMLWriter {
}
return b.toString();
}
/* (non-Javadoc)
* @see org.eclipse.ohf.utilities.xml.IXMLWriter#attribute(java.lang.String, java.lang.String, java.lang.String, boolean)
*/

View File

@ -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<PackageInfo> 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<PackageInfo> 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<PackageInfo> 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<PackageInfo> 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<PackageInfo> 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<PackageInfo> 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<PackageInfo> 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<PackageInfo> 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<PackageInfo> matches = client.getVersions("Simplifier.Core.STU3X");
Assertions.assertTrue(matches.size() == 0);
}

View File

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

View File

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

View File

@ -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<ImplementationGuide> 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);

View File

@ -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;

View File

@ -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());

View File

@ -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");

View File

@ -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

View File

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

View File

@ -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

View File

@ -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'