From dd5f204797cb66bf3dbbb32d44c171ccdfd705e8 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Tue, 16 Nov 2021 17:24:35 +1100 Subject: [PATCH] fix fragile handling of URLs in XVerExtensionManager --- .../java/org/hl7/fhir/r5/utils/XVerExtensionManager.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/XVerExtensionManager.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/XVerExtensionManager.java index 6ddc0c527..6da8f1cbe 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/XVerExtensionManager.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/XVerExtensionManager.java @@ -40,7 +40,15 @@ public class XVerExtensionManager { this.context = context; } + public boolean isR5(String url) { + String v = url.substring(20, 23); + return "5.0".equals(v); + } + public XVerExtensionStatus status(String url) throws FHIRException { + if (url.length() < 24) { + return XVerExtensionStatus.Invalid; + } String v = url.substring(20, 23); if ("5.0".equals(v)) { v = "4.6"; // for now