From 48d6829abf41aca92a7af0b56c33811956366bf7 Mon Sep 17 00:00:00 2001 From: dotasek Date: Fri, 18 Mar 2022 15:03:01 -0400 Subject: [PATCH] Add tests and changes for Url --- .../conv40_50/datatypes40_50/primitive40_50/Url40_50.java | 4 ++-- .../fhir/convertors/VersionConvertorPrimitiveTypeTests.java | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/primitive40_50/Url40_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/primitive40_50/Url40_50.java index de6504e4f..f7ed7564d 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/primitive40_50/Url40_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv40_50/datatypes40_50/primitive40_50/Url40_50.java @@ -5,13 +5,13 @@ import org.hl7.fhir.exceptions.FHIRException; public class Url40_50 { public static org.hl7.fhir.r5.model.UrlType convertUrl(org.hl7.fhir.r4.model.UrlType src) throws FHIRException { - org.hl7.fhir.r5.model.UrlType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.UrlType(src.getValue()) : new org.hl7.fhir.r5.model.UrlType(); + org.hl7.fhir.r5.model.UrlType tgt = src.hasValue() ? new org.hl7.fhir.r5.model.UrlType(src.getValueAsString()) : new org.hl7.fhir.r5.model.UrlType(); ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt); return tgt; } public static org.hl7.fhir.r4.model.UrlType convertUrl(org.hl7.fhir.r5.model.UrlType src) throws FHIRException { - org.hl7.fhir.r4.model.UrlType tgt = src.hasValue() ? new org.hl7.fhir.r4.model.UrlType(src.getValue()) : new org.hl7.fhir.r4.model.UrlType(); + org.hl7.fhir.r4.model.UrlType tgt = src.hasValue() ? new org.hl7.fhir.r4.model.UrlType(src.getValueAsString()) : new org.hl7.fhir.r4.model.UrlType(); 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 e85983bca..6941f07f7 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 @@ -608,6 +608,12 @@ public class VersionConvertorPrimitiveTypeTests { org.hl7.fhir.r5.model.UriType.class, org.hl7.fhir.r5.model.DataType.class, URI_STRINGS), + //Url + getFactoryConversionParams(VersionConvertorFactory_40_50.class, + org.hl7.fhir.r4.model.UrlType.class, org.hl7.fhir.r4.model.Type.class, + org.hl7.fhir.r5.model.UrlType.class, org.hl7.fhir.r5.model.DataType.class, + URI_STRINGS), + //Uuid getFactoryConversionParams(VersionConvertorFactory_10_30.class, org.hl7.fhir.dstu2.model.UuidType.class, org.hl7.fhir.dstu2.model.Type.class,