Package ca.uhn.fhir.jpa.dao.mdm
Class MdmExpansionCacheSvc
java.lang.Object
ca.uhn.fhir.jpa.dao.mdm.MdmExpansionCacheSvc
The purpose of this class is to share context between steps of a given GroupBulkExport job.
This cache allows you to port state between reader/processor/writer. In this case, we are maintaining
a cache of Source Resource ID -> Golden Resource ID, so that we can annotate outgoing resources with their golden owner
if applicable.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuildLogMessage
(String message, boolean theAddCacheContentContent) Builds a log message, potentially enriched with the cache content.getGoldenResourceId
(String theSourceId) Lookup a given resource's golden resource ID in the cache.boolean
Since this cache is used at @JobScope, we can skip a whole whack of expansions happening by simply checking if one of our child steps has populated the cache yet.void
setCacheContents
(Map<String, String> theSourceResourceIdToGoldenResourceIdMap) Populate the cache
-
Constructor Details
-
MdmExpansionCacheSvc
public MdmExpansionCacheSvc()
-
-
Method Details
-
getGoldenResourceId
Lookup a given resource's golden resource ID in the cache. Note that if you pass this function the resource ID of a golden resource, it will just return itself.- Parameters:
theSourceId
- the resource ID of the source resource ,e.g. PAT123- Returns:
- the resource ID of the associated golden resource.
-
buildLogMessage
Builds a log message, potentially enriched with the cache content.- Parameters:
message
- The log messagetheAddCacheContentContent
- If true, will annotate the log message with the current cache contents.- Returns:
- a built log message, which may include the cache content.
-
setCacheContents
Populate the cache- Parameters:
theSourceResourceIdToGoldenResourceIdMap
- the source ID -> golden ID map to populate the cache with.
-
hasBeenPopulated
Since this cache is used at @JobScope, we can skip a whole whack of expansions happening by simply checking if one of our child steps has populated the cache yet. .
-