Package org.ehrbase.api.service
Interface TemplateService
public interface TemplateService
-
Method Summary
Modifier and TypeMethodDescriptionintDeletes all templates from target template storage and returns the number of deleted templates.booleanadminDeleteTemplate(String templateId) Deletes a given template from storage physically.adminUpdateTemplate(String templateId, String content) Replaces a given template in the storage and updates the cache with the new template content.com.nedap.archie.rm.composition.CompositionbuildExample(String templateId) create(org.openehr.schemas.v1.OPERATIONALTEMPLATE content) findOperationalTemplate(String templateId, OperationalTemplateFormat format) Finds and returns the given operational template as string represented in requested format.org.ehrbase.openehr.sdk.webtemplate.model.WebTemplatefindTemplate(String templateId) List<org.ehrbase.openehr.sdk.response.dto.ehrscape.TemplateMetaDataDto>
-
Method Details
-
getAllTemplates
List<org.ehrbase.openehr.sdk.response.dto.ehrscape.TemplateMetaDataDto> getAllTemplates() -
buildExample
-
findTemplate
-
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.
-
create
-
adminDeleteTemplate
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
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
-