Search in sources :

Example 31 with Status

use of org.akaza.openclinica.bean.core.Status in project OpenClinica by OpenClinica.

the class RestoreEventCRFServlet method processRequest.

@Override
public void processRequest() throws Exception {
    FormProcessor fp = new FormProcessor(request);
    // eventCRFId
    int eventCRFId = fp.getInt("id");
    // studySubjectId
    int studySubId = fp.getInt("studySubId");
    checkStudyLocked("ViewStudySubject?id" + studySubId, respage.getString("current_study_locked"));
    StudyEventDAO sedao = new StudyEventDAO(sm.getDataSource());
    StudySubjectDAO subdao = new StudySubjectDAO(sm.getDataSource());
    EventCRFDAO ecdao = new EventCRFDAO(sm.getDataSource());
    StudyDAO sdao = new StudyDAO(sm.getDataSource());
    if (eventCRFId == 0) {
        addPageMessage(respage.getString("please_choose_an_event_CRF_to_restore"));
        request.setAttribute("id", new Integer(studySubId).toString());
        forwardPage(Page.VIEW_STUDY_SUBJECT_SERVLET);
    } else {
        EventCRFBean eventCRF = (EventCRFBean) ecdao.findByPK(eventCRFId);
        StudySubjectBean studySub = (StudySubjectBean) subdao.findByPK(studySubId);
        // YW 11-07-2007, an event CRF could not be restored if its study
        // subject has been removed
        Status s = studySub.getStatus();
        if ("removed".equalsIgnoreCase(s.getName()) || "auto-removed".equalsIgnoreCase(s.getName())) {
            addPageMessage(resword.getString("event_CRF") + resterm.getString("could_not_be") + resterm.getString("restored") + "." + respage.getString("study_subject_has_been_deleted"));
            request.setAttribute("id", new Integer(studySubId).toString());
            forwardPage(Page.VIEW_STUDY_SUBJECT_SERVLET);
        }
        // YW
        request.setAttribute("studySub", studySub);
        // construct info needed on view event crf page
        CRFDAO cdao = new CRFDAO(sm.getDataSource());
        CRFVersionDAO cvdao = new CRFVersionDAO(sm.getDataSource());
        int crfVersionId = eventCRF.getCRFVersionId();
        CRFBean cb = cdao.findByVersionId(crfVersionId);
        eventCRF.setCrf(cb);
        CRFVersionBean cvb = (CRFVersionBean) cvdao.findByPK(crfVersionId);
        eventCRF.setCrfVersion(cvb);
        // then get the definition so we can call
        // DisplayEventCRFBean.setFlags
        int studyEventId = eventCRF.getStudyEventId();
        StudyEventBean event = (StudyEventBean) sedao.findByPK(studyEventId);
        int studyEventDefinitionId = sedao.getDefinitionIdFromStudyEventId(studyEventId);
        StudyEventDefinitionDAO seddao = new StudyEventDefinitionDAO(sm.getDataSource());
        StudyEventDefinitionBean sed = (StudyEventDefinitionBean) seddao.findByPK(studyEventDefinitionId);
        event.setStudyEventDefinition(sed);
        request.setAttribute("event", event);
        EventDefinitionCRFDAO edcdao = new EventDefinitionCRFDAO(sm.getDataSource());
        StudyBean study = (StudyBean) sdao.findByPK(studySub.getStudyId());
        EventDefinitionCRFBean edc = edcdao.findByStudyEventDefinitionIdAndCRFId(study, studyEventDefinitionId, cb.getId());
        DisplayEventCRFBean dec = new DisplayEventCRFBean();
        dec.setEventCRF(eventCRF);
        dec.setFlags(eventCRF, ub, currentRole, edc.isDoubleEntry());
        // find all item data
        ItemDataDAO iddao = new ItemDataDAO(sm.getDataSource());
        ArrayList itemData = iddao.findAllByEventCRFId(eventCRF.getId());
        request.setAttribute("items", itemData);
        String action = request.getParameter("action");
        if ("confirm".equalsIgnoreCase(action)) {
            if (!eventCRF.getStatus().equals(Status.DELETED) && !eventCRF.getStatus().equals(Status.AUTO_DELETED)) {
                addPageMessage(respage.getString("this_event_CRF_avilable_for_study") + " " + " " + respage.getString("please_contact_sysadmin_for_more_information"));
                request.setAttribute("id", new Integer(studySubId).toString());
                forwardPage(Page.VIEW_STUDY_SUBJECT_SERVLET);
                return;
            }
            request.setAttribute("displayEventCRF", dec);
            forwardPage(Page.RESTORE_EVENT_CRF);
        } else {
            logger.info("submit to restore the event CRF from study");
            eventCRF.setStatus(Status.AVAILABLE);
            eventCRF.setUpdater(ub);
            eventCRF.setUpdatedDate(new Date());
            ecdao.update(eventCRF);
            // restore all the item data
            for (int a = 0; a < itemData.size(); a++) {
                ItemDataBean item = (ItemDataBean) itemData.get(a);
                if (item.getStatus().equals(Status.AUTO_DELETED)) {
                    item.setStatus(Status.AVAILABLE);
                    item.setUpdater(ub);
                    item.setUpdatedDate(new Date());
                    iddao.update(item);
                }
            }
            String emailBody = respage.getString("the_event_CRF") + cb.getName() + " " + respage.getString("has_been_restored_to_the_event") + " " + event.getStudyEventDefinition().getName() + ".";
            addPageMessage(emailBody);
            sendEmail(emailBody);
            request.setAttribute("id", new Integer(studySubId).toString());
            forwardPage(Page.VIEW_STUDY_SUBJECT_SERVLET);
        }
    }
}
Also used : ArrayList(java.util.ArrayList) StudyEventDefinitionBean(org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean) StudyEventBean(org.akaza.openclinica.bean.managestudy.StudyEventBean) ItemDataDAO(org.akaza.openclinica.dao.submit.ItemDataDAO) EventCRFBean(org.akaza.openclinica.bean.submit.EventCRFBean) DisplayEventCRFBean(org.akaza.openclinica.bean.submit.DisplayEventCRFBean) ItemDataBean(org.akaza.openclinica.bean.submit.ItemDataBean) StudyEventDAO(org.akaza.openclinica.dao.managestudy.StudyEventDAO) StudyDAO(org.akaza.openclinica.dao.managestudy.StudyDAO) EventCRFDAO(org.akaza.openclinica.dao.submit.EventCRFDAO) Status(org.akaza.openclinica.bean.core.Status) EventDefinitionCRFDAO(org.akaza.openclinica.dao.managestudy.EventDefinitionCRFDAO) EventCRFDAO(org.akaza.openclinica.dao.submit.EventCRFDAO) CRFDAO(org.akaza.openclinica.dao.admin.CRFDAO) CRFVersionDAO(org.akaza.openclinica.dao.submit.CRFVersionDAO) FormProcessor(org.akaza.openclinica.control.form.FormProcessor) StudyBean(org.akaza.openclinica.bean.managestudy.StudyBean) EventDefinitionCRFDAO(org.akaza.openclinica.dao.managestudy.EventDefinitionCRFDAO) StudySubjectDAO(org.akaza.openclinica.dao.managestudy.StudySubjectDAO) Date(java.util.Date) EventCRFBean(org.akaza.openclinica.bean.submit.EventCRFBean) CRFBean(org.akaza.openclinica.bean.admin.CRFBean) DisplayEventCRFBean(org.akaza.openclinica.bean.submit.DisplayEventCRFBean) EventDefinitionCRFBean(org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean) DisplayEventCRFBean(org.akaza.openclinica.bean.submit.DisplayEventCRFBean) StudySubjectBean(org.akaza.openclinica.bean.managestudy.StudySubjectBean) StudyEventDefinitionDAO(org.akaza.openclinica.dao.managestudy.StudyEventDefinitionDAO) CRFVersionBean(org.akaza.openclinica.bean.submit.CRFVersionBean) EventDefinitionCRFBean(org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean)

Example 32 with Status

use of org.akaza.openclinica.bean.core.Status in project OpenClinica by OpenClinica.

the class RestoreStudyEventServlet method processRequest.

@Override
public void processRequest() throws Exception {
    FormProcessor fp = new FormProcessor(request);
    // studyEventId
    int studyEventId = fp.getInt("id");
    // studySubjectId
    int studySubId = fp.getInt("studySubId");
    StudyEventDAO sedao = new StudyEventDAO(sm.getDataSource());
    StudySubjectDAO subdao = new StudySubjectDAO(sm.getDataSource());
    if (studyEventId == 0) {
        addPageMessage(respage.getString("please_choose_a_SE_to_restore"));
        request.setAttribute("id", new Integer(studySubId).toString());
        forwardPage(Page.VIEW_STUDY_SUBJECT_SERVLET);
    } else {
        StudySubjectBean studySub = (StudySubjectBean) subdao.findByPK(studySubId);
        // YW 11-07-2007, a study event could not be restored if its study
        // subject has been removed
        Status s = studySub.getStatus();
        if ("removed".equalsIgnoreCase(s.getName()) || "auto-removed".equalsIgnoreCase(s.getName())) {
            addPageMessage(resword.getString("study_event") + resterm.getString("could_not_be") + resterm.getString("restored") + "." + respage.getString("study_subject_has_been_deleted"));
            request.setAttribute("id", new Integer(studySubId).toString());
            forwardPage(Page.VIEW_STUDY_SUBJECT_SERVLET);
        }
        // YW
        StudyEventBean event = (StudyEventBean) sedao.findByPK(studyEventId);
        request.setAttribute("studySub", studySub);
        StudyEventDefinitionDAO seddao = new StudyEventDefinitionDAO(sm.getDataSource());
        StudyEventDefinitionBean sed = (StudyEventDefinitionBean) seddao.findByPK(event.getStudyEventDefinitionId());
        event.setStudyEventDefinition(sed);
        StudyDAO studydao = new StudyDAO(sm.getDataSource());
        StudyBean study = (StudyBean) studydao.findByPK(studySub.getStudyId());
        request.setAttribute("study", study);
        String action = request.getParameter("action");
        if ("confirm".equalsIgnoreCase(action)) {
            if (event.getStatus().equals(Status.AVAILABLE)) {
                addPageMessage(respage.getString("this_event_is_already_available_for_study") + " " + respage.getString("please_contact_sysadmin_for_more_information"));
                request.setAttribute("id", new Integer(studySubId).toString());
                forwardPage(Page.VIEW_STUDY_SUBJECT_SERVLET);
                return;
            }
            EventDefinitionCRFDAO edcdao = new EventDefinitionCRFDAO(sm.getDataSource());
            // find all crfs in the definition
            ArrayList eventDefinitionCRFs = (ArrayList) edcdao.findAllByEventDefinitionId(study, sed.getId());
            EventCRFDAO ecdao = new EventCRFDAO(sm.getDataSource());
            ArrayList eventCRFs = ecdao.findAllByStudyEvent(event);
            // construct info needed on view study event page
            DisplayStudyEventBean de = new DisplayStudyEventBean();
            de.setStudyEvent(event);
            de.setDisplayEventCRFs(getDisplayEventCRFs(eventCRFs, eventDefinitionCRFs));
            request.setAttribute("displayEvent", de);
            forwardPage(Page.RESTORE_STUDY_EVENT);
        } else {
            logger.info("submit to restore the event to study");
            // restore event to study
            event.setStatus(Status.AVAILABLE);
            event.setUpdater(ub);
            event.setUpdatedDate(new Date());
            sedao.update(event);
            // restore event crfs
            EventCRFDAO ecdao = new EventCRFDAO(sm.getDataSource());
            ArrayList eventCRFs = ecdao.findAllByStudyEvent(event);
            ItemDataDAO iddao = new ItemDataDAO(sm.getDataSource());
            for (int k = 0; k < eventCRFs.size(); k++) {
                EventCRFBean eventCRF = (EventCRFBean) eventCRFs.get(k);
                if (eventCRF.getStatus().equals(Status.AUTO_DELETED)) {
                    eventCRF.setStatus(Status.AVAILABLE);
                    eventCRF.setUpdater(ub);
                    eventCRF.setUpdatedDate(new Date());
                    ecdao.update(eventCRF);
                    // remove all the item data
                    ArrayList itemDatas = iddao.findAllByEventCRFId(eventCRF.getId());
                    for (int a = 0; a < itemDatas.size(); a++) {
                        ItemDataBean item = (ItemDataBean) itemDatas.get(a);
                        if (item.getStatus().equals(Status.AUTO_DELETED)) {
                            item.setStatus(Status.AVAILABLE);
                            item.setUpdater(ub);
                            item.setUpdatedDate(new Date());
                            iddao.update(item);
                        }
                    }
                }
            }
            String emailBody = respage.getString("the_event") + event.getStudyEventDefinition().getName() + " " + respage.getString("has_been_restored_to_the_study") + " " + study.getName() + ".";
            addPageMessage(emailBody);
            //                sendEmail(emailBody);
            request.setAttribute("id", new Integer(studySubId).toString());
            forwardPage(Page.VIEW_STUDY_SUBJECT_SERVLET);
        }
    }
}
Also used : Status(org.akaza.openclinica.bean.core.Status) FormProcessor(org.akaza.openclinica.control.form.FormProcessor) StudyBean(org.akaza.openclinica.bean.managestudy.StudyBean) ArrayList(java.util.ArrayList) StudyEventDefinitionBean(org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean) EventDefinitionCRFDAO(org.akaza.openclinica.dao.managestudy.EventDefinitionCRFDAO) StudyEventBean(org.akaza.openclinica.bean.managestudy.StudyEventBean) DisplayStudyEventBean(org.akaza.openclinica.bean.managestudy.DisplayStudyEventBean) StudySubjectDAO(org.akaza.openclinica.dao.managestudy.StudySubjectDAO) Date(java.util.Date) ItemDataDAO(org.akaza.openclinica.dao.submit.ItemDataDAO) DisplayStudyEventBean(org.akaza.openclinica.bean.managestudy.DisplayStudyEventBean) EventCRFBean(org.akaza.openclinica.bean.submit.EventCRFBean) DisplayEventCRFBean(org.akaza.openclinica.bean.submit.DisplayEventCRFBean) StudySubjectBean(org.akaza.openclinica.bean.managestudy.StudySubjectBean) StudyEventDefinitionDAO(org.akaza.openclinica.dao.managestudy.StudyEventDefinitionDAO) ItemDataBean(org.akaza.openclinica.bean.submit.ItemDataBean) StudyEventDAO(org.akaza.openclinica.dao.managestudy.StudyEventDAO) StudyDAO(org.akaza.openclinica.dao.managestudy.StudyDAO) EventCRFDAO(org.akaza.openclinica.dao.submit.EventCRFDAO)

Example 33 with Status

use of org.akaza.openclinica.bean.core.Status in project OpenClinica by OpenClinica.

the class DataEntryServlet method markCRFComplete.

/**
     * The following methods are for 'mark CRF complete'
     * @param request TODO
     *
     * @return
     */
protected boolean markCRFComplete(HttpServletRequest request) throws Exception {
    locale = LocaleResolver.getLocale(request);
    HttpSession session = request.getSession();
    UserAccountBean ub = (UserAccountBean) request.getSession().getAttribute(USER_BEAN_NAME);
    EventCRFBean ecb = (EventCRFBean) request.getAttribute(INPUT_EVENT_CRF);
    EventDefinitionCRFBean edcb = (EventDefinitionCRFBean) request.getAttribute(EVENT_DEF_CRF_BEAN);
    EventCRFDAO ecdao = new EventCRFDAO(getDataSource());
    ItemDataDAO iddao = new ItemDataDAO(getDataSource(), locale);
    // < respage =
    // ResourceBundle.getBundle("org.akaza.openclinica.i18n.page_messages",
    // locale);
    // < restext =
    // ResourceBundle.getBundle("org.akaza.openclinica.i18n.notes",locale);
    // <
    // resexception=ResourceBundle.getBundle(
    // "org.akaza.openclinica.i18n.exceptions",locale);
    getEventCRFBean(request);
    getEventDefinitionCRFBean(request);
    DataEntryStage stage = ecb.getStage();
    // request.setAttribute(TableOfContentsServlet.INPUT_EVENT_CRF_BEAN,
    // ecb);
    // request.setAttribute(INPUT_EVENT_CRF_ID, new Integer(ecb.getId()));
    LOGGER.trace("inout_event_crf_id:" + ecb.getId());
    if (stage.equals(DataEntryStage.UNCOMPLETED) || stage.equals(DataEntryStage.DOUBLE_DATA_ENTRY_COMPLETE) || stage.equals(DataEntryStage.LOCKED)) {
        addPageMessage(respage.getString("not_mark_CRF_complete1"), request);
        return false;
    }
    if (stage.equals(DataEntryStage.INITIAL_DATA_ENTRY_COMPLETE) || stage.equals(DataEntryStage.DOUBLE_DATA_ENTRY)) {
        if (!edcb.isDoubleEntry()) {
            addPageMessage(respage.getString("not_mark_CRF_complete2"), request);
            return false;
        }
    }
    if (isEachRequiredFieldFillout(request) == false) {
        addPageMessage(respage.getString("not_mark_CRF_complete4"), request);
        return false;
    }
    /*
         * if (ecb.getInterviewerName().trim().equals("")) { throw new InconsistentStateException(errorPage, "You may not mark this Event CRF complete, because
         * the interviewer name is blank."); }
         */
    Status newStatus = ecb.getStatus();
    boolean ide = true;
    if (stage.equals(DataEntryStage.INITIAL_DATA_ENTRY) && edcb.isDoubleEntry()) {
        newStatus = Status.PENDING;
        ecb.setUpdaterId(ub.getId());
        ecb.setUpdater(ub);
        ecb.setUpdatedDate(new Date());
        ecb.setDateCompleted(new Date());
    } else if (stage.equals(DataEntryStage.INITIAL_DATA_ENTRY) && !edcb.isDoubleEntry()) {
        newStatus = Status.UNAVAILABLE;
        ecb.setUpdaterId(ub.getId());
        ecb.setUpdater(ub);
        ecb.setUpdatedDate(new Date());
        ecb.setDateCompleted(new Date());
        ecb.setDateValidateCompleted(new Date());
    } else if (stage.equals(DataEntryStage.DOUBLE_DATA_ENTRY_COMPLETE) && edcb.isDoubleEntry()) {
        newStatus = Status.UNAVAILABLE;
        ecb.setUpdaterId(ub.getId());
        ecb.setUpdater(ub);
        ecb.setUpdatedDate(new Date());
        ecb.setDateCompleted(new Date());
        ecb.setDateValidateCompleted(new Date());
        ide = false;
    } else if (stage.equals(DataEntryStage.INITIAL_DATA_ENTRY_COMPLETE) || stage.equals(DataEntryStage.DOUBLE_DATA_ENTRY)) {
        newStatus = Status.UNAVAILABLE;
        ecb.setDateValidateCompleted(new Date());
        ecb.setUpdaterId(ub.getId());
        ecb.setUpdater(ub);
        ide = false;
    }
    // create them
    if (!isEachSectionReviewedOnce(request)) {
        boolean canSave = saveItemsToMarkComplete(newStatus, request);
        if (canSave == false) {
            addPageMessage(respage.getString("not_mark_CRF_complete3"), request);
            return false;
        }
    }
    ecb.setStatus(newStatus);
    /*
         * Marking the data entry as signed if the corresponding EventDefinitionCRF is being enabled for electronic signature.
         */
    if (edcb.isElectronicSignature()) {
        ecb.setElectronicSignatureStatus(true);
    }
    ecb = (EventCRFBean) ecdao.update(ecb);
    // note the below statement only updates the DATES, not the STATUS
    ecdao.markComplete(ecb, ide);
    // update all the items' status to complete
    iddao.updateStatusByEventCRF(ecb, newStatus);
    // change status for study event
    StudyEventDAO sedao = new StudyEventDAO(getDataSource());
    StudyEventBean seb = (StudyEventBean) sedao.findByPK(ecb.getStudyEventId());
    seb.setUpdatedDate(new Date());
    seb.setUpdater(ub);
    EventDefinitionCRFDAO edcdao = new EventDefinitionCRFDAO(getDataSource());
    ArrayList allCRFs = ecdao.findAllByStudyEventAndStatus(seb, Status.UNAVAILABLE);
    StudyBean study = (StudyBean) session.getAttribute("study");
    ArrayList allEDCs = (ArrayList) edcdao.findAllActiveByEventDefinitionId(study, seb.getStudyEventDefinitionId());
    CRFVersionDAO crfversionDao = new CRFVersionDAO(getDataSource());
    boolean eventCompleted = true;
    boolean allRequired = true;
    //JN Adding another flag
    boolean allCrfsCompleted = false;
    int allEDCsize = allEDCs.size();
    ArrayList nonRequiredCrfIds = new ArrayList();
    ArrayList requiredCrfIds = new ArrayList();
    if (allCRFs.size() == allEDCs.size()) {
        // was
        //JN: all crfs are completed and then set the subject event status as complete
        seb.setSubjectEventStatus(SubjectEventStatus.COMPLETED);
    }
    seb = (StudyEventBean) sedao.update(seb);
    request.setAttribute(INPUT_EVENT_CRF, ecb);
    request.setAttribute(EVENT_DEF_CRF_BEAN, edcb);
    return true;
}
Also used : Status(org.akaza.openclinica.bean.core.Status) ResolutionStatus(org.akaza.openclinica.bean.core.ResolutionStatus) SubjectEventStatus(org.akaza.openclinica.bean.core.SubjectEventStatus) CRFVersionDAO(org.akaza.openclinica.dao.submit.CRFVersionDAO) HttpSession(javax.servlet.http.HttpSession) StudyBean(org.akaza.openclinica.bean.managestudy.StudyBean) ArrayList(java.util.ArrayList) EventDefinitionCRFDAO(org.akaza.openclinica.dao.managestudy.EventDefinitionCRFDAO) StudyEventBean(org.akaza.openclinica.bean.managestudy.StudyEventBean) ItemDataDAO(org.akaza.openclinica.dao.submit.ItemDataDAO) Date(java.util.Date) DataEntryStage(org.akaza.openclinica.bean.core.DataEntryStage) EventCRFBean(org.akaza.openclinica.bean.submit.EventCRFBean) StudyEventDAO(org.akaza.openclinica.dao.managestudy.StudyEventDAO) UserAccountBean(org.akaza.openclinica.bean.login.UserAccountBean) EventDefinitionCRFBean(org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean) EventCRFDAO(org.akaza.openclinica.dao.submit.EventCRFDAO)

Example 34 with Status

use of org.akaza.openclinica.bean.core.Status in project OpenClinica by OpenClinica.

the class ImportSpringJob method processData.

/*
     * processData, a method which should take in all XML files, check to see if they were imported previously, ? insert
     * them into the database if not, and return a message which will go to audit and to the end user.
     */
private ArrayList<String> processData(File[] dest, DataSource dataSource, ResourceBundle respage, ResourceBundle resword, UserAccountBean ub, StudyBean studyBean, File destDirectory, TriggerBean triggerBean, RuleSetServiceInterface ruleSetService) throws Exception {
    StringBuffer msg = new StringBuffer();
    StringBuffer auditMsg = new StringBuffer();
    Mapping myMap = new Mapping();
    String propertiesPath = CoreResources.PROPERTIES_DIR;
    new File(propertiesPath + File.separator + "ODM1-3-0.xsd");
    File xsdFile2 = new File(propertiesPath + File.separator + "ODM1-2-1.xsd");
    // @pgawade 18-April-2011 Fix for issue 8394
    String ODM_MAPPING_DIR_path = CoreResources.ODM_MAPPING_DIR;
    myMap.loadMapping(ODM_MAPPING_DIR_path + File.separator + "cd_odm_mapping.xml");
    Unmarshaller um1 = new Unmarshaller(myMap);
    ODMContainer odmContainer = new ODMContainer();
    // File("log.txt")));
    for (File f : dest) {
        // >> tbh
        boolean fail = false;
        // all whitespace, one or more times
        String regex = "\\s+";
        // replace with underscores
        String replacement = "_";
        String pattern = "yyyy" + File.separator + "MM" + File.separator + "dd" + File.separator + "HHmmssSSS" + File.separator;
        SimpleDateFormat sdfDir = new SimpleDateFormat(pattern);
        String generalFileDir = sdfDir.format(new java.util.Date());
        File logDestDirectory = new File(destDirectory + File.separator + generalFileDir + f.getName().replaceAll(regex, replacement) + ".log.txt");
        if (!logDestDirectory.isDirectory()) {
            logger.debug("creating new dir: " + logDestDirectory.getAbsolutePath());
            logDestDirectory.mkdirs();
        }
        File newFile = new File(logDestDirectory, "log.txt");
        // FileOutputStream out = new FileOutputStream(new
        // File(logDestDirectory, "log.txt"));
        // BufferedWriter out = null;
        // wrap the below in a try-catch?
        BufferedWriter out = new BufferedWriter(new FileWriter(newFile));
        // << tbh 06/2010
        if (f != null) {
            String firstLine = "<P>" + f.getName() + ": ";
            msg.append(firstLine);
            out.write(firstLine);
            auditMsg.append(firstLine);
        } else {
            msg.append("<P>" + respage.getString("unreadable_file") + ": ");
            out.write("<P>" + respage.getString("unreadable_file") + ": ");
            auditMsg.append("<P>" + respage.getString("unreadable_file") + ": ");
        }
        try {
            // schemaValidator.validateAgainstSchema(f, xsdFile);
            odmContainer = (ODMContainer) um1.unmarshal(new FileReader(f));
            logger.debug("Found crf data container for study oid: " + odmContainer.getCrfDataPostImportContainer().getStudyOID());
            logger.debug("found length of subject list: " + odmContainer.getCrfDataPostImportContainer().getSubjectData().size());
        } catch (Exception me1) {
            // fail against one, try another
            try {
                schemaValidator.validateAgainstSchema(f, xsdFile2);
                // for backwards compatibility, we also try to validate vs
                // 1.2.1 ODM 06/2008
                odmContainer = (ODMContainer) um1.unmarshal(new FileReader(f));
            } catch (Exception me2) {
                // not sure if we want to report me2
                MessageFormat mf = new MessageFormat("");
                mf.applyPattern(respage.getString("your_xml_is_not_well_formed"));
                Object[] arguments = { me1.getMessage() };
                msg.append(mf.format(arguments) + "<br/>");
                auditMsg.append(mf.format(arguments) + "<br/>");
                // break here with an exception
                logger.error("found an error with XML: " + msg.toString());
                // continue looping
                continue;
            }
        }
        // next: check, then import
        List<String> errors = getImportCRFDataService(dataSource).validateStudyMetadata(odmContainer, studyBean.getId());
        // the user could be in any study ...
        if (errors != null) {
            if (errors.size() > 0) {
                out.write("<P>Errors:<br/>");
                for (String error : errors) {
                    out.write(error + "<br/>");
                }
                out.write("</P>");
                // fail = true;
                // forwardPage(Page.IMPORT_CRF_DATA);
                // break here with an exception
                // throw new Exception("Your XML in the file " + f.getName()
                // + " was well formed, but generated metadata errors: " +
                // errors.toString());
                // msg.append("Your XML in the file " + f.getName() +
                // " was well formed, but generated metadata errors: " +
                // errors.toString());
                MessageFormat mf = new MessageFormat("");
                mf.applyPattern(respage.getString("your_xml_in_the_file"));
                Object[] arguments = { f.getName(), errors.size() };
                auditMsg.append(mf.format(arguments) + "<br/>");
                msg.append(mf.format(arguments) + "<br/>");
                auditMsg.append("You can see the log file <a href='" + SQLInitServlet.getField("sysURL.base") + "ViewLogMessage?n=" + generalFileDir + f.getName() + "&tn=" + triggerBean.getName() + "&gn=1'>here</a>.<br/>");
                msg.append("You can see the log file <a href='" + SQLInitServlet.getField("sysURL.base") + "ViewLogMessage?n=" + generalFileDir + f.getName() + "&tn=" + triggerBean.getName() + "&gn=1'>here</a>.<br/>");
                // auditMsg.append("Your XML in the file " + f.getName() +
                // " was well formed, but generated " + errors.size() +
                // " metadata errors." + "<br/>");
                out.close();
                continue;
            } else {
                msg.append(respage.getString("passed_study_check") + "<br/>");
                msg.append(respage.getString("passed_oid_metadata_check") + "<br/>");
                auditMsg.append(respage.getString("passed_study_check") + "<br/>");
                auditMsg.append(respage.getString("passed_oid_metadata_check") + "<br/>");
            }
        }
        ImportCRFInfoContainer importCrfInfo = new ImportCRFInfoContainer(odmContainer, dataSource);
        // validation errors, the same as in the ImportCRFDataServlet. DRY?
        List<EventCRFBean> eventCRFBeans = getImportCRFDataService(dataSource).fetchEventCRFBeans(odmContainer, ub);
        ArrayList<Integer> permittedEventCRFIds = new ArrayList<Integer>();
        Boolean eventCRFStatusesValid = getImportCRFDataService(dataSource).eventCRFStatusesValid(odmContainer, ub);
        List<DisplayItemBeanWrapper> displayItemBeanWrappers = new ArrayList<DisplayItemBeanWrapper>();
        HashMap<String, String> totalValidationErrors = new HashMap<String, String>();
        HashMap<String, String> hardValidationErrors = new HashMap<String, String>();
        // The following map is used for setting the EventCRF status post import.
        HashMap<Integer, String> importedCRFStatuses = getImportCRFDataService(dataSource).fetchEventCRFStatuses(odmContainer);
        // -- does the event already exist? if not, fail
        if (eventCRFBeans == null) {
            fail = true;
            msg.append(respage.getString("no_event_status_matching"));
            out.write(respage.getString("no_event_status_matching"));
            out.close();
            continue;
        } else if (!eventCRFBeans.isEmpty()) {
            logger.debug("found a list of eventCRFBeans: " + eventCRFBeans.toString());
            for (EventCRFBean eventCRFBean : eventCRFBeans) {
                DataEntryStage dataEntryStage = eventCRFBean.getStage();
                Status eventCRFStatus = eventCRFBean.getStatus();
                logger.debug("Event CRF Bean: id " + eventCRFBean.getId() + ", data entry stage " + dataEntryStage.getName() + ", status " + eventCRFStatus.getName());
                if (eventCRFStatus.equals(Status.AVAILABLE) || dataEntryStage.equals(DataEntryStage.INITIAL_DATA_ENTRY) || dataEntryStage.equals(DataEntryStage.INITIAL_DATA_ENTRY_COMPLETE) || dataEntryStage.equals(DataEntryStage.DOUBLE_DATA_ENTRY_COMPLETE) || dataEntryStage.equals(DataEntryStage.DOUBLE_DATA_ENTRY)) {
                    permittedEventCRFIds.add(new Integer(eventCRFBean.getId()));
                } else {
                    // break out here with an exception
                    // throw new
                    // Exception("Your listed Event CRF in the file " +
                    // f.getName() +
                    // " does not exist, or has already been locked for import."
                    // );
                    MessageFormat mf = new MessageFormat("");
                    mf.applyPattern(respage.getString("your_listed_crf_in_the_file"));
                    Object[] arguments = { f.getName() };
                    msg.append(mf.format(arguments) + "<br/>");
                    auditMsg.append(mf.format(arguments) + "<br/>");
                    out.write(mf.format(arguments) + "<br/>");
                    out.close();
                    continue;
                }
            }
            if (eventCRFBeans.size() >= permittedEventCRFIds.size()) {
                msg.append(respage.getString("passed_event_crf_status_check") + "<br/>");
                auditMsg.append(respage.getString("passed_event_crf_status_check") + "<br/>");
            } else {
                fail = true;
                msg.append(respage.getString("the_event_crf_not_correct_status") + "<br/>");
                auditMsg.append(respage.getString("the_event_crf_not_correct_status") + "<br/>");
            }
            // create a 'fake' request to generate the validation errors
            // here, tbh 05/2009
            MockHttpServletRequest request = new MockHttpServletRequest();
            // Locale locale = new Locale("en-US");
            request.addPreferredLocale(locale);
            try {
                List<DisplayItemBeanWrapper> tempDisplayItemBeanWrappers = new ArrayList<DisplayItemBeanWrapper>();
                tempDisplayItemBeanWrappers = getImportCRFDataService(dataSource).lookupValidationErrors(request, odmContainer, ub, totalValidationErrors, hardValidationErrors, permittedEventCRFIds);
                logger.debug("size of total validation errors: " + totalValidationErrors.size());
                displayItemBeanWrappers.addAll(tempDisplayItemBeanWrappers);
            } catch (NullPointerException npe1) {
                // what if you have 2 event crfs but the third is a fake?
                npe1.printStackTrace();
                fail = true;
                logger.debug("threw a NPE after calling lookup validation errors");
                msg.append(respage.getString("an_error_was_thrown_while_validation_errors") + "<br/>");
                auditMsg.append(respage.getString("an_error_was_thrown_while_validation_errors") + "<br/>");
                out.write(respage.getString("an_error_was_thrown_while_validation_errors") + "<br/>");
                logger.debug("=== threw the null pointer, import ===");
            } catch (OpenClinicaException oce1) {
                fail = true;
                logger.error("threw an OCE after calling lookup validation errors " + oce1.getOpenClinicaMessage());
                msg.append(oce1.getOpenClinicaMessage() + "<br/>");
                // auditMsg.append(oce1.getOpenClinicaMessage() + "<br/>");
                out.write(oce1.getOpenClinicaMessage() + "<br/>");
            }
        } else if (!eventCRFStatusesValid) {
            fail = true;
            msg.append(respage.getString("the_event_crf_not_correct_status"));
            out.write(respage.getString("the_event_crf_not_correct_status"));
            out.close();
            continue;
        } else {
            // fail = true;
            // break here with an exception
            msg.append(respage.getString("no_event_crfs_matching_the_xml_metadata") + "<br/>");
            // auditMsg.append(respage.getString("no_event_crfs_matching_the_xml_metadata")
            // + "<br/>");
            out.write(respage.getString("no_event_crfs_matching_the_xml_metadata") + "<br/>");
            // throw new Exception(msg.toString());
            out.close();
            continue;
        }
        ArrayList<SubjectDataBean> subjectData = odmContainer.getCrfDataPostImportContainer().getSubjectData();
        if (!hardValidationErrors.isEmpty()) {
            String messageHardVals = triggerService.generateHardValidationErrorMessage(subjectData, hardValidationErrors, false);
            // byte[] messageHardValsBytes = messageHardVals.getBytes();
            out.write(messageHardVals);
            msg.append(respage.getString("file_generated_hard_validation_error"));
            // here we create a file and append the data, tbh 06/2010
            fail = true;
        } else {
            if (!totalValidationErrors.isEmpty()) {
                String totalValErrors = triggerService.generateHardValidationErrorMessage(subjectData, totalValidationErrors, false);
                out.write(totalValErrors);
            // here we also append data to the file, tbh 06/2010
            }
            String validMsgs = triggerService.generateValidMessage(subjectData, totalValidationErrors);
            out.write(validMsgs);
        // third place to append data to the file? tbh 06/2010
        }
        // << tbh 05/2010, bug #5110, leave off the detailed reports
        out.close();
        if (fail) {
            // forwardPage(Page.IMPORT_CRF_DATA);
            // break here with an exception
            // throw new Exception("Problems encountered with file " +
            // f.getName() + ": " + msg.toString());
            MessageFormat mf = new MessageFormat("");
            mf.applyPattern(respage.getString("problems_encountered_with_file"));
            Object[] arguments = { f.getName(), msg.toString() };
            msg = new StringBuffer(mf.format(arguments) + "<br/>");
            out.close();
            auditMsg.append("You can see the log file <a href='" + SQLInitServlet.getField("sysURL.base") + "ViewLogMessage?n=" + generalFileDir + f.getName() + "&tn=" + triggerBean.getName() + "&gn=1'>here</a>.<br/>");
            msg.append("You can see the log file <a href='" + SQLInitServlet.getField("sysURL.base") + "ViewLogMessage?n=" + generalFileDir + f.getName() + "&tn=" + triggerBean.getName() + "&gn=1'>here</a>.<br/>");
            // ": " + msg.toString() + "<br/>");
            continue;
        } else {
            msg.append(respage.getString("passing_crf_edit_checks") + "<br/>");
            auditMsg.append(respage.getString("passing_crf_edit_checks") + "<br/>");
            // session.setAttribute("importedData",
            // displayItemBeanWrappers);
            // session.setAttribute("validationErrors",
            // totalValidationErrors);
            // session.setAttribute("hardValidationErrors",
            // hardValidationErrors);
            // above are to be sent to the user, but what kind of message
            // can we make of them here?
            // if hard validation errors are present, we only generate one
            // table
            // otherwise, we generate the other two: validation errors and
            // valid data
            logger.debug("found total validation errors: " + totalValidationErrors.size());
            SummaryStatsBean ssBean = getImportCRFDataService(dataSource).generateSummaryStatsBean(odmContainer, displayItemBeanWrappers, importCrfInfo);
            // msg.append("===+");
            // the above is a special key that we will use to split the
            // message into two parts
            // a shorter version for the audit and
            // a longer version for the email
            msg.append(triggerService.generateSummaryStatsMessage(ssBean, respage) + "<br/>");
            // session.setAttribute("summaryStats", ssBean);
            // will have to set hard edit checks here as well
            // session.setAttribute("subjectData",
            // ArrayList<SubjectDataBean> subjectData =
            // odmContainer.getCrfDataPostImportContainer().getSubjectData();
            // forwardPage(Page.VERIFY_IMPORT_SERVLET);
            // instead of forwarding, go ahead and save it all, sending a
            // message at the end
            msg.append(triggerService.generateSkippedCRFMessage(importCrfInfo, resword) + "<br/>");
            // setup ruleSets to run if applicable
            List<ImportDataRuleRunnerContainer> containers = this.ruleRunSetup(dataSource, studyBean, ub, ruleSetService, odmContainer);
            CrfBusinessLogicHelper crfBusinessLogicHelper = new CrfBusinessLogicHelper(dataSource);
            for (DisplayItemBeanWrapper wrapper : displayItemBeanWrappers) {
                boolean resetSDV = false;
                int eventCrfBeanId = -1;
                EventCRFBean eventCrfBean = new EventCRFBean();
                logger.debug("right before we check to make sure it is savable: " + wrapper.isSavable());
                if (wrapper.isSavable()) {
                    ArrayList<Integer> eventCrfInts = new ArrayList<Integer>();
                    logger.debug("wrapper problems found : " + wrapper.getValidationErrors().toString());
                    itemDataDao.setFormatDates(false);
                    for (DisplayItemBean displayItemBean : wrapper.getDisplayItemBeans()) {
                        eventCrfBeanId = displayItemBean.getData().getEventCRFId();
                        eventCrfBean = (EventCRFBean) eventCrfDao.findByPK(eventCrfBeanId);
                        logger.debug("found value here: " + displayItemBean.getData().getValue());
                        logger.debug("found status here: " + eventCrfBean.getStatus().getName());
                        ItemDataBean itemDataBean = new ItemDataBean();
                        itemDataBean = itemDataDao.findByItemIdAndEventCRFIdAndOrdinal(displayItemBean.getItem().getId(), eventCrfBean.getId(), displayItemBean.getData().getOrdinal());
                        if (wrapper.isOverwrite() && itemDataBean.getStatus() != null) {
                            logger.debug("just tried to find item data bean on item name " + displayItemBean.getItem().getName());
                            if (!itemDataBean.getValue().equals(displayItemBean.getData().getValue()))
                                resetSDV = true;
                            itemDataBean.setUpdatedDate(new Date());
                            itemDataBean.setUpdater(ub);
                            itemDataBean.setValue(displayItemBean.getData().getValue());
                            // set status?
                            itemDataDao.update(itemDataBean);
                            logger.debug("updated: " + itemDataBean.getItemId());
                            // need to set pk here in order to create dn
                            displayItemBean.getData().setId(itemDataBean.getId());
                        } else {
                            resetSDV = true;
                            itemDataDao.create(displayItemBean.getData());
                            logger.debug("created: " + displayItemBean.getData().getItemId());
                            ItemDataBean itemDataBean2 = itemDataDao.findByItemIdAndEventCRFIdAndOrdinal(displayItemBean.getItem().getId(), eventCrfBean.getId(), displayItemBean.getData().getOrdinal());
                            logger.debug("found: id " + itemDataBean2.getId() + " name " + itemDataBean2.getName());
                            displayItemBean.getData().setId(itemDataBean2.getId());
                        }
                        ItemDAO idao = new ItemDAO(dataSource);
                        ItemBean ibean = (ItemBean) idao.findByPK(displayItemBean.getData().getItemId());
                        logger.debug("*** checking for validation errors: " + ibean.getName());
                        String itemOid = displayItemBean.getItem().getOid() + "_" + wrapper.getStudyEventRepeatKey() + "_" + displayItemBean.getData().getOrdinal() + "_" + wrapper.getStudySubjectOid();
                        if (wrapper.getValidationErrors().containsKey(itemOid)) {
                            ArrayList messageList = (ArrayList) wrapper.getValidationErrors().get(itemOid);
                            for (int iter = 0; iter < messageList.size(); iter++) {
                                String message = (String) messageList.get(iter);
                                DiscrepancyNoteBean parentDn = createDiscrepancyNote(ibean, message, eventCrfBean, displayItemBean, null, ub, dataSource, studyBean);
                                createDiscrepancyNote(ibean, message, eventCrfBean, displayItemBean, parentDn.getId(), ub, dataSource, studyBean);
                                logger.debug("*** created disc note with message: " + message);
                            // displayItemBean);
                            }
                        }
                        // Update CRF status
                        if (!eventCrfInts.contains(new Integer(eventCrfBean.getId()))) {
                            String eventCRFStatus = importedCRFStatuses.get(new Integer(eventCrfBean.getId()));
                            if (eventCRFStatus != null && eventCRFStatus.equals(DataEntryStage.INITIAL_DATA_ENTRY.getName()) && eventCrfBean.getStatus().isAvailable()) {
                                crfBusinessLogicHelper.markCRFStarted(eventCrfBean, ub);
                            } else {
                                crfBusinessLogicHelper.markCRFComplete(eventCrfBean, ub);
                            }
                            logger.debug("*** just updated event crf bean: " + eventCrfBean.getId());
                            eventCrfInts.add(new Integer(eventCrfBean.getId()));
                        }
                    }
                    itemDataDao.setFormatDates(true);
                    // Reset the SDV status if item data has been changed or added
                    if (eventCrfBean != null && resetSDV)
                        eventCrfDao.setSDVStatus(false, ub.getId(), eventCrfBean.getId());
                }
            }
            // msg.append("===+");
            msg.append(respage.getString("data_has_been_successfully_import") + "<br/>");
            auditMsg.append(respage.getString("data_has_been_successfully_import") + "<br/>");
            // MessageFormat mf = new MessageFormat("");
            String linkMessage = respage.getString("you_can_review_the_data") + SQLInitServlet.getField("sysURL.base") + respage.getString("you_can_review_the_data_2") + SQLInitServlet.getField("sysURL.base") + respage.getString("you_can_review_the_data_3") + generalFileDir + f.getName() + "&tn=" + triggerBean.getFullName() + "&gn=1" + respage.getString("you_can_review_the_data_4") + "<br/>";
            // mf.applyPattern(respage.getString("you_can_review_the_data"));
            // Object[] arguments = {
            // SQLInitServlet.getField("sysURL.base"),
            // SQLInitServlet.getField("sysURL.base"), f.getName() };
            msg.append(linkMessage);
            auditMsg.append(linkMessage);
            // was here but is now moved up, tbh
            // String finalLine =
            // "<p>You can review the entered data <a href='" +
            // SQLInitServlet.getField("sysURL.base") +
            // "ListStudySubjects'>here</a>.";
            // >> tbh additional message
            // "you can review the validation messages here" <-- where
            // 'here' is a link to view an external file
            // i.e. /ViewExternal?n=file_name.txt
            // << tbh 06/2010
            // msg.append(finalLine);
            // auditMsg.append(finalLine);
            auditMsg.append(this.runRules(studyBean, ub, containers, ruleSetService, ExecutionMode.SAVE));
        }
    }
    // end for loop
    // is the writer still not closed? try to close it
    ArrayList<String> retList = new ArrayList<String>();
    retList.add(msg.toString());
    retList.add(auditMsg.toString());
    // msg.toString();
    return retList;
}
Also used : ItemBean(org.akaza.openclinica.bean.submit.ItemBean) DisplayItemBean(org.akaza.openclinica.bean.submit.DisplayItemBean) HashMap(java.util.HashMap) ItemDAO(org.akaza.openclinica.dao.submit.ItemDAO) Date(java.util.Date) ArrayList(java.util.ArrayList) Mapping(org.exolab.castor.mapping.Mapping) SummaryStatsBean(org.akaza.openclinica.bean.submit.crfdata.SummaryStatsBean) OpenClinicaException(org.akaza.openclinica.exception.OpenClinicaException) EventCRFBean(org.akaza.openclinica.bean.submit.EventCRFBean) ItemDataBean(org.akaza.openclinica.bean.submit.ItemDataBean) List(java.util.List) ArrayList(java.util.ArrayList) Unmarshaller(org.exolab.castor.xml.Unmarshaller) DisplayItemBeanWrapper(org.akaza.openclinica.bean.submit.DisplayItemBeanWrapper) TransactionStatus(org.springframework.transaction.TransactionStatus) Status(org.akaza.openclinica.bean.core.Status) ResolutionStatus(org.akaza.openclinica.bean.core.ResolutionStatus) DataEntryStage(org.akaza.openclinica.bean.core.DataEntryStage) DiscrepancyNoteBean(org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean) File(java.io.File) FileWriter(java.io.FileWriter) ImportDataRuleRunnerContainer(org.akaza.openclinica.logic.rulerunner.ImportDataRuleRunnerContainer) BufferedWriter(java.io.BufferedWriter) ODMContainer(org.akaza.openclinica.bean.submit.crfdata.ODMContainer) ImportCRFInfoContainer(org.akaza.openclinica.control.submit.ImportCRFInfoContainer) DisplayItemBean(org.akaza.openclinica.bean.submit.DisplayItemBean) FileReader(java.io.FileReader) MessageFormat(java.text.MessageFormat) MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) OpenClinicaException(org.akaza.openclinica.exception.OpenClinicaException) JobExecutionException(org.quartz.JobExecutionException) OpenClinicaSystemException(org.akaza.openclinica.exception.OpenClinicaSystemException) SchedulerException(org.quartz.SchedulerException) IOException(java.io.IOException) Date(java.util.Date) SubjectDataBean(org.akaza.openclinica.bean.submit.crfdata.SubjectDataBean) SimpleDateFormat(java.text.SimpleDateFormat)

Example 35 with Status

use of org.akaza.openclinica.bean.core.Status in project OpenClinica by OpenClinica.

the class CrfBusinessLogicHelper method markCRFStarted.

/**
     * The following methods are for 'mark CRF complete' Note that we will also wrap Study Event status changes in this
     * code, possibly split out in a later release, tbh 06/2008
     * 
     * @return
     */
public boolean markCRFStarted(EventCRFBean ecb, UserAccountBean ub) throws Exception {
    EventCRFDAO eventCrfDao = new EventCRFDAO(ds);
    StudyDAO sdao = new StudyDAO(ds);
    StudyBean study = sdao.findByStudySubjectId(ecb.getStudySubjectId());
    EventDefinitionCRFBean edcb = getEventDefinitionCrfByStudyEventAndCrfVersion(ecb, study);
    StudyEventDefinitionDAO studyEventDefinitionDao = new StudyEventDefinitionDAO(ds);
    StudyEventDefinitionBean sedBean = (StudyEventDefinitionBean) studyEventDefinitionDao.findByPK(edcb.getStudyEventDefinitionId());
    CRFDAO crfDao = new CRFDAO(ds);
    ArrayList crfs = (ArrayList) crfDao.findAllActiveByDefinition(sedBean);
    sedBean.setCrfs(crfs);
    logger.debug("inout_event_crf_id:" + ecb.getId());
    logger.debug("inout_study_event_def_id:" + sedBean.getId());
    Status newStatus = Status.AVAILABLE;
    DataEntryStage newStage = ecb.getStage();
    ecb.setUpdater(ub);
    ecb.setUpdatedDate(new Date());
    ecb.setStatus(newStatus);
    ecb.setStage(newStage);
    ecb = (EventCRFBean) eventCrfDao.update(ecb);
    logger.debug("just updated event crf id: " + ecb.getId());
    StudyEventDAO sedao = new StudyEventDAO(ds);
    StudyEventBean seb = (StudyEventBean) sedao.findByPK(ecb.getStudyEventId());
    if (seb.getSubjectEventStatus().isScheduled() || seb.getSubjectEventStatus().isNotScheduled() || seb.getSubjectEventStatus().isDE_Started()) {
        // change status for study event
        seb.setUpdatedDate(new Date());
        seb.setUpdater(ub);
        seb.setSubjectEventStatus(SubjectEventStatus.DATA_ENTRY_STARTED);
        seb = (StudyEventBean) sedao.update(seb);
    }
    return true;
}
Also used : Status(org.akaza.openclinica.bean.core.Status) SubjectEventStatus(org.akaza.openclinica.bean.core.SubjectEventStatus) EventDefinitionCRFDAO(org.akaza.openclinica.dao.managestudy.EventDefinitionCRFDAO) EventCRFDAO(org.akaza.openclinica.dao.submit.EventCRFDAO) CRFDAO(org.akaza.openclinica.dao.admin.CRFDAO) StudyBean(org.akaza.openclinica.bean.managestudy.StudyBean) ArrayList(java.util.ArrayList) StudyEventDefinitionBean(org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean) StudyEventBean(org.akaza.openclinica.bean.managestudy.StudyEventBean) Date(java.util.Date) DataEntryStage(org.akaza.openclinica.bean.core.DataEntryStage) StudyEventDefinitionDAO(org.akaza.openclinica.dao.managestudy.StudyEventDefinitionDAO) StudyEventDAO(org.akaza.openclinica.dao.managestudy.StudyEventDAO) EventDefinitionCRFBean(org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean) StudyDAO(org.akaza.openclinica.dao.managestudy.StudyDAO) EventCRFDAO(org.akaza.openclinica.dao.submit.EventCRFDAO)

Aggregations

Status (org.akaza.openclinica.bean.core.Status)41 ArrayList (java.util.ArrayList)22 SubjectEventStatus (org.akaza.openclinica.bean.core.SubjectEventStatus)22 StudyEventBean (org.akaza.openclinica.bean.managestudy.StudyEventBean)16 StudyBean (org.akaza.openclinica.bean.managestudy.StudyBean)15 Date (java.util.Date)14 DataEntryStage (org.akaza.openclinica.bean.core.DataEntryStage)13 StudyEventDAO (org.akaza.openclinica.dao.managestudy.StudyEventDAO)13 EventCRFBean (org.akaza.openclinica.bean.submit.EventCRFBean)12 StudyEventDefinitionBean (org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean)11 EventDefinitionCRFDAO (org.akaza.openclinica.dao.managestudy.EventDefinitionCRFDAO)11 EventCRFDAO (org.akaza.openclinica.dao.submit.EventCRFDAO)11 StudySubjectBean (org.akaza.openclinica.bean.managestudy.StudySubjectBean)10 StudyEventDefinitionDAO (org.akaza.openclinica.dao.managestudy.StudyEventDefinitionDAO)10 EventDefinitionCRFBean (org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean)9 StudyDAO (org.akaza.openclinica.dao.managestudy.StudyDAO)9 StudySubjectDAO (org.akaza.openclinica.dao.managestudy.StudySubjectDAO)9 HashMap (java.util.HashMap)8 ResolutionStatus (org.akaza.openclinica.bean.core.ResolutionStatus)8 List (java.util.List)7