Package org.ehrbase.service
Class TemplateDBStorageService
java.lang.Object
org.ehrbase.service.TemplateDBStorageService
- All Implemented Interfaces:
TemplateStorage
@Service
@Transactional
public class TemplateDBStorageService
extends Object
implements TemplateStorage
-
Constructor Summary
ConstructorsConstructorDescriptionTemplateDBStorageService(org.jooq.DSLContext context, ServerConfig serverConfig) -
Method Summary
Modifier and TypeMethodDescriptionintadminDeleteAllTemplates(List<TemplateMetaData> templateMetaDataList) Removes all templates from template storage and returns the number of deleted entries.adminUpdateTemplate(org.openehr.schemas.v1.OPERATIONALTEMPLATE template) Replaces the content of an existing template with the same id as in the provided template with the new content from provided one.booleandeleteTemplate(String templateId) Deletes an operational template from template storage.Find all templates ids in the store;protected I_DomainAccessList all Templates in the store;Optional<org.openehr.schemas.v1.OPERATIONALTEMPLATE>readOperationaltemplate(String templateId) Find and return a saved Template by templateIdvoidstoreTemplate(org.openehr.schemas.v1.OPERATIONALTEMPLATE template, Short sysTenant) Save a template in the store
-
Constructor Details
-
TemplateDBStorageService
-
-
Method Details
-
listAllOperationalTemplates
Description copied from interface:TemplateStorageList all Templates in the store;- Specified by:
listAllOperationalTemplatesin interfaceTemplateStorage- Returns:
-
findAllTemplateIds
Description copied from interface:TemplateStorageFind all templates ids in the store;- Specified by:
findAllTemplateIdsin interfaceTemplateStorage- Returns:
- the list of template ids
-
storeTemplate
Description copied from interface:TemplateStorageSave a template in the store- Specified by:
storeTemplatein interfaceTemplateStorage
-
readOperationaltemplate
public Optional<org.openehr.schemas.v1.OPERATIONALTEMPLATE> readOperationaltemplate(String templateId) Description copied from interface:TemplateStorageFind and return a saved Template by templateId- Specified by:
readOperationaltemplatein interfaceTemplateStorage- Returns:
- the template @see
OPERATIONALTEMPLATEorOptional.empty()if not found.
-
adminUpdateTemplate
Replaces the content of an existing template with the same id as in the provided template with the new content from provided one. Check that the old template is no longer referenced to avoid data inconsistencies- Specified by:
adminUpdateTemplatein interfaceTemplateStorage- Parameters:
template- - Template with new data and id of target to be replaced- Returns:
- - XML content of the updated template
-
deleteTemplate
Deletes an operational template from template storage. The template will be removed physically so ensure that there are no compositions referencing the template.- Specified by:
deleteTemplatein interfaceTemplateStorage- Parameters:
templateId- - Template id to delete from storage, e.g. "IDCR Allergies List.v0"- Returns:
- - Deletion was successful or not
-
adminDeleteAllTemplates
Removes all templates from template storage and returns the number of deleted entries.- Specified by:
adminDeleteAllTemplatesin interfaceTemplateStorage- Returns:
- - Count of deleted templates
-
getDataAccess
-