Search in sources :

Example 56 with EventDefinitionCRFBean

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

the class EventDefinitionCRFDAO method findForStudyByStudyEventDefinitionIdAndCRFId.

/**
 * Find EventDefinitionCRFBean for a study. So this EventDefinitionCRFBean
 * has no parent.
 *
 * @param studyEventDefinitionId
 * @param crfId
 * @return
 */
public EventDefinitionCRFBean findForStudyByStudyEventDefinitionIdAndCRFId(int studyEventDefinitionId, int crfId) {
    EventDefinitionCRFBean answer = new EventDefinitionCRFBean();
    this.setTypesExpected();
    HashMap variables = new HashMap();
    variables.put(new Integer(1), new Integer(studyEventDefinitionId));
    variables.put(new Integer(2), new Integer(crfId));
    String sql = digester.getQuery("findForStudyByStudyEventDefinitionIdAndCRFId");
    ArrayList alist = this.select(sql, variables);
    Iterator it = alist.iterator();
    while (it.hasNext()) {
        answer = (EventDefinitionCRFBean) this.getEntityFromHashMap((HashMap) it.next());
    }
    return answer;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) EventDefinitionCRFBean(org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean)

Example 57 with EventDefinitionCRFBean

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

the class EventDefinitionCRFDAO method findAllActiveNonHiddenByEventDefinitionIdAndStudy.

public Collection findAllActiveNonHiddenByEventDefinitionIdAndStudy(int definitionId, StudyBean study) {
    ArrayList al = new ArrayList();
    this.setTypesExpected();
    HashMap variables = new HashMap();
    if (study.getParentStudyId() > 0) {
        variables.put(new Integer(1), new Integer(definitionId));
        variables.put(new Integer(2), new Integer(study.getId()));
        variables.put(new Integer(3), new Integer(definitionId));
        String sql = digester.getQuery("findAllActiveNonHiddenByEventDefinitionIdAndSite");
        ArrayList alist = this.select(sql, variables);
        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 58 with EventDefinitionCRFBean

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

the class EventDefinitionCRFDAO method findByStudyEventDefinitionIdAndCRFIdAndStudyId.

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

Example 59 with EventDefinitionCRFBean

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

the class EventDefinitionCRFDAO method update.

/**
 * Updates a Study event
 */
@Override
public EntityBean update(EntityBean eb) {
    EventDefinitionCRFBean sb = (EventDefinitionCRFBean) eb;
    HashMap nullVars = new HashMap();
    HashMap variables = new HashMap();
    // UPDATE EVENT_DEFINITION_CRF SET
    // STUDY_EVENT_DEFINITION_ID=?,STUDY_ID=?,CRF_ID=?, REQUIRED_CRF=?,
    // DOUBLE_ENTRY=?,REQUIRE_ALL_TEXT_FILLED=?,DECISION_CONDITIONS=?,
    // NULL_VALUES=?,DEFAULT_VERSION_ID=?,STATUS_ID=?,DATE_UPDATED=?,UPDATE_ID=?,
    // ordinal=?,ELECTRONIC_SIGNATURE=? HIDE_CRF=?,
    // SOURCE_DATA_VERIFICATION_ID=?, Selected_version_ids=?, parent_id=?
    // WHERE EVENT_DEFINITION_CRF_ID=?
    variables.put(new Integer(1), new Integer(sb.getStudyEventDefinitionId()));
    variables.put(new Integer(2), new Integer(sb.getStudyId()));
    variables.put(new Integer(3), new Integer(sb.getCrfId()));
    variables.put(new Integer(4), new Boolean(sb.isRequiredCRF()));
    variables.put(new Integer(5), new Boolean(sb.isDoubleEntry()));
    variables.put(new Integer(6), new Boolean(sb.isRequireAllTextFilled()));
    variables.put(new Integer(7), new Boolean(sb.isDecisionCondition()));
    variables.put(new Integer(8), sb.getNullValues());
    variables.put(new Integer(9), new Integer(sb.getDefaultVersionId()));
    variables.put(new Integer(10), new Integer(sb.getStatus().getId()));
    // DATE_Updated
    variables.put(new Integer(11), new java.util.Date());
    variables.put(new Integer(12), new Integer(sb.getUpdater().getId()));
    variables.put(new Integer(13), new Integer(sb.getOrdinal()));
    variables.put(new Integer(14), new Boolean(sb.isElectronicSignature()));
    variables.put(new Integer(15), new Boolean(sb.isHideCrf()));
    variables.put(new Integer(16), new Integer(sb.getSourceDataVerification().getCode()));
    variables.put(new Integer(17), sb.getSelectedVersionIds());
    if (sb.getParentId() == 0) {
        nullVars.put(new Integer(18), new Integer(Types.INTEGER));
        variables.put(new Integer(18), null);
    } else {
        variables.put(new Integer(18), new Integer(sb.getParentId()));
    }
    variables.put(new Integer(19), new Boolean(sb.isParticipantForm()));
    if (sb.isParticipantForm()) {
        variables.put(new Integer(20), new Boolean(sb.isAllowAnonymousSubmission()));
    } else {
        sb.setAllowAnonymousSubmission(false);
        variables.put(new Integer(20), new Boolean(sb.isAllowAnonymousSubmission()));
    }
    if (sb.isAllowAnonymousSubmission()) {
        variables.put(new Integer(21), sb.getSubmissionUrl());
    } else {
        sb.setSubmissionUrl("");
        variables.put(new Integer(21), sb.getSubmissionUrl());
    }
    variables.put(new Integer(22), new Integer(sb.getId()));
    String sql = digester.getQuery("update");
    this.execute(sql, variables, nullVars);
    return sb;
}
Also used : HashMap(java.util.HashMap) EventDefinitionCRFBean(org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean)

Example 60 with EventDefinitionCRFBean

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

the class EventDefinitionCRFDAO method findAllParentsByDefinition.

/**
 * Find all EventDefinitionCRFBean which have no parent
 * EventDefinitionCRFBean.
 *
 * @param definitionId
 * @return
 */
public Collection findAllParentsByDefinition(int definitionId) {
    this.setTypesExpected();
    HashMap variables = new HashMap();
    variables.put(new Integer(1), new Integer(definitionId));
    String sql = digester.getQuery("findAllParentsByDefinition");
    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