Search in sources :

Example 51 with EventDefinitionCRFBean

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

the class EventDefinitionCRFDAO method findAllByDefinition.

public Collection findAllByDefinition(int definitionId) {
    this.setTypesExpected();
    HashMap variables = new HashMap();
    variables.put(new Integer(1), new Integer(definitionId));
    String sql = digester.getQuery("findAllByDefinition");
    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 52 with EventDefinitionCRFBean

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

the class EventDefinitionCRFDAO method findAllActiveSitesAndStudiesPerParentStudy.

public ArrayList<EventDefinitionCRFBean> findAllActiveSitesAndStudiesPerParentStudy(int parentStudyId) {
    this.setTypesExpected();
    HashMap variables = new HashMap();
    variables.put(new Integer(1), new Integer(parentStudyId));
    variables.put(new Integer(2), new Integer(parentStudyId));
    String sql = digester.getQuery("findAllActiveSitesAndStudiesPerParentStudy");
    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 53 with EventDefinitionCRFBean

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

the class EventDefinitionCRFDAO method create.

/**
 * Creates a new studysubject
 */
@Override
public EntityBean create(EntityBean eb) {
    EventDefinitionCRFBean sb = (EventDefinitionCRFBean) eb;
    HashMap nullVars = new HashMap();
    HashMap variables = new HashMap();
    int id = getNextPK();
    // INSERT INTO EVENT_DEFINITION_CRF
    // (EVENT_DEFINITION_CRF_ID,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,OWNER_ID,DATE_CREATED,ordinal,
    // ELECTRONIC_SIGNATURE,HIDE_CRF,SOURCE_DATA_VERIFICATION_ID,
    // SELECTED_VERSION_IDS, PARENT_ID)
    // VALUES (?,?,?,?,?,?,?,?,?,?,?,?,NOW(),?,?,?,?,?,?)
    variables.put(new Integer(1), new Integer(id));
    variables.put(new Integer(2), new Integer(sb.getStudyEventDefinitionId()));
    variables.put(new Integer(3), new Integer(sb.getStudyId()));
    variables.put(new Integer(4), new Integer(sb.getCrfId()));
    variables.put(new Integer(5), new Boolean(sb.isRequiredCRF()));
    variables.put(new Integer(6), new Boolean(sb.isDoubleEntry()));
    variables.put(new Integer(7), new Boolean(sb.isRequireAllTextFilled()));
    variables.put(new Integer(8), new Boolean(sb.isDecisionCondition()));
    variables.put(new Integer(9), sb.getNullValues());
    variables.put(new Integer(10), new Integer(sb.getDefaultVersionId()));
    variables.put(new Integer(11), new Integer(sb.getStatus().getId()));
    variables.put(new Integer(12), new Integer(sb.getOwnerId()));
    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()) {
        if (sb.getSubmissionUrl() == null)
            sb.setSubmissionUrl("");
        variables.put(new Integer(21), sb.getSubmissionUrl());
    } else {
        sb.setSubmissionUrl("");
        variables.put(new Integer(21), sb.getSubmissionUrl());
    }
    this.execute(digester.getQuery("create"), variables, nullVars);
    if (isQuerySuccessful()) {
        sb.setId(id);
    }
    return sb;
}
Also used : HashMap(java.util.HashMap) EventDefinitionCRFBean(org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean)

Example 54 with EventDefinitionCRFBean

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

the class EventDefinitionCRFDAO method findByDefaultVersion.

public ArrayList findByDefaultVersion(int versionId) {
    this.setTypesExpected();
    HashMap variables = new HashMap();
    variables.put(new Integer(1), new Integer(versionId));
    String sql = digester.getQuery("findByDefaultVersion");
    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 55 with EventDefinitionCRFBean

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

the class EventDefinitionCRFDAO method findByPK.

@Override
public EntityBean findByPK(int ID) {
    EventDefinitionCRFBean eb = new EventDefinitionCRFBean();
    this.setTypesExpected();
    HashMap variables = new HashMap();
    variables.put(new Integer(1), new Integer(ID));
    String sql = digester.getQuery("findByPK");
    ArrayList alist = this.select(sql, variables);
    Iterator it = alist.iterator();
    if (it.hasNext()) {
        eb = (EventDefinitionCRFBean) this.getEntityFromHashMap((HashMap) it.next());
    }
    return eb;
}
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