diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/BaseWorkerContext.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/BaseWorkerContext.java index 9e26d2305..4bcbf8466 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/BaseWorkerContext.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/BaseWorkerContext.java @@ -773,6 +773,11 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte txCache = new TerminologyCache(lock, cachePath); } + public void clearTSCache(String url) throws Exception { + txCache.removeCS(url); + } + + @Override public List findMapsForSource(String url) throws FHIRException { synchronized (lock) { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TerminologyCache.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TerminologyCache.java index 1608323e2..536fd4995 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TerminologyCache.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TerminologyCache.java @@ -460,6 +460,15 @@ public class TerminologyCache { public static void setNoCaching(boolean noCaching) { TerminologyCache.noCaching = noCaching; } + + public void removeCS(String url) { + synchronized (lock) { + String name = getNameForSystem(url); + if (caches.containsKey(name)) { + caches.remove(name); + } + } + } } \ No newline at end of file