Search in sources :

Example 51 with EventCRFBean

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

the class DataEntryServlet method loadFormValueForItemGroup.

/**
     * This methods will create an array of DisplayItemGroupBean, which contains multiple rows for an item group on the data entry form.
     *
     * @param digb
     *            The Item group which has multiple data rows
     * @param dbGroups
     *            The original array got from DB which contains multiple data rows
     * @param formGroups
     *            The new array got from front end which contains multiple data rows
     * @param request TODO
     * @return new constructed formGroups, compare to dbGroups, some rows are update, some new ones are added and some are removed
     */
protected List<DisplayItemGroupBean> loadFormValueForItemGroup(DisplayItemGroupBean digb, List<DisplayItemGroupBean> dbGroups, List<DisplayItemGroupBean> formGroups, int eventDefCRFId, HttpServletRequest request) {
    SectionBean sb = (SectionBean) request.getAttribute(SECTION_BEAN);
    int repeatMax = digb.getGroupMetaBean().getRepeatMax();
    FormProcessor fp = new FormProcessor(request);
    ItemDAO idao = new ItemDAO(getDataSource());
    List<ItemBean> itBeans = idao.findAllItemsByGroupId(digb.getItemGroupBean().getId(), sb.getCRFVersionId());
    LOGGER.debug("+++ starting to review groups: " + repeatMax);
    long timeCheck = System.currentTimeMillis();
    EventCRFBean ecb = (EventCRFBean) request.getAttribute(INPUT_EVENT_CRF);
    // adding this code from below, since we want to pass a null values list
    // in all cases of getDisplayBeansFromItems().
    // For adding null values to display items
    FormBeanUtil formBeanUtil = new FormBeanUtil();
    List<String> nullValuesList = new ArrayList<String>();
    // BWP>> Get a List<String> of any null values such as NA or NI
    // method returns null values as a List<String>
    nullValuesList = formBeanUtil.getNullValuesByEventCRFDefId(eventDefCRFId, getDataSource());
    // >>BWP
    // logger.trace("+++ starting to review groups 2: " + repeatMax);
    long two = System.currentTimeMillis() - timeCheck;
    // logger.trace("time 2: " + two + "ms");
    // >>TBH below dual for loops need a breaker to avoid a performance hit
    int firstLoopBreak = 0;
    int secondLoopBreak = 0;
    ItemDataDAO iddao = new ItemDataDAO(getDataSource(), locale);
    int maxOrdinal = iddao.getMaxOrdinalForGroup(ecb, sb, digb.getItemGroupBean());
    repeatMax = (repeatMax < maxOrdinal) ? maxOrdinal : repeatMax;
    for (int i = 0; i < repeatMax; i++) {
        DisplayItemGroupBean formGroup = new DisplayItemGroupBean();
        formGroup.setItemGroupBean(digb.getItemGroupBean());
        formGroup.setGroupMetaBean(runDynamicsCheck(digb.getGroupMetaBean(), request));
        ItemGroupBean igb = digb.getItemGroupBean();
        // want to do deep copy here, so always get a fresh copy for items,
        // may use other better way to do, like clone
        List<DisplayItemBean> dibs = FormBeanUtil.getDisplayBeansFromItems(itBeans, getDataSource(), ecb, sb.getId(), nullValuesList, getServletContext());
        // and then get newly created rows later, tbh 01/2010
        if (fp.getStartsWith(igb.getOid() + "_manual" + i + "input")) {
            formGroup.setOrdinal(i);
            formGroup.setFormInputOrdinal(i);
            formGroup.setAuto(false);
            formGroup.setInputId(igb.getOid() + "_manual" + i);
            LOGGER.debug("1: set auto to false for " + igb.getOid() + " " + i);
            dibs = processInputForGroupItem(fp, dibs, i, digb, false);
            formGroup.setItems(dibs);
            formGroups.add(formGroup);
        } else if (!StringUtil.isBlank(fp.getString(igb.getOid() + "_manual" + i + ".newRow"))) {
            // ||
            // (fp.getStartsWith(igb.getOid() + "_manual" + i + "input"))) {
            // the ordinal is the number got from [ ] and submitted by
            // repetition javascript
            formGroup.setOrdinal(i);
            formGroup.setFormInputOrdinal(i);
            formGroup.setInputId(igb.getOid() + "_manual" + i + ".newRow");
            formGroup.setAuto(false);
            LOGGER.debug("2: set auto to false for " + igb.getOid() + " " + i);
            dibs = processInputForGroupItem(fp, dibs, i, digb, false);
            formGroup.setItems(dibs);
            formGroups.add(formGroup);
        } else {
            firstLoopBreak++;
        }
        if (firstLoopBreak > 14) {
            LOGGER.debug("break first loop");
            break;
        }
    }
    // end of for (int i = 0; i < repeatMax; i++)
    // >>TBH remove the above eventually, repeat some work here?
    LOGGER.trace("+++ starting to review groups 3: " + repeatMax);
    two = System.currentTimeMillis() - timeCheck;
    LOGGER.trace("time 3: " + two + "ms");
    // had the call to form bean utils here, tbh
    for (int i = 0; i < repeatMax; i++) {
        DisplayItemGroupBean formGroup = new DisplayItemGroupBean();
        formGroup.setItemGroupBean(digb.getItemGroupBean());
        //            try {
        //                // set isShown here, tbh 04/2010
        //                boolean showGroup = getItemMetadataService().isGroupShown(digb.getGroupMetaBean().getId(), ecb);
        //                logger.debug("found show group for group meta bean " + digb.getGroupMetaBean().getId() + ": " + showGroup);
        //                if (showGroup) {
        //                    digb.getGroupMetaBean().setShowGroup(showGroup);
        //                    // we are only hiding, not showing (for now) tbh
        //                }
        //                // << tbh 04/2010
        //            } catch (OpenClinicaException oce) {
        //                // do nothing for right now, just store the bean
        //                logger.debug("throws an OCE for " + digb.getGroupMetaBean().getId());
        //            }
        formGroup.setGroupMetaBean(runDynamicsCheck(digb.getGroupMetaBean(), request));
        ItemGroupBean igb = digb.getItemGroupBean();
        // adding this code from below, since we want to pass a null values
        // list
        // in all cases of getDisplayBeansFromItems().
        // For adding null values to display items
        // FormBeanUtil formBeanUtil = new FormBeanUtil();
        // List<String> nullValuesList = new ArrayList<String>();
        // BWP>> Get a List<String> of any null values such as NA or NI
        // method returns null values as a List<String>
        // >>BWP
        // want to do deep copy here, so always get a fresh copy for items,
        // may use other better way to do, like clone
        // moved it back down here to fix another bug, tbh 12-3-2007
        List<DisplayItemBean> dibs = FormBeanUtil.getDisplayBeansFromItems(itBeans, getDataSource(), ecb, sb.getId(), nullValuesList, getServletContext());
        LOGGER.trace("+++count for dibs after deep copy: " + dibs.size());
        two = System.currentTimeMillis() - timeCheck;
        // created by rep model(add button)
        if (fp.getStartsWith(igb.getOid() + "_" + i + "input")) {
            formGroup.setInputId(igb.getOid() + "_" + i);
            if (i == 0) {
                // ordinal that will be saved into
                formGroup.setOrdinal(i);
            // DB
            } else {
                // from 0 again, the
                formGroup.setFormInputOrdinal(i);
            // ordinal from front
            // end page, needs to be
            // reprocessed
            }
            formGroup.setAuto(true);
            LOGGER.debug("1: set auto to TRUE for " + igb.getOid() + " " + i);
            dibs = processInputForGroupItem(fp, dibs, i, digb, true);
            LOGGER.trace("+++ group ordinal: " + i + " igb name " + igb.getName());
            formGroup.setItems(dibs);
            formGroups.add(formGroup);
        } else if (!StringUtil.isBlank(fp.getString(igb.getOid() + "_" + i + ".newRow"))) {
            // || (fp.getStartsWith(igb.getOid() + "_" + i + "input"))) {
            // the ordinal is the number got from [ ] and submitted by
            // repetition javascript
            formGroup.setInputId(igb.getOid() + "_" + i);
            if (i == 0) {
                // ordinal that will be saved into
                formGroup.setOrdinal(i);
            // DB
            } else {
                // from 0 again, the
                formGroup.setFormInputOrdinal(i);
            // ordinal from front
            // end page, needs to be
            // reprocessed
            }
            // String fieldName = igb.getOid() + "_" + i + this.getInputName(dib);
            // if (!StringUtil.isBlank(fp.getString(fieldName))) {
            // if (i != repeatMax) {
            // formGroup.setAuto(false);
            // logger.debug("set auto to false for " + igb.getOid() + " " + i);
            // } else {
            formGroup.setAuto(true);
            LOGGER.debug("2: set auto to TRUE for " + igb.getOid() + " " + i);
            dibs = processInputForGroupItem(fp, dibs, i, digb, true);
            LOGGER.trace("+++ group ordinal: " + i + " igb name " + igb.getName());
            formGroup.setItems(dibs);
            formGroups.add(formGroup);
        } else {
            secondLoopBreak++;
        }
        if (secondLoopBreak > 14) {
            LOGGER.debug("break second loop");
            break;
        }
    }
    // end of for (int i = 0; i < repeatMax; i++)
    LOGGER.debug("first loop: " + firstLoopBreak);
    LOGGER.debug("second loop: " + secondLoopBreak);
    LOGGER.trace("+++ starting to review groups 4: " + repeatMax);
    two = System.currentTimeMillis() - timeCheck;
    LOGGER.trace("time 4: " + two + "ms");
    // checks how many rows are manually created, not added by repetition
    // model
    int manualRows = getManualRows(formGroups);
    // for (int j = 0; j < formGroups.size(); j++) {
    // DisplayItemGroupBean formItemGroup = formGroups.get(j);
    // // logger.trace("begin formGroup Ordinal:" +
    // // formItemGroup.getOrdinal());
    // if (formItemGroup.isAuto() == false) {
    // manualRows = manualRows + 1;
    // }
    // }
    LOGGER.debug(" manual rows " + manualRows + " formGroup size " + formGroups.size());
    request.setAttribute("manualRows", new Integer(manualRows));
    // reset ordinal for the auto-created rows except for the first row
    for (int j = 0; j < formGroups.size(); j++) {
        DisplayItemGroupBean formItemGroup = formGroups.get(j);
        if (formItemGroup.isAuto() && formItemGroup.getFormInputOrdinal() > 0) {
            LOGGER.trace("+++ formInputOrdinal() " + formItemGroup.getFormInputOrdinal());
            // rows included in the model: first row, last existing row and
            // new rows
            // the rows in between are manually added
            // set the correct ordinal that will be saved into DB
            // the rows generated by model starts from 0, need to add the
            // number of manual rows to
            // get the correct ordinals, otherwise, we will have duplicate
            // ordinals like two ordinal 0
            formItemGroup.setOrdinal(formItemGroup.getFormInputOrdinal() + manualRows);
        }
    }
    LOGGER.trace("+++ starting to review groups 5: " + repeatMax);
    two = System.currentTimeMillis() - timeCheck;
    LOGGER.trace("time 5: " + two + "ms");
    // sort all the rows by ordinal
    Collections.sort(formGroups);
    LOGGER.trace("group row size:" + formGroups.size());
    // suppose we have 3 rows of data from db, the orginal order is 0,1,2,
    // repetition model will submit row number in [ ] like the following:
    // 0,1,2.. consecutive numbers, means no row removed in between
    // 0,1,3,4.. the 2rd row is removed, 3 and 4 are new rows
    int previous = -1;
    for (int j = 0; j < formGroups.size(); j++) {
        DisplayItemGroupBean formItemGroup = formGroups.get(j);
        LOGGER.trace("formGroup Ordinal:" + formItemGroup.getOrdinal());
        // tbh 08/2009
        if (formItemGroup.getOrdinal() == previous) {
            LOGGER.debug("found a match btw previous and ordinal");
            formItemGroup.setEditFlag("edit");
            formItemGroup.setOrdinal(previous + 1);
        // dbGroups.get(j).setEditFlag("edit");
        }
        // << tbh 08/2009
        if (formItemGroup.getOrdinal() > dbGroups.size() - 1) {
            formItemGroup.setEditFlag("add");
        } else {
            for (int i = 0; i < dbGroups.size(); i++) {
                DisplayItemGroupBean dbItemGroup = dbGroups.get(i);
                if (formItemGroup.getOrdinal() == i) {
                    // display, so need to insert this row, not update
                    if ("initial".equalsIgnoreCase(dbItemGroup.getEditFlag())) {
                        formItemGroup.setEditFlag("add");
                    } else {
                        dbItemGroup.setEditFlag("edit");
                        // need to set up item data id in order to update
                        for (DisplayItemBean dib : dbItemGroup.getItems()) {
                            ItemDataBean data = dib.getData();
                            for (DisplayItemBean formDib : formItemGroup.getItems()) {
                                if (formDib.getItem().getId() == dib.getItem().getId()) {
                                    formDib.getData().setId(data.getId());
                                    // this will save the data from IDE
                                    // complete, used only for DDE
                                    formDib.setDbData(dib.getData());
                                    // tbh removed below line so as not to
                                    // log so much, 112007
                                    LOGGER.debug("+++ +++ form dib get data set id " + data.getId());
                                    break;
                                }
                            }
                        }
                        formItemGroup.setEditFlag("edit");
                    }
                    // else
                    break;
                }
            }
        }
        // else
        previous = formItemGroup.getOrdinal();
    }
    LOGGER.trace("+++ === DB group row:" + dbGroups.size());
    LOGGER.trace("+++ === DB group contents: " + dbGroups.toString());
    // cannot get it.-jxu
    for (int i = 0; i < dbGroups.size(); i++) {
        DisplayItemGroupBean dbItemGroup = dbGroups.get(i);
        LOGGER.trace("+++ found edit flag of " + dbItemGroup.getEditFlag() + " for #" + dbItemGroup.getOrdinal());
        // logger.debug("+++ found edit flag of " + dbItemGroup.getEditFlag() + " for #" + dbItemGroup.getOrdinal() + ": " + i);
        if (!"edit".equalsIgnoreCase(dbItemGroup.getEditFlag()) && !"initial".equalsIgnoreCase(dbItemGroup.getEditFlag())) {
            // >> tbh if the group is not shown, we should not touch it 05/2010
            if (dbItemGroup.getGroupMetaBean().isShowGroup()) {
                LOGGER.trace("+++ one row removed, edit flag was " + dbItemGroup.getEditFlag());
                LOGGER.debug("+++ one row removed, edit flag was " + dbItemGroup.getEditFlag());
                dbItemGroup.setEditFlag("remove");
            }
        // << tbh
        }
    }
    LOGGER.debug("+++ about to return form groups: " + formGroups.toString());
    for (int j = 0; j < formGroups.size(); j++) {
        DisplayItemGroupBean formGroup = formGroups.get(j);
        formGroup.setIndex(j);
    }
    return formGroups;
}
Also used : DisplayItemGroupBean(org.akaza.openclinica.bean.submit.DisplayItemGroupBean) DisplayItemBean(org.akaza.openclinica.bean.submit.DisplayItemBean) ItemBean(org.akaza.openclinica.bean.submit.ItemBean) ItemDAO(org.akaza.openclinica.dao.submit.ItemDAO) FormBeanUtil(org.akaza.openclinica.view.form.FormBeanUtil) FormProcessor(org.akaza.openclinica.control.form.FormProcessor) ArrayList(java.util.ArrayList) ItemDataDAO(org.akaza.openclinica.dao.submit.ItemDataDAO) SectionBean(org.akaza.openclinica.bean.submit.SectionBean) DisplaySectionBean(org.akaza.openclinica.bean.submit.DisplaySectionBean) EventCRFBean(org.akaza.openclinica.bean.submit.EventCRFBean) ItemDataBean(org.akaza.openclinica.bean.submit.ItemDataBean) DisplayItemBean(org.akaza.openclinica.bean.submit.DisplayItemBean) ItemGroupBean(org.akaza.openclinica.bean.submit.ItemGroupBean) DisplayItemGroupBean(org.akaza.openclinica.bean.submit.DisplayItemGroupBean)

Example 52 with EventCRFBean

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

the class CreateOneDiscrepancyNoteServlet method updateStudyEvent.

private void updateStudyEvent(String entityType, int entityId) {
    if ("itemData".equalsIgnoreCase(entityType)) {
        int itemDataId = entityId;
        ItemDataDAO iddao = new ItemDataDAO(sm.getDataSource());
        ItemDataBean itemData = (ItemDataBean) iddao.findByPK(itemDataId);
        EventCRFDAO ecdao = new EventCRFDAO(sm.getDataSource());
        StudyEventDAO svdao = new StudyEventDAO(sm.getDataSource());
        EventCRFBean ec = (EventCRFBean) ecdao.findByPK(itemData.getEventCRFId());
        StudyEventBean event = (StudyEventBean) svdao.findByPK(ec.getStudyEventId());
        if (event.getSubjectEventStatus().equals(SubjectEventStatus.SIGNED)) {
            event.setSubjectEventStatus(SubjectEventStatus.COMPLETED);
            event.setUpdater(ub);
            event.setUpdatedDate(new Date());
            svdao.update(event);
        }
    } else if ("eventCrf".equalsIgnoreCase(entityType)) {
        int eventCRFId = entityId;
        EventCRFDAO ecdao = new EventCRFDAO(sm.getDataSource());
        StudyEventDAO svdao = new StudyEventDAO(sm.getDataSource());
        EventCRFBean ec = (EventCRFBean) ecdao.findByPK(eventCRFId);
        StudyEventBean event = (StudyEventBean) svdao.findByPK(ec.getStudyEventId());
        if (event.getSubjectEventStatus().equals(SubjectEventStatus.SIGNED)) {
            event.setSubjectEventStatus(SubjectEventStatus.COMPLETED);
            event.setUpdater(ub);
            event.setUpdatedDate(new Date());
            svdao.update(event);
        }
    }
}
Also used : EventCRFBean(org.akaza.openclinica.bean.submit.EventCRFBean) ItemDataBean(org.akaza.openclinica.bean.submit.ItemDataBean) StudyEventDAO(org.akaza.openclinica.dao.managestudy.StudyEventDAO) StudyEventBean(org.akaza.openclinica.bean.managestudy.StudyEventBean) ItemDataDAO(org.akaza.openclinica.dao.submit.ItemDataDAO) EventCRFDAO(org.akaza.openclinica.dao.submit.EventCRFDAO) Date(java.util.Date)

Example 53 with EventCRFBean

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

the class DataEntryServlet method isSectionReviewedOnce.

/**
     * Checks if a section is reviewed at least once by user
     * updated tbh 03/2011, to fix duplicates issues
     * @param sb
     * @param request TODO
     * @return
     */
protected boolean isSectionReviewedOnce(SectionBean sb, HttpServletRequest request) {
    SectionDAO sdao = new SectionDAO(getDataSource());
    EventCRFBean ecb = (EventCRFBean) request.getAttribute(INPUT_EVENT_CRF);
    EventDefinitionCRFBean edcb = (EventDefinitionCRFBean) request.getAttribute(EVENT_DEF_CRF_BEAN);
    DataEntryStage stage = ecb.getStage();
    HashMap numItemsHM = sdao.getNumItemsBySectionId();
    HashMap numItemsPendingHM = sdao.getNumItemsPendingBySectionId(ecb);
    HashMap numItemsCompletedHM = sdao.getNumItemsCompletedBySectionId(ecb);
    HashMap numItemsBlankHM = sdao.getNumItemsBlankBySectionId(ecb);
    Integer key = new Integer(sb.getId());
    int numItems = TableOfContentsServlet.getIntById(numItemsHM, key);
    int numItemsPending = TableOfContentsServlet.getIntById(numItemsPendingHM, key);
    int numItemsCompleted = TableOfContentsServlet.getIntById(numItemsCompletedHM, key);
    int numItemsBlank = TableOfContentsServlet.getIntById(numItemsBlankHM, key);
    LOGGER.debug(" for " + key + " num items " + numItems + " num items blank " + numItemsBlank + " num items pending " + numItemsPending + " completed " + numItemsCompleted);
    if (stage.equals(DataEntryStage.INITIAL_DATA_ENTRY) && edcb.isDoubleEntry()) {
        if (numItemsPending == 0 && numItems > 0) {
            LOGGER.debug("returns false on ide loop " + key);
            return false;
        }
    } else {
        if (numItemsCompleted == 0 && numItems > 0) {
            LOGGER.debug("returns false on other loop " + key);
            return false;
        }
    }
    return true;
}
Also used : EventCRFBean(org.akaza.openclinica.bean.submit.EventCRFBean) HashMap(java.util.HashMap) EventDefinitionCRFBean(org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean) SectionDAO(org.akaza.openclinica.dao.submit.SectionDAO) DataEntryStage(org.akaza.openclinica.bean.core.DataEntryStage)

Example 54 with EventCRFBean

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

the class DataEntryServlet method saveItemsToMarkComplete.

/**
     * 06/13/2007- jxu Since we don't require users to review each section before mark a CRF as complete, we need to create item data in the database because
     * items will not be created unless the section which contains the items is reviewed by users
     * @param request TODO
     */
private boolean saveItemsToMarkComplete(Status completeStatus, HttpServletRequest request) throws Exception {
    EventCRFBean ecb = (EventCRFBean) request.getAttribute(INPUT_EVENT_CRF);
    SectionDAO sdao = new SectionDAO(getDataSource());
    ArrayList sections = sdao.findAllByCRFVersionId(ecb.getCRFVersionId());
    UserAccountBean ub = (UserAccountBean) request.getSession().getAttribute(USER_BEAN_NAME);
    ItemDataDAO iddao = new ItemDataDAO(getDataSource(), locale);
    ItemDAO idao = new ItemDAO(getDataSource());
    for (int i = 0; i < sections.size(); i++) {
        SectionBean sb = (SectionBean) sections.get(i);
        if (!isCreateItemReqd(sb, request)) {
            // ArrayList requiredItems =
            // idao.findAllRequiredBySectionId(sb.getId());
            // if (!requiredItems.isEmpty()) {
            // return false;
            // }
            ArrayList items = idao.findAllBySectionId(sb.getId());
            for (int j = 0; j < items.size(); j++) {
                ItemBean item = (ItemBean) items.get(j);
                ArrayList<ItemDataBean> itemBean = iddao.findAllByEventCRFIdAndItemIdNoStatus(ecb.getId(), item.getId());
                ItemDataBean idb = new ItemDataBean();
                idb.setItemId(item.getId());
                idb.setEventCRFId(ecb.getId());
                idb.setCreatedDate(new Date());
                idb.setOrdinal(1);
                idb.setOwner(ub);
                if (completeStatus != null) {
                    // to avoid null exception
                    idb.setStatus(completeStatus);
                } else {
                    idb.setStatus(Status.UNAVAILABLE);
                }
                idb.setValue("");
                boolean save = true;
                if (itemBean.size() > 0)
                    save = false;
                /* while(itemBean.iterator().hasNext())
                    {

                        ItemDataBean temp = itemBean.iterator().next();
                       if(idb.getEventCRFId()==(temp.getEventCRFId()))
                       {
                           if(idb.getItemId()==(temp.getItemId())){
                              save = false;
                           }
                       }


                    }*/
                if (save) {
                    iddao.create(idb);
                }
            }
        }
    }
    return true;
}
Also used : DisplayItemBean(org.akaza.openclinica.bean.submit.DisplayItemBean) ItemBean(org.akaza.openclinica.bean.submit.ItemBean) ItemDAO(org.akaza.openclinica.dao.submit.ItemDAO) ArrayList(java.util.ArrayList) ItemDataDAO(org.akaza.openclinica.dao.submit.ItemDataDAO) Date(java.util.Date) SectionBean(org.akaza.openclinica.bean.submit.SectionBean) DisplaySectionBean(org.akaza.openclinica.bean.submit.DisplaySectionBean) EventCRFBean(org.akaza.openclinica.bean.submit.EventCRFBean) ItemDataBean(org.akaza.openclinica.bean.submit.ItemDataBean) UserAccountBean(org.akaza.openclinica.bean.login.UserAccountBean) SectionDAO(org.akaza.openclinica.dao.submit.SectionDAO)

Example 55 with EventCRFBean

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

the class DataEntryServlet method prepareScoreItems.

protected HashMap<String, ItemBean> prepareScoreItems(HttpServletRequest request) {
    HashMap<String, ItemBean> scoreItems = new HashMap<String, ItemBean>();
    EventCRFBean ecb = (EventCRFBean) request.getAttribute(INPUT_EVENT_CRF);
    ItemDAO idao = new ItemDAO(getDataSource());
    ArrayList<ItemBean> ibs = idao.findAllItemsByVersionId(ecb.getCRFVersionId());
    for (ItemBean ib : ibs) {
        scoreItems.put(ib.getName(), ib);
    }
    return scoreItems;
}
Also used : DisplayItemBean(org.akaza.openclinica.bean.submit.DisplayItemBean) ItemBean(org.akaza.openclinica.bean.submit.ItemBean) EventCRFBean(org.akaza.openclinica.bean.submit.EventCRFBean) HashMap(java.util.HashMap) ItemDAO(org.akaza.openclinica.dao.submit.ItemDAO)

Aggregations

EventCRFBean (org.akaza.openclinica.bean.submit.EventCRFBean)198 ArrayList (java.util.ArrayList)118 StudyEventBean (org.akaza.openclinica.bean.managestudy.StudyEventBean)89 EventCRFDAO (org.akaza.openclinica.dao.submit.EventCRFDAO)85 StudyEventDAO (org.akaza.openclinica.dao.managestudy.StudyEventDAO)68 ItemDataBean (org.akaza.openclinica.bean.submit.ItemDataBean)64 ItemDataDAO (org.akaza.openclinica.dao.submit.ItemDataDAO)63 EventDefinitionCRFBean (org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean)62 HashMap (java.util.HashMap)54 StudyBean (org.akaza.openclinica.bean.managestudy.StudyBean)52 StudySubjectBean (org.akaza.openclinica.bean.managestudy.StudySubjectBean)52 EventDefinitionCRFDAO (org.akaza.openclinica.dao.managestudy.EventDefinitionCRFDAO)48 Date (java.util.Date)47 StudySubjectDAO (org.akaza.openclinica.dao.managestudy.StudySubjectDAO)47 CRFVersionBean (org.akaza.openclinica.bean.submit.CRFVersionBean)44 CRFVersionDAO (org.akaza.openclinica.dao.submit.CRFVersionDAO)43 StudyEventDefinitionDAO (org.akaza.openclinica.dao.managestudy.StudyEventDefinitionDAO)42 CRFBean (org.akaza.openclinica.bean.admin.CRFBean)41 StudyEventDefinitionBean (org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean)41 FormProcessor (org.akaza.openclinica.control.form.FormProcessor)41