Class TemplateStoreAccess

java.lang.Object
org.ehrbase.dao.access.support.DataAccess
org.ehrbase.dao.access.jooq.TemplateStoreAccess
All Implemented Interfaces:
I_DomainAccess, I_SimpleCRUD, I_TemplateStoreAccess

public class TemplateStoreAccess extends DataAccess implements I_TemplateStoreAccess
  • Constructor Details

    • TemplateStoreAccess

      public TemplateStoreAccess(I_DomainAccess domainAccess, org.openehr.schemas.v1.OPERATIONALTEMPLATE operationaltemplate, Short sysTenant)
  • Method Details

    • commit

      public UUID commit(Timestamp transactionTime)
      Description copied from interface: I_SimpleCRUD
      storeComposition a new entry in the DB
      Specified by:
      commit in interface I_SimpleCRUD
      Returns:
      the UUID of the newly created record
    • commit

      public UUID commit()
      Description copied from interface: I_SimpleCRUD
      storeComposition a new entry in the DB, using a default transaction time
      only implemented with "root" tables: ehr, contribution and composition!
      Specified by:
      commit in interface I_SimpleCRUD
      Returns:
      the UUID of the newly created record
    • update

      public Boolean update(Timestamp transactionTime)
      Description copied from interface: I_SimpleCRUD
      updateComposition the current entry
      depending on the implementation, records are updated only if one or more field(s) have been changed
      Specified by:
      update in interface I_SimpleCRUD
      Returns:
    • update

      public Boolean update(Timestamp transactionTime, boolean force)
      Description copied from interface: I_SimpleCRUD
      updateComposition the current entry even if the record is not modified
      intended to be used with temporal tables to ensure that a set of interdependent tables are updated in sync. This approach is used to simplify versions retrieval.
      Specified by:
      update in interface I_SimpleCRUD
      Returns:
    • update

      public Boolean update()
      Description copied from interface: I_SimpleCRUD
      updateComposition the current entry using time now as the system transaction time
      only implemented at root level object (contribution, composition, ehr). depending on the implementation, records are updated only if one or more field(s) have been changed
      Specified by:
      update in interface I_SimpleCRUD
      Returns:
    • update

      public Boolean update(Boolean force)
      Description copied from interface: I_SimpleCRUD
      updateComposition the current entry using time now as the system transaction time
      only implemented at root level object (contribution, composition, ehr). depending on the implementation, records are updated only if one or more field(s) have been changed
      Specified by:
      update in interface I_SimpleCRUD
      Returns:
    • delete

      public Integer delete()
      Description copied from interface: I_SimpleCRUD
      delete the Versioned Object associated with the instance implementing this Data Access Interface. Relies on ON DELETE CASCADE
      Specified by:
      delete in interface I_SimpleCRUD
      Returns:
    • getDataAccess

      public DataAccess getDataAccess()
      Specified by:
      getDataAccess in interface I_DomainAccess
    • getTemplate

      public org.openehr.schemas.v1.OPERATIONALTEMPLATE getTemplate()
      Specified by:
      getTemplate in interface I_TemplateStoreAccess
    • setTemplate

      public void setTemplate(org.openehr.schemas.v1.OPERATIONALTEMPLATE template)
      Specified by:
      setTemplate in interface I_TemplateStoreAccess
    • retrieveInstanceByTemplateId

      public static I_TemplateStoreAccess retrieveInstanceByTemplateId(I_DomainAccess domainAccess, String templateId)
    • fetchAll

      public static List<TemplateMetaData> fetchAll(I_DomainAccess domainAccess)
    • fetchAllTemplateIds

      public static Set<String> fetchAllTemplateIds(I_DomainAccess domainAccess)
    • adminUpdateTemplate

      public static String adminUpdateTemplate(I_DomainAccess domainAccess, org.openehr.schemas.v1.OPERATIONALTEMPLATE template)
      Replaces the old content of a template with the new provided content in the database storage. The target template id must be provided within the new template. This is a destructive operation thus the old template will be checked against Compositions if there are any usages of the template to avoid data inconsistencies.
      Parameters:
      domainAccess - - Database connection context
      template - - New template data to store
      Returns:
      - Updated template XML content
    • deleteTemplate

      public static boolean deleteTemplate(I_DomainAccess domainAccess, String templateId)
      Removes the template identified by its template_id from database and returns if the operation succeeded.
      Parameters:
      domainAccess - - Database access instance
      templateId - - Target template_id, e.g. "IDCR - Problem List.v1"
      Returns:
      - Deletion succeeded or not
    • adminDeleteAllTemplates

      public static int adminDeleteAllTemplates(I_DomainAccess domainAccess)