@@ -198,10 +211,10 @@ public class PostgresPatientStore extends PostgresExtension<I2b2Patient> impleme
//selectAll = db.prepareStatement("SELECT p.patient_num, p.vital_status_cd, p.birth_date, p.death_date, p.sex_cd, p.download_date, p.sourcesystem_cd, m.patient_ide, m.patient_ide_source, m.patient_ide_status FROM patient_mapping m, patient_dimension p WHERE m.patient_num=p.patient_num AND m.project_id='"+projectId+"'");
// TODO select only patients relevant to the current project: eg. join patient_dimension with patient_mapping to get only relevant rows.
selectAll=db.prepareStatement("SELECT patient_num, vital_status_cd, birth_date, death_date, sex_cd, download_date, sourcesystem_cd FROM patient_dimension",ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_READ_ONLY);
selectAll.setFetchSize(getFetchSize());
selectAll.setFetchSize(this.fetchSize);
selectAllIde=db.prepareStatement("SELECT patient_num, patient_ide, patient_ide_source, patient_ide_status, project_id FROM patient_mapping WHERE project_id='"+projectId+"' ORDER BY patient_num",ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_READ_ONLY);
selectAllIde.setFetchSize(getFetchSize());
selectAllIde.setFetchSize(this.fetchSize);
deletePatientSource=db.prepareStatement("DELETE FROM patient_dimension WHERE sourcesystem_cd=?");
deleteMapSource=db.prepareStatement("DELETE FROM patient_mapping WHERE sourcesystem_cd=?");
...
...
@@ -453,7 +466,7 @@ public class PostgresPatientStore extends PostgresExtension<I2b2Patient> impleme