Package org.ehrbase.api.service
Interface ContributionService
- All Superinterfaces:
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 Summary
Modifier and TypeMethodDescriptionvoidadminDelete(UUID contributionId) Admin method to delete a Contribution from the DB.commitContribution(UUID ehrId, String content, org.ehrbase.response.ehrscape.CompositionFormat format) Commit a CONTRIBUTION containing any number of serialized VERSIONobjects. Optional<org.ehrbase.response.ehrscape.ContributionDto>getContribution(UUID ehrId, UUID contributionId) Return the Contribution with given id in given EHR.getListOfTemplates(String contribution, org.ehrbase.response.ehrscape.CompositionFormat format) Extracts set of used templates in payload's compositions.booleanhasContribution(UUID ehrId, UUID contributionId) Check if given contribution exists and is part of given EHR.Methods inherited from interface org.ehrbase.api.service.BaseService
getServerConfig, getSystemUuid
-
Method Details
-
hasContribution
Check if given contribution exists and is part of given EHR.- Parameters:
ehrId- ID of EHRcontributionId- ID of contribution- Returns:
- True if exists and part of EHR, false if not
-
getContribution
Optional<org.ehrbase.response.ehrscape.ContributionDto> getContribution(UUID ehrId, UUID contributionId) Return the Contribution with given id in given EHR.- Parameters:
ehrId- ID of EHRcontributionId- ID of contribution- Returns:
Optionalcontaining aContributionDtoif successful, empty if not
-
commitContribution
UUID commitContribution(UUID ehrId, String content, org.ehrbase.response.ehrscape.CompositionFormat format) Commit a CONTRIBUTION containing any number of serialized VERSIONobjects. - Parameters:
ehrId- ID of EHRcontent- serialized content, containing version objects and audit object in given formatformat- format of serialized versions- Returns:
- ID of successfully committed contribution
- Throws:
IllegalArgumentException- when input can't be processedInternalServerException- when DB is inconsistent
-
adminDelete
Admin method to delete a Contribution from the DB. See EHRbase Admin API specification for details.- Parameters:
contributionId- Contribution to delete
-
getListOfTemplates
Set<String> getListOfTemplates(String contribution, org.ehrbase.response.ehrscape.CompositionFormat format) Extracts set of used templates in payload's compositions.- Parameters:
contribution- Contribution request contentformat- Format of that content- Returns:
- Set of templates used by compositions
-