Class CodeSystemsCache
- java.lang.Object
-
- com.ibm.fhir.persistence.jdbc.util.CodeSystemsCache
-
public class CodeSystemsCache extends Object
This class provides a static cache for FHIR Systems that are part of Token type Search parameters.
-
-
Constructor Summary
Constructors Constructor Description CodeSystemsCache()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
dumpCacheContents()
static String
getCacheNameForTenantDatastore()
Returns a String containing a combination of the current tenantId and datastoreId.static Integer
getCodeSystemId(String systemName)
Retrieves the id for the passed system, for the current tenant-datastore.static boolean
isEnabled()
static void
putCodeSystemId(String tenantDatastoreCacheName, String systemName, Integer systemId)
Adds the passed code system name and id to the current tenant-datastore cache.static void
putCodeSystemIds(String tenantDatastoreCacheName, Map<String,Integer> newCodeSystems)
Adds the passed code system name/id pairs to the the current tenant-datastore cache.static String
reportCacheDiscrepancies(ParameterDAO dao)
Determines and reports any discrepancies between the current thread's Code Systems cache and the contents of the database CODE_SYSTEMS table.static void
setEnabled(boolean newEnabled)
-
-
-
Method Detail
-
getCodeSystemId
public static Integer getCodeSystemId(String systemName)
Retrieves the id for the passed system, for the current tenant-datastore. If not found, null is returned.- Parameters:
parameter
- The name of a code system- Returns:
- Integer The id corresponding to the passed code system
-
putCodeSystemId
public static void putCodeSystemId(String tenantDatastoreCacheName, String systemName, Integer systemId)
Adds the passed code system name and id to the current tenant-datastore cache.- Parameters:
tenantDatastoreCacheName
- The name of the datastore-specific cache the entry should be added to.systemName
- A valid code system name.systemId
- The id associated with the passed code system name.
-
putCodeSystemIds
public static void putCodeSystemIds(String tenantDatastoreCacheName, Map<String,Integer> newCodeSystems)
Adds the passed code system name/id pairs to the the current tenant-datastore cache.- Parameters:
tenantDatastoreCacheName
- The name of the datastore-specific cache the entry should be added to.newParameters
- A Map containing code system name/id pairs.
-
getCacheNameForTenantDatastore
public static String getCacheNameForTenantDatastore()
Returns a String containing a combination of the current tenantId and datastoreId.- Returns:
-
dumpCacheContents
public static String dumpCacheContents()
- Returns:
- String - A formatted representation of the entire cache managed by this class.
-
reportCacheDiscrepancies
public static String reportCacheDiscrepancies(ParameterDAO dao)
Determines and reports any discrepancies between the current thread's Code Systems cache and the contents of the database CODE_SYSTEMS table.- Parameters:
dao
- A Parameter DAO instance- Returns:
- String - A report detailing cache/db discrepancies.
-
isEnabled
public static boolean isEnabled()
-
setEnabled
public static void setEnabled(boolean newEnabled)
-
-