Search in sources :

Example 11 with DisplayItemWithGroupBean

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

the class DynamicsMetadataService method updateGroupDynamicsInSection.

public void updateGroupDynamicsInSection(List<DisplayItemWithGroupBean> displayItemWithGroups, int sectionId, EventCRFBean eventCrfBean) {
    for (DisplayItemWithGroupBean itemWithGroup : displayItemWithGroups) {
        if (itemWithGroup.isInGroup()) {
            updateDynShowGroupInSection(itemWithGroup.getItemGroup(), eventCrfBean);
            updateGroupDynItemsInSection(itemWithGroup, sectionId, eventCrfBean.getCRFVersionId(), eventCrfBean.getId());
        }
    }
}
Also used : DisplayItemWithGroupBean(org.akaza.openclinica.bean.submit.DisplayItemWithGroupBean)

Example 12 with DisplayItemWithGroupBean

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

the class DataEntryServlet method reshuffleReasonForChangeHashAndDiscrepancyNotes.

private void reshuffleReasonForChangeHashAndDiscrepancyNotes(List<DisplayItemWithGroupBean> allItems, HttpServletRequest request, EventCRFBean ecb) {
    int manualRows = 0;
    HashMap<String, Boolean> noteSubmitted = (HashMap<String, Boolean>) request.getSession().getAttribute(DataEntryServlet.NOTE_SUBMITTED);
    FormDiscrepancyNotes noteTree = (FormDiscrepancyNotes) request.getSession().getAttribute(CreateDiscrepancyNoteServlet.FLAG_DISCREPANCY_RFC);
    ArrayList<DiscrepancyNoteBean> fieldNote = null;
    String intendedKey = null;
    String replacementKey = null;
    if ((noteSubmitted == null || noteSubmitted.size() < 1) && (noteTree == null || noteTree.getFieldNotes() == null || noteTree.getFieldNotes().size() < 1)) {
        return;
    }
    for (int i = 0; i < allItems.size(); i++) {
        DisplayItemWithGroupBean diwb = allItems.get(i);
        if (diwb.isInGroup()) {
            List<DisplayItemGroupBean> dgbs = diwb.getItemGroups();
            for (int j = 0; j < dgbs.size(); j++) {
                DisplayItemGroupBean digb = dgbs.get(j);
                ItemGroupBean igb = digb.getItemGroupBean();
                List<DisplayItemBean> dibs = digb.getItems();
                if (j == 0) {
                    // first repeat
                    for (DisplayItemBean dib : dibs) {
                        intendedKey = ecb.getId() + "_" + digb.getInputId() + getInputName(dib);
                        replacementKey = ecb.getId() + "_" + digb.getItemGroupBean().getOid() + "_" + j + getInputName(dib);
                        if (!replacementKey.equals(intendedKey)) {
                            if (noteSubmitted.containsKey(intendedKey)) {
                                noteSubmitted.put(replacementKey, Boolean.TRUE);
                                noteSubmitted.remove(intendedKey);
                            }
                            if (noteTree.getNotes(intendedKey) != null) {
                                fieldNote = (ArrayList<DiscrepancyNoteBean>) noteTree.getNotes(intendedKey);
                                if (fieldNote != null && fieldNote.size() > 0) {
                                    noteTree.getFieldNotes().put(replacementKey, fieldNote);
                                    noteTree.getFieldNotes().remove(intendedKey);
                                }
                            //not changing here because this hash should not be used
                            //                                      noteTree.addIdNote(note.getEntityId(), field);
                            //
                            }
                        }
                    }
                } else {
                    // everything in between
                    manualRows++;
                    for (DisplayItemBean dib : dibs) {
                        intendedKey = ecb.getId() + "_" + digb.getInputId() + getInputName(dib);
                        replacementKey = ecb.getId() + "_" + digb.getItemGroupBean().getOid() + "_manual" + (j) + getInputName(dib);
                        if (!replacementKey.equals(intendedKey)) {
                            if (noteSubmitted != null && noteSubmitted.containsKey(intendedKey)) {
                                noteSubmitted.put(replacementKey, Boolean.TRUE);
                                noteSubmitted.remove(intendedKey);
                            }
                            if (noteTree != null && noteTree.getNotes(intendedKey) != null) {
                                fieldNote = (ArrayList<DiscrepancyNoteBean>) noteTree.getNotes(intendedKey);
                                if (fieldNote != null && fieldNote.size() > 0) {
                                    noteTree.getFieldNotes().put(replacementKey, fieldNote);
                                    noteTree.getFieldNotes().remove(intendedKey);
                                }
                            }
                        }
                    }
                }
                LOGGER.debug("removing: " + intendedKey + " and replacing it with " + replacementKey);
            }
        }
    }
    request.getSession().setAttribute(DataEntryServlet.NOTE_SUBMITTED, noteSubmitted);
}
Also used : DisplayItemGroupBean(org.akaza.openclinica.bean.submit.DisplayItemGroupBean) HashMap(java.util.HashMap) FormDiscrepancyNotes(org.akaza.openclinica.control.form.FormDiscrepancyNotes) DisplayItemWithGroupBean(org.akaza.openclinica.bean.submit.DisplayItemWithGroupBean) DiscrepancyNoteBean(org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean) DisplayItemBean(org.akaza.openclinica.bean.submit.DisplayItemBean) ItemGroupBean(org.akaza.openclinica.bean.submit.ItemGroupBean) DisplayItemGroupBean(org.akaza.openclinica.bean.submit.DisplayItemGroupBean)

Example 13 with DisplayItemWithGroupBean

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

the class FormBeanUtil method addNullValuesToDisplayItemWithGroupBeans.

public void addNullValuesToDisplayItemWithGroupBeans(List<DisplayItemWithGroupBean> groupBeans, List<String> nullValuesList) {
    if (nullValuesList == null || nullValuesList.isEmpty() || groupBeans == null || groupBeans.isEmpty()) {
        return;
    }
    DisplayItemGroupBean displayItemGroupBean = null;
    List<DisplayItemBean> disBeans = new ArrayList<DisplayItemBean>();
    String responseName = "";
    List<ResponseOptionBean> respOptions;
    for (DisplayItemWithGroupBean withGroupBean : groupBeans) {
        displayItemGroupBean = withGroupBean.getItemGroup();
        disBeans = displayItemGroupBean.getItems();
        for (DisplayItemBean singleBean : disBeans) {
            responseName = singleBean.getMetadata().getResponseSet().getResponseType().getName();
            respOptions = singleBean.getMetadata().getResponseSet().getOptions();
            if (respOptions != null && ("checkbox".equalsIgnoreCase(responseName) || "radio".equalsIgnoreCase(responseName) || "single-select".equalsIgnoreCase(responseName) || "multi-select".equalsIgnoreCase(responseName))) {
                this.addBeansToResponseOptions(nullValuesList, respOptions);
            }
        }
    }
}
Also used : DisplayItemGroupBean(org.akaza.openclinica.bean.submit.DisplayItemGroupBean) DisplayItemWithGroupBean(org.akaza.openclinica.bean.submit.DisplayItemWithGroupBean) ArrayList(java.util.ArrayList) DisplayItemBean(org.akaza.openclinica.bean.submit.DisplayItemBean) ResponseOptionBean(org.akaza.openclinica.bean.submit.ResponseOptionBean)

Aggregations

DisplayItemWithGroupBean (org.akaza.openclinica.bean.submit.DisplayItemWithGroupBean)13 DisplayItemGroupBean (org.akaza.openclinica.bean.submit.DisplayItemGroupBean)12 DisplayItemBean (org.akaza.openclinica.bean.submit.DisplayItemBean)11 ArrayList (java.util.ArrayList)6 HashMap (java.util.HashMap)6 DiscrepancyNoteBean (org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean)5 EventCRFBean (org.akaza.openclinica.bean.submit.EventCRFBean)5 HttpSession (javax.servlet.http.HttpSession)4 EventDefinitionCRFBean (org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean)4 DisplaySectionBean (org.akaza.openclinica.bean.submit.DisplaySectionBean)4 ItemGroupBean (org.akaza.openclinica.bean.submit.ItemGroupBean)4 SectionBean (org.akaza.openclinica.bean.submit.SectionBean)4 FormDiscrepancyNotes (org.akaza.openclinica.control.form.FormDiscrepancyNotes)4 DiscrepancyNoteDAO (org.akaza.openclinica.dao.managestudy.DiscrepancyNoteDAO)4 DateFormat (java.text.DateFormat)3 SimpleDateFormat (java.text.SimpleDateFormat)3 Date (java.util.Date)3 StudyBean (org.akaza.openclinica.bean.managestudy.StudyBean)3 StudyEventBean (org.akaza.openclinica.bean.managestudy.StudyEventBean)3 StudyEventDefinitionBean (org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean)3