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