Package org.ehrbase.service
Interface TemplateStorage
- All Known Implementing Classes:
TemplateDBStorageService
public interface TemplateStorage
-
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;findUuidByTemplateId(String templateId) List 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
-
Method Details
-
listAllOperationalTemplates
List<TemplateMetaData> listAllOperationalTemplates()List all Templates in the store;- Returns:
-
findAllTemplateIds
Find all templates ids in the store;- Returns:
- the list of template ids
-
findUuidByTemplateId
-
storeTemplate
Save a template in the store- Parameters:
template-- Throws:
RuntimeException- template Id or uuid are not unique
-
readOperationalTemplate
Find and return a saved Template by templateId- Parameters:
templateId-- 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- 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.- 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.- Returns:
- - Count of deleted templates
-