Interface ContributionService

  • All Superinterfaces:
    BaseService

    public interface ContributionService
    extends BaseService
    Interface for contribution service roughly based on openEHR SM "I_EHR_CONTRIBUTION Interface", see: https://specifications.openehr.org/releases/SM/latest/openehr_platform.html#_i_ehr_contribution_interface
    • Method Detail

      • hasContribution

        boolean hasContribution​(UUID ehrId,
                                UUID contributionId)
        Check if given contribution exists and is part of given EHR.
        Parameters:
        ehrId - ID of EHR
        contributionId - ID of contribution
        Returns:
        True if exists and part of EHR, false if not
      • getContribution

        Optional<ContributionDto> getContribution​(UUID ehrId,
                                                  UUID contributionId)
        Return the Contribution with given id in given EHR.
        Parameters:
        ehrId - ID of EHR
        contributionId - ID of contribution
        Returns:
        Optional containing a ContributionDto if successful, empty if not
      • commitContribution

        UUID commitContribution​(UUID ehrId,
                                String content,
                                CompositionFormat format)
        Commit a CONTRIBUTION containing any number of serialized VERSION objects.
        Parameters:
        ehrId - ID of EHR
        content - serialized content, containing version objects and audit object in given format
        format - format of serialized versions
        Returns:
        ID of successfully committed contribution
        Throws:
        IllegalArgumentException - when input can't be processed
        InternalServerException - when DB is inconsistent