Add tests and changes for Time + fix skipped Uuid conversions

This commit is contained in:
dotasek 2022-03-18 14:09:01 -04:00
parent 33ec1f640e
commit b7fbd3ce44
14 changed files with 69 additions and 30 deletions

View File

@ -5,13 +5,13 @@ import org.hl7.fhir.exceptions.FHIRException;
public class Time10_30 {
public static org.hl7.fhir.dstu3.model.TimeType convertTime(org.hl7.fhir.dstu2.model.TimeType src) throws FHIRException {
org.hl7.fhir.dstu3.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.TimeType(src.getValue()) : new org.hl7.fhir.dstu3.model.TimeType();
org.hl7.fhir.dstu3.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.TimeType(src.getValueAsString()) : new org.hl7.fhir.dstu3.model.TimeType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.TimeType convertTime(org.hl7.fhir.dstu3.model.TimeType src) throws FHIRException {
org.hl7.fhir.dstu2.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.TimeType(src.getValue()) : new org.hl7.fhir.dstu2.model.TimeType();
org.hl7.fhir.dstu2.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.TimeType(src.getValueAsString()) : new org.hl7.fhir.dstu2.model.TimeType();
ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().copyElement(src, tgt);
return tgt;
}

View File

@ -5,13 +5,13 @@ import org.hl7.fhir.exceptions.FHIRException;
public class Time10_40 {
public static org.hl7.fhir.r4.model.TimeType convertTime(org.hl7.fhir.dstu2.model.TimeType src) throws FHIRException {
org.hl7.fhir.r4.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.r4.model.TimeType(src.getValue()) : new org.hl7.fhir.r4.model.TimeType();
org.hl7.fhir.r4.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.r4.model.TimeType(src.getValueAsString()) : new org.hl7.fhir.r4.model.TimeType();
ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.TimeType convertTime(org.hl7.fhir.r4.model.TimeType src) throws FHIRException {
org.hl7.fhir.dstu2.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.TimeType(src.getValue()) : new org.hl7.fhir.dstu2.model.TimeType();
org.hl7.fhir.dstu2.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.TimeType(src.getValueAsString()) : new org.hl7.fhir.dstu2.model.TimeType();
ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().copyElement(src, tgt);
return tgt;
}

View File

@ -5,13 +5,13 @@ import org.hl7.fhir.exceptions.FHIRException;
public class Time10_50 {
public static org.hl7.fhir.r5.model.TimeType convertTime(org.hl7.fhir.dstu2.model.TimeType src) throws FHIRException {
org.hl7.fhir.r5.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.TimeType(src.getValue()) : new org.hl7.fhir.r5.model.TimeType();
org.hl7.fhir.r5.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.TimeType(src.getValueAsString()) : new org.hl7.fhir.r5.model.TimeType();
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2.model.TimeType convertTime(org.hl7.fhir.r5.model.TimeType src) throws FHIRException {
org.hl7.fhir.dstu2.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.TimeType(src.getValue()) : new org.hl7.fhir.dstu2.model.TimeType();
org.hl7.fhir.dstu2.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.dstu2.model.TimeType(src.getValueAsString()) : new org.hl7.fhir.dstu2.model.TimeType();
ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().copyElement(src, tgt);
return tgt;
}

View File

@ -137,10 +137,10 @@ public class Type14_30 {
return UnsignedInt14_30.convertUnsignedInt((org.hl7.fhir.dstu3.model.UnsignedIntType) src);
if (src instanceof org.hl7.fhir.dstu3.model.IntegerType)
return Integer14_30.convertInteger((org.hl7.fhir.dstu3.model.IntegerType) src);
if (src instanceof org.hl7.fhir.dstu3.model.UriType)
return Uri14_30.convertUri((org.hl7.fhir.dstu3.model.UriType) src);
if (src instanceof org.hl7.fhir.dstu3.model.UuidType)
return Uuid14_30.convertUuid((org.hl7.fhir.dstu3.model.UuidType) src);
if (src instanceof org.hl7.fhir.dstu3.model.UriType)
return Uri14_30.convertUri((org.hl7.fhir.dstu3.model.UriType) src);
if (src instanceof org.hl7.fhir.dstu3.model.Extension)
return Extension14_30.convertExtension((org.hl7.fhir.dstu3.model.Extension) src);
if (src instanceof org.hl7.fhir.dstu3.model.Narrative)

View File

@ -5,15 +5,13 @@ import org.hl7.fhir.exceptions.FHIRException;
public class Time14_30 {
public static org.hl7.fhir.dstu3.model.TimeType convertTime(org.hl7.fhir.dstu2016may.model.TimeType src) throws FHIRException {
org.hl7.fhir.dstu3.model.TimeType tgt = new org.hl7.fhir.dstu3.model.TimeType();
if (src.hasValue()) tgt.setValue(src.getValue());
org.hl7.fhir.dstu3.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.TimeType(src.getValueAsString()) : new org.hl7.fhir.dstu3.model.TimeType();
ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2016may.model.TimeType convertTime(org.hl7.fhir.dstu3.model.TimeType src) throws FHIRException {
org.hl7.fhir.dstu2016may.model.TimeType tgt = new org.hl7.fhir.dstu2016may.model.TimeType();
if (src.hasValue()) tgt.setValue(src.getValue());
org.hl7.fhir.dstu2016may.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.dstu2016may.model.TimeType(src.getValueAsString()) : new org.hl7.fhir.dstu2016may.model.TimeType();
ConversionContext14_30.INSTANCE.getVersionConvertor_14_30().copyElement(src, tgt);
return tgt;
}

View File

@ -134,9 +134,9 @@ public class Type14_40 {
return UnsignedInt14_40.convertUnsignedInt((org.hl7.fhir.r4.model.UnsignedIntType) src);
if (src instanceof org.hl7.fhir.r4.model.IntegerType)
return Integer14_40.convertInteger((org.hl7.fhir.r4.model.IntegerType) src);
if (src instanceof org.hl7.fhir.r4.model.UriType) return Uri14_40.convertUri((org.hl7.fhir.r4.model.UriType) src);
if (src instanceof org.hl7.fhir.r4.model.UuidType)
return Uuid14_40.convertUuid((org.hl7.fhir.r4.model.UuidType) src);
if (src instanceof org.hl7.fhir.r4.model.UriType) return Uri14_40.convertUri((org.hl7.fhir.r4.model.UriType) src);
if (src instanceof org.hl7.fhir.r4.model.Extension)
return Extension14_40.convertExtension((org.hl7.fhir.r4.model.Extension) src);
if (src instanceof org.hl7.fhir.r4.model.Narrative)

View File

@ -5,15 +5,13 @@ import org.hl7.fhir.exceptions.FHIRException;
public class Time14_40 {
public static org.hl7.fhir.r4.model.TimeType convertTime(org.hl7.fhir.dstu2016may.model.TimeType src) throws FHIRException {
org.hl7.fhir.r4.model.TimeType tgt = new org.hl7.fhir.r4.model.TimeType();
if (src.hasValue()) tgt.setValue(src.getValue());
org.hl7.fhir.r4.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.r4.model.TimeType(src.getValueAsString()) : new org.hl7.fhir.r4.model.TimeType();
ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2016may.model.TimeType convertTime(org.hl7.fhir.r4.model.TimeType src) throws FHIRException {
org.hl7.fhir.dstu2016may.model.TimeType tgt = new org.hl7.fhir.dstu2016may.model.TimeType();
if (src.hasValue()) tgt.setValue(src.getValue());
org.hl7.fhir.dstu2016may.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.dstu2016may.model.TimeType(src.getValueAsString()) : new org.hl7.fhir.dstu2016may.model.TimeType();
ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt);
return tgt;
}

View File

@ -5,15 +5,13 @@ import org.hl7.fhir.exceptions.FHIRException;
public class Time14_50 {
public static org.hl7.fhir.r5.model.TimeType convertTime(org.hl7.fhir.dstu2016may.model.TimeType src) throws FHIRException {
org.hl7.fhir.r5.model.TimeType tgt = new org.hl7.fhir.r5.model.TimeType();
if (src.hasValue()) tgt.setValue(src.getValue());
org.hl7.fhir.r5.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.TimeType(src.getValueAsString()) : new org.hl7.fhir.r5.model.TimeType();
ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu2016may.model.TimeType convertTime(org.hl7.fhir.r5.model.TimeType src) throws FHIRException {
org.hl7.fhir.dstu2016may.model.TimeType tgt = new org.hl7.fhir.dstu2016may.model.TimeType();
if (src.hasValue()) tgt.setValue(src.getValue());
org.hl7.fhir.dstu2016may.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.dstu2016may.model.TimeType(src.getValueAsString()) : new org.hl7.fhir.dstu2016may.model.TimeType();
ConversionContext14_50.INSTANCE.getVersionConvertor_14_50().copyElement(src, tgt);
return tgt;
}

View File

@ -5,13 +5,13 @@ import org.hl7.fhir.exceptions.FHIRException;
public class Time30_40 {
public static org.hl7.fhir.r4.model.TimeType convertTime(org.hl7.fhir.dstu3.model.TimeType src) throws FHIRException {
org.hl7.fhir.r4.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.r4.model.TimeType(src.getValue()) : new org.hl7.fhir.r4.model.TimeType();
org.hl7.fhir.r4.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.r4.model.TimeType(src.getValueAsString()) : new org.hl7.fhir.r4.model.TimeType();
ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu3.model.TimeType convertTime(org.hl7.fhir.r4.model.TimeType src) throws FHIRException {
org.hl7.fhir.dstu3.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.TimeType(src.getValue()) : new org.hl7.fhir.dstu3.model.TimeType();
org.hl7.fhir.dstu3.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.TimeType(src.getValueAsString()) : new org.hl7.fhir.dstu3.model.TimeType();
ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
return tgt;
}

View File

@ -151,9 +151,9 @@ public class Type30_50 {
return String30_50.convertString((org.hl7.fhir.r5.model.StringType) src);
if (src instanceof org.hl7.fhir.r5.model.TimeType)
return Time30_50.convertTime((org.hl7.fhir.r5.model.TimeType) src);
if (src instanceof org.hl7.fhir.r5.model.UriType) return Uri30_50.convertUri((org.hl7.fhir.r5.model.UriType) src);
if (src instanceof org.hl7.fhir.r5.model.UuidType)
return Uuid30_50.convertUuid((org.hl7.fhir.r5.model.UuidType) src);
if (src instanceof org.hl7.fhir.r5.model.UriType) return Uri30_50.convertUri((org.hl7.fhir.r5.model.UriType) src);
if (src instanceof org.hl7.fhir.r5.model.Extension)
return Extension30_50.convertExtension((org.hl7.fhir.r5.model.Extension) src);
if (src instanceof org.hl7.fhir.r5.model.Narrative)

View File

@ -5,13 +5,13 @@ import org.hl7.fhir.exceptions.FHIRException;
public class Time30_50 {
public static org.hl7.fhir.r5.model.TimeType convertTime(org.hl7.fhir.dstu3.model.TimeType src) throws FHIRException {
org.hl7.fhir.r5.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.TimeType(src.getValue()) : new org.hl7.fhir.r5.model.TimeType();
org.hl7.fhir.r5.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.TimeType(src.getValueAsString()) : new org.hl7.fhir.r5.model.TimeType();
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
return tgt;
}
public static org.hl7.fhir.dstu3.model.TimeType convertTime(org.hl7.fhir.r5.model.TimeType src) throws FHIRException {
org.hl7.fhir.dstu3.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.TimeType(src.getValue()) : new org.hl7.fhir.dstu3.model.TimeType();
org.hl7.fhir.dstu3.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.dstu3.model.TimeType(src.getValueAsString()) : new org.hl7.fhir.dstu3.model.TimeType();
ConversionContext30_50.INSTANCE.getVersionConvertor_30_50().copyElement(src, tgt);
return tgt;
}

View File

@ -44,14 +44,14 @@ public class Type40_50 {
if (src instanceof org.hl7.fhir.r4.model.MarkdownType)
return MarkDown40_50.convertMarkdown((org.hl7.fhir.r4.model.MarkdownType) src);
if (src instanceof org.hl7.fhir.r4.model.OidType) return Oid40_50.convertOid((org.hl7.fhir.r4.model.OidType) src);
if (src instanceof org.hl7.fhir.r4.model.StringType)
return String40_50.convertString((org.hl7.fhir.r4.model.StringType) src);
if (src instanceof org.hl7.fhir.r4.model.TimeType)
return Time40_50.convertTime((org.hl7.fhir.r4.model.TimeType) src);
if (src instanceof org.hl7.fhir.r4.model.UrlType) return Url40_50.convertUrl((org.hl7.fhir.r4.model.UrlType) src);
if (src instanceof org.hl7.fhir.r4.model.UuidType)
return Uuid40_50.convertUuid((org.hl7.fhir.r4.model.UuidType) src);
if (src instanceof org.hl7.fhir.r4.model.UriType) return Uri40_50.convertUri((org.hl7.fhir.r4.model.UriType) src);
if (src instanceof org.hl7.fhir.r4.model.StringType)
return String40_50.convertString((org.hl7.fhir.r4.model.StringType) src);
if (src instanceof org.hl7.fhir.r4.model.Extension)
return Extension40_50.convertExtension((org.hl7.fhir.r4.model.Extension) src);
if (src instanceof org.hl7.fhir.r4.model.Narrative)

View File

@ -11,7 +11,7 @@ public class Time40_50 {
}
public static org.hl7.fhir.r4.model.TimeType convertTime(org.hl7.fhir.r5.model.TimeType src) throws FHIRException {
org.hl7.fhir.r4.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.r4.model.TimeType(src.getValue()) : new org.hl7.fhir.r4.model.TimeType();
org.hl7.fhir.r4.model.TimeType tgt = src.hasValue() ? new org.hl7.fhir.r4.model.TimeType(src.getValueAsString()) : new org.hl7.fhir.r4.model.TimeType();
ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
return tgt;
}

View File

@ -65,16 +65,23 @@ public class VersionConvertorPrimitiveTypeTests {
private static String[] POSITIVE_INT_STRINGS = {
"1", "12345", Integer.toString(Integer.MAX_VALUE)
};
private static String[] TIME_STRINGS = {
"12:34:56", "12:34:56.789"
};
private static String[] UNSIGNED_INT_STRINGS = {
"0", "12345", Integer.toString(Integer.MAX_VALUE)
};
private static String[] URI_STRINGS = {
"foo://example.com:8042/find/bassist?name=lemmy#birthdate"
};
private static String[] URL_STRINGS = {
"http://example.com:8042/find/bassist?name=lemmy#birthdate"
};
private static String[] UUID_STRINGS = {
"123e4567-e89b-12d3-a456-426614174000"
};
@ -487,6 +494,44 @@ public class VersionConvertorPrimitiveTypeTests {
org.hl7.fhir.r5.model.StringType.class, org.hl7.fhir.r5.model.DataType.class,
STRING_STRINGS),
//Time
getFactoryConversionParams(VersionConvertorFactory_10_30.class,
org.hl7.fhir.dstu2.model.TimeType.class, org.hl7.fhir.dstu2.model.Type.class,
org.hl7.fhir.dstu3.model.TimeType.class, org.hl7.fhir.dstu3.model.Type.class,
TIME_STRINGS),
getFactoryConversionParams(VersionConvertorFactory_10_40.class,
org.hl7.fhir.dstu2.model.TimeType.class, org.hl7.fhir.dstu2.model.Type.class,
org.hl7.fhir.r4.model.TimeType.class, org.hl7.fhir.r4.model.Type.class,
TIME_STRINGS),
getFactoryConversionParams(VersionConvertorFactory_10_50.class,
org.hl7.fhir.dstu2.model.TimeType.class, org.hl7.fhir.dstu2.model.Type.class,
org.hl7.fhir.r5.model.TimeType.class, org.hl7.fhir.r5.model.DataType.class,
TIME_STRINGS),
getFactoryConversionParams(VersionConvertorFactory_14_30.class,
org.hl7.fhir.dstu2016may.model.TimeType.class, org.hl7.fhir.dstu2016may.model.Type.class,
org.hl7.fhir.dstu3.model.TimeType.class, org.hl7.fhir.dstu3.model.Type.class,
TIME_STRINGS),
getFactoryConversionParams(VersionConvertorFactory_14_40.class,
org.hl7.fhir.dstu2016may.model.TimeType.class, org.hl7.fhir.dstu2016may.model.Type.class,
org.hl7.fhir.r4.model.TimeType.class, org.hl7.fhir.r4.model.Type.class,
TIME_STRINGS),
getFactoryConversionParams(VersionConvertorFactory_14_50.class,
org.hl7.fhir.dstu2016may.model.TimeType.class, org.hl7.fhir.dstu2016may.model.Type.class,
org.hl7.fhir.r5.model.TimeType.class, org.hl7.fhir.r5.model.DataType.class,
TIME_STRINGS),
getFactoryConversionParams(VersionConvertorFactory_30_40.class,
org.hl7.fhir.dstu3.model.TimeType.class, org.hl7.fhir.dstu3.model.Type.class,
org.hl7.fhir.r4.model.TimeType.class, org.hl7.fhir.r4.model.Type.class,
TIME_STRINGS),
getFactoryConversionParams(VersionConvertorFactory_30_50.class,
org.hl7.fhir.dstu3.model.TimeType.class, org.hl7.fhir.dstu3.model.Type.class,
org.hl7.fhir.r5.model.TimeType.class, org.hl7.fhir.r5.model.DataType.class,
TIME_STRINGS),
getFactoryConversionParams(VersionConvertorFactory_40_50.class,
org.hl7.fhir.r4.model.TimeType.class, org.hl7.fhir.r4.model.Type.class,
org.hl7.fhir.r5.model.TimeType.class, org.hl7.fhir.r5.model.DataType.class,
TIME_STRINGS),
//UnsignedInt
getFactoryConversionParams(VersionConvertorFactory_10_30.class,
org.hl7.fhir.dstu2.model.UnsignedIntType.class, org.hl7.fhir.dstu2.model.Type.class,