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 ce706d0fe..5cba7179a 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 @@ -71,6 +71,11 @@ public class VersionUtilities { if (isR4Ver(v)) { return "hl7.fhir.r4.core"; } + + if (isR4BVer(v)) { + return "hl7.fhir.r4b.core"; + } + if ("current".equals(v)) { return "hl7.fhir.r5.core"; } @@ -122,17 +127,21 @@ public class VersionUtilities { } public static boolean isSupportedVersion(String version) { - return Utilities.existsInList(version, "1.0.2", "1.4.0", "3.0.2", "4.0.1", CURRENT_FULL_VERSION); + return Utilities.existsInList(version, "1.0.2", "1.4.0", "3.0.2", "4.0.1", "4.1.0", CURRENT_FULL_VERSION); } public static String listSupportedVersions() { - return "1.0.2, 1.4.0, 3.0.2, 4.0.1, "+CURRENT_FULL_VERSION; + return "1.0.2, 1.4.0, 3.0.2, 4.0.1, 4.1.0, "+CURRENT_FULL_VERSION; } public static boolean isR5Ver(String ver) { return ver != null && ver.startsWith(CURRENT_VERSION); } + public static boolean isR4BVer(String ver) { + return ver != null && ver.startsWith("4.1"); + } + public static boolean isR4Ver(String ver) { return ver != null && ver.startsWith("4.0"); } diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/NpmPackage.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/NpmPackage.java index 310872d96..ae3bc4039 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/NpmPackage.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/NpmPackage.java @@ -719,7 +719,8 @@ public class NpmPackage { public String fhirVersion() { if ("hl7.fhir.core".equals(JSONUtil.str(npm, "name"))) return JSONUtil.str(npm, "version"); - else if (JSONUtil.str(npm, "name").startsWith("hl7.fhir.r2.") || JSONUtil.str(npm, "name").startsWith("hl7.fhir.r2b.") || JSONUtil.str(npm, "name").startsWith("hl7.fhir.r3.") || JSONUtil.str(npm, "name").startsWith("hl7.fhir.r4.") || JSONUtil.str(npm, "name").startsWith("hl7.fhir.r5.")) + else if (JSONUtil.str(npm, "name").startsWith("hl7.fhir.r2.") || JSONUtil.str(npm, "name").startsWith("hl7.fhir.r2b.") || JSONUtil.str(npm, "name").startsWith("hl7.fhir.r3.") || + JSONUtil.str(npm, "name").startsWith("hl7.fhir.r4.") || JSONUtil.str(npm, "name").startsWith("hl7.fhir.r4b.") || JSONUtil.str(npm, "name").startsWith("hl7.fhir.r5.")) return JSONUtil.str(npm, "version"); else { JsonObject dep = npm.getAsJsonObject("dependencies");