Class ParameterDAOImpl
- java.lang.Object
 - 
- com.ibm.fhir.persistence.jdbc.dao.impl.FHIRDbDAOImpl
 - 
- com.ibm.fhir.persistence.jdbc.dao.impl.ParameterDAOImpl
 
 
 
- 
- All Implemented Interfaces:
 FHIRDbDAO,ParameterDAO
public class ParameterDAOImpl extends FHIRDbDAOImpl implements ParameterDAO
This Data Access Object implements the ParameterDAO interface for creating, updating, and retrieving rows in the IBM FHIR Server parameter-related tables. 
- 
- 
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_TOKEN_SYSTEM 
- 
Constructor Summary
Constructors Constructor Description ParameterDAOImpl(Connection connection, String schemaName, FHIRDbFlavor flavor)Constructs a DAO using the passed externally managed database connection.ParameterDAOImpl(Connection connection, String schemaName, FHIRDbFlavor flavor, TransactionSynchronizationRegistry trxSynchRegistry)Constructs a DAO instance suitable for acquiring connections from a JDBC Datasource object. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intacquireCodeSystemId(String codeSystemName)Acquire and return the id associated with the passed code-system name.intacquireParameterNameId(String parameterName)Acquire and return the id associated with the passed parameter name.voidaddCodeSystemsCacheCandidate(String codeSystemName, Integer codeSystemId)Adds a code system name / code system id pair to a candidate collection for population into the CodeSystemsCache.voidaddParameterNamesCacheCandidate(String parameterName, Integer parameterId)Adds a parameter name / parameter id pair to a candidate collection for population into the ParameterNamesCache.protected IntegergetCodeSystemIdFromCaches(String codeSystemName)protected IntegergetParameterNameIdFromCaches(String parameterName)Map<String,Integer>readAllCodeSystems()Reads all rows in the Code_Systems table and returns the data as a MapMap<String,Integer>readAllSearchParameterNames()Reads all rows in the Parameter_Names table and returns the data as a MapIntegerreadCodeSystemId(String codeSystemName)Read the id for the given code system name, but do not create a new record if it doesn't exist.intreadOrAddCodeSystemId(String codeSystemName)Calls a stored procedure to read the system contained in the passed Parameter in the Code_Systems table.intreadOrAddParameterNameId(String parameterName)Calls a stored procedure to read the name contained in the passed Parameter in the Parameter_Names table.IntegerreadParameterNameId(String parameterName)Read the id for the given parameter name, but do not create a new record if it doesn't exist.- 
Methods inherited from class com.ibm.fhir.persistence.jdbc.dao.impl.FHIRDbDAOImpl
buildExceptionWithIssue, buildFHIRPersistenceDBConnectException, cleanup, cleanup, createDTO, createDTOs, getConnection, getFlavor, getSchemaName, isDb2Database, runCountQuery, runQuery, runQuery_STR_VALUES, severe, severe 
- 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface com.ibm.fhir.persistence.jdbc.dao.api.FHIRDbDAO
getConnection, getFlavor, isDb2Database 
 - 
 
 - 
 
- 
- 
Field Detail
- 
DEFAULT_TOKEN_SYSTEM
public static final String DEFAULT_TOKEN_SYSTEM
- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Constructor Detail
- 
ParameterDAOImpl
public ParameterDAOImpl(Connection connection, String schemaName, FHIRDbFlavor flavor, TransactionSynchronizationRegistry trxSynchRegistry)
Constructs a DAO instance suitable for acquiring connections from a JDBC Datasource object.- Parameters:
 Connection- - A database connection that will be managed by the caller.schemaName-flavor-trxSynchRegistry-
 
- 
ParameterDAOImpl
public ParameterDAOImpl(Connection connection, String schemaName, FHIRDbFlavor flavor)
Constructs a DAO using the passed externally managed database connection. The connection used by this instance for all DB operations will be the passed connection.- Parameters:
 Connection- - A database connection that will be managed by the caller.schemaName-flavor-
 
 - 
 
- 
Method Detail
- 
readAllSearchParameterNames
public Map<String,Integer> readAllSearchParameterNames() throws FHIRPersistenceDBConnectException, FHIRPersistenceDataAccessException
Description copied from interface:ParameterDAOReads all rows in the Parameter_Names table and returns the data as a Map- Specified by:
 readAllSearchParameterNamesin interfaceParameterDAO- Returns:
 - Map
- A map containing key=parameter-name, value=parameter-name-id  - Throws:
 FHIRPersistenceDBConnectExceptionFHIRPersistenceDataAccessException
 
- 
readAllCodeSystems
public Map<String,Integer> readAllCodeSystems() throws FHIRPersistenceDBConnectException, FHIRPersistenceDataAccessException
Description copied from interface:ParameterDAOReads all rows in the Code_Systems table and returns the data as a Map- Specified by:
 readAllCodeSystemsin interfaceParameterDAO- Returns:
 - Map
- A map containing key=system-name, value=system-id  - Throws:
 FHIRPersistenceDBConnectExceptionFHIRPersistenceDataAccessException
 
- 
readOrAddParameterNameId
public int readOrAddParameterNameId(String parameterName) throws FHIRPersistenceDBConnectException, FHIRPersistenceDataAccessException
Calls a stored procedure to read the name contained in the passed Parameter in the Parameter_Names table. If it's not in the DB, it will be stored and a unique id will be returned.- Specified by:
 readOrAddParameterNameIdin interfaceParameterDAO- Parameters:
 parameter-- Returns:
 - Integer - The generated id of the stored system.
 - Throws:
 FHIRPersistenceDBConnectExceptionFHIRPersistenceDataAccessException
 
- 
readOrAddCodeSystemId
public int readOrAddCodeSystemId(String codeSystemName) throws FHIRPersistenceDBConnectException, FHIRPersistenceDataAccessException
Calls a stored procedure to read the system contained in the passed Parameter in the Code_Systems table. If it's not in the DB, it will be stored and a unique id will be returned.- Specified by:
 readOrAddCodeSystemIdin interfaceParameterDAO- Parameters:
 parameter-- Returns:
 - Integer - The generated id of the stored system.
 - Throws:
 FHIRPersistenceDBConnectExceptionFHIRPersistenceDataAccessExceptionFHIRPersistenceException
 
- 
addCodeSystemsCacheCandidate
public void addCodeSystemsCacheCandidate(String codeSystemName, Integer codeSystemId) throws FHIRPersistenceException
Adds a code system name / code system id pair to a candidate collection for population into the CodeSystemsCache. This pair must be present as a row in the FHIR DB CODE_SYSTEMS table.- Specified by:
 addCodeSystemsCacheCandidatein interfaceParameterDAO- Parameters:
 codeSystemName- A valid code system name.codeSystemId- The id corresponding to the code system name.- Throws:
 FHIRPersistenceException
 
- 
addParameterNamesCacheCandidate
public void addParameterNamesCacheCandidate(String parameterName, Integer parameterId) throws FHIRPersistenceException
Adds a parameter name / parameter id pair to a candidate collection for population into the ParameterNamesCache. This pair must be present as a row in the FHIR DB PARAMETER_NAMES table.- Specified by:
 addParameterNamesCacheCandidatein interfaceParameterDAO- Parameters:
 parameterName- A valid search or sort parameter name.parameterId- The id corresponding to the parameter name.- Throws:
 FHIRPersistenceException
 
- 
acquireParameterNameId
public int acquireParameterNameId(String parameterName) throws FHIRPersistenceException
Acquire and return the id associated with the passed parameter name.- Specified by:
 acquireParameterNameIdin interfaceParameterDAO- Parameters:
 parameterName- The name of a valid FHIR search parameter.- Returns:
 - Integer A parameter id.
 - Throws:
 FHIRPersistenceException
 
- 
acquireCodeSystemId
public int acquireCodeSystemId(String codeSystemName) throws FHIRPersistenceException
Acquire and return the id associated with the passed code-system name.- Specified by:
 acquireCodeSystemIdin interfaceParameterDAO- Parameters:
 codeSystemName- The name of a valid code-system.- Returns:
 - Integer A code-system id.
 - Throws:
 FHIRPersistenceException
 
- 
readParameterNameId
public Integer readParameterNameId(String parameterName) throws FHIRPersistenceDBConnectException, FHIRPersistenceDataAccessException
Description copied from interface:ParameterDAORead the id for the given parameter name, but do not create a new record if it doesn't exist.- Specified by:
 readParameterNameIdin interfaceParameterDAO- Returns:
 - the id for the parameter name, or null not found
 - Throws:
 FHIRPersistenceDBConnectExceptionFHIRPersistenceDataAccessException
 
- 
readCodeSystemId
public Integer readCodeSystemId(String codeSystemName) throws FHIRPersistenceDBConnectException, FHIRPersistenceDataAccessException
Description copied from interface:ParameterDAORead the id for the given code system name, but do not create a new record if it doesn't exist.- Specified by:
 readCodeSystemIdin interfaceParameterDAO- Returns:
 - Integer - The id associated with the passed code system name, or null if it doesn't exist
 - Throws:
 FHIRPersistenceDBConnectExceptionFHIRPersistenceDataAccessException
 
 - 
 
 -