Search in sources :

Example 56 with ItemDAO

use of org.akaza.openclinica.dao.submit.ItemDAO in project OpenClinica by OpenClinica.

the class CrfBusinessLogicHelper method isEachRequiredFieldFillout.

protected boolean isEachRequiredFieldFillout(EventCRFBean ecb) {
    ItemDataDAO iddao = new ItemDataDAO(ds);
    ItemDAO idao = new ItemDAO(ds);
    int allRequiredNum = idao.findAllRequiredByCRFVersionId(ecb.getCRFVersionId());
    int allRequiredFilledOut = iddao.findAllRequiredByEventCRFId(ecb);
    if (allRequiredNum > allRequiredFilledOut) {
        return false;
    }
    ArrayList allFilled = iddao.findAllBlankRequiredByEventCRFId(ecb.getId(), ecb.getCRFVersionId());
    if (!allFilled.isEmpty()) {
        return false;
    }
    return true;
}
Also used : ItemDAO(org.akaza.openclinica.dao.submit.ItemDAO) ArrayList(java.util.ArrayList) ItemDataDAO(org.akaza.openclinica.dao.submit.ItemDataDAO)

Aggregations

ItemDAO (org.akaza.openclinica.dao.submit.ItemDAO)56 ArrayList (java.util.ArrayList)43 ItemBean (org.akaza.openclinica.bean.submit.ItemBean)43 HashMap (java.util.HashMap)25 DisplayItemBean (org.akaza.openclinica.bean.submit.DisplayItemBean)22 ItemDataDAO (org.akaza.openclinica.dao.submit.ItemDataDAO)22 ItemDataBean (org.akaza.openclinica.bean.submit.ItemDataBean)21 ItemFormMetadataDAO (org.akaza.openclinica.dao.submit.ItemFormMetadataDAO)21 CRFDAO (org.akaza.openclinica.dao.admin.CRFDAO)20 EventCRFBean (org.akaza.openclinica.bean.submit.EventCRFBean)19 ItemFormMetadataBean (org.akaza.openclinica.bean.submit.ItemFormMetadataBean)18 CRFBean (org.akaza.openclinica.bean.admin.CRFBean)16 FormProcessor (org.akaza.openclinica.control.form.FormProcessor)15 ItemGroupBean (org.akaza.openclinica.bean.submit.ItemGroupBean)14 SectionBean (org.akaza.openclinica.bean.submit.SectionBean)14 EventCRFDAO (org.akaza.openclinica.dao.submit.EventCRFDAO)14 CRFVersionDAO (org.akaza.openclinica.dao.submit.CRFVersionDAO)13 StudyEventDefinitionBean (org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean)12 CRFVersionBean (org.akaza.openclinica.bean.submit.CRFVersionBean)12 StudyEventDefinitionDAO (org.akaza.openclinica.dao.managestudy.StudyEventDefinitionDAO)12