Package org.ehrbase.dao.access.jooq
Class PartyIdentifiedAccess
- java.lang.Object
-
- org.ehrbase.dao.access.support.DataAccess
-
- org.ehrbase.dao.access.jooq.PartyIdentifiedAccess
-
- All Implemented Interfaces:
I_DomainAccess,I_PartyIdentifiedAccess,I_SimpleCRUD
public class PartyIdentifiedAccess extends DataAccess implements I_PartyIdentifiedAccess
Created by Christian Chevalley on 4/10/2015.
-
-
Field Summary
-
Fields inherited from interface org.ehrbase.dao.access.interfaces.I_DomainAccess
DBCP2_POOL, KEY_AUTO_RECONNECT, KEY_CONNECTION_MODE, KEY_DATABASE, KEY_DIALECT, KEY_HOST, KEY_INITIAL_CONNECTIONS, KEY_INTROSPECT_CACHE, KEY_KNOWLEDGE, KEY_LOG_ABANDONNED, KEY_LOGIN, KEY_MAX_ACTIVE, KEY_MAX_CONNECTION, KEY_MAX_IDLE, KEY_PASSWORD, KEY_PORT, KEY_REMOVE_ABANDONNED, KEY_REMOVE_ABANDONNED_TIMEOUT, KEY_SCHEMA, KEY_SET_MAX_PREPARED_STATEMENTS, KEY_SET_POOL_PREPARED_STATEMENTS, KEY_TEST_ON_BORROW, KEY_URL, KEY_WAIT_MS, PG_POOL
-
-
Constructor Summary
Constructors Constructor Description PartyIdentifiedAccess(org.jooq.DSLContext context, ServerConfig serverConfig, String partyName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description IntegeraddIdentifier(String value, String issuer, String assigner, String type)add an identifier to a partyUUIDcommit()storeComposition a new entry in the DB, using a default transaction time
only implemented with "root" tables: ehr, contribution and composition!UUIDcommit(Timestamp transactionTime)storeComposition a new entry in the DBIntegerdelete()delete the Versioned Object associated with the instance implementing this Data Access Interface.IntegerdeleteIdentifier(String idCode, String issuer)delete a specific identifier for the current partystatic UUIDfindIdentifiedParty(org.jooq.DSLContext context, List<com.nedap.archie.rm.datavalues.DvIdentifier> identifierList)static UUIDfindReferencedParty(org.jooq.DSLContext context, com.nedap.archie.rm.support.identification.PartyRef partyRef)DataAccessgetDataAccess()UUIDgetId()String[]getIdentifiersKeySet()get the list of identifier keys
a key is formatted as 'code:issuer'static UUIDgetOrCreateParty(I_DomainAccess domainAccess, com.nedap.archie.rm.generic.PartyIdentified partyIdentified)retrieve or create a party with a PartyIdentified (external ref)static UUIDgetOrCreateParty(I_DomainAccess domainAccess, String name, String idCode, String issuer, String assigner, String typeName)retrieve or create a party with an identifier (NB.StringgetPartyName()get the party nameStringgetPartyRefNamespace()StringgetPartyRefValue()static I_PartyIdentifiedAccessretrieveInstance(I_DomainAccess domainAccess, UUID id)retrieve a party identified from its UUIDstatic UUIDretrievePartyIdByPartyName(I_DomainAccess domainAccess, String partyName)retrieve an instance by its name
should be used for test purpose as the subject should not be known in this contextstatic com.nedap.archie.rm.generic.PartyIdentifiedretrievePartyIdentified(String name, String refScheme, String refNamespace, String refValue, String refType)static com.nedap.archie.rm.generic.PartyIdentifiedretrievePartyIdentified(I_DomainAccess domainAccess, UUID id)retrieve an identified party by its UUIDvoidsetPartyName(String name)set the party nameBooleanupdate()updateComposition the current entry using time now as the system transaction time
only implemented at root level object (contribution, composition, ehr).Booleanupdate(Boolean force)Deprecated.Booleanupdate(Timestamp transactionTime)updateComposition the current entry
depending on the implementation, records are updated only if one or more field(s) have been changedBooleanupdate(Timestamp transactionTime, boolean force)Deprecated.-
Methods inherited from class org.ehrbase.dao.access.support.DataAccess
getConnection, getContext, getDialect, getIntrospectService, getKnowledgeManager, getServerConfig, releaseConnection
-
-
-
-
Constructor Detail
-
PartyIdentifiedAccess
public PartyIdentifiedAccess(org.jooq.DSLContext context, ServerConfig serverConfig, String partyName)
-
-
Method Detail
-
retrieveInstance
public static I_PartyIdentifiedAccess retrieveInstance(I_DomainAccess domainAccess, UUID id)
Description copied from interface:I_PartyIdentifiedAccessretrieve a party identified from its UUID- Parameters:
domainAccess- SQL accessid- UUID- Returns:
- an access layer instance
-
retrievePartyIdByPartyName
public static UUID retrievePartyIdByPartyName(I_DomainAccess domainAccess, String partyName)
Description copied from interface:I_PartyIdentifiedAccessretrieve an instance by its name
should be used for test purpose as the subject should not be known in this context- Parameters:
domainAccess- SQL accesspartyName- a subject name- Returns:
-
getOrCreateParty
public static UUID getOrCreateParty(I_DomainAccess domainAccess, String name, String idCode, String issuer, String assigner, String typeName)
Description copied from interface:I_PartyIdentifiedAccessretrieve or create a party with an identifier (NB. a party has n identifiers)name- the party nameidCode- the identifier valueissuer- identifier issuerassigner- identifier assignertypeName- identifier type- Returns:
-
findIdentifiedParty
public static UUID findIdentifiedParty(org.jooq.DSLContext context, List<com.nedap.archie.rm.datavalues.DvIdentifier> identifierList)
-
findReferencedParty
public static UUID findReferencedParty(org.jooq.DSLContext context, com.nedap.archie.rm.support.identification.PartyRef partyRef)
-
getOrCreateParty
public static UUID getOrCreateParty(I_DomainAccess domainAccess, com.nedap.archie.rm.generic.PartyIdentified partyIdentified)
Description copied from interface:I_PartyIdentifiedAccessretrieve or create a party with a PartyIdentified (external ref)- Returns:
-
retrievePartyIdentified
public static com.nedap.archie.rm.generic.PartyIdentified retrievePartyIdentified(I_DomainAccess domainAccess, UUID id)
Description copied from interface:I_PartyIdentifiedAccessretrieve an identified party by its UUID- Returns:
-
retrievePartyIdentified
public static com.nedap.archie.rm.generic.PartyIdentified retrievePartyIdentified(String name, String refScheme, String refNamespace, String refValue, String refType)
-
commit
public UUID commit(Timestamp transactionTime)
Description copied from interface:I_SimpleCRUDstoreComposition a new entry in the DB- Specified by:
commitin interfaceI_SimpleCRUD- Returns:
- the UUID of the newly created record
-
commit
public UUID commit()
Description copied from interface:I_SimpleCRUDstoreComposition a new entry in the DB, using a default transaction time
only implemented with "root" tables: ehr, contribution and composition!- Specified by:
commitin interfaceI_SimpleCRUD- Returns:
- the UUID of the newly created record
-
update
public Boolean update(Timestamp transactionTime)
Description copied from interface:I_SimpleCRUDupdateComposition the current entry
depending on the implementation, records are updated only if one or more field(s) have been changed- Specified by:
updatein interfaceI_SimpleCRUD- Returns:
-
update
@Deprecated public Boolean update(Timestamp transactionTime, boolean force)
Deprecated.Description copied from interface:I_SimpleCRUDupdateComposition the current entry even if the record is not modified
intended to be used with temporal tables to ensure that a set of interdependent tables are updated in sync. This approach is used to simplify versions retrieval.- Specified by:
updatein interfaceI_SimpleCRUD- Returns:
- Throws:
InternalServerException- because inherited interface function isn't implemented in this class
-
update
public Boolean update()
Description copied from interface:I_SimpleCRUDupdateComposition the current entry using time now as the system transaction time
only implemented at root level object (contribution, composition, ehr). depending on the implementation, records are updated only if one or more field(s) have been changed- Specified by:
updatein interfaceI_SimpleCRUD- Returns:
-
update
@Deprecated public Boolean update(Boolean force)
Deprecated.Description copied from interface:I_SimpleCRUDupdateComposition the current entry using time now as the system transaction time
only implemented at root level object (contribution, composition, ehr). depending on the implementation, records are updated only if one or more field(s) have been changed- Specified by:
updatein interfaceI_SimpleCRUD- Returns:
- Throws:
InternalServerException- because inherited interface function isn't implemented in this class
-
delete
public Integer delete()
Description copied from interface:I_SimpleCRUDdelete the Versioned Object associated with the instance implementing this Data Access Interface. Relies on ON DELETE CASCADE- Specified by:
deletein interfaceI_SimpleCRUD- Returns:
-
addIdentifier
public Integer addIdentifier(String value, String issuer, String assigner, String type)
Description copied from interface:I_PartyIdentifiedAccessadd an identifier to a party- Specified by:
addIdentifierin interfaceI_PartyIdentifiedAccess- Parameters:
value- a subject id codeissuer- the authority issuing the subject Id Code (ex. NHS)assigner- the authority that assign the id to the identified itemtype- a descriptive literal following a conventional vocabulary (SSN, prescription etc.)- Returns:
- number of record added
-
deleteIdentifier
public Integer deleteIdentifier(String idCode, String issuer)
Description copied from interface:I_PartyIdentifiedAccessdelete a specific identifier for the current party- Specified by:
deleteIdentifierin interfaceI_PartyIdentifiedAccess- Parameters:
idCode- the subject codeissuer- the issuer id- Returns:
- number of record deleted
-
getPartyName
public String getPartyName()
Description copied from interface:I_PartyIdentifiedAccessget the party name- Specified by:
getPartyNamein interfaceI_PartyIdentifiedAccess- Returns:
-
setPartyName
public void setPartyName(String name)
Description copied from interface:I_PartyIdentifiedAccessset the party name- Specified by:
setPartyNamein interfaceI_PartyIdentifiedAccess
-
getPartyRefValue
public String getPartyRefValue()
- Specified by:
getPartyRefValuein interfaceI_PartyIdentifiedAccess
-
getPartyRefNamespace
public String getPartyRefNamespace()
- Specified by:
getPartyRefNamespacein interfaceI_PartyIdentifiedAccess
-
getIdentifiersKeySet
public String[] getIdentifiersKeySet()
Description copied from interface:I_PartyIdentifiedAccessget the list of identifier keys
a key is formatted as 'code:issuer'- Specified by:
getIdentifiersKeySetin interfaceI_PartyIdentifiedAccess- Returns:
-
getId
public UUID getId()
- Specified by:
getIdin interfaceI_PartyIdentifiedAccess
-
getDataAccess
public DataAccess getDataAccess()
- Specified by:
getDataAccessin interfaceI_DomainAccess
-
-