Package org.ehrbase.api.service
Interface EhrService
- All Superinterfaces:
BaseService
-
Method Summary
Modifier and TypeMethodDescriptionvoidadminDeleteEhr(UUID ehrId) Admin method to delete an EHR from the DB.voidvoiddefault voidcheckEhrExists(UUID ehrId) Checks if an EHR with the given UUID exists.default voidChecks if the EHR with the given UUID is modifiable.Creates new EHR instance, with default settings and values when no status or ID is supplied.findBySubject(String subjectId, String nameSpace) com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTimegetCreationTime(UUID ehrId) com.nedap.archie.rm.ehr.EhrStatusgetEhrStatus(UUID ehrUuid) Gets latest EHR_STATUS of the given EHR.Optional<com.nedap.archie.rm.changecontrol.OriginalVersion<com.nedap.archie.rm.ehr.EhrStatus>>getEhrStatusAtVersion(UUID ehrUuid, UUID versionedObjectUid, int version) Gets particular EHR_STATUS matching the given version Uid.Optional<org.ehrbase.response.ehrscape.EhrStatusDto>getEhrStatusEhrScape(UUID ehrUuid, org.ehrbase.response.ehrscape.CompositionFormat format) Deprecated.getEhrStatusVersionByTimestamp(UUID ehrUid, Timestamp timestamp) Get version number of EHR_STATUS associated with given EHR UID at given timestamp.Helper to get (Versioned Object) Uid of EHR_STATUS of given EHR.getLatestVersionUidOfStatus(UUID ehrId) Get latest version UID of an EHR_STATUS by given associated EHR UID.com.nedap.archie.rm.generic.RevisionHistoryGets revision history of EhrStatus associated with given EHR.getSubjectExtRef(String ehrId) Helper to directly get the external subject reference form the linked subject to given EHR.getSubjectExtRefs(Collection<String> ehrIds) getSubjectUuid(String ehrId) Helper to directly get the linked subject ID to given EHR.com.nedap.archie.rm.ehr.VersionedEhrStatusgetVersionedEhrStatus(UUID ehrUid) Gets version container EhrStatus associated with given EHR.booleanReturn True if a EHR with identifier ehrId exists.isModifiable(UUID ehrId) Returns true if an EHR_STATUS for the given EHR ID exists and has the is_modifiable flag set to true.updateStatus(UUID ehrId, com.nedap.archie.rm.ehr.EhrStatus status, UUID contribution, UUID audit) Update the EHR_STATUS linked to the given EHRMethods inherited from interface org.ehrbase.api.service.BaseService
getServerConfig, getSystemUuid
-
Method Details
-
create
Creates new EHR instance, with default settings and values when no status or ID is supplied.- Parameters:
ehrId- Optional, sets custom IDstatus- Optional, sets custom status- Returns:
- UUID of new EHR instance
- Throws:
DuplicateObjectException- when given party/subject already has an EHRInternalServerException- when unspecified error occurs
-
getEhrStatusEhrScape
@Deprecated Optional<org.ehrbase.response.ehrscape.EhrStatusDto> getEhrStatusEhrScape(UUID ehrUuid, org.ehrbase.response.ehrscape.CompositionFormat format) Deprecated. -
getEhrStatus
Gets latest EHR_STATUS of the given EHR.- Parameters:
ehrUuid- EHR subject- Returns:
- Latest EHR_STATUS
-
getEhrStatusAtVersion
Optional<com.nedap.archie.rm.changecontrol.OriginalVersion<com.nedap.archie.rm.ehr.EhrStatus>> getEhrStatusAtVersion(UUID ehrUuid, UUID versionedObjectUid, int version) Gets particular EHR_STATUS matching the given version Uid.- Parameters:
ehrUuid- Root EHRversionedObjectUid- Given Uid of EHR_STATUSversion- Given version of EHR_STATUS- Returns:
- Matching EHR_STATUS or empty
-
updateStatus
UUID updateStatus(UUID ehrId, com.nedap.archie.rm.ehr.EhrStatus status, UUID contribution, UUID audit) Update the EHR_STATUS linked to the given EHR- Parameters:
ehrId- ID of linked EHRstatus- input EHR_STATUScontribution- Optional ID of custom contribution. Can be null.audit-- Returns:
UUIDof the updated status- Throws:
ObjectNotFoundException- when given ehrId cannot be foundInvalidApiParameterException- when given status is invalid, e.g. not a valid openEHR RM object
-
findBySubject
-
getLatestVersionUidOfStatus
Get latest version UID of an EHR_STATUS by given associated EHR UID.- Parameters:
ehrId- EHR ID- Returns:
- EHR_STATUS version UID
-
getCreationTime
-
getEhrStatusVersionByTimestamp
Get version number of EHR_STATUS associated with given EHR UID at given timestamp.- Parameters:
ehrUid- EHR UIDtimestamp- Timestamp of point in time- Returns:
- version number
-
hasEhr
Return True if a EHR with identifier ehrId exists. Implements has_ehr from the openEHR Platform Abstract Service Model.- Parameters:
ehrId- identifier to test- Returns:
- True when existing, false if not
-
isModifiable
Returns true if an EHR_STATUS for the given EHR ID exists and has the is_modifiable flag set to true.- Parameters:
ehrId- EHR ID to check- Returns:
- flag value (true/false) if EHR exists, null otherwise
-
getEhrStatusVersionedObjectUidByEhr
Helper to get (Versioned Object) Uid of EHR_STATUS of given EHR.- Parameters:
ehrUid- Uid of EHR- Returns:
- UUID of corresponding EHR_STATUS
-
getVersionedEhrStatus
Gets version container EhrStatus associated with given EHR.- Parameters:
ehrUid- Given EHR ID- Returns:
- Version container object
-
getRevisionHistoryOfVersionedEhrStatus
Gets revision history of EhrStatus associated with given EHR.- Parameters:
ehrUid- Given EHR ID- Returns:
- Revision history object
-
adminDeleteEhr
Admin method to delete an EHR from the DB. See EHRbase Admin API specification for details.- Parameters:
ehrId- EHR to delete
-
adminPurgePartyIdentified
void adminPurgePartyIdentified() -
adminDeleteOrphanHistory
void adminDeleteOrphanHistory() -
getSubjectUuid
Helper to directly get the linked subject ID to given EHR.- Parameters:
ehrId- Given EHR ID- Returns:
- Linked subject ID or null
-
getSubjectExtRef
Helper to directly get the external subject reference form the linked subject to given EHR.- Parameters:
ehrId- Given EHR ID- Returns:
- Linked external subject reference or null
-
getSubjectExtRefs
-
checkEhrExists
Checks if an EHR with the given UUID exists. ThrowsObjectNotFoundExceptionif no EHR is found- Parameters:
ehrId- EHR ID to check
-
checkEhrExistsAndIsModifiable
Checks if the EHR with the given UUID is modifiable. ThrowsObjectNotFoundExceptionif no EHR is found. ThrowsGeneralRequestProcessingExceptionif the EHR is not modifiable.- Parameters:
ehrId- EHR ID to check
-