From da95cae6622bc016843d0d27640ad895bf16e336 Mon Sep 17 00:00:00 2001 From: dotasek Date: Tue, 4 Jan 2022 17:37:45 -0500 Subject: [PATCH 01/16] Add hasResource check to Bundle10_XX convertors --- .../fhir/convertors/conv10_30/resources10_30/Bundle10_30.java | 4 ++-- .../fhir/convertors/conv10_40/resources10_40/Bundle10_40.java | 4 ++-- .../fhir/convertors/conv10_50/resources10_50/Bundle10_50.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Bundle10_30.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Bundle10_30.java index 7689d1874..ba17e1dc5 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Bundle10_30.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_30/resources10_30/Bundle10_30.java @@ -60,8 +60,8 @@ public class Bundle10_30 { tgt.addLink(convertBundleLinkComponent(t)); if (src.hasFullUrlElement()) tgt.setFullUrlElement(Uri10_30.convertUri(src.getFullUrlElement())); - org.hl7.fhir.dstu2.model.Resource res = ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertResource(src.getResource()); - tgt.setResource(res); + if (src.hasResource()) + tgt.setResource(ConversionContext10_30.INSTANCE.getVersionConvertor_10_30().convertResource(src.getResource())); if (src.hasSearch()) tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); if (src.hasRequest()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Bundle10_40.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Bundle10_40.java index becb30cb2..3047c9fbe 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Bundle10_40.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_40/resources10_40/Bundle10_40.java @@ -78,8 +78,8 @@ public class Bundle10_40 { for (org.hl7.fhir.r4.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); if (src.hasFullUrlElement()) tgt.setFullUrlElement(Uri10_40.convertUri(src.getFullUrlElement())); - org.hl7.fhir.dstu2.model.Resource res = ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().convertResource(src.getResource()); - tgt.setResource(res); + if (src.hasResource()) + tgt.setResource(ConversionContext10_40.INSTANCE.getVersionConvertor_10_40().convertResource(src.getResource())); if (src.hasSearch()) tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); if (src.hasRequest()) diff --git a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Bundle10_50.java b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Bundle10_50.java index 98c3b2807..6b7c5fc60 100644 --- a/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Bundle10_50.java +++ b/org.hl7.fhir.convertors/src/main/java/org/hl7/fhir/convertors/conv10_50/resources10_50/Bundle10_50.java @@ -78,8 +78,8 @@ public class Bundle10_50 { for (org.hl7.fhir.r5.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); if (src.hasFullUrlElement()) tgt.setFullUrlElement(Uri10_50.convertUri(src.getFullUrlElement())); - org.hl7.fhir.dstu2.model.Resource res = ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().convertResource(src.getResource()); - tgt.setResource(res); + if (src.hasResource()) + tgt.setResource(ConversionContext10_50.INSTANCE.getVersionConvertor_10_50().convertResource(src.getResource())); if (src.hasSearch()) tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch())); if (src.hasRequest()) From 86c36092888135f908c46444b5430d6abde67808 Mon Sep 17 00:00:00 2001 From: Lloyd McKenzie Date: Tue, 4 Jan 2022 21:46:57 -0700 Subject: [PATCH 02/16] Changes relevant to improving the rendering of artifact intros. Specifically: - ensure that when validating codes against value sets, the valid coding is actually returned - strip out the new extensions we add for FMM - improve the rendering of Quantity and Range. (The former was horrid and the latter wasn't as nice as it could be.) --- .../fhir/r5/conformance/ProfileUtilities.java | 2 ++ .../hl7/fhir/r5/renderers/DataRenderer.java | 32 +++++++++++-------- .../terminologies/ValueSetCheckerSimple.java | 8 +++-- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/ProfileUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/ProfileUtilities.java index 808f256b2..c73fdaf6f 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/ProfileUtilities.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/ProfileUtilities.java @@ -2087,6 +2087,8 @@ public class ProfileUtilities extends TranslatingUtilities { private void removeStatusExtensions(ElementDefinition outcome) { outcome.removeExtension(ToolingExtensions.EXT_FMM_LEVEL); + outcome.removeExtension(ToolingExtensions.EXT_FMM_SUPPORT); + outcome.removeExtension(ToolingExtensions.EXT_FMM_DERIVED); outcome.removeExtension(ToolingExtensions.EXT_STANDARDS_STATUS); outcome.removeExtension(ToolingExtensions.EXT_NORMATIVE_VERSION); outcome.removeExtension(ToolingExtensions.EXT_WORKGROUP); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java index 998205f4c..626de3b84 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java @@ -1139,9 +1139,11 @@ public class DataRenderer extends Renderer { protected String displayQuantity(Quantity q) { StringBuilder s = new StringBuilder(); - s.append("(system = '").append(TerminologyRenderer.describeSystem(q.getSystem())) - .append("' code ").append(q.getCode()) - .append(" = '").append(lookupCode(q.getSystem(), null, q.getCode())).append("')"); + s.append(q.hasValue() ? q.getValue() : "?"); + if (q.hasUnit()) + s.append(" ").append(q.getUnit()); + else if (q.hasCode()) + s.append(" ").append(q.getCode()); return s.toString(); } @@ -1166,18 +1168,20 @@ public class DataRenderer extends Renderer { } public String displayRange(Range q) { + if (!q.hasLow() && !q.hasHigh()) + return "?"; + StringBuilder b = new StringBuilder(); - if (q.hasLow()) - b.append(q.getLow().getValue().toString()); - else - b.append("?"); - b.append("-"); - if (q.hasHigh()) - b.append(q.getHigh().getValue().toString()); - else - b.append("?"); - if (q.getLow().hasUnit()) - b.append(" "+q.getLow().getUnit()); + + boolean sameUnits = (q.getLow().hasUnit() && q.getHigh().hasUnit() && q.getLow().getUnit().equals(q.getHigh().getUnit())) + || (q.getLow().hasCode() && q.getHigh().hasCode() && q.getLow().getCode().equals(q.getHigh().getCode())); + String low = "?"; + if (q.hasLow() && q.getLow().hasValue()) + low = sameUnits ? q.getLow().getValue().toString() : displayQuantity(q.getLow()); + String high = displayQuantity(q.getHigh()); + if (high.isEmpty()) + high = "?"; + b.append(low).append("\u00A0 to \u00A0").append(high); return b.toString(); } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ValueSetCheckerSimple.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ValueSetCheckerSimple.java index 8285a81ba..14b034793 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ValueSetCheckerSimple.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/ValueSetCheckerSimple.java @@ -142,6 +142,7 @@ public class ValueSetCheckerSimple extends ValueSetWorker implements ValueSetChe } } } + Coding foundCoding = null; if (valueset != null && options.getValueSetMode() != ValueSetMode.NO_MEMBERSHIP_CHECK) { Boolean result = false; for (Coding c : code.getCoding()) { @@ -150,6 +151,7 @@ public class ValueSetCheckerSimple extends ValueSetWorker implements ValueSetChe result = null; } else if (ok) { result = true; + foundCoding = c; } } if (result == null) { @@ -162,8 +164,10 @@ public class ValueSetCheckerSimple extends ValueSetWorker implements ValueSetChe return new ValidationResult(IssueSeverity.ERROR, errors.toString()); } else if (warnings.size() > 0) { return new ValidationResult(IssueSeverity.WARNING, warnings.toString()); - } else { - return new ValidationResult(IssueSeverity.INFORMATION, null); + } else { + ConceptDefinitionComponent cd = new ConceptDefinitionComponent(foundCoding.getCode()); + cd.setDisplay(foundCoding.getDisplay()); + return new ValidationResult(foundCoding.getSystem(), cd); } } From 0d0799318638a6f55794526abef42a45b87543cc Mon Sep 17 00:00:00 2001 From: dotasek Date: Wed, 5 Jan 2022 12:49:28 -0500 Subject: [PATCH 03/16] Add tests --- .../convertors/conv10_30/Bundle10_30Test.java | 35 +++++++++++++++++++ .../convertors/conv10_40/Bundle10_40Test.java | 34 ++++++++++++++++++ .../convertors/conv10_50/Bundle10_50Test.java | 34 ++++++++++++++++++ 3 files changed, 103 insertions(+) create mode 100644 org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/conv10_30/Bundle10_30Test.java create mode 100644 org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/conv10_40/Bundle10_40Test.java create mode 100644 org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/conv10_50/Bundle10_50Test.java diff --git a/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/conv10_30/Bundle10_30Test.java b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/conv10_30/Bundle10_30Test.java new file mode 100644 index 000000000..020257b87 --- /dev/null +++ b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/conv10_30/Bundle10_30Test.java @@ -0,0 +1,35 @@ +package org.hl7.fhir.convertors.conv10_30; + + +import org.hl7.fhir.convertors.factory.VersionConvertorFactory_10_30; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +import java.io.IOException; + +public class Bundle10_30Test { + + @Test + @DisplayName("Test 10_30 bundle conversion when resource is null") + public void testNoResourceBundleConversion() throws IOException { + org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent bec = new org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent() + .setRequest( + new org.hl7.fhir.dstu3.model.Bundle.BundleEntryRequestComponent() + .setMethod(org.hl7.fhir.dstu3.model.Bundle.HTTPVerb.DELETE) + .setUrl("Patient?identifier=123456") + ); + + org.hl7.fhir.dstu3.model.Bundle stu3Bundle = new org.hl7.fhir.dstu3.model.Bundle() + .addEntry(bec); + + org.hl7.fhir.dstu2.model.Resource dstu2Resource = VersionConvertorFactory_10_30.convertResource(stu3Bundle); + Assertions.assertNotNull(dstu2Resource); + Assertions.assertTrue(dstu2Resource instanceof org.hl7.fhir.dstu2.model.Bundle); + + org.hl7.fhir.dstu2.model.Bundle dstu2Bundle = (org.hl7.fhir.dstu2.model.Bundle) dstu2Resource; + Assertions.assertEquals(1, dstu2Bundle.getEntry().size()); + + Assertions.assertNull(dstu2Bundle.getEntry().get(0).getResource()); + } +} diff --git a/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/conv10_40/Bundle10_40Test.java b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/conv10_40/Bundle10_40Test.java new file mode 100644 index 000000000..c2e290d38 --- /dev/null +++ b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/conv10_40/Bundle10_40Test.java @@ -0,0 +1,34 @@ +package org.hl7.fhir.convertors.conv10_40; + +import org.hl7.fhir.convertors.factory.VersionConvertorFactory_10_40; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +import java.io.IOException; + +public class Bundle10_40Test { + + @Test + @DisplayName("Test 10_40 bundle conversion when resource is null") + public void testNoResourceBundleConversion() throws IOException { + org.hl7.fhir.r4.model.Bundle.BundleEntryComponent bec = new org.hl7.fhir.r4.model.Bundle.BundleEntryComponent() + .setRequest( + new org.hl7.fhir.r4.model.Bundle.BundleEntryRequestComponent() + .setMethod(org.hl7.fhir.r4.model.Bundle.HTTPVerb.DELETE) + .setUrl("Patient?identifier=123456") + ); + + org.hl7.fhir.r4.model.Bundle r4Bundle = new org.hl7.fhir.r4.model.Bundle() + .addEntry(bec); + + org.hl7.fhir.dstu2.model.Resource dstu2Resource = VersionConvertorFactory_10_40.convertResource(r4Bundle); + Assertions.assertNotNull(dstu2Resource); + Assertions.assertTrue(dstu2Resource instanceof org.hl7.fhir.dstu2.model.Bundle); + + org.hl7.fhir.dstu2.model.Bundle dstu2Bundle = (org.hl7.fhir.dstu2.model.Bundle) dstu2Resource; + Assertions.assertEquals(1, dstu2Bundle.getEntry().size()); + + Assertions.assertNull(dstu2Bundle.getEntry().get(0).getResource()); + } +} diff --git a/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/conv10_50/Bundle10_50Test.java b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/conv10_50/Bundle10_50Test.java new file mode 100644 index 000000000..5151c8ca7 --- /dev/null +++ b/org.hl7.fhir.convertors/src/test/java/org/hl7/fhir/convertors/conv10_50/Bundle10_50Test.java @@ -0,0 +1,34 @@ +package org.hl7.fhir.convertors.conv10_50; + +import org.hl7.fhir.convertors.factory.VersionConvertorFactory_10_50; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +import java.io.IOException; + +public class Bundle10_50Test { + + @Test + @DisplayName("Test 10_50 bundle conversion when resource is null") + public void testNoResourceBundleConversion() throws IOException { + org.hl7.fhir.r5.model.Bundle.BundleEntryComponent bec = new org.hl7.fhir.r5.model.Bundle.BundleEntryComponent() + .setRequest( + new org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent() + .setMethod(org.hl7.fhir.r5.model.Bundle.HTTPVerb.DELETE) + .setUrl("Patient?identifier=123456") + ); + + org.hl7.fhir.r5.model.Bundle r5Bundle = new org.hl7.fhir.r5.model.Bundle() + .addEntry(bec); + + org.hl7.fhir.dstu2.model.Resource dstu2Resource = VersionConvertorFactory_10_50.convertResource(r5Bundle); + Assertions.assertNotNull(dstu2Resource); + Assertions.assertTrue(dstu2Resource instanceof org.hl7.fhir.dstu2.model.Bundle); + + org.hl7.fhir.dstu2.model.Bundle dstu2Bundle = (org.hl7.fhir.dstu2.model.Bundle) dstu2Resource; + Assertions.assertEquals(1, dstu2Bundle.getEntry().size()); + + Assertions.assertNull(dstu2Bundle.getEntry().get(0).getResource()); + } +} From fb28de44776613325b9d197ad685a94dd2518880 Mon Sep 17 00:00:00 2001 From: dotasek Date: Fri, 7 Jan 2022 15:11:26 -0500 Subject: [PATCH 04/16] Update RELEASE_NOTES.md --- RELEASE_NOTES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index e69de29bb..9cecd303d 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -0,0 +1 @@ +* fix bug for NullPointerException in Bundle convertors when resource is not available. From 0bb4628f6b7e446218b85bae74b1e91bcf1200ad Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Mon, 10 Jan 2022 20:29:06 +1100 Subject: [PATCH 05/16] fix NPE in validator & rendering fixes: concept map display + name rendering issue for Med Resources + fix locale date issue --- .../fhir/r5/renderers/ConceptMapRenderer.java | 20 +- .../fhir/r5/renderers/ResourceRenderer.java | 3 +- .../r5/renderers/utils/ElementWrappers.java | 3 +- .../hl7/fhir/r5/utils/ResourceUtilities.java | 296 ++---------------- .../instance/InstanceValidator.java | 2 +- 5 files changed, 52 insertions(+), 272 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ConceptMapRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ConceptMapRenderer.java index 979817c28..c353e4ecf 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ConceptMapRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ConceptMapRenderer.java @@ -132,11 +132,25 @@ public class ConceptMapRenderer extends TerminologyRenderer { tr.td().b().tx("Destination Code"); if (comment) tr.td().b().tx("Comment"); + tr = tbl.tr(); + XhtmlNode td = tr.td().colspan(comment ? "4" : "3"); + td.tx("Mapping from "); + if (grp.hasSource()) { + renderCanonical(cm, td, grp.getSource()); + } else { + td.code("unspecified code system"); + } + td.tx(" to "); + if (grp.hasTarget()) { + renderCanonical(cm, td, grp.getTarget()); + } else { + td.code("unspecified code system"); + } for (SourceElementComponent ccl : grp.getElement()) { tr = tbl.tr(); - XhtmlNode td = tr.td(); + td = tr.td(); td.addText(ccl.getCode()); - display = getDisplayForConcept(systemFromCanonical(grp.getSource()), versionFromCanonical(grp.getSource()), ccl.getCode()); + display = ccl.hasDisplay() ? ccl.getDisplay() : getDisplayForConcept(systemFromCanonical(grp.getSource()), versionFromCanonical(grp.getSource()), ccl.getCode()); if (display != null && !isSameCodeAndDisplay(ccl.getCode(), display)) td.tx(" ("+display+")"); TargetElementComponent ccm = ccl.getTarget().get(0); @@ -152,7 +166,7 @@ public class ConceptMapRenderer extends TerminologyRenderer { } td = tr.td(); td.addText(ccm.getCode()); - display = getDisplayForConcept(systemFromCanonical(grp.getTarget()), versionFromCanonical(grp.getTarget()), ccm.getCode()); + display = ccm.hasDisplay() ? ccm.getDisplay() : getDisplayForConcept(systemFromCanonical(grp.getTarget()), versionFromCanonical(grp.getTarget()), ccm.getCode()); if (display != null && !isSameCodeAndDisplay(ccm.getCode(), display)) td.tx(" ("+display+")"); if (comment) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ResourceRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ResourceRenderer.java index 65f59608d..76da6f160 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ResourceRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ResourceRenderer.java @@ -158,9 +158,8 @@ public abstract class ResourceRenderer extends DataRenderer { if (target.hasUserData("path")) { x.ah(target.getUserString("path")).tx(cr.present()); } else { - url = url.substring(0, url.indexOf("|")); x.code().tx(url); - x.tx(": "+cr.present()); + x.tx(" ("+cr.present()+")"); } } } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/ElementWrappers.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/ElementWrappers.java index d9ab450b5..45a835ab8 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/ElementWrappers.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/ElementWrappers.java @@ -173,7 +173,8 @@ public class ElementWrappers { s = s + " " + family.getValues().get(0).primitiveValue().toUpperCase(); return s; } else { - throw new Error("Now what? ("+b.fhirType()+")"); + // well, we couldn't get a name from that + return null; } } return null; diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ResourceUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ResourceUtilities.java index 0cf3e1fa6..0bb1b67e4 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ResourceUtilities.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/ResourceUtilities.java @@ -31,10 +31,13 @@ package org.hl7.fhir.r5.utils; import java.util.List; +import java.util.Locale; +import java.util.Map; import org.hl7.fhir.r5.model.Bundle; import org.hl7.fhir.r5.model.Bundle.BundleEntryComponent; import org.hl7.fhir.r5.model.Bundle.BundleLinkComponent; +import org.hl7.fhir.r5.model.CanonicalResource; import org.hl7.fhir.r5.model.CodeableConcept; import org.hl7.fhir.r5.model.Coding; import org.hl7.fhir.r5.model.ContactPoint; @@ -61,6 +64,7 @@ import org.hl7.fhir.utilities.xhtml.XhtmlComposer; public class ResourceUtilities { public final static String FHIR_LANGUAGE = "urn:ietf:bcp:47"; + private static JurisdictionLocales jl = new JurisdictionLocales(); public static boolean isAnError(OperationOutcome error) { for (OperationOutcomeIssueComponent t : error.getIssue()) @@ -120,275 +124,37 @@ public class ResourceUtilities { resource.setMeta(new Meta()); return resource.getMeta(); } - -// public static String representDataElementCollection(IWorkerContext context, Bundle bundle, boolean profileLink, String linkBase) { -// StringBuilder b = new StringBuilder(); -// DataElement common = showDECHeader(b, bundle); -// b.append("\r\n"); -// List cols = chooseColumns(bundle, common, b, profileLink); -// for (BundleEntryComponent e : bundle.getEntry()) { -// DataElement de = (DataElement) e.getResource(); -// renderDE(de, cols, b, profileLink, linkBase); -// } -// b.append("
\r\n"); -// return b.toString(); -// } -// -// -// private static void renderDE(DataElement de, List cols, StringBuilder b, boolean profileLink, String linkBase) { -// b.append(""); -// for (String col : cols) { -// String v; -// ElementDefinition dee = de.getElement().get(0); -// if (col.equals("DataElement.name")) { -// v = de.hasName() ? Utilities.escapeXml(de.getName()) : ""; -// } else if (col.equals("DataElement.status")) { -// v = de.hasStatusElement() ? de.getStatusElement().asStringValue() : ""; -// } else if (col.equals("DataElement.code")) { -// v = renderCoding(dee.getCode()); -// } else if (col.equals("DataElement.type")) { -// v = dee.hasType() ? Utilities.escapeXml(dee.getType().get(0).getCode()) : ""; -// } else if (col.equals("DataElement.units")) { -// v = renderDEUnits(ToolingExtensions.getAllowedUnits(dee)); -// } else if (col.equals("DataElement.binding")) { -// v = renderBinding(dee.getBinding()); -// } else if (col.equals("DataElement.minValue")) { -// v = ToolingExtensions.hasExtension(de, "http://hl7.org/fhir/StructureDefinition/minValue") ? Utilities.escapeXml(ToolingExtensions.readPrimitiveExtension(de, "http://hl7.org/fhir/StructureDefinition/minValue").asStringValue()) : ""; -// } else if (col.equals("DataElement.maxValue")) { -// v = ToolingExtensions.hasExtension(de, "http://hl7.org/fhir/StructureDefinition/maxValue") ? Utilities.escapeXml(ToolingExtensions.readPrimitiveExtension(de, "http://hl7.org/fhir/StructureDefinition/maxValue").asStringValue()) : ""; -// } else if (col.equals("DataElement.maxLength")) { -// v = ToolingExtensions.hasExtension(de, "http://hl7.org/fhir/StructureDefinition/maxLength") ? Utilities.escapeXml(ToolingExtensions.readPrimitiveExtension(de, "http://hl7.org/fhir/StructureDefinition/maxLength").asStringValue()) : ""; -// } else if (col.equals("DataElement.mask")) { -// v = ToolingExtensions.hasExtension(de, "http://hl7.org/fhir/StructureDefinition/mask") ? Utilities.escapeXml(ToolingExtensions.readPrimitiveExtension(de, "http://hl7.org/fhir/StructureDefinition/mask").asStringValue()) : ""; -// } else -// throw new Error("Unknown column name: "+col); -// -// b.append(""+v+""); -// } -// if (profileLink) { -// b.append("Profile, CEM"); -// if (ToolingExtensions.hasExtension(de, ToolingExtensions.EXT_CIMI_REFERENCE)) -// b.append(", CIMI"); -// b.append(""); -// } -// b.append("\r\n"); -// } - - - private static String renderBinding(ElementDefinitionBindingComponent binding) { - // TODO Auto-generated method stub + public static Locale getLocale(CanonicalResource cr) { + return getLocale(cr.getLanguage(), cr.getJurisdiction()); + } + + public static Locale getLocale(String lang, List jurisdictions) { + if (lang != null && lang.contains("-")) { + return new Locale(lang); + } + for (CodeableConcept cc : jurisdictions) { + Locale locale = getLocale(lang, cc); + if (locale != null) { + return locale; + } + } return null; } - private static String renderDEUnits(DataType units) { - if (units == null || units.isEmpty()) - return ""; - if (units instanceof CodeableConcept) - return renderCodeable((CodeableConcept) units); - else - return ""+Utilities.escapeXml(((Reference) units).getReference())+""; - - } - private static String renderCodeable(CodeableConcept units) { - if (units == null || units.isEmpty()) - return ""; - String v = renderCoding(units.getCoding()); - if (units.hasText()) - v = v + " " +Utilities.escapeXml(units.getText()); - return v; - } - - private static String renderCoding(List codes) { - CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(); - for (Coding c : codes) - b.append(renderCoding(c)); - return b.toString(); - } - - private static String renderCoding(Coding code) { - if (code == null || code.isEmpty()) - return ""; - else - return ""+Utilities.escapeXml(code.getCode())+""; - } - -// private static List chooseColumns(Bundle bundle, DataElement common, StringBuilder b, boolean profileLink) { -// b.append(""); -// List results = new ArrayList(); -// results.add("DataElement.name"); -// b.append("Name"); -// if (!common.hasStatus()) { -// results.add("DataElement.status"); -// b.append("Status"); -// } -// if (hasCode(bundle)) { -// results.add("DataElement.code"); -// b.append("Code"); -// } -// if (!common.getElement().get(0).hasType() && hasType(bundle)) { -// results.add("DataElement.type"); -// b.append("Type"); -// } -// if (hasUnits(bundle)) { -// results.add("DataElement.units"); -// b.append("Units"); -// } -// if (hasBinding(bundle)) { -// results.add("DataElement.binding"); -// b.append("Binding"); -// } -// if (hasExtension(bundle, "http://hl7.org/fhir/StructureDefinition/minValue")) { -// results.add("DataElement.minValue"); -// b.append("Min Value"); -// } -// if (hasExtension(bundle, "http://hl7.org/fhir/StructureDefinition/maxValue")) { -// results.add("DataElement.maxValue"); -// b.append("Max Value"); -// } -// if (hasExtension(bundle, "http://hl7.org/fhir/StructureDefinition/maxLength")) { -// results.add("DataElement.maxLength"); -// b.append("Max Length"); -// } -// if (hasExtension(bundle, "http://hl7.org/fhir/StructureDefinition/mask")) { -// results.add("DataElement.mask"); -// b.append("Mask"); -// } -// if (profileLink) -// b.append("Links"); -// b.append("\r\n"); -// return results; -// } -// -// private static boolean hasExtension(Bundle bundle, String url) { -// for (BundleEntryComponent e : bundle.getEntry()) { -// DataElement de = (DataElement) e.getResource(); -// if (ToolingExtensions.hasExtension(de, url)) -// return true; -// } -// return false; -// } -// -// private static boolean hasBinding(Bundle bundle) { -// for (BundleEntryComponent e : bundle.getEntry()) { -// DataElement de = (DataElement) e.getResource(); -// if (de.getElement().get(0).hasBinding()) -// return true; -// } -// return false; -// } -// -// private static boolean hasCode(Bundle bundle) { -// for (BundleEntryComponent e : bundle.getEntry()) { -// DataElement de = (DataElement) e.getResource(); -// if (de.getElement().get(0).hasCode()) -// return true; -// } -// return false; -// } -// -// private static boolean hasType(Bundle bundle) { -// for (BundleEntryComponent e : bundle.getEntry()) { -// DataElement de = (DataElement) e.getResource(); -// if (de.getElement().get(0).hasType()) -// return true; -// } -// return false; -// } -// -// private static boolean hasUnits(Bundle bundle) { -// for (BundleEntryComponent e : bundle.getEntry()) { -// DataElement de = (DataElement) e.getResource(); -// if (ToolingExtensions.getAllowedUnits(de.getElement().get(0)) != null) -// return true; -// } -// return false; -// } -// -// private static DataElement showDECHeader(StringBuilder b, Bundle bundle) { -// DataElement meta = new DataElement(); -// DataElement prototype = (DataElement) bundle.getEntry().get(0).getResource(); -// meta.setPublisher(prototype.getPublisher()); -// meta.getContact().addAll(prototype.getContact()); -// meta.setStatus(prototype.getStatus()); -// meta.setDate(prototype.getDate()); -// meta.addElement().getType().addAll(prototype.getElement().get(0).getType()); -// -// for (BundleEntryComponent e : bundle.getEntry()) { -// DataElement de = (DataElement) e.getResource(); -// if (!Base.compareDeep(de.getPublisherElement(), meta.getPublisherElement(), false)) -// meta.setPublisherElement(null); -// if (!Base.compareDeep(de.getContact(), meta.getContact(), false)) -// meta.getContact().clear(); -// if (!Base.compareDeep(de.getStatusElement(), meta.getStatusElement(), false)) -// meta.setStatusElement(null); -// if (!Base.compareDeep(de.getDateElement(), meta.getDateElement(), false)) -// meta.setDateElement(null); -// if (!Base.compareDeep(de.getElement().get(0).getType(), meta.getElement().get(0).getType(), false)) -// meta.getElement().get(0).getType().clear(); -// } -// if (meta.hasPublisher() || meta.hasContact() || meta.hasStatus() || meta.hasDate() /* || meta.hasType() */) { -// b.append("\r\n"); -// if (meta.hasPublisher()) -// b.append("\r\n"); -// if (meta.hasContact()) { -// b.append("\r\n"); -// } -// if (meta.hasStatus()) -// b.append("\r\n"); -// if (meta.hasDate()) -// b.append("\r\n"); -// if (meta.getElement().get(0).hasType()) -// b.append("\r\n"); -// b.append("
Publisher:"+meta.getPublisher()+"
Contacts:"); -// boolean firsti = true; -// for (ContactDetail c : meta.getContact()) { -// if (firsti) -// firsti = false; -// else -// b.append("
"); -// if (c.hasName()) -// b.append(Utilities.escapeXml(c.getName())+": "); -// boolean first = true; -// for (ContactPoint cp : c.getTelecom()) { -// if (first) -// first = false; -// else -// b.append(", "); -// renderContactPoint(b, cp); -// } -// } -// b.append("
Status:"+meta.getStatus().toString()+"
Date:"+meta.getDateElement().asStringValue()+"
Type:"+renderType(meta.getElement().get(0).getType())+"
\r\n"); -// } -// return meta; -// } - - private static String renderType(List type) { - if (type == null || type.isEmpty()) - return ""; - CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(); - for (TypeRefComponent c : type) - b.append(renderType(c)); - return b.toString(); - } - - private static String renderType(TypeRefComponent type) { - if (type == null || type.isEmpty()) - return ""; - return type.getWorkingCode(); - } - - public static void renderContactPoint(StringBuilder b, ContactPoint cp) { - if (cp != null && !cp.isEmpty()) { - if (cp.getSystem() == ContactPointSystem.EMAIL) - b.append(""+cp.getValue()+""); - else if (cp.getSystem() == ContactPointSystem.FAX) - b.append("Fax: "+cp.getValue()); - else if (cp.getSystem() == ContactPointSystem.OTHER) - b.append(""+cp.getValue()+""); - else - b.append(cp.getValue()); + private static Locale getLocale(String lang, CodeableConcept cc) { + if (cc.hasCoding("http://unstats.un.org/unsd/methods/m49/m49.htm", "001")) { + return new Locale("en-US"); } - } + String c = cc.getCode("urn:iso:std:iso:3166:-2"); + String l = jl.get(c); + if (l == null) { + return null; + } else if (lang != null) { + return new Locale(lang+"-"+l.substring(l.indexOf("-")+1)); + } else { + return new Locale(l); + } + } } \ No newline at end of file diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java index 6b7cac727..38ec59016 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java @@ -4656,7 +4656,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat timeTracker.sd(t); trackUsage(profile, hostContext, element); if (rule(errors, IssueType.INVALID, element.line(), element.col(), stack.getLiteralPath(), - profile != null, I18nConstants.BUNDLE_BUNDLE_ENTRY_NOPROFILE_TYPE, special.toHuman(), resourceName)) { + profile != null, I18nConstants.BUNDLE_BUNDLE_ENTRY_NOPROFILE_TYPE, special == null ? "??" : special.toHuman(), resourceName)) { validateResource(hc, errors, resource, element, profile, idstatus, stack); } } else { From cec1a365ec4c34d55db56c7edc307db0813e6333 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Mon, 10 Jan 2022 20:50:19 +1100 Subject: [PATCH 06/16] add missing file --- .../fhir/r5/utils/JurisdictionLocales.java | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/JurisdictionLocales.java diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/JurisdictionLocales.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/JurisdictionLocales.java new file mode 100644 index 000000000..9bdf35c95 --- /dev/null +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/JurisdictionLocales.java @@ -0,0 +1,66 @@ +package org.hl7.fhir.r5.utils; + +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +/** + * This clas smaps between the jurisdictions defined for CanonicalResource.jurisdiction + * and Java Locale + * @author graha + * + */ + +public class JurisdictionLocales { + + private Map map = new HashMap<>(); + + public JurisdictionLocales() { + super(); + register(); + } + + private void register() { + register("USA", "US", "en-US"); + register("AUS", "AU", "en-AU"); + register("NZL", "NZ", "en-NZ"); + register("GBR", "GB", "en-GB"); + register("IND", "IN", "en-IN"); + + register("AUT", "AT", "de-AT"); + register("CHE", "CH", "de-CH"); + register("DEU", "DE", "de-DE"); + register("NOR", "NO", "no-NO"); + register("SWE", "SE", "sv-SE"); + register("FIN", "FI", "fi-FI"); + register("DNK", "DK", "da-DK"); + register("NLD", "NL", "nl-NL"); + register("BEL", "BE", "nl-BE"); // but will be fr-BE if lang is specified + register("FRA", "FR", "fr-FR"); + register("ITA", "IT", "it-IT"); + register("RUS", "RU", "ru-RU"); + + register("ESP", "ES", "es-ES"); + register("ARG", "AR", "es-AR"); + register("UGY", "UY", "es-UY"); + + register("PRT", "PT", "pt-PT"); + register("BRA", "BR", "pt-BR"); + + register("CHN", "CN", "zh-CN"); + register("TWN", "TW", "zh-TW"); + register("JPN", "JP", "ja-JP"); + register("KOR", "KR", "ko-KR"); + register("VNM", "VN", "vn-VN"); + } + + private void register(String code3, String code2, String locale) { + map.put(code3, locale); + map.put(code2, locale); + } + + public String get(String c) { + return map.get(c.toUpperCase()); + } + +} From d5e98dbf946c34659131d2b736637cc3c379d5f2 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Mon, 10 Jan 2022 23:03:35 +1100 Subject: [PATCH 07/16] fix snapshot build --- .../java/org/hl7/fhir/r4b/test/NarrativeGenerationTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.hl7.fhir.r4b/src/test/java/org/hl7/fhir/r4b/test/NarrativeGenerationTests.java b/org.hl7.fhir.r4b/src/test/java/org/hl7/fhir/r4b/test/NarrativeGenerationTests.java index 5b569a869..daffccc0d 100644 --- a/org.hl7.fhir.r4b/src/test/java/org/hl7/fhir/r4b/test/NarrativeGenerationTests.java +++ b/org.hl7.fhir.r4b/src/test/java/org/hl7/fhir/r4b/test/NarrativeGenerationTests.java @@ -106,7 +106,7 @@ public class NarrativeGenerationTests { } public static Stream data() throws ParserConfigurationException, IOException, FHIRFormatError, SAXException { - Document tests = XMLUtil.parseToDom(TestingUtilities.loadTestResource("r5", "narrative", "manifest.xml")); + Document tests = XMLUtil.parseToDom(TestingUtilities.loadTestResource("r4b", "narrative", "manifest.xml")); Element test = XMLUtil.getFirstChild(tests.getDocumentElement()); List objects = new ArrayList<>(); while (test != null && test.getNodeName().equals("test")) { From a50cbccc16ee583165355195b7a8458d37d44361 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Mon, 10 Jan 2022 23:46:41 +1100 Subject: [PATCH 08/16] update test case depedency --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4b883a295..59aa0f0bf 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ 5.1.0 - 1.1.84-SNAPSHOT + 1.1.85 5.7.1 1.7.1 3.0.0-M5 From 8931bb5165534f67c9bb5cb9e4116219c6e9612d Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Mon, 10 Jan 2022 23:49:03 +1100 Subject: [PATCH 09/16] get the version correct --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 59aa0f0bf..68f429785 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ 5.1.0 - 1.1.85 + 1.1.84 5.7.1 1.7.1 3.0.0-M5 From 6b5f43df9bae62f2d3c11bd90c5071c5bc99573b Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Tue, 11 Jan 2022 05:48:15 +1100 Subject: [PATCH 10/16] fix rendering problem --- .../main/java/org/hl7/fhir/r5/renderers/ConceptMapRenderer.java | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ConceptMapRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ConceptMapRenderer.java index c353e4ecf..03e220742 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ConceptMapRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ConceptMapRenderer.java @@ -59,7 +59,7 @@ public class ConceptMapRenderer extends TerminologyRenderer { p.addText(Utilities.capitalize(cm.getStatus().toString())+" (not intended for production usage). "); else p.addText(Utilities.capitalize(cm.getStatus().toString())+". "); - p.tx("Published on "+(cm.hasDate() ? cm.getDateElement().toHumanDisplay() : "?ngen-10?")+" by "+cm.getPublisher()); + p.tx("Published on "+(cm.hasDate() ? display(cm.getDateElement()) : "?ngen-10?")+" by "+cm.getPublisher()); if (!cm.getContact().isEmpty()) { p.tx(" ("); boolean firsti = true; diff --git a/pom.xml b/pom.xml index 68f429785..59aa0f0bf 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ 5.1.0 - 1.1.84 + 1.1.85 5.7.1 1.7.1 3.0.0-M5 From d5ed9eefbd6872db55b3fce38b5ec5f5c8d5558f Mon Sep 17 00:00:00 2001 From: Lloyd McKenzie Date: Mon, 10 Jan 2022 12:41:54 -0700 Subject: [PATCH 11/16] Fixed spacing with non-breaking spaces issue --- .../src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java index 626de3b84..dd2ede1eb 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java @@ -1181,7 +1181,7 @@ public class DataRenderer extends Renderer { String high = displayQuantity(q.getHigh()); if (high.isEmpty()) high = "?"; - b.append(low).append("\u00A0 to \u00A0").append(high); + b.append(low).append("\u00A0to\u00A0").append(high); return b.toString(); } From 48556bffa77fd612c69ab1feced8329aaec442f1 Mon Sep 17 00:00:00 2001 From: dotasek Date: Mon, 10 Jan 2022 16:14:19 -0500 Subject: [PATCH 12/16] Fix java locale backward compatibility --- RELEASE_NOTES.md | 1 + pom.xml | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 9cecd303d..64314d80a 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1 +1,2 @@ * fix bug for NullPointerException in Bundle convertors when resource is not available. +* fix Java locale backward compatibility in surefire \ No newline at end of file diff --git a/pom.xml b/pom.xml index 59aa0f0bf..fa300f1ff 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ 5.1.0 - 1.1.85 + 1.1.86-SNAPSHOT 5.7.1 1.7.1 3.0.0-M5 @@ -397,6 +397,9 @@ Surefire testing run. This may appear as an error in some IDEs, but it will run regardless. --> ${argLine} -Xmx4096m + + COMPAT + false org/hl7/fhir/validation/cli/** From cddfdc6d8b0170a8ce7a6ff0ecfcbd5a8b8799f7 Mon Sep 17 00:00:00 2001 From: dotasek Date: Mon, 10 Jan 2022 16:52:18 -0500 Subject: [PATCH 13/16] Update to released version of test case dependencies --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fa300f1ff..85607ce5b 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ 5.1.0 - 1.1.86-SNAPSHOT + 1.1.86 5.7.1 1.7.1 3.0.0-M5 From 8a933094b111195766e08a60d37f4338b421896d Mon Sep 17 00:00:00 2001 From: markiantorno Date: Mon, 10 Jan 2022 23:53:00 +0000 Subject: [PATCH 14/16] Release: v5.6.22 * fix bug for NullPointerException in Bundle convertors when resource is not available. * fix Java locale backward compatibility in surefire ***NO_CI*** --- org.hl7.fhir.convertors/pom.xml | 2 +- org.hl7.fhir.dstu2/pom.xml | 2 +- org.hl7.fhir.dstu2016may/pom.xml | 2 +- org.hl7.fhir.dstu3/pom.xml | 2 +- org.hl7.fhir.r4/pom.xml | 2 +- org.hl7.fhir.r4b/pom.xml | 2 +- org.hl7.fhir.r5/pom.xml | 2 +- org.hl7.fhir.report/pom.xml | 2 +- org.hl7.fhir.utilities/pom.xml | 2 +- org.hl7.fhir.validation.cli/pom.xml | 2 +- org.hl7.fhir.validation/pom.xml | 2 +- pom.xml | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/org.hl7.fhir.convertors/pom.xml b/org.hl7.fhir.convertors/pom.xml index fe2fefd13..ba296099c 100644 --- a/org.hl7.fhir.convertors/pom.xml +++ b/org.hl7.fhir.convertors/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 5.6.22-SNAPSHOT + 5.6.22 ../pom.xml diff --git a/org.hl7.fhir.dstu2/pom.xml b/org.hl7.fhir.dstu2/pom.xml index b5473f935..46977457a 100644 --- a/org.hl7.fhir.dstu2/pom.xml +++ b/org.hl7.fhir.dstu2/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 5.6.22-SNAPSHOT + 5.6.22 ../pom.xml diff --git a/org.hl7.fhir.dstu2016may/pom.xml b/org.hl7.fhir.dstu2016may/pom.xml index e0ab3176b..629e4131a 100644 --- a/org.hl7.fhir.dstu2016may/pom.xml +++ b/org.hl7.fhir.dstu2016may/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 5.6.22-SNAPSHOT + 5.6.22 ../pom.xml diff --git a/org.hl7.fhir.dstu3/pom.xml b/org.hl7.fhir.dstu3/pom.xml index c1c491d7f..c67d0447e 100644 --- a/org.hl7.fhir.dstu3/pom.xml +++ b/org.hl7.fhir.dstu3/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 5.6.22-SNAPSHOT + 5.6.22 ../pom.xml diff --git a/org.hl7.fhir.r4/pom.xml b/org.hl7.fhir.r4/pom.xml index 7c7757b95..5543278c2 100644 --- a/org.hl7.fhir.r4/pom.xml +++ b/org.hl7.fhir.r4/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 5.6.22-SNAPSHOT + 5.6.22 ../pom.xml diff --git a/org.hl7.fhir.r4b/pom.xml b/org.hl7.fhir.r4b/pom.xml index 07bacd12f..13ca7a81b 100644 --- a/org.hl7.fhir.r4b/pom.xml +++ b/org.hl7.fhir.r4b/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 5.6.22-SNAPSHOT + 5.6.22 ../pom.xml diff --git a/org.hl7.fhir.r5/pom.xml b/org.hl7.fhir.r5/pom.xml index bcec14682..fa756dfe5 100644 --- a/org.hl7.fhir.r5/pom.xml +++ b/org.hl7.fhir.r5/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 5.6.22-SNAPSHOT + 5.6.22 ../pom.xml diff --git a/org.hl7.fhir.report/pom.xml b/org.hl7.fhir.report/pom.xml index c50ac9144..a17807b76 100644 --- a/org.hl7.fhir.report/pom.xml +++ b/org.hl7.fhir.report/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 5.6.22-SNAPSHOT + 5.6.22 ../pom.xml diff --git a/org.hl7.fhir.utilities/pom.xml b/org.hl7.fhir.utilities/pom.xml index 0446788d4..395964858 100644 --- a/org.hl7.fhir.utilities/pom.xml +++ b/org.hl7.fhir.utilities/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 5.6.22-SNAPSHOT + 5.6.22 ../pom.xml diff --git a/org.hl7.fhir.validation.cli/pom.xml b/org.hl7.fhir.validation.cli/pom.xml index 5b8cf5931..5d2dee9a6 100644 --- a/org.hl7.fhir.validation.cli/pom.xml +++ b/org.hl7.fhir.validation.cli/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 5.6.22-SNAPSHOT + 5.6.22 ../pom.xml diff --git a/org.hl7.fhir.validation/pom.xml b/org.hl7.fhir.validation/pom.xml index fb550f976..a09d5edd1 100644 --- a/org.hl7.fhir.validation/pom.xml +++ b/org.hl7.fhir.validation/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 5.6.22-SNAPSHOT + 5.6.22 ../pom.xml diff --git a/pom.xml b/pom.xml index 85607ce5b..d4d7f93ab 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ HAPI FHIR --> org.hl7.fhir.core - 5.6.22-SNAPSHOT + 5.6.22 pom From b08691b42547876a00790e283545b22741abefba Mon Sep 17 00:00:00 2001 From: markiantorno Date: Tue, 11 Jan 2022 00:07:58 +0000 Subject: [PATCH 15/16] Updating version to: 5.6.23-SNAPSHOT and incrementing test cases dependency. --- RELEASE_NOTES.md | 2 -- org.hl7.fhir.convertors/pom.xml | 2 +- org.hl7.fhir.dstu2/pom.xml | 2 +- org.hl7.fhir.dstu2016may/pom.xml | 2 +- org.hl7.fhir.dstu3/pom.xml | 2 +- org.hl7.fhir.r4/pom.xml | 2 +- org.hl7.fhir.r4b/pom.xml | 2 +- org.hl7.fhir.r5/pom.xml | 2 +- org.hl7.fhir.report/pom.xml | 2 +- org.hl7.fhir.utilities/pom.xml | 2 +- org.hl7.fhir.validation.cli/pom.xml | 2 +- org.hl7.fhir.validation/pom.xml | 2 +- pom.xml | 2 +- 13 files changed, 12 insertions(+), 14 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 64314d80a..e69de29bb 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,2 +0,0 @@ -* fix bug for NullPointerException in Bundle convertors when resource is not available. -* fix Java locale backward compatibility in surefire \ No newline at end of file diff --git a/org.hl7.fhir.convertors/pom.xml b/org.hl7.fhir.convertors/pom.xml index ba296099c..fc15d9701 100644 --- a/org.hl7.fhir.convertors/pom.xml +++ b/org.hl7.fhir.convertors/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 5.6.22 + 5.6.23-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu2/pom.xml b/org.hl7.fhir.dstu2/pom.xml index 46977457a..88cea202f 100644 --- a/org.hl7.fhir.dstu2/pom.xml +++ b/org.hl7.fhir.dstu2/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 5.6.22 + 5.6.23-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu2016may/pom.xml b/org.hl7.fhir.dstu2016may/pom.xml index 629e4131a..8da34a0b2 100644 --- a/org.hl7.fhir.dstu2016may/pom.xml +++ b/org.hl7.fhir.dstu2016may/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 5.6.22 + 5.6.23-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.dstu3/pom.xml b/org.hl7.fhir.dstu3/pom.xml index c67d0447e..4491984ae 100644 --- a/org.hl7.fhir.dstu3/pom.xml +++ b/org.hl7.fhir.dstu3/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 5.6.22 + 5.6.23-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.r4/pom.xml b/org.hl7.fhir.r4/pom.xml index 5543278c2..7fab0b11d 100644 --- a/org.hl7.fhir.r4/pom.xml +++ b/org.hl7.fhir.r4/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 5.6.22 + 5.6.23-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.r4b/pom.xml b/org.hl7.fhir.r4b/pom.xml index 13ca7a81b..b9cbdd108 100644 --- a/org.hl7.fhir.r4b/pom.xml +++ b/org.hl7.fhir.r4b/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 5.6.22 + 5.6.23-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.r5/pom.xml b/org.hl7.fhir.r5/pom.xml index fa756dfe5..a2fed4045 100644 --- a/org.hl7.fhir.r5/pom.xml +++ b/org.hl7.fhir.r5/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 5.6.22 + 5.6.23-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.report/pom.xml b/org.hl7.fhir.report/pom.xml index a17807b76..e16b1fb06 100644 --- a/org.hl7.fhir.report/pom.xml +++ b/org.hl7.fhir.report/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 5.6.22 + 5.6.23-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.utilities/pom.xml b/org.hl7.fhir.utilities/pom.xml index 395964858..2aaa93f4c 100644 --- a/org.hl7.fhir.utilities/pom.xml +++ b/org.hl7.fhir.utilities/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 5.6.22 + 5.6.23-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.validation.cli/pom.xml b/org.hl7.fhir.validation.cli/pom.xml index 5d2dee9a6..78d411504 100644 --- a/org.hl7.fhir.validation.cli/pom.xml +++ b/org.hl7.fhir.validation.cli/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 5.6.22 + 5.6.23-SNAPSHOT ../pom.xml diff --git a/org.hl7.fhir.validation/pom.xml b/org.hl7.fhir.validation/pom.xml index a09d5edd1..bdb31ba9f 100644 --- a/org.hl7.fhir.validation/pom.xml +++ b/org.hl7.fhir.validation/pom.xml @@ -5,7 +5,7 @@ ca.uhn.hapi.fhir org.hl7.fhir.core - 5.6.22 + 5.6.23-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index d4d7f93ab..1d1166222 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ HAPI FHIR --> org.hl7.fhir.core - 5.6.22 + 5.6.23-SNAPSHOT pom From 3a98e0b5facef16084d1580f8c70f6ec9dbb75fd Mon Sep 17 00:00:00 2001 From: Lloyd McKenzie Date: Tue, 11 Jan 2022 08:24:33 -0700 Subject: [PATCH 16/16] Add code system if no unit and not UCUM. --- .../java/org/hl7/fhir/r5/renderers/DataRenderer.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java index dd2ede1eb..db77f5ba3 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java @@ -1160,8 +1160,13 @@ public class DataRenderer extends Renderer { } if (q.hasUnit()) x.tx(" "+q.getUnit()); - else if (q.hasCode()) - x.tx(" "+q.getCode()); + else if (q.hasCode() && q.hasSystem()) { + // if there's a code there *shall* be a system, so if we've got one and not the other, things are invalid and we won't bother trying to render + if (q.hasSystem() && q.getSystem().equals("http://unitsofmeasure.org")) + x.tx(" "+q.getCode()); + else + x.tx("(unit "+q.getCode()+" from "+q.getSystem()+")"); + } if (showCodeDetails && q.hasCode()) { x.span("background: LightGoldenRodYellow", null).tx(" (Details: "+TerminologyRenderer.describeSystem(q.getSystem())+" code "+q.getCode()+" = '"+lookupCode(q.getSystem(), null, q.getCode())+"')"); }