Package org.ehrbase.service
Class KnowledgeCacheService
- java.lang.Object
-
- org.ehrbase.service.KnowledgeCacheService
-
- All Implemented Interfaces:
I_KnowledgeCache,IntrospectService
@Service public class KnowledgeCacheService extends Object implements I_KnowledgeCache, IntrospectService
Look up and caching for archetypes, openEHR showTemplates and Operational Templates. Search in path defined as- 1. System environment ETHERCIS_ARCHETYPE_DIR, ETHERCIS_TEMPLATE_DIR, ETHERCIS_OPT_DIR
- 2. Application path %USER_HOME%/.ethercis/archetype, %USER_HOME%/.ethercis/template, %USER_HOME%/.ethercis/opt
- 3. User can also include a source directory by invoking addXYZPath method
The resources extensions are defined by the following default:
- ADL: archetype
- OET: openehr template
- OPT: operational template
- Author:
- C. Chevalley
-
-
Field Summary
-
Fields inherited from interface org.ehrbase.ehr.knowledge.I_KnowledgeCache
TEMPLATE_ID
-
-
Constructor Summary
Constructors Constructor Description KnowledgeCacheService(TemplateStorage templateStorage, javax.cache.CacheManager cacheManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringaddOperationalTemplate(byte[] content)Adds operational template to system and also in current cache.voidcloseCache()I_KnowledgeCachegetKnowledge()I_QueryOptMetaDatagetQueryOptMetaData(String templateId)I_QueryOptMetaDatagetQueryOptMetaData(UUID uuid)List<TemplateMetaData>listAllOperationalTemplates()Optional<OPERATIONALTEMPLATE>retrieveOperationalTemplate(String key)retrieve an operational template document instanceOptional<OPERATIONALTEMPLATE>retrieveOperationalTemplate(UUID uuid)retrieve a cached operational template document instance using its unique Id
-
-
-
Constructor Detail
-
KnowledgeCacheService
@Autowired public KnowledgeCacheService(@Qualifier("templateDBStorageService") TemplateStorage templateStorage, javax.cache.CacheManager cacheManager)
-
-
Method Detail
-
closeCache
@PreDestroy public void closeCache()
-
addOperationalTemplate
public String addOperationalTemplate(byte[] content)
Description copied from interface:I_KnowledgeCacheAdds operational template to system and also in current cache.- Specified by:
addOperationalTemplatein interfaceI_KnowledgeCache- Parameters:
content- operational template input- Returns:
- resulting template ID, when successful
-
listAllOperationalTemplates
public List<TemplateMetaData> listAllOperationalTemplates()
- Specified by:
listAllOperationalTemplatesin interfaceI_KnowledgeCache
-
retrieveOperationalTemplate
public Optional<OPERATIONALTEMPLATE> retrieveOperationalTemplate(String key)
Description copied from interface:I_KnowledgeCacheretrieve an operational template document instance- Specified by:
retrieveOperationalTemplatein interfaceI_KnowledgeCache- Parameters:
key- the name of the operational template- Returns:
- an OPERATIONALTEMPLATE document instance or null
- See Also:
OPERATIONALTEMPLATE
-
retrieveOperationalTemplate
public Optional<OPERATIONALTEMPLATE> retrieveOperationalTemplate(UUID uuid)
Description copied from interface:I_KnowledgeCacheretrieve a cached operational template document instance using its unique Id- Specified by:
retrieveOperationalTemplatein interfaceI_KnowledgeCache- Parameters:
uuid- the name of the operational template- Returns:
- an OPERATIONALTEMPLATE document instance or null
- See Also:
OPERATIONALTEMPLATE
-
getQueryOptMetaData
public I_QueryOptMetaData getQueryOptMetaData(UUID uuid)
- Specified by:
getQueryOptMetaDatain interfaceIntrospectService
-
getQueryOptMetaData
public I_QueryOptMetaData getQueryOptMetaData(String templateId)
- Specified by:
getQueryOptMetaDatain interfaceIntrospectService
-
getKnowledge
public I_KnowledgeCache getKnowledge()
- Specified by:
getKnowledgein interfaceIntrospectService
-
-