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());
}
}
}
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);
}
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);
}
}
}
}
Aggregations