Search in sources :

Example 91 with StudyEventDefinitionBean

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

the class StudyEventDefinitionDAO method findAllByStudyAndLimit.

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

Example 92 with StudyEventDefinitionBean

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

the class StudyEventDefinitionDAO method findAllActiveByParentStudyId.

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

Example 93 with StudyEventDefinitionBean

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

the class StudyEventDefinitionDAO method findByOid.

public StudyEventDefinitionBean findByOid(String oid) {
    StudyEventDefinitionBean studyEventDefinitionBean = new StudyEventDefinitionBean();
    setTypesExpected();
    HashMap variables = new HashMap();
    variables.put(new Integer(1), oid);
    String sql = digester.getQuery("findByOid");
    ArrayList rows = this.select(sql, variables);
    Iterator it = rows.iterator();
    if (it.hasNext()) {
        studyEventDefinitionBean = (StudyEventDefinitionBean) this.getEntityFromHashMap((HashMap) it.next());
        return studyEventDefinitionBean;
    } else {
        return null;
    }
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) StudyEventDefinitionBean(org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean)

Example 94 with StudyEventDefinitionBean

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

the class OpenClinicaVariableNode method validateEvent.

void validateEvent() throws OpenClinicaSystemException {
    StudyEventDefinitionBean studyEventDefinition = getExpressionService().getStudyEventDefinitionFromExpressionForEventScheduling(number);
    String studyEventOID = number.split("\\.")[0];
    String expressionContext = expressionWrapper.getExpressionContext();
    //Verify expression refers to a valid event.
    if (studyEventDefinition == null)
        throw new OpenClinicaSystemException("OCRERR_0034", new String[] { number });
    //Verify expression doesn't use repeating event notation if event is not repeating
    if (!studyEventDefinition.isRepeating() && studyEventOID.matches(REPEATING))
        throw new OpenClinicaSystemException("OCRERR_0039", new String[] { number });
    //Verify only Target expressions use the 'ALL' repeating notation.
    if (expressionContext != null && !expressionContext.equals(ExpressionObjectWrapper.CONTEXT_TARGET)) {
        if (studyEventOID.matches(REPEATING) && !studyEventOID.matches(REPEATING_NOALL))
            throw new OpenClinicaSystemException("OCRERR_0040", new String[] { number });
    }
}
Also used : StudyEventDefinitionBean(org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean) OpenClinicaSystemException(org.akaza.openclinica.exception.OpenClinicaSystemException)

Example 95 with StudyEventDefinitionBean

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

the class MetadataUnit method collectMetaDataVersion.

/**
     * To retrieve the ODM with form version OID as one of the parameters
     * @param formVersionOID
     */
private void collectMetaDataVersion(String formVersionOID) {
    StudyBean study = studyBase.getStudy();
    OdmExtractDAO oedao = new OdmExtractDAO(this.ds);
    MetaDataVersionBean metadata = this.odmStudy.getMetaDataVersion();
    ODMBean odmBean = new ODMBean();
    odmBean.setODMVersion("oc1.3");
    setOdmBean(odmBean);
    ArrayList<StudyEventDefinitionBean> sedBeansInStudy = (ArrayList<StudyEventDefinitionBean>) studyBase.getSedBeansInStudy();
    if (sedBeansInStudy == null || sedBeansInStudy.size() < 1) {
        logger.info("null, because there is no study event definition in this study.");
        return;
    }
    if (metadata.getOid() == null || metadata.getOid().length() <= 0) {
        metadata.setOid("v1.0.0");
    }
    if (metadata.getName() == null || metadata.getName().length() <= 0) {
        metadata.setName("MetaDataVersion_v1.0.0");
    }
    oedao.getODMMetadataForForm(metadata, formVersionOID, this.odmBean.getODMVersion());
}
Also used : MetaDataVersionBean(org.akaza.openclinica.bean.odmbeans.MetaDataVersionBean) StudyBean(org.akaza.openclinica.bean.managestudy.StudyBean) OdmStudyBean(org.akaza.openclinica.bean.odmbeans.OdmStudyBean) ArrayList(java.util.ArrayList) OdmExtractDAO(org.akaza.openclinica.dao.extract.OdmExtractDAO) ODMBean(org.akaza.openclinica.bean.odmbeans.ODMBean) StudyEventDefinitionBean(org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean)

Aggregations

StudyEventDefinitionBean (org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean)155 ArrayList (java.util.ArrayList)109 StudyEventDefinitionDAO (org.akaza.openclinica.dao.managestudy.StudyEventDefinitionDAO)85 StudyBean (org.akaza.openclinica.bean.managestudy.StudyBean)65 StudyEventBean (org.akaza.openclinica.bean.managestudy.StudyEventBean)61 StudyEventDAO (org.akaza.openclinica.dao.managestudy.StudyEventDAO)61 CRFBean (org.akaza.openclinica.bean.admin.CRFBean)56 EventDefinitionCRFBean (org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean)55 HashMap (java.util.HashMap)51 EventCRFBean (org.akaza.openclinica.bean.submit.EventCRFBean)51 EventDefinitionCRFDAO (org.akaza.openclinica.dao.managestudy.EventDefinitionCRFDAO)50 CRFDAO (org.akaza.openclinica.dao.admin.CRFDAO)49 EventCRFDAO (org.akaza.openclinica.dao.submit.EventCRFDAO)49 FormProcessor (org.akaza.openclinica.control.form.FormProcessor)48 StudySubjectBean (org.akaza.openclinica.bean.managestudy.StudySubjectBean)45 StudyDAO (org.akaza.openclinica.dao.managestudy.StudyDAO)45 StudySubjectDAO (org.akaza.openclinica.dao.managestudy.StudySubjectDAO)42 CRFVersionDAO (org.akaza.openclinica.dao.submit.CRFVersionDAO)39 Date (java.util.Date)37 CRFVersionBean (org.akaza.openclinica.bean.submit.CRFVersionBean)37