Search in sources :

Example 66 with DiscrepancyNoteBean

use of org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean in project OpenClinica by OpenClinica.

the class DiscrepancyNoteDAO method findAllParentsByStudy.

public ArrayList findAllParentsByStudy(StudyBean study) {
    HashMap variables = new HashMap();
    variables.put(Integer.valueOf(1), Integer.valueOf(study.getId()));
    variables.put(Integer.valueOf(2), Integer.valueOf(study.getId()));
    ArrayList notes = executeFindAllQuery("findAllParentsByStudy", variables);
    if (fetchMapping) {
        for (int i = 0; i < notes.size(); i++) {
            DiscrepancyNoteBean dnb = (DiscrepancyNoteBean) notes.get(i);
            dnb = findSingleMapping(dnb);
            notes.set(i, dnb);
        }
    }
    return notes;
}
Also used : HashMap(java.util.HashMap) DiscrepancyNoteBean(org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean) ArrayList(java.util.ArrayList)

Example 67 with DiscrepancyNoteBean

use of org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean in project OpenClinica by OpenClinica.

the class DiscrepancyNoteDAO method update.

/**
     * Updates a Study event
     */
@Override
public EntityBean update(EntityBean eb) {
    // update discrepancy_note set
    // description =?,
    // discrepancy_note_type_id =? ,
    // resolution_status_id =? ,
    // detailed_notes =?
    // where discrepancy_note_id=?
    DiscrepancyNoteBean dnb = (DiscrepancyNoteBean) eb;
    dnb.setActive(false);
    HashMap variables = new HashMap();
    variables.put(Integer.valueOf(1), dnb.getDescription());
    variables.put(Integer.valueOf(2), Integer.valueOf(dnb.getDiscrepancyNoteTypeId()));
    variables.put(Integer.valueOf(3), Integer.valueOf(dnb.getResolutionStatusId()));
    variables.put(Integer.valueOf(4), dnb.getDetailedNotes());
    variables.put(Integer.valueOf(5), Integer.valueOf(dnb.getOwnerId()));
    variables.put(Integer.valueOf(6), Integer.valueOf(dnb.getId()));
    this.execute(digester.getQuery("update"), variables);
    if (isQuerySuccessful()) {
        dnb.setActive(true);
    }
    return dnb;
}
Also used : HashMap(java.util.HashMap) DiscrepancyNoteBean(org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean)

Example 68 with DiscrepancyNoteBean

use of org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean in project OpenClinica by OpenClinica.

the class DiscrepancyNoteDAO method findAllParentItemNotesByEventCRF.

public ArrayList<DiscrepancyNoteBean> findAllParentItemNotesByEventCRF(int eventCRFId) {
    this.setTypesExpected();
    ArrayList alist = new ArrayList();
    HashMap variables = new HashMap();
    variables.put(Integer.valueOf(1), Integer.valueOf(eventCRFId));
    alist = this.select(digester.getQuery("findAllParentItemNotesByEventCRF"), 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;
}
Also used : HashMap(java.util.HashMap) DiscrepancyNoteBean(org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator)

Example 69 with DiscrepancyNoteBean

use of org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean in project OpenClinica by OpenClinica.

the class DiscrepancyNoteDAO method getStudySubjectDNCountWithFilter.

public Integer getStudySubjectDNCountWithFilter(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("getStudySubjectDNCountWithFilter");
    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;
    }
}
Also used : HashMap(java.util.HashMap) DiscrepancyNoteBean(org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator)

Example 70 with DiscrepancyNoteBean

use of org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean in project OpenClinica by OpenClinica.

the class DiscrepancyNoteDAO method findAllSubjectByStudy.

public ArrayList findAllSubjectByStudy(StudyBean study) {
    this.setTypesExpected();
    ArrayList alist = new ArrayList();
    // ss.label
    this.setTypeExpected(12, TypeNames.STRING);
    // column_name
    this.setTypeExpected(13, TypeNames.STRING);
    // 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(study.getId()));
    alist = this.select(digester.getQuery("findAllSubjectByStudy"), 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("subject_id")).intValue());
        al.add(eb);
    }
    return al;
}
Also used : HashMap(java.util.HashMap) DiscrepancyNoteBean(org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator)

Aggregations

DiscrepancyNoteBean (org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean)122 ArrayList (java.util.ArrayList)81 HashMap (java.util.HashMap)62 Iterator (java.util.Iterator)44 DiscrepancyNoteDAO (org.akaza.openclinica.dao.managestudy.DiscrepancyNoteDAO)34 Date (java.util.Date)20 StudySubjectBean (org.akaza.openclinica.bean.managestudy.StudySubjectBean)20 EventCRFBean (org.akaza.openclinica.bean.submit.EventCRFBean)20 StudySubjectDAO (org.akaza.openclinica.dao.managestudy.StudySubjectDAO)20 StudyEventBean (org.akaza.openclinica.bean.managestudy.StudyEventBean)18 EventCRFDAO (org.akaza.openclinica.dao.submit.EventCRFDAO)18 FormProcessor (org.akaza.openclinica.control.form.FormProcessor)15 StudyBean (org.akaza.openclinica.bean.managestudy.StudyBean)14 StudyDAO (org.akaza.openclinica.dao.managestudy.StudyDAO)14 StudyEventDAO (org.akaza.openclinica.dao.managestudy.StudyEventDAO)13 ItemDataBean (org.akaza.openclinica.bean.submit.ItemDataBean)11 StudyEventDefinitionDAO (org.akaza.openclinica.dao.managestudy.StudyEventDefinitionDAO)11 ItemDataDAO (org.akaza.openclinica.dao.submit.ItemDataDAO)11 UserAccountBean (org.akaza.openclinica.bean.login.UserAccountBean)10 StudyEventDefinitionBean (org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean)10