Interface I_CompositionAccess
-
- All Superinterfaces:
I_SimpleCRUD
- All Known Implementing Classes:
CompositionAccess
public interface I_CompositionAccess extends I_SimpleCRUD
Composition Access Layer Interface
Interface CRUD and specific methods
-
-
Field Summary
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description intaddContent(I_EntryAccess entry)add an entry to the compositionUUIDcommit(UUID committerId, UUID systemId, String description)UUIDcommitWithCustomContribution(UUID committerId, UUID systemId, String description)Unlike the basic commit it is necessary to set the contribution manually beforehand, here.Integerdelete(UUID committerId, UUID systemId, String description)Delete a composition
Delete by simulating an SQL CASCADE wherever appropriate
delete entry first delete the corresponding version entry delete the composition recordIntegerdeleteWithCustomContribution(UUID committerId, UUID systemId, String description)Unlike the basic delete it is necessary to set the contribution manually beforehand, here.static booleanexists(I_DomainAccess domainAccess, UUID versionedObjectId)Checks if the given versionedObjectID points to an existing composition.static IntegerfetchTerritoryCode(I_DomainAccess domainAccess, String territoryAsString)UUIDgetAuditDetailsId()UUIDgetComposerId()get the composer IdList<I_EntryAccess>getContent()get the list of entries for this compositionList<UUID>getContentIds()get the list of entry Ids for this compositionOptional<UUID>getContextId()get the event context idUUIDgetContributionId()get the contribution idUUIDgetEhrid()get the EHR id to which this composition belongs toUUIDgetId()get the composition IdStringgetLanguageCode()get the language code for this composition (eg.static IntegergetLastVersionNumber(I_DomainAccess domainAccess, UUID compositionId)retrieve the number of versions for this composition or 1 if no history presentstatic I_CompositionAccessgetNewInstance(I_DomainAccess domain, com.nedap.archie.rm.composition.Composition composition, UUID ehrId)Get a new Composition Access InstanceTimestampgetSysTransaction()IntegergetTerritoryCode()FIXME: bug? comment says 2-letter while methods are saying Integer get the 2-letters country codeTimestampgetTimeCommitted()Gets time_committed from contribution of composition.IntegergetVersion()static intgetVersionFromTimeStamp(I_DomainAccess domainAccess, UUID vCompositionUid, Timestamp timeCommitted)Calculate the version corresponding to aVersionedCompositionwhich is the closest in time (before) theTimestampprovided.static Map<I_CompositionAccess,Integer>getVersionMapOfComposition(I_DomainAccess domainAccess, UUID compositionId)Creates Map containing all versions as their Access object with their matching version number.static booleanhasPreviousVersion(I_DomainAccess domainAccess, UUID compositionId)check if a composition has a previous version in historystatic booleanisDeleted(I_DomainAccess domainAccess, UUID versionedObjectId)Checks if given composition ID is ID of a logically deleted composition.static booleanisValidLanguageCode(I_DomainAccess domainAccess, String languageCode)static I_CompositionAccessretrieveCompositionVersion(I_DomainAccess domainAccess, UUID id, int version)Retrieve composition(s) for an identified versionstatic I_CompositionAccessretrieveInstance(I_DomainAccess domainAccess, UUID id)Retrieve a composition access instance from the persistence layerstatic I_CompositionAccessretrieveInstanceByTimestamp(I_DomainAccess domainAccess, UUID compositionUid, Timestamp timeCommitted)Returns the instance of aVersionedCompositioncorresponding to the version which is the closest in time before the timeCommitted provided.static Map<I_CompositionAccess,Integer>retrieveInstancesInContribution(I_DomainAccess domainAccess, UUID contributionId)Retrieve a map of composition accesses for all compositions referencing a contributionvoidsetAuditDetailsAccess(I_AuditDetailsAccess auditDetailsAccess)voidsetAuditDetailsId(UUID auditId)voidsetComposerId(UUID composerId)set the composer idvoidsetComposition(com.nedap.archie.rm.composition.Composition composition)voidsetCompositionRecord(CompositionHistoryRecord record)Set the record via converting from a history record.voidsetCompositionRecord(CompositionRecord record)voidsetCompositionRecord(org.jooq.Result<?> records)voidsetContent(List<I_EntryAccess> content)voidsetContext(com.nedap.archie.rm.composition.EventContext historicalEventContext)voidsetContextCompositionId(UUID contextId)set the event context idvoidsetContributionAccess(I_ContributionAccess contributionAccess)voidsetContributionId(UUID contributionId)set the contribution id for this compositionvoidsetEhrid(UUID ehrId)set the EHR idvoidsetLanguageCode(String code)set the language codevoidsetTerritoryCode(Integer code)FIXME: bug? comment says 2-letter while methods are saying Integer set the 2-letters territory codeBooleanupdate(UUID committerId, UUID systemId, ContributionDef.ContributionState state, I_ConceptAccess.ContributionChangeType contributionChangeType, String description)voidupdateCompositionData(com.nedap.archie.rm.composition.Composition newComposition)BooleanupdateWithCustomContribution(UUID committerId, UUID systemId, I_ConceptAccess.ContributionChangeType contributionChangeType, String description)Unlike the basic update it is necessary to set the contribution manually beforehand, here.
-
-
-
Field Detail
-
COMPOSITION_JOIN
static final String COMPOSITION_JOIN
- See Also:
- Constant Field Values
-
COMPOSER_JOIN
static final String COMPOSER_JOIN
- See Also:
- Constant Field Values
-
COMPOSER_ID
static final String COMPOSER_ID
- See Also:
- Constant Field Values
-
FACILITY_JOIN
static final String FACILITY_JOIN
- See Also:
- Constant Field Values
-
FACILITY_ID
static final String FACILITY_ID
- See Also:
- Constant Field Values
-
EVENT_CONTEXT_JOIN
static final String EVENT_CONTEXT_JOIN
- See Also:
- Constant Field Values
-
PARTICIPATION_JOIN
static final String PARTICIPATION_JOIN
- See Also:
- Constant Field Values
-
PERFORMER_JOIN
static final String PERFORMER_JOIN
- See Also:
- Constant Field Values
-
TERRITORY_JOIN
static final String TERRITORY_JOIN
- See Also:
- Constant Field Values
-
CONCEPT_JOIN
static final String CONCEPT_JOIN
- See Also:
- Constant Field Values
-
F_VERSION
static final String F_VERSION
- See Also:
- Constant Field Values
-
F_COMPOSITION_ID
static final String F_COMPOSITION_ID
- See Also:
- Constant Field Values
-
F_ENTRY
static final String F_ENTRY
- See Also:
- Constant Field Values
-
F_ENTRY_TEMPLATE
static final String F_ENTRY_TEMPLATE
- See Also:
- Constant Field Values
-
F_LANGUAGE
static final String F_LANGUAGE
- See Also:
- Constant Field Values
-
F_TERRITORY
static final String F_TERRITORY
- See Also:
- Constant Field Values
-
F_TERRITORY_CODE
static final String F_TERRITORY_CODE
- See Also:
- Constant Field Values
-
F_COMPOSER_NAME
static final String F_COMPOSER_NAME
- See Also:
- Constant Field Values
-
F_COMPOSER_REF_VALUE
static final String F_COMPOSER_REF_VALUE
- See Also:
- Constant Field Values
-
F_COMPOSER_REF_SCHEME
static final String F_COMPOSER_REF_SCHEME
- See Also:
- Constant Field Values
-
F_COMPOSER_REF_NAMESPACE
static final String F_COMPOSER_REF_NAMESPACE
- See Also:
- Constant Field Values
-
F_COMPOSER_REF_TYPE
static final String F_COMPOSER_REF_TYPE
- See Also:
- Constant Field Values
-
F_COMPOSER_ID_VALUE
static final String F_COMPOSER_ID_VALUE
- See Also:
- Constant Field Values
-
F_COMPOSER_ID_ISSUER
static final String F_COMPOSER_ID_ISSUER
- See Also:
- Constant Field Values
-
F_COMPOSER_ID_TYPE_NAME
static final String F_COMPOSER_ID_TYPE_NAME
- See Also:
- Constant Field Values
-
F_CONTEXT_START_TIME
static final String F_CONTEXT_START_TIME
- See Also:
- Constant Field Values
-
F_CONTEXT_START_TIME_TZID
static final String F_CONTEXT_START_TIME_TZID
- See Also:
- Constant Field Values
-
F_CONTEXT_END_TIME
static final String F_CONTEXT_END_TIME
- See Also:
- Constant Field Values
-
F_CONTEXT_END_TIME_TZID
static final String F_CONTEXT_END_TIME_TZID
- See Also:
- Constant Field Values
-
F_CONTEXT_LOCATION
static final String F_CONTEXT_LOCATION
- See Also:
- Constant Field Values
-
F_CONTEXT_OTHER_CONTEXT
static final String F_CONTEXT_OTHER_CONTEXT
- See Also:
- Constant Field Values
-
F_FACILITY_NAME
static final String F_FACILITY_NAME
- See Also:
- Constant Field Values
-
F_FACILITY_REF_VALUE
static final String F_FACILITY_REF_VALUE
- See Also:
- Constant Field Values
-
F_FACILITY_REF_SCHEME
static final String F_FACILITY_REF_SCHEME
- See Also:
- Constant Field Values
-
F_FACILITY_REF_NAMESPACE
static final String F_FACILITY_REF_NAMESPACE
- See Also:
- Constant Field Values
-
F_FACILITY_REF_TYPE
static final String F_FACILITY_REF_TYPE
- See Also:
- Constant Field Values
-
F_FACILITY_ID_VALUE
static final String F_FACILITY_ID_VALUE
- See Also:
- Constant Field Values
-
F_FACILITY_ID_ISSUER
static final String F_FACILITY_ID_ISSUER
- See Also:
- Constant Field Values
-
F_FACILITY_ID_TYPE_NAME
static final String F_FACILITY_ID_TYPE_NAME
- See Also:
- Constant Field Values
-
F_PARTICIPATION_FUNCTION
static final String F_PARTICIPATION_FUNCTION
- See Also:
- Constant Field Values
-
F_PARTICIPATION_MODE
static final String F_PARTICIPATION_MODE
- See Also:
- Constant Field Values
-
F_PARTICIPATION_START_TIME
static final String F_PARTICIPATION_START_TIME
- See Also:
- Constant Field Values
-
F_PARTICIPATION_START_TIME_TZID
static final String F_PARTICIPATION_START_TIME_TZID
- See Also:
- Constant Field Values
-
F_PERFORMER_NAME
static final String F_PERFORMER_NAME
- See Also:
- Constant Field Values
-
F_PERFORMER_REF_VALUE
static final String F_PERFORMER_REF_VALUE
- See Also:
- Constant Field Values
-
F_PERFORMER_REF_SCHEME
static final String F_PERFORMER_REF_SCHEME
- See Also:
- Constant Field Values
-
F_PERFORMER_REF_NAMESPACE
static final String F_PERFORMER_REF_NAMESPACE
- See Also:
- Constant Field Values
-
F_PERFORMER_REF_TYPE
static final String F_PERFORMER_REF_TYPE
- See Also:
- Constant Field Values
-
F_PERFORMER_ID_VALUE
static final String F_PERFORMER_ID_VALUE
- See Also:
- Constant Field Values
-
F_PERFORMER_ID_ISSUER
static final String F_PERFORMER_ID_ISSUER
- See Also:
- Constant Field Values
-
F_PERFORMER_ID_TYPE_NAME
static final String F_PERFORMER_ID_TYPE_NAME
- See Also:
- Constant Field Values
-
F_CONCEPT_ID
static final String F_CONCEPT_ID
- See Also:
- Constant Field Values
-
F_CONCEPT_DESCRIPTION
static final String F_CONCEPT_DESCRIPTION
- See Also:
- Constant Field Values
-
compositionRef
static final org.jooq.Table<CompositionRecord> compositionRef
-
composerRef
static final org.jooq.Table<PartyIdentifiedRecord> composerRef
-
composerId
static final org.jooq.Table<IdentifierRecord> composerId
-
facilityRef
static final org.jooq.Table<PartyIdentifiedRecord> facilityRef
-
facilityId
static final org.jooq.Table<IdentifierRecord> facilityId
-
eventContextRef
static final org.jooq.Table<EventContextRecord> eventContextRef
-
participationRef
static final org.jooq.Table<ParticipationRecord> participationRef
-
performerRef
static final org.jooq.Table<PartyIdentifiedRecord> performerRef
-
territoryRef
static final org.jooq.Table<TerritoryRecord> territoryRef
-
conceptRef
static final org.jooq.Table<ConceptRecord> conceptRef
-
-
Method Detail
-
getNewInstance
static I_CompositionAccess getNewInstance(I_DomainAccess domain, com.nedap.archie.rm.composition.Composition composition, UUID ehrId)
Get a new Composition Access Instance- Parameters:
domain- SQL context, knowledgecomposition- a valid RM compositionehrId- the EHR holding this instance- Returns:
I_CompositionAccessobject of the new access instance- Throws:
IllegalArgumentException- when retrieval failed because of wrong input
-
retrieveCompositionVersion
static I_CompositionAccess retrieveCompositionVersion(I_DomainAccess domainAccess, UUID id, int version)
Retrieve composition(s) for an identified version- Parameters:
domainAccess- SQL contextid- the versioned_object uuidversion- version number- Returns:
I_CompositionAccessobject of the matching access instance- Throws:
IllegalArgumentException- when version number is not greater 0ObjectNotFoundException- when not matching composition can't be found
-
getVersionFromTimeStamp
static int getVersionFromTimeStamp(I_DomainAccess domainAccess, UUID vCompositionUid, Timestamp timeCommitted)
Calculate the version corresponding to aVersionedCompositionwhich is the closest in time (before) theTimestampprovided.- Parameters:
domainAccess- TheI_DomainAccesscontaining the persistence information and DB connection parameters for persisting a composition.vCompositionUid- TheUUIDcorresponding to aVersionedCompositiontimeCommitted-Timestampof commit- Returns:
- version number
- Throws:
IllegalArgumentException- if no version is available for theTimestampprovided.InternalServerException- when SQL statements fail due to internal problems.
-
retrieveInstanceByTimestamp
static I_CompositionAccess retrieveInstanceByTimestamp(I_DomainAccess domainAccess, UUID compositionUid, Timestamp timeCommitted)
Returns the instance of aVersionedCompositioncorresponding to the version which is the closest in time before the timeCommitted provided.- Parameters:
domainAccess-I_DomainAccesswith the persistence SQL Context and knowledge cachecompositionUid-UUIDthat identifies the composition.timeCommitted- {java.sql.Timestamp} that indicates the point in time to search version for the composition backwards.- Returns:
- the number of the version that is the closest in time (before) the timeCommitted parameter provided. If a null timeCommitted is provided the latest composition will be returned.
- Throws:
IllegalArgumentExceptionInternalServerExceptionObjectNotFoundException
-
retrieveInstance
static I_CompositionAccess retrieveInstance(I_DomainAccess domainAccess, UUID id)
Retrieve a composition access instance from the persistence layer- Parameters:
domainAccess- SQL context, knowledgeid- a composition uuid- Returns:
- a valid
I_CompositionAccess
-
retrieveInstancesInContribution
static Map<I_CompositionAccess,Integer> retrieveInstancesInContribution(I_DomainAccess domainAccess, UUID contributionId)
Retrieve a map of composition accesses for all compositions referencing a contribution- Parameters:
domainAccess- SQL context, knowledgecontributionId- contribution object uuid- Returns:
- a map of
I_CompositionAccessand their version number, that match the condition - Throws:
IllegalArgumentException- on DB inconsistency
-
hasPreviousVersion
static boolean hasPreviousVersion(I_DomainAccess domainAccess, UUID compositionId)
check if a composition has a previous version in history- Parameters:
domainAccess-compositionId-- Returns:
-
getVersionMapOfComposition
static Map<I_CompositionAccess,Integer> getVersionMapOfComposition(I_DomainAccess domainAccess, UUID compositionId)
Creates Map containing all versions as their Access object with their matching version number.- Parameters:
domainAccess- Data AccesscompositionId- Given composition ID- Returns:
- Map referencing all versions and their version number
-
getLastVersionNumber
static Integer getLastVersionNumber(I_DomainAccess domainAccess, UUID compositionId)
retrieve the number of versions for this composition or 1 if no history present- Parameters:
domainAccess-compositionId-- Returns:
-
fetchTerritoryCode
static Integer fetchTerritoryCode(I_DomainAccess domainAccess, String territoryAsString)
-
isValidLanguageCode
static boolean isValidLanguageCode(I_DomainAccess domainAccess, String languageCode)
-
commit
UUID commit(UUID committerId, UUID systemId, String description)
- Throws:
InternalServerException- when contribution couldn't be created because of an internal problemIllegalArgumentException- when content couldn't be committed
-
commitWithCustomContribution
UUID commitWithCustomContribution(UUID committerId, UUID systemId, String description)
Unlike the basic commit it is necessary to set the contribution manually beforehand, here. This allows committing with a specific contribution ID, which could be used to process several objects at once.- Parameters:
committerId- Committer ID (PartyIdentified)description- Description textsystemId- System ID- Returns:
- ID of committed object
- Throws:
IllegalArgumentException- when content couldn't be committed
-
update
Boolean update(UUID committerId, UUID systemId, ContributionDef.ContributionState state, I_ConceptAccess.ContributionChangeType contributionChangeType, String description)
-
updateWithCustomContribution
Boolean updateWithCustomContribution(UUID committerId, UUID systemId, I_ConceptAccess.ContributionChangeType contributionChangeType, String description)
Unlike the basic update it is necessary to set the contribution manually beforehand, here. This allows updating with a specific contribution ID, which could be used to process several objects at once.- Parameters:
committerId- Committer of this changesystemId- System of origin of this changecontributionChangeType- Change type of this changedescription- Updated description or NULL- Returns:
- Boolean to indicate success or failure of update
-
delete
Integer delete(UUID committerId, UUID systemId, String description)
Delete a composition
Delete by simulating an SQL CASCADE wherever appropriate
- delete entry first
- delete the corresponding version entry
- delete the composition record
- Returns:
-
deleteWithCustomContribution
Integer deleteWithCustomContribution(UUID committerId, UUID systemId, String description)
Unlike the basic delete it is necessary to set the contribution manually beforehand, here. This allows deleting with a specific contribution ID, which could be used to process several objects at once.- Parameters:
committerId- Committer of this changesystemId- System of origin of this changedescription- Updated description or NUL- Returns:
- Rows affected by delete
-
getSysTransaction
Timestamp getSysTransaction()
-
getTimeCommitted
Timestamp getTimeCommitted()
Gets time_committed from contribution of composition.- Returns:
- Timestamp of time of commitment
-
getId
UUID getId()
get the composition Id- Returns:
-
setComposerId
void setComposerId(UUID composerId)
set the composer id- Parameters:
composerId-UUID
-
getContextId
Optional<UUID> getContextId()
get the event context id- Returns:
- Optional with ID if it exists, otherwise empty Optional
-
getLanguageCode
String getLanguageCode()
get the language code for this composition (eg. 'en', 'fr' etc.)- Returns:
- language code as string
-
setLanguageCode
void setLanguageCode(String code)
set the language code- Parameters:
code- String
-
getTerritoryCode
Integer getTerritoryCode()
FIXME: bug? comment says 2-letter while methods are saying Integer get the 2-letters country code- Returns:
-
setTerritoryCode
void setTerritoryCode(Integer code)
FIXME: bug? comment says 2-letter while methods are saying Integer set the 2-letters territory code- Parameters:
code- String
-
getContentIds
List<UUID> getContentIds()
get the list of entry Ids for this composition- Returns:
- a list of entry
UUIDs
-
setContextCompositionId
void setContextCompositionId(UUID contextId)
set the event context id- Parameters:
contextId-UUID- Throws:
org.jooq.exception.DataAccessException- on problem updating context
-
addContent
int addContent(I_EntryAccess entry)
add an entry to the composition- Parameters:
entry-I_EntryAccessinstance- Returns:
- >0 success
-
getContent
List<I_EntryAccess> getContent()
get the list of entries for this composition- Returns:
- the list of entry as
I_EntryAccess - See Also:
I_EntryAccess
-
setContent
void setContent(List<I_EntryAccess> content)
-
setContributionId
void setContributionId(UUID contributionId)
set the contribution id for this composition- Parameters:
contributionId-
-
setCompositionRecord
void setCompositionRecord(CompositionRecord record)
-
setCompositionRecord
void setCompositionRecord(CompositionHistoryRecord record)
Set the record via converting from a history record.- Parameters:
record- History record
-
setCompositionRecord
void setCompositionRecord(org.jooq.Result<?> records)
- Throws:
IllegalArgumentException- when handling of record failed
-
setComposition
void setComposition(com.nedap.archie.rm.composition.Composition composition)
-
setContributionAccess
void setContributionAccess(I_ContributionAccess contributionAccess)
-
setAuditDetailsAccess
void setAuditDetailsAccess(I_AuditDetailsAccess auditDetailsAccess)
-
getVersion
Integer getVersion()
-
updateCompositionData
void updateCompositionData(com.nedap.archie.rm.composition.Composition newComposition)
- Throws:
IllegalArgumentException- when seeking language code, territory code or composer ID failed
-
setContext
void setContext(com.nedap.archie.rm.composition.EventContext historicalEventContext)
-
getAuditDetailsId
UUID getAuditDetailsId()
-
setAuditDetailsId
void setAuditDetailsId(UUID auditId)
-
exists
static boolean exists(I_DomainAccess domainAccess, UUID versionedObjectId)
Checks if the given versionedObjectID points to an existing composition.- Parameters:
domainAccess- Data access objectversionedObjectId- ID to be checked- Returns:
- True if exists
- Throws:
ObjectNotFoundException- if ID does not exist
-
isDeleted
static boolean isDeleted(I_DomainAccess domainAccess, UUID versionedObjectId)
Checks if given composition ID is ID of a logically deleted composition.- Parameters:
domainAccess- Data access objectversionedObjectId- ID to be checked- Returns:
- True if deleted, false if not
- Throws:
ObjectNotFoundException- If no composition entries at all can be foundInternalServerException- If DB is inconsistent or some other problem occurs
-
-