Class CodeSystemDAOImpl
- java.lang.Object
-
- com.ibm.fhir.persistence.jdbc.dao.impl.CodeSystemDAOImpl
-
- All Implemented Interfaces:
CodeSystemDAO
- Direct Known Subclasses:
DerbyCodeSystemDAO,PostgresCodeSystemDAO
public class CodeSystemDAOImpl extends java.lang.Object implements CodeSystemDAO
This DAO uses a connection provided to its constructor. It's therefore assumed to be a short-lived object, created on-the-fly. Caching etc is handled elsewhere...we're just doing JDBC stuff here.
-
-
Constructor Summary
Constructors Constructor Description CodeSystemDAOImpl(java.sql.Connection c, java.lang.String schemaName)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 protected java.sql.ConnectiongetConnection()Provide subclasses with access to theConnectionprotected java.lang.StringgetSchemaName()Getter for the FHIR data schemajava.util.Map<java.lang.String,java.lang.Integer>readAllCodeSystems()Reads all rows in the code_systems table and returns the data as a Mapjava.lang.IntegerreadCodeSystemId(java.lang.String codeSystem)Read the code_system_id for the given code system nameintreadOrAddCodeSystem(java.lang.String systemName)Calls a stored procedure to read the system contained in the passed Parameter in the Code_Systems table.
-
-
-
Method Detail
-
getConnection
protected java.sql.Connection getConnection()
Provide subclasses with access to theConnection- Returns:
-
getSchemaName
protected java.lang.String getSchemaName()
Getter for the FHIR data schema- Returns:
-
readAllCodeSystems
public java.util.Map<java.lang.String,java.lang.Integer> readAllCodeSystems() throws FHIRPersistenceDataAccessExceptionDescription copied from interface:CodeSystemDAOReads all rows in the code_systems table and returns the data as a Map- Specified by:
readAllCodeSystemsin interfaceCodeSystemDAO- Returns:
- A map containing key=system-name, value=system-id
- Throws:
FHIRPersistenceDataAccessException
-
readOrAddCodeSystem
public int readOrAddCodeSystem(java.lang.String systemName) throws FHIRPersistenceDataAccessExceptionCalls 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:
readOrAddCodeSystemin interfaceCodeSystemDAO- Parameters:
systemName-- Returns:
- The generated id of the stored system.
- Throws:
FHIRPersistenceDataAccessException
-
readCodeSystemId
public java.lang.Integer readCodeSystemId(java.lang.String codeSystem) throws FHIRPersistenceDataAccessExceptionDescription copied from interface:CodeSystemDAORead the code_system_id for the given code system name- Specified by:
readCodeSystemIdin interfaceCodeSystemDAO- Returns:
- the parameter_name_id for for parameter, or null if it doesn't exist
- Throws:
FHIRPersistenceDataAccessException
-
-