From ebedced511b3c065fb42892ff0780595dec8ab6e Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 13 Jun 2024 12:12:13 +1000 Subject: [PATCH] don't reload different sub-version of extensions pack --- .../hl7/fhir/r5/context/SimpleWorkerContext.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/SimpleWorkerContext.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/SimpleWorkerContext.java index 0b09ee369..e60feb7c4 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/SimpleWorkerContext.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/SimpleWorkerContext.java @@ -806,7 +806,21 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon } public boolean hasPackage(String idAndver) { - return loadedPackages.contains(idAndver); + if (loadedPackages.contains(idAndver)) { + return true; + } + // not clear whether the same logic should apply to other cross-version packages? + if (idAndver.startsWith("hl7.fhir.uv.extensions")) { + String v = idAndver.substring(idAndver.lastIndexOf("#")+1); + for (String s : loadedPackages) { + String v2 = s.substring(s.lastIndexOf("#")+1); + if (s.startsWith("hl7.fhir.uv.extensions.") && VersionUtilities.versionsMatch(v, v2)) { + return true; + } + } + } + return false; + } @Override