Search in sources :

Example 16 with AuditBean

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;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) AuditBean(org.akaza.openclinica.bean.admin.AuditBean)

Example 17 with AuditBean

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;
}
Also used : AuditBean(org.akaza.openclinica.bean.admin.AuditBean)

Example 18 with AuditBean

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;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) AuditBean(org.akaza.openclinica.bean.admin.AuditBean)

Example 19 with AuditBean

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;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) AuditBean(org.akaza.openclinica.bean.admin.AuditBean)

Aggregations

AuditBean (org.akaza.openclinica.bean.admin.AuditBean)19 ArrayList (java.util.ArrayList)16 Iterator (java.util.Iterator)15 HashMap (java.util.HashMap)13 AuditDAO (org.akaza.openclinica.dao.admin.AuditDAO)3 Collection (java.util.Collection)2 List (java.util.List)2 StudyBean (org.akaza.openclinica.bean.managestudy.StudyBean)2 StudyEventBean (org.akaza.openclinica.bean.managestudy.StudyEventBean)2 StudySubjectBean (org.akaza.openclinica.bean.managestudy.StudySubjectBean)2 EventCRFBean (org.akaza.openclinica.bean.submit.EventCRFBean)2 ItemDataBean (org.akaza.openclinica.bean.submit.ItemDataBean)2 SubjectBean (org.akaza.openclinica.bean.submit.SubjectBean)2 FormProcessor (org.akaza.openclinica.control.form.FormProcessor)2 CRFDAO (org.akaza.openclinica.dao.admin.CRFDAO)2 EventDefinitionCRFDAO (org.akaza.openclinica.dao.managestudy.EventDefinitionCRFDAO)2 StudyDAO (org.akaza.openclinica.dao.managestudy.StudyDAO)2 StudyEventDAO (org.akaza.openclinica.dao.managestudy.StudyEventDAO)2 StudyEventDefinitionDAO (org.akaza.openclinica.dao.managestudy.StudyEventDefinitionDAO)2 StudySubjectDAO (org.akaza.openclinica.dao.managestudy.StudySubjectDAO)2