Interface FolderService

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void adminDeleteFolder​(UUID folderId)
      Admin method to delete a Folder from the DB.
      Optional<org.ehrbase.response.ehrscape.FolderDto> get​(com.nedap.archie.rm.support.identification.ObjectVersionId folderId, String path)
      Retrieves a folder from database identified by object_version_uid and extracts the given sub path of existing.
      Optional<org.ehrbase.response.ehrscape.FolderDto> getByTimeStamp​(com.nedap.archie.rm.support.identification.ObjectVersionId folderId, Timestamp timestamp, String path)
      Fetches an folder entry from database identified by the root folder uid and the given timestamp.
      Integer getLastVersionNumber​(com.nedap.archie.rm.support.identification.ObjectVersionId folderId)
      Searches the last version number of a given folder entry from database.
      Optional<org.ehrbase.response.ehrscape.FolderDto> getLatest​(com.nedap.archie.rm.support.identification.ObjectVersionId folderId, String path)
      Fetches the latest entry from database.
      Integer getVersionNumberForTimestamp​(com.nedap.archie.rm.support.identification.ObjectVersionId folderId, Timestamp timestamp)
      Searches for the folder version that was the current version at the given timestamp.
      org.ehrbase.response.ehrscape.StructuredString serialize​(com.nedap.archie.rm.directory.Folder folder, org.ehrbase.response.ehrscape.StructuredStringFormat format)
      Serializes folder content from request body into a structured string that can be used by database save mechanism to parse in into jsonb format that will be saved at the database.
    • Method Detail

      • get

        Optional<org.ehrbase.response.ehrscape.FolderDto> get​(com.nedap.archie.rm.support.identification.ObjectVersionId folderId,
                                                              String path)
        Retrieves a folder from database identified by object_version_uid and extracts the given sub path of existing. If the object_version_uid does not contain a version number the latest entry will be returned. A path with common unix like root notation '/' will be treated as if there is no path specified and the full tree will be returned.
        Parameters:
        folderId - - object_version_uid for target folder
        path - - Optional path to sub folder to extract
        Returns:
        FolderDTO for further usage in upper layers
      • getLatest

        Optional<org.ehrbase.response.ehrscape.FolderDto> getLatest​(com.nedap.archie.rm.support.identification.ObjectVersionId folderId,
                                                                    String path)
        Fetches the latest entry from database. This will be
        Parameters:
        folderId - - object_version_uid for target folder
        path - - Optional path to sub folder to extract
        Returns:
        FolderDTO for further usage in other layers
      • getByTimeStamp

        Optional<org.ehrbase.response.ehrscape.FolderDto> getByTimeStamp​(com.nedap.archie.rm.support.identification.ObjectVersionId folderId,
                                                                         Timestamp timestamp,
                                                                         String path)
        Fetches an folder entry from database identified by the root folder uid and the given timestamp. If the current version has ben modified after the given timestamp the folder will be searched inside the folder history table.
        Parameters:
        folderId - - object_version_uid for target folder
        timestamp - - Timestamp of folder version to find
        path - - Optional path to sub folder to extract
        Returns:
        FolderDTO for further usage in other layers
      • serialize

        org.ehrbase.response.ehrscape.StructuredString serialize​(com.nedap.archie.rm.directory.Folder folder,
                                                                 org.ehrbase.response.ehrscape.StructuredStringFormat format)
        Serializes folder content from request body into a structured string that can be used by database save mechanism to parse in into jsonb format that will be saved at the database.
        Parameters:
        folder - - Folder to serialize
        format - - Source format of the folder
        Returns:
        Structured string that can be parsed into jsonb
      • getLastVersionNumber

        Integer getLastVersionNumber​(com.nedap.archie.rm.support.identification.ObjectVersionId folderId)
        Searches the last version number of a given folder entry from database. This will be executed against the folder table which contains the latest entry of a folder. The version will be extracted from there.
        Parameters:
        folderId - - Id of the folder to search for the latest version
        Returns:
        Version number of the latest folder entry
        Throws:
        ObjectNotFoundException - - Folder entry does not exist
      • getVersionNumberForTimestamp

        Integer getVersionNumberForTimestamp​(com.nedap.archie.rm.support.identification.ObjectVersionId folderId,
                                             Timestamp timestamp)
        Searches for the folder version that was the current version at the given timestamp. If the entry from folder table has a later timestamp the folder history will be queried to find the version at the timestamp
        Parameters:
        folderId - - Id of the folder to search the version
        timestamp - - Timestamp to look for the version number
        Returns:
        - Version number that was actual at the timestamp
        Throws:
        ObjectNotFoundException - - Folder entry does not exist at the time
      • adminDeleteFolder

        void adminDeleteFolder​(UUID folderId)
        Admin method to delete a Folder from the DB. See EHRbase Admin API specification for details.
        Parameters:
        folderId - Folder to delete