Add support for removing code systems from the cache

This commit is contained in:
Grahame Grieve 2020-06-18 08:46:01 +10:00
parent 93b0d74eb5
commit 6a6f6e6167
2 changed files with 14 additions and 0 deletions

View File

@ -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<ConceptMap> findMapsForSource(String url) throws FHIRException {
synchronized (lock) {

View File

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