use of org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean in project OpenClinica by OpenClinica.
the class DiscrepancyNoteDAO method updateAssignedUser.
public EntityBean updateAssignedUser(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.getAssignedUserId());
variables.put(Integer.valueOf(2), Integer.valueOf(dnb.getId()));
this.execute(digester.getQuery("updateAssignedUser"), 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 findAllParentItemNotesByEventCRFWithConstraints.
public ArrayList<DiscrepancyNoteBean> findAllParentItemNotesByEventCRFWithConstraints(int eventCRFId, StringBuffer constraints) {
this.setTypesExpected();
ArrayList alist = new ArrayList();
HashMap variables = new HashMap();
variables.put(Integer.valueOf(1), Integer.valueOf(eventCRFId));
String sql = digester.getQuery("findAllParentItemNotesByEventCRF");
String[] s = sql.split("order by");
sql = s[0] + " " + constraints.toString() + " order by " + s[1];
alist = this.select(sql, variables);
ArrayList<DiscrepancyNoteBean> al = new ArrayList<DiscrepancyNoteBean>();
Iterator it = alist.iterator();
while (it.hasNext()) {
HashMap hm = (HashMap) it.next();
DiscrepancyNoteBean eb = (DiscrepancyNoteBean) this.getEntityFromHashMap(hm);
al.add(eb);
}
return al;
}
use of org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean in project OpenClinica by OpenClinica.
the class DiscrepancyNoteDAO method findAllItemDataByStudy.
public ArrayList findAllItemDataByStudy(StudyBean study, Set<String> hiddenCrfNames) {
this.setTypesExpected();
ArrayList al = new ArrayList();
// ss.label
this.setTypeExpected(12, TypeNames.STRING);
// date_start
this.setTypeExpected(13, TypeNames.DATE);
// sed_id
this.setTypeExpected(14, TypeNames.INT);
// sed_name
this.setTypeExpected(15, TypeNames.STRING);
// crf_name
this.setTypeExpected(16, TypeNames.STRING);
// item_name
this.setTypeExpected(17, TypeNames.STRING);
// value
this.setTypeExpected(18, TypeNames.STRING);
// item_data_id
this.setTypeExpected(19, TypeNames.INT);
// item_id
this.setTypeExpected(20, TypeNames.INT);
HashMap variables = new HashMap();
variables.put(Integer.valueOf(1), Integer.valueOf(study.getId()));
variables.put(Integer.valueOf(2), Integer.valueOf(study.getId()));
ArrayList alist = this.select(digester.getQuery("findAllItemDataByStudy"), variables);
Iterator it = alist.iterator();
if (hiddenCrfNames.size() > 0) {
while (it.hasNext()) {
HashMap hm = (HashMap) it.next();
Integer sedId = (Integer) hm.get("sed_id");
String crfName = (String) hm.get("crf_name");
if (!hiddenCrfNames.contains(sedId + "_" + crfName)) {
DiscrepancyNoteBean eb = (DiscrepancyNoteBean) this.getEntityFromHashMap(hm);
eb.setEventName((String) hm.get("sed_name"));
eb.setEventStart((Date) hm.get("date_start"));
eb.setCrfName(crfName);
eb.setSubjectName((String) hm.get("label"));
eb.setEntityName((String) hm.get("item_name"));
eb.setEntityValue((String) hm.get("value"));
eb.setEntityId((Integer) hm.get("item_data_id"));
eb.setItemId((Integer) hm.get("item_id"));
al.add(eb);
}
}
} else {
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.setEntityName((String) hm.get("item_name"));
eb.setEntityValue((String) hm.get("value"));
eb.setEntityId((Integer) hm.get("item_data_id"));
eb.setItemId((Integer) hm.get("item_id"));
al.add(eb);
}
}
return al;
}
use of org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean in project OpenClinica by OpenClinica.
the class DiscrepancyNoteDAO method findAllItemDataByStudyAndParent.
public ArrayList findAllItemDataByStudyAndParent(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);
// item_name
this.setTypeExpected(16, TypeNames.STRING);
// value
this.setTypeExpected(17, TypeNames.STRING);
// item_data_id
this.setTypeExpected(18, TypeNames.INT);
// item_id
this.setTypeExpected(19, 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("findAllItemDataByStudyAndParent"), 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.setEntityName((String) hm.get("item_name"));
eb.setEntityValue((String) hm.get("value"));
// YW << change EntityId from item_id to item_data_id.
eb.setEntityId(((Integer) hm.get("item_data_id")).intValue());
eb.setItemId(((Integer) hm.get("item_id")).intValue());
// YW >>
al.add(eb);
}
return al;
}
use of org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean in project OpenClinica by OpenClinica.
the class DiscrepancyNoteDAO method findAllStudyEventByStudyAndId.
/**
* Find all DiscrepancyNoteBeans associated with a certain Study Subject and Study.
*
* @param study
* A StudyBean, whose id property is checked.
* @param studySubjectId
* The id of a Study Subject.
* @return An ArrayList of DiscrepancyNoteBeans.
*/
public ArrayList findAllStudyEventByStudyAndId(StudyBean study, int studySubjectId) {
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);
// column_name
this.setTypeExpected(15, TypeNames.STRING);
// study_event_id
this.setTypeExpected(16, 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("findAllStudyEventByStudyAndId"), 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.setEventName((String) hm.get("sed_name"));
eb.setEventStart((Date) hm.get("date_start"));
eb.setColumn((String) hm.get("column_name"));
eb.setEntityId(((Integer) hm.get("study_event_id")).intValue());
al.add(eb);
}
return al;
}
Aggregations