public class PostgresPatientStore extends PostgresExtension<I2b2Patient> implements PatientStore, Closeable
The method open(Connection, String, DataDialect) will load all patients (relevant to the selected project)
into a memory structure based on a hash table.
Some optional columns are used: vital_status_cd, birth_date, death_date, sex_cd, download_date, sourcesystem_cd
The store should be separate from the extension? E.g. I2b2PatientExtension which can operate on PostgresStore, OracleStore, etc. HistreamPatientExtension can also operate on I2b2PostgresStore?
The patient_mapping table is used to map actual (source) patient_ide to internal patient_num for facts. The patient_mapping table is also used to store patient merge events (eg. different patient_ide referring to the same patient_num The Observation stream will still use the actual source patient_ide and encounter_ide
In the patient_mapping table, patient_ide_status can assume values Active, Inactive, Deleted, Merged. The 'Active' patient_mapping for the selected project is used as primary patient id, all other rows are used as alias ids.
| Constructor and Description |
|---|
PostgresPatientStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
I2b2Patient |
createInstance(Object... args) |
I2b2Patient |
createInstance(Observation fact) |
void |
deleteWhereSourceId(String sourceId) |
void |
flush()
Write updates to disk.
|
String[] |
getAliasIds(Patient patient) |
Iterable<Class<? super I2b2Patient>> |
getInstanceTypes() |
I2b2Patient |
lookupPatientNum(Integer patient_num) |
void |
merge(Patient patient,
String additionalId,
ExternalSourceType source) |
void |
open(Connection connection,
String projectId,
DataDialect dialect) |
protected void |
prepareStatements() |
void |
purge(String id) |
I2b2Patient |
retrieve(String id) |
int |
size()
Returns the number of patients which are currently available in memory.
|
public void open(Connection connection, String projectId, DataDialect dialect) throws SQLException
SQLExceptionpublic I2b2Patient lookupPatientNum(Integer patient_num)
protected void prepareStatements()
throws SQLException
prepareStatements in class PostgresExtension<I2b2Patient>SQLExceptionpublic int size()
public I2b2Patient createInstance(Observation fact)
createInstance in interface Extension<I2b2Patient>public Iterable<Class<? super I2b2Patient>> getInstanceTypes()
getInstanceTypes in interface Extension<I2b2Patient>public I2b2Patient createInstance(Object... args) throws IllegalArgumentException
createInstance in interface Extension<I2b2Patient>IllegalArgumentExceptionpublic I2b2Patient retrieve(String id)
retrieve in interface PatientStorepublic void merge(Patient patient, String additionalId, ExternalSourceType source)
merge in interface PatientStorepublic String[] getAliasIds(Patient patient)
getAliasIds in interface PatientStorepublic void deleteWhereSourceId(String sourceId) throws SQLException
deleteWhereSourceId in class PostgresExtension<I2b2Patient>SQLExceptionpublic void flush()
PostgresExtensionflush in class PostgresExtension<I2b2Patient>public void purge(String id)
purge in interface PatientStorepublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2013–2017 R.W.Majeed. All rights reserved.