Class TemplateDBStorageService

java.lang.Object
org.ehrbase.service.TemplateDBStorageService
All Implemented Interfaces:
TemplateStorage

@Service @Transactional public class TemplateDBStorageService extends Object implements TemplateStorage
  • Constructor Details

    • TemplateDBStorageService

      public TemplateDBStorageService(org.jooq.DSLContext context, ServerConfig serverConfig)
  • Method Details

    • listAllOperationalTemplates

      public List<TemplateMetaData> listAllOperationalTemplates()
      Description copied from interface: TemplateStorage
      List all Templates in the store;
      Specified by:
      listAllOperationalTemplates in interface TemplateStorage
      Returns:
    • findAllTemplateIds

      public Set<String> findAllTemplateIds()
      Description copied from interface: TemplateStorage
      Find all templates ids in the store;
      Specified by:
      findAllTemplateIds in interface TemplateStorage
      Returns:
      the list of template ids
    • storeTemplate

      public void storeTemplate(org.openehr.schemas.v1.OPERATIONALTEMPLATE template, Short sysTenant)
      Description copied from interface: TemplateStorage
      Save a template in the store
      Specified by:
      storeTemplate in interface TemplateStorage
    • readOperationaltemplate

      public Optional<org.openehr.schemas.v1.OPERATIONALTEMPLATE> readOperationaltemplate(String templateId)
      Description copied from interface: TemplateStorage
      Find and return a saved Template by templateId
      Specified by:
      readOperationaltemplate in interface TemplateStorage
      Returns:
      the template @see OPERATIONALTEMPLATE or Optional.empty() if not found.
    • adminUpdateTemplate

      public String 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. Check that the old template is no longer referenced to avoid data inconsistencies
      Specified by:
      adminUpdateTemplate in interface TemplateStorage
      Parameters:
      template - - Template with new data and id of target to be replaced
      Returns:
      - XML content of the updated template
    • deleteTemplate

      public boolean deleteTemplate(String templateId)
      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:
      deleteTemplate in interface TemplateStorage
      Parameters:
      templateId - - Template id to delete from storage, e.g. "IDCR Allergies List.v0"
      Returns:
      - Deletion was successful or not
    • adminDeleteAllTemplates

      public int adminDeleteAllTemplates(List<TemplateMetaData> templateMetaDataList)
      Removes all templates from template storage and returns the number of deleted entries.
      Specified by:
      adminDeleteAllTemplates in interface TemplateStorage
      Returns:
      - Count of deleted templates
    • getDataAccess

      protected I_DomainAccess getDataAccess()