diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/Element.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/Element.java index d306c414b..c46e85c01 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/Element.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/Element.java @@ -634,7 +634,14 @@ public class Element extends Base { @Override public String toString() { - return name+"="+fhirType() + "["+(children == null || hasValue() ? value : Integer.toString(children.size())+" children")+"]"; + if (name.equals(fhirType()) && isResource()) { + return fhirType()+"/"+getIdBase() + "["+(children == null || hasValue() ? value : Integer.toString(children.size())+" children")+"]"; + + } else if (isResource()) { + return name+"="+fhirType()+"/"+getIdBase()+ "["+(children == null || hasValue() ? value : Integer.toString(children.size())+" children")+"]"; + } else { + return name+"="+fhirType() + "["+(children == null || hasValue() ? value : Integer.toString(children.size())+" children")+"]"; + } } @Override diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/Manager.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/Manager.java index be9918f74..0bfcf8f90 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/Manager.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/elementmodel/Manager.java @@ -62,6 +62,8 @@ public class Manager { return "txt"; case VBAR: return "hl7"; + case SHC: + return "shc"; } return null; } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/CodeSystemRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/CodeSystemRenderer.java index 7af63b922..f9618e79f 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/CodeSystemRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/CodeSystemRenderer.java @@ -422,7 +422,7 @@ public class CodeSystemRenderer extends TerminologyRenderer { if (first) first = false; else td.addText(", "); if (pcv.hasValueCoding()) { td.addText(pcv.getValueCoding().getCode()); - } else if (pcv.hasValueStringType() && Utilities.isAbsoluteUrl(pcv.getValue().primitiveValue())) { + } else if (pcv.hasValueStringType() && Utilities.isAbsoluteUrlLinkable(pcv.getValue().primitiveValue())) { td.ah(pcv.getValue().primitiveValue()).tx(pcv.getValue().primitiveValue()); } else { td.addText(pcv.getValue().primitiveValue()); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java index c7420060a..6eb2606ef 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java @@ -450,8 +450,10 @@ public class ProfileDrivenRenderer extends ResourceRenderer { x.addText(((Enumeration) e).getValue().toString()); // todo: look up a display name if there is one return true; } else if (e instanceof BooleanType) { - if (((BooleanType) e).getValue()) { + if (((BooleanType) e).hasValue()) { x.addText(name); + x.addText(": "); + x.addText(((BooleanType) e).getValueAsString()); return true; } } else if (e instanceof CodeableReference) { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireRenderer.java index 4c9769072..3bb0e805c 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireRenderer.java @@ -1013,7 +1013,7 @@ public class QuestionnaireRenderer extends TerminologyRenderer { private void defn(XhtmlNode tbl, String name, String url, Resource res) throws UnsupportedEncodingException, IOException { if (res != null && res.hasUserData("path")) { defn(tbl, "Definition", RendererFactory.factory(res, context).display(res), res.getUserString("path")); - } else if (Utilities.isAbsoluteUrl(url)) { + } else if (Utilities.isAbsoluteUrlLinkable(url)) { defn(tbl, "Definition", url, url); } { defn(tbl, "Definition", url); diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java index 5679a06e0..9fce7c0f0 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java @@ -1098,7 +1098,17 @@ public class Utilities { if (ref != null && ref.contains(":")) { String scheme = ref.substring(0, ref.indexOf(":")); 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:")) + return (existsInList(scheme, "http", "https", "urn") || (isToken(scheme) && scheme.equals(scheme.toLowerCase())) || 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; + } + + public static boolean isAbsoluteUrlLinkable(String ref) { + if (ref != null && ref.contains(":")) { + String scheme = ref.substring(0, ref.indexOf(":")); + String details = ref.substring(ref.indexOf(":")+1); + return (existsInList(scheme, "http", "https", "ftp")) && details != null && details.length() > 0 && !details.contains(" "); // rfc5141 } return false; diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/VersionUtilities.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/VersionUtilities.java index 5cba7179a..18640920f 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/VersionUtilities.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/VersionUtilities.java @@ -135,7 +135,7 @@ public class VersionUtilities { } public static boolean isR5Ver(String ver) { - return ver != null && ver.startsWith(CURRENT_VERSION); + return ver != null && (ver.startsWith(CURRENT_VERSION) || ver.equals("current")); } public static boolean isR4BVer(String ver) {