use of org.akaza.openclinica.bean.managestudy.StudySubjectBean in project OpenClinica by OpenClinica.
the class StudySubjectDAO method getCountWithFilter.
public Integer getCountWithFilter(StudyAuditLogFilter filter, StudyBean currentStudy) {
StudySubjectBean studySubjectBean = new StudySubjectBean();
setTypesExpected();
HashMap variables = new HashMap();
variables.put(new Integer(1), currentStudy.getId());
variables.put(new Integer(2), currentStudy.getId());
String sql = digester.getQuery("getCountWithFilterAuditLog");
sql += filter.execute("");
ArrayList rows = this.select(sql, variables);
Iterator it = rows.iterator();
if (it.hasNext()) {
Integer count = (Integer) ((HashMap) it.next()).get("count");
return count;
} else {
return null;
}
}
use of org.akaza.openclinica.bean.managestudy.StudySubjectBean in project OpenClinica by OpenClinica.
the class StudySubjectDAO method getTotalEventCrfCountForCrfMigration.
public Integer getTotalEventCrfCountForCrfMigration(FormLayoutBean sourceCrfVersionBean, FormLayoutBean targetCrfVersionBean, ArrayList<String> studyEventDefnlist, ArrayList<String> sitelist) {
StudySubjectBean studySubjectBean = new StudySubjectBean();
setTypesExpected();
HashMap variables = new HashMap();
String eventStr = StringUtils.join(studyEventDefnlist, ",");
String siteStr = StringUtils.join(sitelist, ",");
variables.put(new Integer(1), new Integer(sourceCrfVersionBean.getId()));
variables.put(2, eventStr);
variables.put(3, siteStr);
variables.put(4, String.valueOf(sourceCrfVersionBean.getId()));
variables.put(5, String.valueOf(targetCrfVersionBean.getId()));
String sql = digester.getQuery("getTotalEventCrfCountForCrfMigration");
ArrayList rows = this.select(sql, variables);
Iterator it = rows.iterator();
if (it.hasNext()) {
Integer count = (Integer) ((HashMap) it.next()).get("count");
return count;
} else {
return null;
}
}
use of org.akaza.openclinica.bean.managestudy.StudySubjectBean in project OpenClinica by OpenClinica.
the class StudySubjectDAO method getWithFilterAndSort.
public ArrayList<StudySubjectBean> getWithFilterAndSort(StudyBean currentStudy, StudyAuditLogFilter filter, StudyAuditLogSort sort, int rowStart, int rowEnd) {
ArrayList<StudySubjectBean> studySubjects = new ArrayList<StudySubjectBean>();
setTypesExpectedFilter();
HashMap variables = new HashMap();
variables.put(new Integer(1), currentStudy.getId());
variables.put(new Integer(2), currentStudy.getId());
String sql = digester.getQuery("getWithFilterAndSortAuditLog");
sql = sql + filter.execute("");
if ("oracle".equalsIgnoreCase(CoreResources.getDBName())) {
sql += " )x) where r between " + (rowStart + 1) + " and " + rowEnd;
sql = sql + sort.execute("");
} else {
sql = sql + sort.execute("");
sql = sql + " LIMIT " + (rowEnd - rowStart) + " OFFSET " + rowStart;
}
// System.out.println("SQL: " + sql);
ArrayList rows = this.select(sql, variables);
Iterator it = rows.iterator();
while (it.hasNext()) {
StudySubjectBean studySubjectBean = (StudySubjectBean) this.getEntityFromHashMap((HashMap) it.next());
studySubjects.add(studySubjectBean);
}
return studySubjects;
}
use of org.akaza.openclinica.bean.managestudy.StudySubjectBean in project OpenClinica by OpenClinica.
the class StudySubjectDAO method getCountWithFilter.
public Integer getCountWithFilter(ListEventsForSubjectFilter filter, StudyBean currentStudy) {
StudySubjectBean studySubjectBean = new StudySubjectBean();
setTypesExpected();
HashMap variables = new HashMap();
variables.put(new Integer(1), currentStudy.getId());
variables.put(new Integer(2), currentStudy.getId());
String sql = digester.getQuery("getCountWithFilter");
sql += filter.execute("");
ArrayList rows = this.select(sql, variables);
Iterator it = rows.iterator();
if (it.hasNext()) {
Integer count = (Integer) ((HashMap) it.next()).get("count");
return count;
} else {
return null;
}
}
use of org.akaza.openclinica.bean.managestudy.StudySubjectBean in project OpenClinica by OpenClinica.
the class StudySubjectDAO method getWithFilterAndSort.
public ArrayList<StudySubjectBean> getWithFilterAndSort(StudyBean currentStudy, ListDiscNotesForCRFFilter filter, ListDiscNotesForCRFSort sort, int rowStart, int rowEnd) {
ArrayList<StudySubjectBean> studySubjects = new ArrayList<StudySubjectBean>();
setTypesExpected();
HashMap variables = new HashMap();
variables.put(new Integer(1), currentStudy.getId());
variables.put(new Integer(2), currentStudy.getId());
String sql = digester.getQuery("getWithFilterAndSortListDiscNotes");
sql = sql + filter.execute("");
if ("oracle".equalsIgnoreCase(CoreResources.getDBName())) {
sql += " )x) where r between " + (rowStart + 1) + " and " + rowEnd;
sql = sql + sort.execute("");
} else {
sql = sql + sort.execute("");
sql = sql + " LIMIT " + (rowEnd - rowStart) + " OFFSET " + rowStart;
}
ArrayList rows = this.select(sql, variables);
Iterator it = rows.iterator();
while (it.hasNext()) {
StudySubjectBean studySubjectBean = (StudySubjectBean) this.getEntityFromHashMap((HashMap) it.next());
studySubjects.add(studySubjectBean);
}
return studySubjects;
}
Aggregations