diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ToolingExtensions.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ToolingExtensions.java index a58c3fa8b..48bdcf7d0 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ToolingExtensions.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ToolingExtensions.java @@ -821,7 +821,7 @@ public class ToolingExtensions { if (!StringUtils.isBlank(content)) { Extension ex = getExtension(e, url); if (ex != null) - ex.setValue(new CodeType(content)); + ex.setValue(new UrlType(content)); else e.getExtension().add(Factory.newExtension(url, new UrlType(content), true)); } @@ -830,10 +830,28 @@ public class ToolingExtensions { public static void addUrlExtension(DomainResource dr, String url, String value) { Extension ex = getExtension(dr, url); if (ex != null) - ex.setValue(new CodeType(value)); + ex.setValue(new UrlType(value)); else dr.getExtension().add(Factory.newExtension(url, new UrlType(value), true)); } + public static void addUriExtension(Element e, String url, String content) { + if (!StringUtils.isBlank(content)) { + Extension ex = getExtension(e, url); + if (ex != null) + ex.setValue(new UriType(content)); + else + e.getExtension().add(Factory.newExtension(url, new UriType(content), true)); + } + } + + public static void addUriExtension(DomainResource dr, String url, String value) { + Extension ex = getExtension(dr, url); + if (ex != null) + ex.setValue(new UriType(value)); + else + dr.getExtension().add(Factory.newExtension(url, new UriType(value), true)); + } + }