Interface I_ContributionAccess
-
- All Superinterfaces:
I_SimpleCRUD
- All Known Implementing Classes:
ContributionAccess
public interface I_ContributionAccess extends I_SimpleCRUD
Access layer to Contributions Created by Christian Chevalley on 4/21/2015.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddComposition(I_CompositionAccess compositionAccess)add a new composition to this contribution
NB: The contribution and composition requires commit() to be saved in the DBUUIDcommit(Timestamp transactionTime, UUID committerId, UUID systemId, ContributionDataType contributionType, ContributionDef.ContributionState contributionState, I_ConceptAccess.ContributionChangeType contributionChangeType, String description)Commits given input as contribution record.UUIDcommit(Timestamp transactionTime, ContributionDataType contributionType, ContributionDef.ContributionState state)Commits given input as contribution record.UUIDcommitWithSignature(String signature)commit the contribution with a certifying signature
the signature is stored in the Contribution Version entry, the state of the contribution is then 'complete'UUIDgetAuditsCommitter()StringgetAuditsDescription()UUIDgetAuditsSystemId()I_CompositionAccessgetComposition(UUID id)Set<UUID>getCompositionIds()ContributionDataTypegetContributionDataType()UUIDgetContributionId()get the contribution UUIDContributionDef.ContributionStategetContributionState()get the contribution stateContributionDef.ContributionTypegetContributionType()get the contribution typeStringgetDataType()UUIDgetEhrId()get the contribution Ehr Id it belongs toUUIDgetHasAuditDetails()UUIDgetId()static I_ContributionAccessgetInstance(I_DomainAccess domain, UUID ehrId)get a new minimal contribution access layer instancebooleanremoveComposition(I_CompositionAccess compositionAccess)TODO: doc.static I_ContributionAccessretrieveInstance(I_DomainAccess domainAccess, UUID contributionId)retrieve an instance of I_ContributionAccess layer to the DBstatic I_ContributionAccessretrieveVersionedInstance(I_DomainAccess domainAccess, UUID contributionObjId, Timestamp timestamp)retrieve a contribution from its object ID and a timestamp FIXME: note: this only looks for instances in *_history table, see called method for details on problem - also naming suggestively wrong?voidsetAuditDetailsChangeType(UUID changeType)voidsetAuditDetailsValues(com.nedap.archie.rm.generic.AuditDetails auditObject)voidsetAuditDetailsValues(UUID committer, UUID system, String description)Convenience setter for contribution's auditvoidsetComplete()set the contribution as completevoidsetContributionDataType(ContributionDataType contributionDataType)voidsetDataType(ContributionDataType contributionDataType)voidsetDeleted()set the contribution as deletedvoidsetEhrId(UUID ehrId)set the contribution Ehr Id it belongs tovoidsetHasAuditDetails(UUID auditId)voidsetIncomplete()set the contribution as incompletevoidsetState(ContributionDef.ContributionState state)set the state of contributionBooleanupdate(Timestamp transactionTime, UUID committerId, UUID systemId, String contributionType, String contributionState, String contributionChangeType, String description)Update with embedded audit update.Booleanupdate(Timestamp transactionTime, UUID committerId, UUID systemId, ContributionDataType contributionType, ContributionDef.ContributionState contributionState, I_ConceptAccess.ContributionChangeType contributionChangeType, String description)Update with embedded audit update.voidupdateComposition(I_CompositionAccess compositionAccess)updateComposition an existing composition
only a composition with the same id is effectively updated with this method
NB: The contribution and composition requires commit() to be saved in the DBUUIDupdateWithSignature(String signature)
-
-
-
Method Detail
-
getInstance
static I_ContributionAccess getInstance(I_DomainAccess domain, UUID ehrId)
get a new minimal contribution access layer instance- Parameters:
domain- SQL contextehrId- the EHR uuid this contribution belong to- Returns:
- a new minimal
I_ContributionAccess
-
retrieveInstance
static I_ContributionAccess retrieveInstance(I_DomainAccess domainAccess, UUID contributionId)
retrieve an instance of I_ContributionAccess layer to the DB- Parameters:
domainAccess- SQL contextcontributionId- the contribution id- Returns:
- an I_ContributionAccess instance or null
- Throws:
InternalServerException- on failed fetching of contribution
-
retrieveVersionedInstance
static I_ContributionAccess retrieveVersionedInstance(I_DomainAccess domainAccess, UUID contributionObjId, Timestamp timestamp)
retrieve a contribution from its object ID and a timestamp FIXME: note: this only looks for instances in *_history table, see called method for details on problem - also naming suggestively wrong?- Parameters:
domainAccess- SQL contextcontributionObjId- the contribution object UUIDtimestamp- time in history to calculate related version- Returns:
- an
I_ContributionAccessinstance or null
-
addComposition
void addComposition(I_CompositionAccess compositionAccess)
add a new composition to this contribution
NB: The contribution and composition requires commit() to be saved in the DB- Parameters:
compositionAccess- a valid I_CompositionAccess- Throws:
IllegalArgumentException- when composition is not complete, e.g. has not embedded audit
-
updateComposition
void updateComposition(I_CompositionAccess compositionAccess)
updateComposition an existing composition
only a composition with the same id is effectively updated with this method
NB: The contribution and composition requires commit() to be saved in the DB- Parameters:
compositionAccess- access instance
-
removeComposition
boolean removeComposition(I_CompositionAccess compositionAccess)
TODO: doc. what exactly happens or need to happen, i.e. also commit(..) necessary afterwards?- Parameters:
compositionAccess- access instance- Returns:
- ?
-
commit
UUID commit(Timestamp transactionTime, ContributionDataType contributionType, ContributionDef.ContributionState state)
Commits given input as contribution record. Creation of audit is required beforehand. All parameters are optional and will be provided with default values if NULL.- Parameters:
transactionTime- Timestamp of transaction timecontributionType- String representation of contribution typestate- String representation of contribution state- Returns:
-
commit
UUID commit(Timestamp transactionTime, UUID committerId, UUID systemId, ContributionDataType contributionType, ContributionDef.ContributionState contributionState, I_ConceptAccess.ContributionChangeType contributionChangeType, String description)
Commits given input as contribution record. Embeds creation of audit for this commit. All parameters are optional and will be provided with default values if NULL.- Parameters:
transactionTime- Timestamp of transaction timecommitterId- ID of committersystemId- ID of committing systemcontributionType- String representation of contribution typecontributionState- String representation of contribution statecontributionChangeType- String representation of contribution change typedescription- Description- Returns:
UUIDof committed contribution- Throws:
InternalServerException- when contribution couldn't be created because of an internal problem
-
update
Boolean update(Timestamp transactionTime, UUID committerId, UUID systemId, String contributionType, String contributionState, String contributionChangeType, String description)
Update with embedded audit update.- Parameters:
transactionTime- Timestamp of transaction timecommitterId- ID of committer (part of AuditDetails)systemId- ID of committing system (part of AuditDetails)contributionType- String representation of contribution typecontributionState- String representation of contribution statecontributionChangeType- String representation of contribution change type (part of AuditDetails)description- Description (part of AuditDetails)- Returns:
- True for success
-
update
Boolean update(Timestamp transactionTime, UUID committerId, UUID systemId, ContributionDataType contributionType, ContributionDef.ContributionState contributionState, I_ConceptAccess.ContributionChangeType contributionChangeType, String description)
Update with embedded audit update.- Parameters:
transactionTime- Timestamp of transaction timecommitterId- ID of committer (part of AuditDetails)systemId- ID of committing system (part of AuditDetails)contributionType- ContributionDataType representation of contribution typecontributionState- ContributionState representation of contribution statecontributionChangeType- ContributionChangeType representation of contribution change type (part of AuditDetails)description- Description (part of AuditDetails)- Returns:
- True for success
-
commitWithSignature
UUID commitWithSignature(String signature)
commit the contribution with a certifying signature
the signature is stored in the Contribution Version entry, the state of the contribution is then 'complete'- Parameters:
signature- String representing the certification- Returns:
- UUID of committed contribution
-
getContributionId
UUID getContributionId()
get the contribution UUID- Returns:
- ID of contribution
-
getContributionDataType
ContributionDataType getContributionDataType()
-
setContributionDataType
void setContributionDataType(ContributionDataType contributionDataType)
-
setState
void setState(ContributionDef.ContributionState state)
set the state of contribution- Parameters:
state- ContributionDef- See Also:
ContributionDef
-
setComplete
void setComplete()
set the contribution as complete
-
setIncomplete
void setIncomplete()
set the contribution as incomplete
-
setDeleted
void setDeleted()
set the contribution as deleted
-
getContributionType
ContributionDef.ContributionType getContributionType()
get the contribution type- Returns:
- type
- See Also:
ContributionDef.ContributionType
-
getContributionState
ContributionDef.ContributionState getContributionState()
get the contribution state- Returns:
- state
- See Also:
ContributionDef.ContributionState
-
getEhrId
UUID getEhrId()
get the contribution Ehr Id it belongs to- Returns:
- Ehr UUID
-
setEhrId
void setEhrId(UUID ehrId)
set the contribution Ehr Id it belongs to
-
getComposition
I_CompositionAccess getComposition(UUID id)
-
getDataType
String getDataType()
-
setDataType
void setDataType(ContributionDataType contributionDataType)
-
getId
UUID getId()
-
setAuditDetailsValues
void setAuditDetailsValues(UUID committer, UUID system, String description)
Convenience setter for contribution's audit- Parameters:
committer- committer ID (Party Identified)system- system on which this is initiateddescription- description
-
setAuditDetailsValues
void setAuditDetailsValues(com.nedap.archie.rm.generic.AuditDetails auditObject)
-
setAuditDetailsChangeType
void setAuditDetailsChangeType(UUID changeType)
-
getAuditsCommitter
UUID getAuditsCommitter()
-
getAuditsSystemId
UUID getAuditsSystemId()
-
getAuditsDescription
String getAuditsDescription()
-
setHasAuditDetails
void setHasAuditDetails(UUID auditId)
-
getHasAuditDetails
UUID getHasAuditDetails()
-
-