Search in sources :

Example 61 with CRFBean

use of org.akaza.openclinica.bean.admin.CRFBean in project OpenClinica by OpenClinica.

the class CRFDAO method update.

public EntityBean update(EntityBean eb) {
    CRFBean cb = (CRFBean) eb;
    HashMap variables = new HashMap();
    variables.put(Integer.valueOf(1), Integer.valueOf(cb.getStatus().getId()));
    // variables.put(Integer.valueOf(2), cb.getLabel());
    variables.put(Integer.valueOf(2), cb.getName());
    variables.put(Integer.valueOf(3), cb.getDescription());
    variables.put(Integer.valueOf(4), Integer.valueOf(cb.getUpdater().getId()));
    variables.put(Integer.valueOf(5), Integer.valueOf(cb.getId()));
    this.execute(digester.getQuery("update"), variables);
    return eb;
}
Also used : HashMap(java.util.HashMap) CRFBean(org.akaza.openclinica.bean.admin.CRFBean)

Example 62 with CRFBean

use of org.akaza.openclinica.bean.admin.CRFBean in project OpenClinica by OpenClinica.

the class CRFDAO method create.

public EntityBean create(EntityBean eb) {
    CRFBean cb = (CRFBean) eb;
    HashMap variables = new HashMap();
    variables.put(Integer.valueOf(1), Integer.valueOf(cb.getStatus().getId()));
    // variables.put(Integer.valueOf(2), cb.getLabel());
    variables.put(Integer.valueOf(2), cb.getName());
    variables.put(Integer.valueOf(3), cb.getDescription());
    variables.put(Integer.valueOf(4), Integer.valueOf(cb.getOwner().getId()));
    variables.put(Integer.valueOf(5), getValidOid(cb, cb.getName()));
    variables.put(Integer.valueOf(6), cb.getStudyId());
    // am i the only one who runs their daos' unit tests after I change
    // things, tbh?
    this.execute(digester.getQuery("create"), variables);
    if (isQuerySuccessful()) {
        cb.setActive(true);
    }
    return cb;
}
Also used : HashMap(java.util.HashMap) CRFBean(org.akaza.openclinica.bean.admin.CRFBean)

Example 63 with CRFBean

use of org.akaza.openclinica.bean.admin.CRFBean in project OpenClinica by OpenClinica.

the class CRFDAO method findByLayoutId.

public CRFBean findByLayoutId(int formLayoutId) {
    CRFBean answer = new CRFBean();
    this.unsetTypeExpected();
    this.setTypesExpected();
    HashMap variables = new HashMap();
    variables.put(Integer.valueOf(1), Integer.valueOf(formLayoutId));
    String sql = digester.getQuery("findByLayoutId");
    ArrayList rows = select(sql, variables);
    if (rows.size() > 0) {
        HashMap row = (HashMap) rows.get(0);
        answer = (CRFBean) getEntityFromHashMap(row);
    }
    return answer;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) CRFBean(org.akaza.openclinica.bean.admin.CRFBean)

Example 64 with CRFBean

use of org.akaza.openclinica.bean.admin.CRFBean in project OpenClinica by OpenClinica.

the class OdmExtractDAO method getEventDefCRF.

private EventDefinitionCRFBean getEventDefCRF(StudyEventDefBean studyEventDefBean, ElementRefBean formRef, int studyId) {
    StudyBean studyBean = (StudyBean) sdao.findByPK(studyId);
    StudyEventDefinitionBean sedBean = seddao.findByOid(studyEventDefBean.getOid());
    CRFBean crfBean = crfdao.findByOid(formRef.getElementDefOID());
    return edcdao.findByStudyEventDefinitionIdAndCRFId(studyBean, sedBean.getId(), crfBean.getId());
}
Also used : StudyBean(org.akaza.openclinica.bean.managestudy.StudyBean) StudyEventDefinitionBean(org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean) EventDefinitionCRFBean(org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean) CRFBean(org.akaza.openclinica.bean.admin.CRFBean)

Example 65 with CRFBean

use of org.akaza.openclinica.bean.admin.CRFBean in project OpenClinica by OpenClinica.

the class OdmExtractDAO method getFormLayoutRefs.

List<ElementRefBean> getFormLayoutRefs(FormDefBean formDef) {
    CRFBean crfBean = crfdao.findByOid(formDef.getOid());
    List<FormLayoutBean> formLayouts = fldao.findAllByCRFId(crfBean.getId());
    List<ElementRefBean> elementRefs = new ArrayList<>();
    ElementRefBean element;
    for (FormLayoutBean formLayout : formLayouts) {
        element = new ElementRefBean();
        element.setName(formLayout.getName());
        element.setUrl(formLayout.getUrl());
        elementRefs.add(element);
    }
    return elementRefs;
}
Also used : ElementRefBean(org.akaza.openclinica.bean.odmbeans.ElementRefBean) ArrayList(java.util.ArrayList) FormLayoutBean(org.akaza.openclinica.bean.submit.FormLayoutBean) EventDefinitionCRFBean(org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean) CRFBean(org.akaza.openclinica.bean.admin.CRFBean)

Aggregations

CRFBean (org.akaza.openclinica.bean.admin.CRFBean)138 ArrayList (java.util.ArrayList)95 EventDefinitionCRFBean (org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean)78 CRFDAO (org.akaza.openclinica.dao.admin.CRFDAO)78 EventCRFBean (org.akaza.openclinica.bean.submit.EventCRFBean)70 CRFVersionBean (org.akaza.openclinica.bean.submit.CRFVersionBean)67 CRFVersionDAO (org.akaza.openclinica.dao.submit.CRFVersionDAO)63 StudyEventDefinitionBean (org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean)56 EventDefinitionCRFDAO (org.akaza.openclinica.dao.managestudy.EventDefinitionCRFDAO)44 HashMap (java.util.HashMap)43 EventCRFDAO (org.akaza.openclinica.dao.submit.EventCRFDAO)43 FormProcessor (org.akaza.openclinica.control.form.FormProcessor)40 StudyEventDefinitionDAO (org.akaza.openclinica.dao.managestudy.StudyEventDefinitionDAO)37 StudyEventDAO (org.akaza.openclinica.dao.managestudy.StudyEventDAO)29 StudyBean (org.akaza.openclinica.bean.managestudy.StudyBean)27 Iterator (java.util.Iterator)26 StudyEventBean (org.akaza.openclinica.bean.managestudy.StudyEventBean)26 DisplayEventCRFBean (org.akaza.openclinica.bean.submit.DisplayEventCRFBean)22 ItemBean (org.akaza.openclinica.bean.submit.ItemBean)21 ItemDataDAO (org.akaza.openclinica.dao.submit.ItemDataDAO)20