Add support for R4B

This commit is contained in:
Grahame Grieve 2021-06-24 21:47:06 +10:00
parent 9862f0a390
commit 54f085545d
2 changed files with 13 additions and 3 deletions

View File

@ -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");
}

View File

@ -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");