diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/primitivetypes10_30/Decimal10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/primitivetypes10_30/Decimal10_30.java index f89a53394..d9a19761b 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/primitivetypes10_30/Decimal10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/datatypes10_30/primitivetypes10_30/Decimal10_30.java @@ -5,13 +5,13 @@ import org.hl7.fhir.exceptions.FHIRException; public class Decimal10_30 { public static org.hl7.fhir.dstu3.model.DecimalType convertDecimal(org.hl7.fhir.dstu2.model.DecimalType src) throws FHIRException { - org.hl7.fhir.dstu3.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.DecimalType(src.getValue()) : new org.hl7.fhir.dstu3.model.DecimalType(); + org.hl7.fhir.dstu3.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.DecimalType(src.getValueAsString()) : new org.hl7.fhir.dstu3.model.DecimalType(); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); return tgt; } public static org.hl7.fhir.dstu2.model.DecimalType convertDecimal(org.hl7.fhir.dstu3.model.DecimalType src) throws FHIRException { - org.hl7.fhir.dstu2.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.DecimalType(src.getValue()) : new org.hl7.fhir.dstu2.model.DecimalType(); + org.hl7.fhir.dstu2.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.DecimalType(src.getValueAsString()) : new org.hl7.fhir.dstu2.model.DecimalType(); ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt); return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/primitivetypes10_40/Decimal10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/primitivetypes10_40/Decimal10_40.java index d3ba5db80..a5211219a 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/primitivetypes10_40/Decimal10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/datatypes10_40/primitivetypes10_40/Decimal10_40.java @@ -5,13 +5,13 @@ import org.hl7.fhir.exceptions.FHIRException; public class Decimal10_40 { public static org.hl7.fhir.r4.model.DecimalType convertDecimal(org.hl7.fhir.dstu2.model.DecimalType src) throws FHIRException { - org.hl7.fhir.r4.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.r4.model.DecimalType(src.getValue()) : new org.hl7.fhir.r4.model.DecimalType(); + org.hl7.fhir.r4.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.r4.model.DecimalType(src.getValueAsString()) : new org.hl7.fhir.r4.model.DecimalType(); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); return tgt; } public static org.hl7.fhir.dstu2.model.DecimalType convertDecimal(org.hl7.fhir.r4.model.DecimalType src) throws FHIRException { - org.hl7.fhir.dstu2.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.DecimalType(src.getValue()) : new org.hl7.fhir.dstu2.model.DecimalType(); + org.hl7.fhir.dstu2.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.DecimalType(src.getValueAsString()) : new org.hl7.fhir.dstu2.model.DecimalType(); ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt); return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/primitivetypes10_50/Decimal10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/primitivetypes10_50/Decimal10_50.java index 8dcf9be62..c519cfdba 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/primitivetypes10_50/Decimal10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/datatypes10_50/primitivetypes10_50/Decimal10_50.java @@ -5,13 +5,13 @@ import org.hl7.fhir.exceptions.FHIRException; public class Decimal10_50 { public static org.hl7.fhir.r5.model.DecimalType convertDecimal(org.hl7.fhir.dstu2.model.DecimalType src) throws FHIRException { - org.hl7.fhir.r5.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.DecimalType(src.getValue()) : new org.hl7.fhir.r5.model.DecimalType(); + org.hl7.fhir.r5.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.DecimalType(src.getValueAsString()) : new org.hl7.fhir.r5.model.DecimalType(); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); return tgt; } public static org.hl7.fhir.dstu2.model.DecimalType convertDecimal(org.hl7.fhir.r5.model.DecimalType src) throws FHIRException { - org.hl7.fhir.dstu2.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.DecimalType(src.getValue()) : new org.hl7.fhir.dstu2.model.DecimalType(); + org.hl7.fhir.dstu2.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.DecimalType(src.getValueAsString()) : new org.hl7.fhir.dstu2.model.DecimalType(); ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt); return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/primitivetypes14_30/Decimal14_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/primitivetypes14_30/Decimal14_30.java index 5c4a06ae4..f88d298dc 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/primitivetypes14_30/Decimal14_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_30/datatypes14_30/primitivetypes14_30/Decimal14_30.java @@ -5,15 +5,13 @@ import org.hl7.fhir.exceptions.FHIRException; public class Decimal14_30 { public static org.hl7.fhir.dstu3.model.DecimalType convertDecimal(org.hl7.fhir.dstu2016may.model.DecimalType src) throws FHIRException { - org.hl7.fhir.dstu3.model.DecimalType tgt = new org.hl7.fhir.dstu3.model.DecimalType(); - if (src.hasValue()) tgt.setValue(src.getValue()); + org.hl7.fhir.dstu3.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.DecimalType(src.getValueAsString()) : new org.hl7.fhir.dstu3.model.DecimalType(); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); return tgt; } public static org.hl7.fhir.dstu2016may.model.DecimalType convertDecimal(org.hl7.fhir.dstu3.model.DecimalType src) throws FHIRException { - org.hl7.fhir.dstu2016may.model.DecimalType tgt = new org.hl7.fhir.dstu2016may.model.DecimalType(); - if (src.hasValue()) tgt.setValue(src.getValue()); + org.hl7.fhir.dstu2016may.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.dstu2016may.model.DecimalType(src.getValueAsString()) : new org.hl7.fhir.dstu2016may.model.DecimalType(); ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt); return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/primitivetypes14_40/Decimal14_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/primitivetypes14_40/Decimal14_40.java index 67b61a60a..8b570a60d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/primitivetypes14_40/Decimal14_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_40/datatypes14_40/primitivetypes14_40/Decimal14_40.java @@ -5,15 +5,13 @@ import org.hl7.fhir.exceptions.FHIRException; public class Decimal14_40 { public static org.hl7.fhir.r4.model.DecimalType convertDecimal(org.hl7.fhir.dstu2016may.model.DecimalType src) throws FHIRException { - org.hl7.fhir.r4.model.DecimalType tgt = new org.hl7.fhir.r4.model.DecimalType(); - if (src.hasValue()) tgt.setValue(src.getValue()); + org.hl7.fhir.r4.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.r4.model.DecimalType(src.getValueAsString()) : new org.hl7.fhir.r4.model.DecimalType(); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); return tgt; } public static org.hl7.fhir.dstu2016may.model.DecimalType convertDecimal(org.hl7.fhir.r4.model.DecimalType src) throws FHIRException { - org.hl7.fhir.dstu2016may.model.DecimalType tgt = new org.hl7.fhir.dstu2016may.model.DecimalType(); - if (src.hasValue()) tgt.setValue(src.getValue()); + org.hl7.fhir.dstu2016may.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.dstu2016may.model.DecimalType(src.getValueAsString()) : new org.hl7.fhir.dstu2016may.model.DecimalType(); ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt); return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/primitivetypes14_50/Decimal14_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/primitivetypes14_50/Decimal14_50.java index 3916b9202..858941a06 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/primitivetypes14_50/Decimal14_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv14_50/datatypes14_50/primitivetypes14_50/Decimal14_50.java @@ -5,15 +5,13 @@ import org.hl7.fhir.exceptions.FHIRException; public class Decimal14_50 { public static org.hl7.fhir.r5.model.DecimalType convertDecimal(org.hl7.fhir.dstu2016may.model.DecimalType src) throws FHIRException { - org.hl7.fhir.r5.model.DecimalType tgt = new org.hl7.fhir.r5.model.DecimalType(); - if (src.hasValue()) tgt.setValue(src.getValue()); + org.hl7.fhir.r5.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.DecimalType(src.getValueAsString()) : new org.hl7.fhir.r5.model.DecimalType(); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); return tgt; } public static org.hl7.fhir.dstu2016may.model.DecimalType convertDecimal(org.hl7.fhir.r5.model.DecimalType src) throws FHIRException { - org.hl7.fhir.dstu2016may.model.DecimalType tgt = new org.hl7.fhir.dstu2016may.model.DecimalType(); - if (src.hasValue()) tgt.setValue(src.getValue()); + org.hl7.fhir.dstu2016may.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.dstu2016may.model.DecimalType(src.getValueAsString()) : new org.hl7.fhir.dstu2016may.model.DecimalType(); ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt); return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/primitivetypes30_40/Decimal30_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/primitivetypes30_40/Decimal30_40.java index 07a2498f8..e3145efee 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/primitivetypes30_40/Decimal30_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_40/datatypes30_40/primitivetypes30_40/Decimal30_40.java @@ -5,13 +5,13 @@ import org.hl7.fhir.exceptions.FHIRException; public class Decimal30_40 { public static org.hl7.fhir.r4.model.DecimalType convertDecimal(org.hl7.fhir.dstu3.model.DecimalType src) throws FHIRException { - org.hl7.fhir.r4.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.r4.model.DecimalType(src.getValue()) : new org.hl7.fhir.r4.model.DecimalType(); + org.hl7.fhir.r4.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.r4.model.DecimalType(src.getValueAsString()) : new org.hl7.fhir.r4.model.DecimalType(); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); return tgt; } public static org.hl7.fhir.dstu3.model.DecimalType convertDecimal(org.hl7.fhir.r4.model.DecimalType src) throws FHIRException { - org.hl7.fhir.dstu3.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.DecimalType(src.getValue()) : new org.hl7.fhir.dstu3.model.DecimalType(); + org.hl7.fhir.dstu3.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.DecimalType(src.getValueAsString()) : new org.hl7.fhir.dstu3.model.DecimalType(); ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt); return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/primitivetypes30_50/Decimal30_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/primitivetypes30_50/Decimal30_50.java index 12a9e9df6..691163ea2 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/primitivetypes30_50/Decimal30_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv30_50/datatypes30_50/primitivetypes30_50/Decimal30_50.java @@ -5,13 +5,13 @@ import org.hl7.fhir.exceptions.FHIRException; public class Decimal30_50 { public static org.hl7.fhir.r5.model.DecimalType convertDecimal(org.hl7.fhir.dstu3.model.DecimalType src) throws FHIRException { - org.hl7.fhir.r5.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.DecimalType(src.getValue()) : new org.hl7.fhir.r5.model.DecimalType(); + org.hl7.fhir.r5.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.DecimalType(src.getValueAsString()) : new org.hl7.fhir.r5.model.DecimalType(); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); return tgt; } public static org.hl7.fhir.dstu3.model.DecimalType convertDecimal(org.hl7.fhir.r5.model.DecimalType src) throws FHIRException { - org.hl7.fhir.dstu3.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.DecimalType(src.getValue()) : new org.hl7.fhir.dstu3.model.DecimalType(); + org.hl7.fhir.dstu3.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.DecimalType(src.getValueAsString()) : new org.hl7.fhir.dstu3.model.DecimalType(); ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt); return tgt; } diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/primitive40_50/Decimal40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/primitive40_50/Decimal40_50.java index 3ec7df816..9a65f9394 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/primitive40_50/Decimal40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/primitive40_50/Decimal40_50.java @@ -5,13 +5,13 @@ import org.hl7.fhir.exceptions.FHIRException; public class Decimal40_50 { public static org.hl7.fhir.r5.model.DecimalType convertDecimal(org.hl7.fhir.r4.model.DecimalType src) throws FHIRException { - org.hl7.fhir.r5.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.DecimalType(src.getValue()) : new org.hl7.fhir.r5.model.DecimalType(); + org.hl7.fhir.r5.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.DecimalType(src.getValueAsString()) : new org.hl7.fhir.r5.model.DecimalType(); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); return tgt; } public static org.hl7.fhir.r4.model.DecimalType convertDecimal(org.hl7.fhir.r5.model.DecimalType src) throws FHIRException { - org.hl7.fhir.r4.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.r4.model.DecimalType(src.getValue()) : new org.hl7.fhir.r4.model.DecimalType(); + org.hl7.fhir.r4.model.DecimalType tgt = src.hasValue() ? new org.hl7.fhir.r4.model.DecimalType(src.getValueAsString()) : new org.hl7.fhir.r4.model.DecimalType(); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); return tgt; } diff --git a/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/VersionConvertorPrimitiveTypeTests.java b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/VersionConvertorPrimitiveTypeTests.java index 0989e36c3..4877d38d8 100644 --- a/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/VersionConvertorPrimitiveTypeTests.java +++ b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/VersionConvertorPrimitiveTypeTests.java @@ -10,6 +10,7 @@ import java.lang.reflect.Array; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.math.BigDecimal; import java.util.Arrays; import java.util.stream.Stream; @@ -23,6 +24,20 @@ public class VersionConvertorPrimitiveTypeTests { "true", "false" }; + private static String[] DECIMAL_STRINGS = { + BigDecimal.valueOf(-Double.MAX_VALUE).toPlainString(), + "-12345", + "-12.300", + "-12.3000", + "0", + "0.0", + "0.00", + "12.300", + "12.3000", + "12345", + BigDecimal.valueOf(Double.MAX_VALUE).toPlainString() + }; + private static String[] ID_STRINGS = { "345e3443345343f3453.t34g5348t3-45t34" }; @@ -200,6 +215,45 @@ public class VersionConvertorPrimitiveTypeTests { org.hl7.fhir.r5.model.CodeType.class, org.hl7.fhir.r5.model.DataType.class, STRING_STRINGS), + //Decimal + getConversionParams(VersionConvertorFactory_10_30.class, + org.hl7.fhir.dstu2.model.DecimalType.class, org.hl7.fhir.dstu2.model.Type.class, + org.hl7.fhir.dstu3.model.DecimalType.class, org.hl7.fhir.dstu3.model.Type.class, + DECIMAL_STRINGS), + getConversionParams(VersionConvertorFactory_10_40.class, + org.hl7.fhir.dstu2.model.DecimalType.class, org.hl7.fhir.dstu2.model.Type.class, + org.hl7.fhir.r4.model.DecimalType.class, org.hl7.fhir.r4.model.Type.class, + DECIMAL_STRINGS), + getConversionParams(VersionConvertorFactory_10_50.class, + org.hl7.fhir.dstu2.model.DecimalType.class, org.hl7.fhir.dstu2.model.Type.class, + org.hl7.fhir.r5.model.DecimalType.class, org.hl7.fhir.r5.model.DataType.class, + DECIMAL_STRINGS), + getConversionParams(VersionConvertorFactory_14_30.class, + org.hl7.fhir.dstu2016may.model.DecimalType.class, org.hl7.fhir.dstu2016may.model.Type.class, + org.hl7.fhir.dstu3.model.DecimalType.class, org.hl7.fhir.dstu3.model.Type.class, + DECIMAL_STRINGS), + getConversionParams(VersionConvertorFactory_14_40.class, + org.hl7.fhir.dstu2016may.model.DecimalType.class, org.hl7.fhir.dstu2016may.model.Type.class, + org.hl7.fhir.r4.model.DecimalType.class, org.hl7.fhir.r4.model.Type.class, + DECIMAL_STRINGS), + getConversionParams(VersionConvertorFactory_14_50.class, + org.hl7.fhir.dstu2016may.model.DecimalType.class, org.hl7.fhir.dstu2016may.model.Type.class, + org.hl7.fhir.r5.model.DecimalType.class, org.hl7.fhir.r5.model.DataType.class, + DECIMAL_STRINGS), + getConversionParams(VersionConvertorFactory_30_40.class, + org.hl7.fhir.dstu3.model.DecimalType.class, org.hl7.fhir.dstu3.model.Type.class, + org.hl7.fhir.r4.model.DecimalType.class, org.hl7.fhir.r4.model.Type.class, + DECIMAL_STRINGS), + getConversionParams(VersionConvertorFactory_30_50.class, + org.hl7.fhir.dstu3.model.DecimalType.class, org.hl7.fhir.dstu3.model.Type.class, + org.hl7.fhir.r5.model.DecimalType.class, org.hl7.fhir.r5.model.DataType.class, + DECIMAL_STRINGS), + getConversionParams(VersionConvertorFactory_40_50.class, + org.hl7.fhir.r4.model.DecimalType.class, org.hl7.fhir.r4.model.Type.class, + org.hl7.fhir.r5.model.DecimalType.class, org.hl7.fhir.r5.model.DataType.class, + DECIMAL_STRINGS), + + //Id getConversionParams(VersionConvertorFactory_10_30.class, org.hl7.fhir.dstu2.model.IdType.class, org.hl7.fhir.dstu2.model.Type.class, diff --git a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/model/DecimalType.java b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/model/DecimalType.java index d29bad799..85f6a4fb9 100644 --- a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/model/DecimalType.java +++ b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/model/DecimalType.java @@ -1,33 +1,33 @@ package org.hl7.fhir.r4.model; -/* - 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. + + */ @@ -81,8 +81,7 @@ public class DecimalType extends PrimitiveType implements Comparable * Constructor */ public DecimalType(String theValue) { - setValue(new BigDecimal(theValue)); - setRepresentation(theValue); + setValueAsString(theValue); } @Override @@ -152,6 +151,11 @@ public class DecimalType extends PrimitiveType implements Comparable setValue(BigDecimal.valueOf(theValue)); } + public void setValueAsString(String theString) { + setValue(new BigDecimal(theString)); + setRepresentation(theString); + } + /** * Sets a new value using a long */ diff --git a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/DecimalType.java b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/DecimalType.java index 24a11820b..6e0b2ae0d 100644 --- a/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/DecimalType.java +++ b/org.hl7.fhir.r4b/src/main/java/org/hl7/fhir/r4b/model/DecimalType.java @@ -1,33 +1,33 @@ package org.hl7.fhir.r4b.model; -/* - 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. + + */ @@ -81,8 +81,7 @@ public class DecimalType extends PrimitiveType implements Comparable * Constructor */ public DecimalType(String theValue) { - setValue(new BigDecimal(theValue)); - setRepresentation(theValue); + setValueAsString(theValue); } @Override @@ -152,6 +151,11 @@ public class DecimalType extends PrimitiveType implements Comparable setValue(BigDecimal.valueOf(theValue)); } + public void setValueAsString(String theString) { + setValue(new BigDecimal(theString)); + setRepresentation(theString); + } + /** * Sets a new value using a long */ diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/DecimalType.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/DecimalType.java index ca9ec22e8..0091257e8 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/DecimalType.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/DecimalType.java @@ -1,33 +1,33 @@ package org.hl7.fhir.r5.model; -/* - 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. + + */ @@ -81,8 +81,7 @@ public class DecimalType extends PrimitiveType implements Comparable * Constructor */ public DecimalType(String theValue) { - setValue(new BigDecimal(theValue)); - setRepresentation(theValue); + setValueAsString(theValue); } @Override @@ -166,6 +165,11 @@ public class DecimalType extends PrimitiveType implements Comparable setValue(BigDecimal.valueOf(theValue)); } + public void setValueAsString(String theString) { + setValue(new BigDecimal(theString)); + setRepresentation(theString); + } + @Override public DecimalType copy() { DecimalType ret = new DecimalType(getValue());