Search in sources :

Example 31 with ItemBean

use of org.akaza.openclinica.bean.submit.ItemBean in project OpenClinica by OpenClinica.

the class CreateDatasetServlet method allSedItemIdsInStudy.

public static ArrayList<String> allSedItemIdsInStudy(HashMap events, CRFDAO crfdao, ItemDAO idao) {
    ArrayList<String> sedItemIds = new ArrayList<String>();
    Iterator it = events.keySet().iterator();
    while (it.hasNext()) {
        StudyEventDefinitionBean sed = (StudyEventDefinitionBean) it.next();
        ArrayList<ItemBean> sedItems = new ArrayList<ItemBean>();
        ArrayList crfs = (ArrayList) crfdao.findAllActiveByDefinition(sed);
        for (int i = 0; i < crfs.size(); i++) {
            CRFBean crf = (CRFBean) crfs.get(i);
            ArrayList<ItemBean> items = idao.findAllActiveByCRF(crf);
            for (ItemBean item : items) {
                Integer itemId = item.getId();
                if (!sedItemIds.contains(itemId)) {
                    sedItemIds.add(sed.getId() + "-" + item.getId());
                }
            }
        }
    }
    return sedItemIds;
}
Also used : ItemBean(org.akaza.openclinica.bean.submit.ItemBean) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) StudyEventDefinitionBean(org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean) CRFBean(org.akaza.openclinica.bean.admin.CRFBean)

Example 32 with ItemBean

use of org.akaza.openclinica.bean.submit.ItemBean in project OpenClinica by OpenClinica.

the class ViewSelectedServlet method getAllSelected.

public static ArrayList getAllSelected(DatasetBean db, ItemDAO idao, ItemFormMetadataDAO imfdao) throws Exception {
    ArrayList items = new ArrayList();
    // ArrayList itemIds = db.getItemIds();
    ArrayList itemDefCrfs = db.getItemDefCrf();
    for (int i = 0; i < itemDefCrfs.size(); i++) {
        ItemBean item = (ItemBean) itemDefCrfs.get(i);
        item.setSelected(true);
        ArrayList metas = imfdao.findAllByItemId(item.getId());
        for (int h = 0; h < metas.size(); h++) {
            ItemFormMetadataBean ifmb = (ItemFormMetadataBean) metas.get(h);
        // logger.info("group name found:
        // "+ifmb.getGroupLabel());
        }
        item.setItemMetas(metas);
        items.add(item);
    }
    return items;
}
Also used : ItemBean(org.akaza.openclinica.bean.submit.ItemBean) ArrayList(java.util.ArrayList) ItemFormMetadataBean(org.akaza.openclinica.bean.submit.ItemFormMetadataBean)

Example 33 with ItemBean

use of org.akaza.openclinica.bean.submit.ItemBean in project OpenClinica by OpenClinica.

the class PrintAllEventCRFServlet method validateDisplayItemBean.

/*
     * (non-Javadoc)
     *
     * @see org.akaza.openclinica.control.submit.DataEntryServlet#validateDisplayItemBean(org.akaza.openclinica.core.form.Validator,
     *      org.akaza.openclinica.bean.submit.DisplayItemBean)
     */
@Override
protected DisplayItemBean validateDisplayItemBean(DiscrepancyValidator v, DisplayItemBean dib, String inputName, HttpServletRequest request) {
    ItemBean ib = dib.getItem();
    org.akaza.openclinica.bean.core.ResponseType rt = dib.getMetadata().getResponseSet().getResponseType();
    // note that this step sets us up both for
    // displaying the data on the form again, in the event of an error
    // and sending the data to the database, in the event of no error
    dib = loadFormValue(dib, request);
    // types TEL and ED are not supported yet
    if (rt.equals(org.akaza.openclinica.bean.core.ResponseType.TEXT) || rt.equals(org.akaza.openclinica.bean.core.ResponseType.TEXTAREA)) {
        dib = validateDisplayItemBeanText(v, dib, inputName, request);
    } else if (rt.equals(org.akaza.openclinica.bean.core.ResponseType.RADIO) || rt.equals(org.akaza.openclinica.bean.core.ResponseType.SELECT)) {
        dib = validateDisplayItemBeanSingleCV(v, dib, inputName);
    } else if (rt.equals(org.akaza.openclinica.bean.core.ResponseType.CHECKBOX) || rt.equals(org.akaza.openclinica.bean.core.ResponseType.SELECTMULTI)) {
        dib = validateDisplayItemBeanMultipleCV(v, dib, inputName);
    } else if (rt.equals(org.akaza.openclinica.bean.core.ResponseType.CALCULATION) || rt.equals(org.akaza.openclinica.bean.core.ResponseType.GROUP_CALCULATION)) {
        // for now, treat calculation like any other text input --
        // eventually this might need to be customized
        dib = validateDisplayItemBeanText(v, dib, inputName, request);
    }
    return dib;
}
Also used : DisplayItemBean(org.akaza.openclinica.bean.submit.DisplayItemBean) ItemBean(org.akaza.openclinica.bean.submit.ItemBean)

Example 34 with ItemBean

use of org.akaza.openclinica.bean.submit.ItemBean in project OpenClinica by OpenClinica.

the class PrintAllSiteEventCRFServlet method validateDisplayItemBean.

/*
     * (non-Javadoc)
     *
     * @see org.akaza.openclinica.control.submit.DataEntryServlet#validateDisplayItemBean(org.akaza.openclinica.core.form.Validator,
     *      org.akaza.openclinica.bean.submit.DisplayItemBean)
     */
@Override
protected DisplayItemBean validateDisplayItemBean(DiscrepancyValidator v, DisplayItemBean dib, String inputName, HttpServletRequest request) {
    ItemBean ib = dib.getItem();
    org.akaza.openclinica.bean.core.ResponseType rt = dib.getMetadata().getResponseSet().getResponseType();
    // note that this step sets us up both for
    // displaying the data on the form again, in the event of an error
    // and sending the data to the database, in the event of no error
    dib = loadFormValue(dib, request);
    // types TEL and ED are not supported yet
    if (rt.equals(org.akaza.openclinica.bean.core.ResponseType.TEXT) || rt.equals(org.akaza.openclinica.bean.core.ResponseType.TEXTAREA)) {
        dib = validateDisplayItemBeanText(v, dib, inputName, request);
    } else if (rt.equals(org.akaza.openclinica.bean.core.ResponseType.RADIO) || rt.equals(org.akaza.openclinica.bean.core.ResponseType.SELECT)) {
        dib = validateDisplayItemBeanSingleCV(v, dib, inputName);
    } else if (rt.equals(org.akaza.openclinica.bean.core.ResponseType.CHECKBOX) || rt.equals(org.akaza.openclinica.bean.core.ResponseType.SELECTMULTI)) {
        dib = validateDisplayItemBeanMultipleCV(v, dib, inputName);
    } else if (rt.equals(org.akaza.openclinica.bean.core.ResponseType.CALCULATION) || rt.equals(org.akaza.openclinica.bean.core.ResponseType.GROUP_CALCULATION)) {
        // for now, treat calculation like any other text input --
        // eventually this might need to be customized
        dib = validateDisplayItemBeanText(v, dib, inputName, request);
    }
    return dib;
}
Also used : DisplayItemBean(org.akaza.openclinica.bean.submit.DisplayItemBean) ItemBean(org.akaza.openclinica.bean.submit.ItemBean)

Example 35 with ItemBean

use of org.akaza.openclinica.bean.submit.ItemBean in project OpenClinica by OpenClinica.

the class PrintCRFServlet method validateDisplayItemBean.

/*
     * (non-Javadoc)
     * @see org.akaza.openclinica.control.submit.DataEntryServlet#validateDisplayItemBean(org.akaza.openclinica.core.form.Validator,
     * org.akaza.openclinica.bean.submit.DisplayItemBean)
     */
@Override
protected DisplayItemBean validateDisplayItemBean(DiscrepancyValidator v, DisplayItemBean dib, String inputName, HttpServletRequest request) {
    ItemBean ib = dib.getItem();
    org.akaza.openclinica.bean.core.ResponseType rt = dib.getMetadata().getResponseSet().getResponseType();
    // note that this step sets us up both for
    // displaying the data on the form again, in the event of an error
    // and sending the data to the database, in the event of no error
    dib = loadFormValue(dib, request);
    // types TEL and ED are not supported yet
    if (rt.equals(org.akaza.openclinica.bean.core.ResponseType.TEXT) || rt.equals(org.akaza.openclinica.bean.core.ResponseType.TEXTAREA)) {
        dib = validateDisplayItemBeanText(v, dib, inputName, request);
    } else if (rt.equals(org.akaza.openclinica.bean.core.ResponseType.RADIO) || rt.equals(org.akaza.openclinica.bean.core.ResponseType.SELECT)) {
        dib = validateDisplayItemBeanSingleCV(v, dib, inputName);
    } else if (rt.equals(org.akaza.openclinica.bean.core.ResponseType.CHECKBOX) || rt.equals(org.akaza.openclinica.bean.core.ResponseType.SELECTMULTI)) {
        dib = validateDisplayItemBeanMultipleCV(v, dib, inputName);
    } else if (rt.equals(org.akaza.openclinica.bean.core.ResponseType.CALCULATION) || rt.equals(org.akaza.openclinica.bean.core.ResponseType.GROUP_CALCULATION)) {
        // for now, treat calculation like any other text input --
        // eventually this might need to be customized
        dib = validateDisplayItemBeanText(v, dib, inputName, request);
    }
    return dib;
}
Also used : DisplayItemBean(org.akaza.openclinica.bean.submit.DisplayItemBean) ItemBean(org.akaza.openclinica.bean.submit.ItemBean)

Aggregations

ItemBean (org.akaza.openclinica.bean.submit.ItemBean)132 ArrayList (java.util.ArrayList)77 DisplayItemBean (org.akaza.openclinica.bean.submit.DisplayItemBean)56 HashMap (java.util.HashMap)50 ItemDAO (org.akaza.openclinica.dao.submit.ItemDAO)43 ItemDataBean (org.akaza.openclinica.bean.submit.ItemDataBean)42 ItemFormMetadataBean (org.akaza.openclinica.bean.submit.ItemFormMetadataBean)36 ItemGroupBean (org.akaza.openclinica.bean.submit.ItemGroupBean)26 EventCRFBean (org.akaza.openclinica.bean.submit.EventCRFBean)25 Iterator (java.util.Iterator)23 CRFBean (org.akaza.openclinica.bean.admin.CRFBean)22 ItemDataDAO (org.akaza.openclinica.dao.submit.ItemDataDAO)22 StudyEventDefinitionBean (org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean)21 ItemFormMetadataDAO (org.akaza.openclinica.dao.submit.ItemFormMetadataDAO)20 CRFVersionBean (org.akaza.openclinica.bean.submit.CRFVersionBean)15 SectionBean (org.akaza.openclinica.bean.submit.SectionBean)15 FormProcessor (org.akaza.openclinica.control.form.FormProcessor)15 StudyEventBean (org.akaza.openclinica.bean.managestudy.StudyEventBean)13 StudySubjectBean (org.akaza.openclinica.bean.managestudy.StudySubjectBean)13 DisplayItemGroupBean (org.akaza.openclinica.bean.submit.DisplayItemGroupBean)13