use of org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean in project OpenClinica by OpenClinica.
the class DiscrepancyNoteDAO method getItemDataDNCountWithFilter.
public Integer getItemDataDNCountWithFilter(ListNotesFilter filter, Integer currentStudyId) {
DiscrepancyNoteBean discrepancyNoteBean = new DiscrepancyNoteBean();
setTypesExpected();
HashMap variables = new HashMap();
variables.put(Integer.valueOf(1), currentStudyId);
variables.put(Integer.valueOf(2), currentStudyId);
String sql = digester.getQuery("getItemDataDNCountWithFilter");
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.DiscrepancyNoteBean in project OpenClinica by OpenClinica.
the class DiscrepancyNoteDAO method updateDnMapActivation.
public EntityBean updateDnMapActivation(EntityBean eb) {
// update discrepancy_note set
// assigned_user_id = ?
// where discrepancy_note_id=?
DiscrepancyNoteBean dnb = (DiscrepancyNoteBean) eb;
dnb.setActive(false);
HashMap variables = new HashMap();
variables.put(Integer.valueOf(1), dnb.isActivated());
variables.put(Integer.valueOf(2), dnb.getEntityId());
this.execute(digester.getQuery("updateDnMapActivation"), variables);
if (isQuerySuccessful()) {
dnb.setActive(true);
}
return dnb;
}
use of org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean in project OpenClinica by OpenClinica.
the class DiscrepancyNoteDAO method findAllStudySubjectByStudyAndId.
public ArrayList<DiscrepancyNoteBean> findAllStudySubjectByStudyAndId(StudyBean study, int studySubjectId) {
this.setTypesExpected();
ArrayList alist = new ArrayList();
// ss.label
this.setTypeExpected(12, TypeNames.STRING);
// column_name
this.setTypeExpected(13, TypeNames.STRING);
// study_subject_id
this.setTypeExpected(14, TypeNames.INT);
HashMap variables = new HashMap();
variables.put(Integer.valueOf(1), Integer.valueOf(study.getId()));
variables.put(Integer.valueOf(2), Integer.valueOf(study.getId()));
variables.put(Integer.valueOf(3), Integer.valueOf(studySubjectId));
alist = this.select(digester.getQuery("findAllStudySubjectByStudyAndId"), variables);
ArrayList al = new ArrayList();
Iterator it = alist.iterator();
while (it.hasNext()) {
HashMap hm = (HashMap) it.next();
DiscrepancyNoteBean eb = (DiscrepancyNoteBean) this.getEntityFromHashMap(hm);
eb.setSubjectName((String) hm.get("label"));
eb.setColumn((String) hm.get("column_name"));
eb.setEntityId(((Integer) hm.get("study_subject_id")).intValue());
al.add(eb);
}
return al;
}
use of org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean in project OpenClinica by OpenClinica.
the class DiscrepancyNoteDAO method findAllEventCRFByStudyAndParent.
public ArrayList findAllEventCRFByStudyAndParent(StudyBean study, DiscrepancyNoteBean parent) {
this.setTypesExpected();
ArrayList alist = new ArrayList();
// ss.label
this.setTypeExpected(12, TypeNames.STRING);
// date_start
this.setTypeExpected(13, TypeNames.DATE);
// sed_name
this.setTypeExpected(14, TypeNames.STRING);
// crf_name
this.setTypeExpected(15, TypeNames.STRING);
// column_name
this.setTypeExpected(16, TypeNames.STRING);
// event_crf_id
this.setTypeExpected(17, TypeNames.INT);
HashMap variables = new HashMap();
variables.put(Integer.valueOf(1), Integer.valueOf(study.getId()));
variables.put(Integer.valueOf(2), Integer.valueOf(study.getId()));
variables.put(Integer.valueOf(3), Integer.valueOf(parent.getId()));
alist = this.select(digester.getQuery("findAllEventCRFByStudyAndParent"), variables);
ArrayList al = new ArrayList();
Iterator it = alist.iterator();
while (it.hasNext()) {
HashMap hm = (HashMap) it.next();
DiscrepancyNoteBean eb = (DiscrepancyNoteBean) this.getEntityFromHashMap(hm);
eb.setEventName((String) hm.get("sed_name"));
eb.setEventStart((Date) hm.get("date_start"));
eb.setCrfName((String) hm.get("crf_name"));
eb.setSubjectName((String) hm.get("label"));
eb.setColumn((String) hm.get("column_name"));
eb.setEntityId(((Integer) hm.get("event_crf_id")).intValue());
al.add(eb);
}
return al;
}
use of org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean in project OpenClinica by OpenClinica.
the class DiscrepancyNoteDAO method findItemDataDNotesFromEventCRF.
public ArrayList<DiscrepancyNoteBean> findItemDataDNotesFromEventCRF(EventCRFBean eventCRFBean) {
this.setTypesExpected();
ArrayList dNotelist = new ArrayList();
HashMap variables = new HashMap();
variables.put(Integer.valueOf(1), Integer.valueOf(eventCRFBean.getId()));
dNotelist = this.select(digester.getQuery("findItemDataDNotesFromEventCRF"), variables);
ArrayList<DiscrepancyNoteBean> returnedNotelist = new ArrayList<DiscrepancyNoteBean>();
Iterator it = dNotelist.iterator();
while (it.hasNext()) {
HashMap hm = (HashMap) it.next();
DiscrepancyNoteBean eb = (DiscrepancyNoteBean) this.getEntityFromHashMap(hm);
eb.setEventCRFId(eventCRFBean.getId());
returnedNotelist.add(eb);
}
return returnedNotelist;
}
Aggregations