use of org.akaza.openclinica.bean.admin.AuditBean in project OpenClinica by OpenClinica.
the class AuditDAO method checkItemAuditEventsExist.
public ArrayList checkItemAuditEventsExist(int itemId, String auditTable, int ecbId) {
this.setTypesExpected();
HashMap variables = new HashMap();
variables.put(new Integer(1), new Integer(itemId));
variables.put(new Integer(2), auditTable);
variables.put(new Integer(3), ecbId);
String sql = digester.getQuery("checkItemAuditEventsExist");
ArrayList alist = this.select(sql, variables);
ArrayList al = new ArrayList();
Iterator it = alist.iterator();
while (it.hasNext()) {
AuditBean eb = (AuditBean) this.getEntityFromHashMap((HashMap) it.next());
if (eb.getAuditEventTypeId() == 3 || eb.getAuditEventTypeId() == 6 || eb.getAuditEventTypeId() == 12) {
eb.setOldValue(Status.get(new Integer(eb.getOldValue())).getName());
eb.setNewValue(Status.get(new Integer(eb.getNewValue())).getName());
}
al.add(eb);
}
return al;
}
use of org.akaza.openclinica.bean.admin.AuditBean in project OpenClinica by OpenClinica.
the class AuditDAO method getEntityFromHashMapWithItemDataTypeUpdated.
public Object getEntityFromHashMapWithItemDataTypeUpdated(HashMap hm) {
AuditBean eb = (AuditBean) this.getEntityFromHashMap(hm);
eb.setItemDataTypeId((Integer) hm.get("item_data_type_id"));
eb.setEventCrfVersionId((Integer) hm.get("event_crf_version_id"));
eb.setFormLayoutName((String) hm.get("crf_version_name"));
eb.setCrfName((String) hm.get("crf_name"));
eb.setStudyEventId((Integer) hm.get("study_event_id"));
eb.setOrdinal((Integer) hm.get("ordinal"));
eb.setDateInterviewed((java.util.Date) hm.get("date_interviewed"));
eb.setInterviewerName((String) hm.get("interviewer_name"));
if (((Integer) hm.get("item_data_repeat_key")) != null)
eb.setItemDataRepeatKey(((Integer) hm.get("item_data_repeat_key")));
return eb;
}
use of org.akaza.openclinica.bean.admin.AuditBean in project OpenClinica by OpenClinica.
the class AuditDAO method findStudySubjectGroupAssignmentAuditEvents.
/*
* Find audit group assignment log events for a study subject
*
*/
public Collection findStudySubjectGroupAssignmentAuditEvents(int studySubjectId) {
this.setTypesExpected();
HashMap variables = new HashMap();
variables.put(new Integer(1), new Integer(studySubjectId));
String sql = digester.getQuery("findStudySubjectGroupAssignmentAuditEvents");
ArrayList alist = this.select(sql, variables);
ArrayList al = new ArrayList();
Iterator it = alist.iterator();
while (it.hasNext()) {
AuditBean eb = (AuditBean) this.getEntityFromHashMap((HashMap) it.next());
al.add(eb);
}
return al;
}
use of org.akaza.openclinica.bean.admin.AuditBean in project OpenClinica by OpenClinica.
the class AuditDAO method findItemAuditEvents.
/*
* Find audit events for a single Item
*/
public ArrayList findItemAuditEvents(int entityId, String auditTable) {
this.setTypesExpected();
HashMap variables = new HashMap();
variables.put(new Integer(1), new Integer(entityId));
variables.put(new Integer(2), auditTable);
String sql = digester.getQuery("findSingleItemAuditEvents");
ArrayList alist = this.select(sql, variables);
ArrayList al = new ArrayList();
Iterator it = alist.iterator();
while (it.hasNext()) {
AuditBean eb = (AuditBean) this.getEntityFromHashMap((HashMap) it.next());
// 3 6 12 32
if (eb.getAuditEventTypeId() == 3 || eb.getAuditEventTypeId() == 6 || eb.getAuditEventTypeId() == 12) {
eb.setOldValue(Status.get(new Integer(eb.getOldValue())).getName());
eb.setNewValue(Status.get(new Integer(eb.getNewValue())).getName());
}
al.add(eb);
}
return al;
}
Aggregations