Search in sources :

Example 16 with StudyBean

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

the class StudyEventDefinitionDAO method findAllByStudy.

@Override
public ArrayList findAllByStudy(StudyBean study) {
    StudyDAO studyDao = new StudyDAO(this.getDs());
    if (study.getParentStudyId() > 0) {
        // If the study has a parent than it is a site, in this case we
        // should get the event definitions of the parent
        StudyBean parentStudy = new StudyBean();
        parentStudy = (StudyBean) studyDao.findByPK(study.getParentStudyId());
        return super.findAllByStudy(parentStudy);
    } else {
        return super.findAllByStudy(study);
    }
}
Also used : StudyBean(org.akaza.openclinica.bean.managestudy.StudyBean)

Example 17 with StudyBean

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

the class StudyDAO method findByPK.

public EntityBean findByPK(int ID) {
    StudyBean eb = new StudyBean();
    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 = (StudyBean) this.getEntityFromHashMap((HashMap) it.next());
    }
    return eb;
}
Also used : HashMap(java.util.HashMap) StudyBean(org.akaza.openclinica.bean.managestudy.StudyBean) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator)

Example 18 with StudyBean

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

the class StudyDAO method create.

/**
     * <b>create </b>, the method that creates a study in the database.
     * <P>
     * note: create is split up into four custom functions, per the use case; we
     * are creating the standard create function here which calls all four
     * functions at once, but the seperate functions may be required in the
     * control servlets.
     * 
     * @return eb the created entity bean.
     */
public EntityBean create(EntityBean eb) {
    StudyBean sb = (StudyBean) eb;
    sb = this.createStepOne(sb);
    // in the above step, we will have created a primary key,
    // and in the next steps, we update the study bean
    // in phases
    sb = this.createStepTwo(sb);
    sb = this.createStepThree(sb);
    sb = this.createStepFour(sb);
    return sb;
}
Also used : StudyBean(org.akaza.openclinica.bean.managestudy.StudyBean)

Example 19 with StudyBean

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

the class StudyDAO method findByOid.

public StudyBean findByOid(String oid) {
    StudyBean sb = null;
    this.unsetTypeExpected();
    this.setTypesExpected();
    HashMap variables = new HashMap();
    variables.put(new Integer(1), oid);
    ArrayList alist = this.select(digester.getQuery("findByOid"), variables);
    Iterator it = alist.iterator();
    if (it.hasNext()) {
        sb = (StudyBean) this.getEntityFromHashMap((HashMap) it.next());
        return sb;
    } else {
        logger.info("returning null from find by oid...");
        return null;
    }
}
Also used : HashMap(java.util.HashMap) StudyBean(org.akaza.openclinica.bean.managestudy.StudyBean) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator)

Example 20 with StudyBean

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

the class StudyDAO method findAllByParentStudyIdOrderedByIdAsc.

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

Aggregations

StudyBean (org.akaza.openclinica.bean.managestudy.StudyBean)350 ArrayList (java.util.ArrayList)183 StudyDAO (org.akaza.openclinica.dao.managestudy.StudyDAO)175 FormProcessor (org.akaza.openclinica.control.form.FormProcessor)92 HashMap (java.util.HashMap)84 StudySubjectBean (org.akaza.openclinica.bean.managestudy.StudySubjectBean)66 StudyEventDefinitionBean (org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean)65 StudyEventDefinitionDAO (org.akaza.openclinica.dao.managestudy.StudyEventDefinitionDAO)62 Date (java.util.Date)59 StudyEventBean (org.akaza.openclinica.bean.managestudy.StudyEventBean)58 StudyEventDAO (org.akaza.openclinica.dao.managestudy.StudyEventDAO)57 UserAccountBean (org.akaza.openclinica.bean.login.UserAccountBean)56 StudySubjectDAO (org.akaza.openclinica.dao.managestudy.StudySubjectDAO)54 EventCRFBean (org.akaza.openclinica.bean.submit.EventCRFBean)52 EventCRFDAO (org.akaza.openclinica.dao.submit.EventCRFDAO)52 EventDefinitionCRFDAO (org.akaza.openclinica.dao.managestudy.EventDefinitionCRFDAO)45 Locale (java.util.Locale)39 UserAccountDAO (org.akaza.openclinica.dao.login.UserAccountDAO)39 EventDefinitionCRFBean (org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean)37 Iterator (java.util.Iterator)36