Search in sources :

Example 81 with EventDefinitionCRFBean

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

the class EventDefinitionCRFDAO method findAllByCrfDefinitionInSiteOnly.

public ArrayList<EventDefinitionCRFBean> findAllByCrfDefinitionInSiteOnly(int definitionId, int crfId) {
    this.setTypesExpected();
    HashMap variables = new HashMap();
    variables.put(new Integer(1), new Integer(definitionId));
    variables.put(new Integer(2), new Integer(crfId));
    String sql = digester.getQuery("findAllByCrfDefinitionInSiteOnly");
    ArrayList alist = this.select(sql, variables);
    ArrayList<EventDefinitionCRFBean> al = new ArrayList();
    Iterator it = alist.iterator();
    while (it.hasNext()) {
        EventDefinitionCRFBean eb = (EventDefinitionCRFBean) this.getEntityFromHashMap((HashMap) it.next());
        al.add(eb);
    }
    return al;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) EventDefinitionCRFBean(org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean)

Example 82 with EventDefinitionCRFBean

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

the class EventDefinitionCRFDAO method findAllActiveByEventDefinitionIdAndSiteIdAndParentStudyId.

public Collection findAllActiveByEventDefinitionIdAndSiteIdAndParentStudyId(int definitionId, int siteId, int parentStudyId) {
    this.setTypesExpected();
    HashMap variables = new HashMap();
    variables.put(new Integer(1), new Integer(definitionId));
    variables.put(new Integer(2), new Integer(siteId));
    variables.put(new Integer(3), new Integer(parentStudyId));
    variables.put(new Integer(4), new Integer(definitionId));
    variables.put(new Integer(5), new Integer(siteId));
    String sql = digester.getQuery("findAllActiveByEventDefinitionIdAndSiteIdAndParentStudyId");
    ArrayList alist = this.select(sql, variables);
    ArrayList al = new ArrayList();
    Iterator it = alist.iterator();
    while (it.hasNext()) {
        EventDefinitionCRFBean eb = (EventDefinitionCRFBean) this.getEntityFromHashMap((HashMap) it.next());
        al.add(eb);
    }
    return al;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) EventDefinitionCRFBean(org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean)

Example 83 with EventDefinitionCRFBean

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

the class EventDefinitionCRFDAO method findAllSubmissionUriAndStudyId.

public ArrayList<EventDefinitionCRFBean> findAllSubmissionUriAndStudyId(String submissionUri, int studyId) {
    this.setTypesExpected();
    HashMap variables = new HashMap();
    variables.put(new Integer(1), new String(submissionUri));
    variables.put(new Integer(2), new Integer(studyId));
    variables.put(new Integer(3), new Integer(studyId));
    String sql = digester.getQuery("findAllSubmissionUriAndStudyId");
    ArrayList alist = this.select(sql, variables);
    ArrayList<EventDefinitionCRFBean> al = new ArrayList();
    Iterator it = alist.iterator();
    while (it.hasNext()) {
        EventDefinitionCRFBean eb = (EventDefinitionCRFBean) this.getEntityFromHashMap((HashMap) it.next());
        al.add(eb);
    }
    return al;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) EventDefinitionCRFBean(org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean)

Example 84 with EventDefinitionCRFBean

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

the class EventDefinitionCRFDAO method getEntityFromHashMap.

/**
 * <p>
 * getEntityFromHashMap, the method that gets the object from the database
 * query.
 */
@Override
public Object getEntityFromHashMap(HashMap hm) {
    EventDefinitionCRFBean eb = new EventDefinitionCRFBean();
    super.setEntityAuditInformation(eb, hm);
    // EVENT_DEFINITION_CRF_ID STUDY_EVENT_DEFINITION_ID STUDY_ID
    // CRF_ID REQUIRED_CRF DOUBLE_ENTRY REQUIRE_ALL_TEXT_FILLED
    // DECISION_CONDITIONS DEFAULT_VERSION_ID STATUS_ID OWNER_ID
    // DATE_CREATED DATE_UPDATED UPDATE_ID
    eb.setId(((Integer) hm.get("event_definition_crf_id")).intValue());
    eb.setStudyEventDefinitionId(((Integer) hm.get("study_event_definition_id")).intValue());
    eb.setStudyId(((Integer) hm.get("study_id")).intValue());
    eb.setCrfId(((Integer) hm.get("crf_id")).intValue());
    eb.setRequiredCRF(((Boolean) hm.get("required_crf")).booleanValue());
    eb.setDoubleEntry(((Boolean) hm.get("double_entry")).booleanValue());
    eb.setRequireAllTextFilled(((Boolean) hm.get("require_all_text_filled")).booleanValue());
    eb.setDecisionCondition(((Boolean) hm.get("decision_conditions")).booleanValue());
    eb.setNullValues((String) hm.get("null_values"));
    eb.setDefaultVersionId(((Integer) hm.get("default_version_id")).intValue());
    eb.setOrdinal(((Integer) hm.get("ordinal")).intValue());
    eb.setElectronicSignature(((Boolean) hm.get("electronic_signature")).booleanValue());
    // issue 3212
    eb.setHideCrf(((Boolean) hm.get("hide_crf")));
    int sdvId = (Integer) hm.get("source_data_verification_code");
    eb.setSourceDataVerification(SourceDataVerification.getByCode(sdvId > 0 ? sdvId : 3));
    String selectedVersionIds = (String) hm.get("selected_version_ids");
    eb.setSelectedVersionIds(selectedVersionIds != null ? selectedVersionIds : "");
    int parentId = (Integer) hm.get("parent_id");
    eb.setParentId(parentId > 0 ? parentId : 0);
    eb.setParticipantForm(((Boolean) hm.get("participant_form")).booleanValue());
    eb.setAllowAnonymousSubmission(((Boolean) hm.get("allow_anonymous_submission")).booleanValue());
    eb.setSubmissionUrl(((String) hm.get("submission_url")));
    return eb;
}
Also used : EventDefinitionCRFBean(org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean)

Example 85 with EventDefinitionCRFBean

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

the class EventDefinitionCRFDAO method findAllByCRF.

public Collection findAllByCRF(int crfId) {
    this.setTypesExpected();
    HashMap variables = new HashMap();
    variables.put(new Integer(1), new Integer(crfId));
    String sql = digester.getQuery("findByCRFId");
    ArrayList alist = this.select(sql, variables);
    ArrayList al = new ArrayList();
    Iterator it = alist.iterator();
    while (it.hasNext()) {
        EventDefinitionCRFBean eb = (EventDefinitionCRFBean) this.getEntityFromHashMap((HashMap) it.next());
        al.add(eb);
    }
    return al;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) EventDefinitionCRFBean(org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean)

Aggregations

EventDefinitionCRFBean (org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean)146 ArrayList (java.util.ArrayList)112 EventCRFBean (org.akaza.openclinica.bean.submit.EventCRFBean)67 EventDefinitionCRFDAO (org.akaza.openclinica.dao.managestudy.EventDefinitionCRFDAO)65 HashMap (java.util.HashMap)57 CRFBean (org.akaza.openclinica.bean.admin.CRFBean)50 StudyEventDefinitionBean (org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean)50 CRFVersionBean (org.akaza.openclinica.bean.submit.CRFVersionBean)49 CRFVersionDAO (org.akaza.openclinica.dao.submit.CRFVersionDAO)48 CRFDAO (org.akaza.openclinica.dao.admin.CRFDAO)43 EventCRFDAO (org.akaza.openclinica.dao.submit.EventCRFDAO)42 StudyEventDefinitionDAO (org.akaza.openclinica.dao.managestudy.StudyEventDefinitionDAO)38 Iterator (java.util.Iterator)36 StudyBean (org.akaza.openclinica.bean.managestudy.StudyBean)35 StudyEventDAO (org.akaza.openclinica.dao.managestudy.StudyEventDAO)35 StudyEventBean (org.akaza.openclinica.bean.managestudy.StudyEventBean)32 FormProcessor (org.akaza.openclinica.control.form.FormProcessor)30 ItemDataDAO (org.akaza.openclinica.dao.submit.ItemDataDAO)28 DisplayEventCRFBean (org.akaza.openclinica.bean.submit.DisplayEventCRFBean)26 StudyDAO (org.akaza.openclinica.dao.managestudy.StudyDAO)26