Package org.ehrbase.api.service
Interface TemplateService
-
- All Superinterfaces:
BaseService
public interface TemplateService extends BaseService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intadminDeleteAllTemplates()Deletes all templates from target template storage and returns the number of deleted templates.booleanadminDeleteTemplate(String templateId)Deletes a given template from storage physically.StringadminUpdateTemplate(String templateId, String content)Replaces a given template in the storage and updates the cache with the new template content.org.ehrbase.response.ehrscape.StructuredStringbuildExample(String templateId, org.ehrbase.response.ehrscape.CompositionFormat format)Stringcreate(String content)StringfindOperationalTemplate(String templateId, OperationalTemplateFormat format)Finds and returns the given operational template as string represented in requested format.org.ehrbase.webtemplate.model.WebTemplatefindTemplate(String templateId)List<org.ehrbase.response.ehrscape.TemplateMetaDataDto>getAllTemplates()-
Methods inherited from interface org.ehrbase.api.service.BaseService
getServerConfig, getSystemUuid
-
-
-
-
Method Detail
-
getAllTemplates
List<org.ehrbase.response.ehrscape.TemplateMetaDataDto> getAllTemplates()
-
buildExample
org.ehrbase.response.ehrscape.StructuredString buildExample(String templateId, org.ehrbase.response.ehrscape.CompositionFormat format)
-
findTemplate
org.ehrbase.webtemplate.model.WebTemplate findTemplate(String templateId)
-
findOperationalTemplate
String findOperationalTemplate(String templateId, OperationalTemplateFormat format) throws RuntimeException
Finds and returns the given operational template as string represented in requested format.- Parameters:
templateId- - Unique name of operational templateformat- - As enum value fromOperationalTemplateFormat- Returns:
- Throws:
RuntimeException- When the template couldn't be found, the format isn't support or in case of another error.
-
adminDeleteTemplate
boolean adminDeleteTemplate(String templateId)
Deletes a given template from storage physically. The template is no longer available. If you try to delete a template that is used in at least one Composition Entry or in one history entry the deletion will be rejected.- Parameters:
templateId- - Template id to delete, e.g. "IDCR Allergies List.v0"- Returns:
- - Whether the template could be removed or not
-
adminUpdateTemplate
String adminUpdateTemplate(String templateId, String content)
Replaces a given template in the storage and updates the cache with the new template content. Will be rejected if the template has referencing Compositions.- Parameters:
templateId- - Tempalte id to update, e.g. "IDCR Allergies List.v0"content- - New content to overwrite the template with- Returns:
- - New template id
-
adminDeleteAllTemplates
int adminDeleteAllTemplates()
Deletes all templates from target template storage and returns the number of deleted templates. If any template is referenced by at least one Composition the deletion will be rejected and no template will be removed.- Returns:
- - Number of deleted templates
-
-