Interface I_CompositionAccess
- All Superinterfaces:
I_Compensatable,I_VersionedCRUD
- All Known Implementing Classes:
CompositionAccess
Composition Access Layer Interface
Interface CRUD and specific methods
Interface CRUD and specific methods
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final org.jooq.Table<IdentifierRecord>static final org.jooq.Table<PartyIdentifiedRecord>static final Stringstatic final org.jooq.Table<CompositionRecord>static final Stringstatic final org.jooq.Table<ConceptRecord>static final Stringstatic final org.jooq.Table<EventContextRecord>static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final org.jooq.Table<IdentifierRecord>static final org.jooq.Table<PartyIdentifiedRecord>static final Stringstatic final org.jooq.Table<ParticipationRecord>static final Stringstatic final org.jooq.Table<PartyIdentifiedRecord>static final Stringstatic final org.jooq.Table<TerritoryRecord> -
Method Summary
Modifier and TypeMethodDescriptionvoidInvoke physical deletion.static booleanexists(I_DomainAccess domainAccess, UUID versionedObjectId) Checks if the given versionedObjectID points to an existing composition.static intfetchTerritoryCode(I_DomainAccess domainAccess, String territoryAsString) get the composer IdGet the entry linked to the composition.get the event context idget the contribution idgetEhrid()get the EHR id to which this composition belongs tostatic UUIDgetEhrId(I_DomainAccess domainAccess, UUID compositionId) getId()get the composition Idget 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 presentgetLinks()static I_CompositionAccessgetNewInstance(I_DomainAccess domain, com.nedap.archie.rm.composition.Composition composition, UUID ehrId, String tenantIdentifier) Get a new Composition Access InstanceFIXME: bug? comment says 2-letter while methods are saying Integer get the 2-letters country codeGets time_committed from contribution of composition.static intgetVersionFromTimeStamp(I_DomainAccess domainAccess, UUID vCompositionUid, Timestamp timeCommitted) Calculate the version corresponding to aVersionedCompositionwhich is the closest in time (before) theTimestampprovided.static Map<Integer,I_CompositionAccess> 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<com.nedap.archie.rm.support.identification.ObjectVersionId,I_CompositionAccess> retrieveInstancesInContribution(I_DomainAccess domainAccess, UUID contributionId, String node) 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) voidSet the record via converting from a history record.voidvoidsetCompositionRecord(org.jooq.Result<?> records) voidsetContent(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 compositionvoidset the EHR idvoidsetFeederAudit(com.nedap.archie.rm.archetyped.FeederAudit feederAudit) voidsetLanguageCode(String code) set the language codevoidvoidsetTerritoryCode(Integer code) FIXME: bug? comment says 2-letter while methods are saying Integer set the 2-letters territory codevoidupdateCompositionData(com.nedap.archie.rm.composition.Composition newComposition)
-
Field Details
-
COMPOSITION_JOIN
- See Also:
-
COMPOSER_JOIN
- See Also:
-
COMPOSER_ID
- See Also:
-
FACILITY_JOIN
- See Also:
-
FACILITY_ID
- See Also:
-
EVENT_CONTEXT_JOIN
- See Also:
-
PARTICIPATION_JOIN
- See Also:
-
PERFORMER_JOIN
- See Also:
-
TERRITORY_JOIN
- See Also:
-
CONCEPT_JOIN
- See Also:
-
F_VERSION
- See Also:
-
F_COMPOSITION_ID
- See Also:
-
F_ENTRY
- See Also:
-
F_ENTRY_TEMPLATE
- See Also:
-
F_LANGUAGE
- See Also:
-
F_TERRITORY
- See Also:
-
F_TERRITORY_CODE
- See Also:
-
F_COMPOSER_NAME
- See Also:
-
F_COMPOSER_REF_VALUE
- See Also:
-
F_COMPOSER_REF_SCHEME
- See Also:
-
F_COMPOSER_REF_NAMESPACE
- See Also:
-
F_COMPOSER_REF_TYPE
- See Also:
-
F_COMPOSER_ID_VALUE
- See Also:
-
F_COMPOSER_ID_ISSUER
- See Also:
-
F_COMPOSER_ID_TYPE_NAME
- See Also:
-
F_CONTEXT_START_TIME
- See Also:
-
F_CONTEXT_START_TIME_TZID
- See Also:
-
F_CONTEXT_END_TIME
- See Also:
-
F_CONTEXT_END_TIME_TZID
- See Also:
-
F_CONTEXT_LOCATION
- See Also:
-
F_CONTEXT_SETTING
- See Also:
-
F_CONTEXT_OTHER_CONTEXT
- See Also:
-
F_FACILITY_NAME
- See Also:
-
F_FACILITY_REF_VALUE
- See Also:
-
F_FACILITY_REF_SCHEME
- See Also:
-
F_FACILITY_REF_NAMESPACE
- See Also:
-
F_FACILITY_REF_TYPE
- See Also:
-
F_FACILITY_ID_VALUE
- See Also:
-
F_FACILITY_ID_ISSUER
- See Also:
-
F_FACILITY_ID_TYPE_NAME
- See Also:
-
F_PARTICIPATION_FUNCTION
- See Also:
-
F_PARTICIPATION_MODE
- See Also:
-
F_PARTICIPATION_START_TIME
- See Also:
-
F_PARTICIPATION_START_TIME_TZID
- See Also:
-
F_PERFORMER_NAME
- See Also:
-
F_PERFORMER_REF_VALUE
- See Also:
-
F_PERFORMER_REF_SCHEME
- See Also:
-
F_PERFORMER_REF_NAMESPACE
- See Also:
-
F_PERFORMER_REF_TYPE
- See Also:
-
F_PERFORMER_ID_VALUE
- See Also:
-
F_PERFORMER_ID_ISSUER
- See Also:
-
F_PERFORMER_ID_TYPE_NAME
- See Also:
-
F_CONCEPT_ID
- See Also:
-
F_CONCEPT_DESCRIPTION
- See Also:
-
compositionRef
-
composerRef
-
composerId
-
facilityRef
-
facilityId
-
eventContextRef
-
participationRef
-
performerRef
-
territoryRef
-
conceptRef
-
-
Method Details
-
getNewInstance
static I_CompositionAccess getNewInstance(I_DomainAccess domain, com.nedap.archie.rm.composition.Composition composition, UUID ehrId, String tenantIdentifier) 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
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<com.nedap.archie.rm.support.identification.ObjectVersionId,I_CompositionAccess> retrieveInstancesInContribution(I_DomainAccess domainAccess, UUID contributionId, String node) Retrieve a map of composition accesses for all compositions referencing a contribution- Parameters:
domainAccess- SQL context, knowledgecontributionId- contribution object uuidnode- Name of local node, for creation of object version ID- Returns:
- a map of
I_CompositionAccessand their version ID, that match the condition - Throws:
IllegalArgumentException- on DB inconsistency
-
hasPreviousVersion
check if a composition has a previous version in history- Parameters:
domainAccess-compositionId-- Returns:
-
getVersionMapOfComposition
static Map<Integer,I_CompositionAccess> 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 by their version number
-
getLastVersionNumber
retrieve the number of versions for this composition or 1 if no history present- Parameters:
domainAccess-compositionId-- Returns:
-
fetchTerritoryCode
-
isValidLanguageCode
-
getEhrId
-
getSysTransaction
Timestamp getSysTransaction()- Specified by:
getSysTransactionin interfaceI_Compensatable
-
getTimeCommitted
Timestamp getTimeCommitted()Gets time_committed from contribution of composition.- Returns:
- Timestamp of time of commitment
-
getId
UUID getId()get the composition Id- Specified by:
getIdin interfaceI_Compensatable- Returns:
-
getEhrid
UUID getEhrid()get the EHR id to which this composition belongs to- Returns:
UUID
-
setEhrid
set the EHR id- Parameters:
ehrId-UUID
-
getComposerId
UUID getComposerId()get the composer Id- Returns:
UUID
-
setComposerId
set the composer id- Parameters:
composerId-UUID
-
getContextId
get the event context id- Returns:
- Optional with ID if it exists, otherwise empty Optional
-
getContributionId
UUID getContributionId()get the contribution id- Specified by:
getContributionIdin interfaceI_Compensatable- Returns:
UUID
-
getLanguageCode
String getLanguageCode()get the language code for this composition (eg. 'en', 'fr' etc.)- Returns:
- language code as string
-
setLanguageCode
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
FIXME: bug? comment says 2-letter while methods are saying Integer set the 2-letters territory code- Parameters:
code- String
-
getFeederAudit
String getFeederAudit() -
setFeederAudit
void setFeederAudit(com.nedap.archie.rm.archetyped.FeederAudit feederAudit) -
setLinks
-
getLinks
String getLinks() -
setContextCompositionId
set the event context id- Parameters:
contextId-UUID- Throws:
org.jooq.exception.DataAccessException- on problem updating context
-
getContent
I_EntryAccess getContent()Get the entry linked to the composition.- Returns:
- the entry
- See Also:
-
setContent
-
setContributionId
set the contribution id for this composition- Parameters:
contributionId-
-
setCompositionRecord
-
setCompositionRecord
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
-
setAuditDetailsAccess
-
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() -
getAuditDetailsAccess
I_AuditDetailsAccess getAuditDetailsAccess() -
setAuditDetailsId
-
exists
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
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
-
adminDelete
void adminDelete()Invoke physical deletion. -
getAttestationRef
UUID getAttestationRef()
-