From a6ba8fd67a540ceed9314dac3880b1c2ee4d42ae Mon Sep 17 00:00:00 2001 From: Hank Yang <61555885+Hankych@users.noreply.github.com> Date: Mon, 7 Nov 2022 11:59:33 -0500 Subject: [PATCH 1/2] Fixed HL7 Validator CLI Jurisdiction Output (#980) * Failing test * Fixed breaking jurisdiction test Co-authored-by: dotasek --- .../terminologies/JurisdictionUtilities.java | 2 +- .../JurisdictionUtilitiesTests.java | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/terminology/JurisdictionUtilitiesTests.java diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/JurisdictionUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/JurisdictionUtilities.java index 3c4529739..862312517 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/JurisdictionUtilities.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/JurisdictionUtilities.java @@ -57,7 +57,7 @@ public class JurisdictionUtilities { } public static String displayJurisdiction(String s) { - return displayJurisdiction(CodeSystemUtilities.readCoding(getJurisdictionFromLocale(s))); + return displayJurisdiction(CodeSystemUtilities.readCoding(s)); } public static String displayJurisdiction(Coding c) { diff --git a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/terminology/JurisdictionUtilitiesTests.java b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/terminology/JurisdictionUtilitiesTests.java new file mode 100644 index 000000000..ba56053ec --- /dev/null +++ b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/terminology/JurisdictionUtilitiesTests.java @@ -0,0 +1,24 @@ +package org.hl7.fhir.r5.terminology; + +import org.hl7.fhir.r5.terminologies.JurisdictionUtilities; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class JurisdictionUtilitiesTests { + + @ParameterizedTest + @CsvSource({ + "uv,Global (Whole world)", + "world,Global (Whole world)", + "global,Global (Whole world)", + "ar,Argentina", + "bf,Burkina Faso" + }) + void testDisplayJurisdiction(String cliString, String expectedDisplayString) { + final String jurisdiction = JurisdictionUtilities.getJurisdictionFromLocale(cliString); + + assertEquals(expectedDisplayString, JurisdictionUtilities.displayJurisdiction(jurisdiction)); + } +} From 10d104d2f63a0aaf294b807700eb7e27259a9adb Mon Sep 17 00:00:00 2001 From: dotasek Date: Mon, 7 Nov 2022 16:09:10 -0500 Subject: [PATCH 2/2] Add setExtensions method (#981) * Add setExtensions method * Add jsonproperty for setExtensions Co-authored-by: dotasek --- .../java/org/hl7/fhir/validation/cli/model/CliContext.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/model/CliContext.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/model/CliContext.java index cb7350579..817ac0d39 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/model/CliContext.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/model/CliContext.java @@ -209,6 +209,12 @@ public class CliContext { return extensions; } + @JsonProperty("extensions") + public CliContext setExtensions(List extensions) { + this.extensions = extensions; + return this; + } + @JsonProperty("hintAboutNonMustSupport") public boolean isHintAboutNonMustSupport() { return hintAboutNonMustSupport;