Search in sources :

Example 6 with DiscrepancyNoteDAO

use of org.akaza.openclinica.dao.managestudy.DiscrepancyNoteDAO in project OpenClinica by OpenClinica.

the class DiscrepancyNoteUtil method generateDiscNoteSummaryRefactored.

/**
     * Generate a summary of statistics for a collection of discrepancy notes.
     *
     * @param allDiscBeans
     *            A List of DiscrepancyNoteBeans.
     * @return A Map mapping the name of each type of note (e.g., "Annotation")
     *         to another Map containing that type's statistics.
     */
public Map generateDiscNoteSummaryRefactored(DataSource ds, StudyBean currentStudy, Set<Integer> resolutionStatusIds, int discNoteType) {
    DiscrepancyNoteDAO discrepancyNoteDAO = new DiscrepancyNoteDAO(ds);
    boolean filterDiscNotes = checkResolutionStatus(resolutionStatusIds);
    boolean filterforDiscNoteType = discNoteType >= 1 && discNoteType <= 4;
    //if (allDiscBeans == null || allDiscBeans.isEmpty())
    //   return new HashMap();
    /*
         * This container is a Map of Maps. e.g., Failed Validation Check -->
         * Map [Total --> total number of Failed Validation Check type notes,
         * Open --> total number of Failed Validation Check notes that are Open
         * types, etc.]
         */
    Map<String, Map> summaryMap = new HashMap<String, Map>();
    // The internal Map, mapping the name of the status (e.g., Resolved) to
    // the number of
    // Notes that are Resolved for that particular discrepancy note type
    // (e.g., Failed Validation Check).
    Map<String, Integer> tempMap = null;
    int tempType = 0;
    int tempTotal = 0;
    Set<String> p = new HashSet<String>();
    if (filterforDiscNoteType) {
        String[] discNoteTypeNames = { "Failed Validation Check", "Annotation", "Query", "Reason for Change" };
        p.add(discNoteTypeNames[discNoteType - 1]);
    } else {
        p = TYPES.keySet();
    }
    String q = "";
    if (filterDiscNotes) {
        q += " AND ( ";
        int i = 0;
        for (Integer resolutionStatusId : resolutionStatusIds) {
            if (i > 0) {
                q += " OR ";
            }
            q += " dn.resolution_status_id = " + resolutionStatusId;
            i++;
        }
        q += " ) ";
    }
    // initialize Map
    for (String discNoteTypeName : p) {
        tempMap = new HashMap<String, Integer>();
        //String query = "";
        // Create the summary or outer Map for each type name (e.g.,
        // Incomplete)
        summaryMap.put(discNoteTypeName, tempMap);
        tempType = TYPES.get(discNoteTypeName);
        //tempTotal = getNumberOfDiscNoteType(allDiscBeans, tempType);
        tempTotal = discrepancyNoteDAO.getViewNotesCountWithFilter(q + " AND dn.discrepancy_note_type_id =" + tempType, currentStudy);
        tempMap.put("Total", tempTotal);
        if (tempTotal == 0)
            continue;
        for (String statusName : RESOLUTION_STATUS.keySet()) {
            int number = discrepancyNoteDAO.getViewNotesCountWithFilter(q + " AND dn.discrepancy_note_type_id =" + tempType + " AND dn.resolution_status_id = " + RESOLUTION_STATUS.get(statusName), currentStudy);
            tempMap.put(statusName, number);
        }
    }
    return summaryMap;
}
Also used : DiscrepancyNoteDAO(org.akaza.openclinica.dao.managestudy.DiscrepancyNoteDAO) HashMap(java.util.HashMap) HashMap(java.util.HashMap) Map(java.util.Map) HashSet(java.util.HashSet)

Example 7 with DiscrepancyNoteDAO

use of org.akaza.openclinica.dao.managestudy.DiscrepancyNoteDAO in project OpenClinica by OpenClinica.

the class DiscrepancyNoteUtil method injectDiscNotesIntoDisplayStudyEvents.

/**
     * Add associated discrepancy notes to the appropriate StudyEventBean
     * (contained by DisplayStudyBeans). A StudyEventBean has a List of
     * DiscrepancyNoteBeans.
     *
     * @param displayStudyBeans
     *            A List of DisplayStudyEventBeans
     * @param resolutionStatus
     *            An int representing the resolution status, if we are filtering
     *            the DiscrepancyNoteBeans based on their resolutionStatus id
     *            number.
     * @param dataSource
     *            A DataSource used for the DAO methods.
     * @param discNoteType
     *            An int representing the discrepancy note type, if we are
     *            filtering the DiscrepancyNoteBeans based on their
     *            discrepancyNoteTypeId number.
     */
public void injectDiscNotesIntoDisplayStudyEvents(List<DisplayStudyEventBean> displayStudyBeans, int resolutionStatus, DataSource dataSource, int discNoteType) {
    if (displayStudyBeans == null) {
        return;
    }
    // booleans representing whether this method should only get
    // DiscrepancyNoteBeans with
    // certain resolution status or discrepancyNoteTypeId number.
    boolean hasResolutionStatus = resolutionStatus >= 1 && resolutionStatus <= 5;
    boolean hasDiscNoteType = discNoteType >= 1 && discNoteType <= 4;
    EventCRFDAO eventCRFDAO = new EventCRFDAO(dataSource);
    DiscrepancyNoteDAO discrepancyNoteDAO = new DiscrepancyNoteDAO(dataSource);
    StudyEventBean studyEventBean;
    List<EventCRFBean> eventCRFBeans = new ArrayList<EventCRFBean>();
    List<DiscrepancyNoteBean> foundDiscNotes = new ArrayList<DiscrepancyNoteBean>();
    for (DisplayStudyEventBean dStudyEventBean : displayStudyBeans) {
        studyEventBean = dStudyEventBean.getStudyEvent();
        // All EventCRFs for a study event
        eventCRFBeans = eventCRFDAO.findAllByStudyEvent(studyEventBean);
        for (EventCRFBean eventCrfBean : eventCRFBeans) {
            // Find ItemData type notes associated iwth an event crf
            foundDiscNotes = discrepancyNoteDAO.findItemDataDNotesFromEventCRF(eventCrfBean);
            // filter for any specified disc note type
            if (!foundDiscNotes.isEmpty() && hasDiscNoteType) {
                // only include disc notes that have the specified disc note
                // type id
                foundDiscNotes = filterforDiscNoteType(foundDiscNotes, discNoteType);
            }
            if (!foundDiscNotes.isEmpty()) {
                if (!hasResolutionStatus) {
                    studyEventBean.getDiscBeanList().addAll(foundDiscNotes);
                } else {
                    // the parameter passed to the servlet
                    for (DiscrepancyNoteBean discBean : foundDiscNotes) {
                        if (discBean.getResolutionStatusId() == resolutionStatus) {
                            studyEventBean.getDiscBeanList().add(discBean);
                        }
                    }
                }
            }
            // Find EventCRF type notes
            foundDiscNotes = discrepancyNoteDAO.findEventCRFDNotesFromEventCRF(eventCrfBean);
            // filter for any specified disc note type
            if (!foundDiscNotes.isEmpty() && hasDiscNoteType) {
                foundDiscNotes = filterforDiscNoteType(foundDiscNotes, discNoteType);
            }
            if (!foundDiscNotes.isEmpty()) {
                if (!hasResolutionStatus) {
                    studyEventBean.getDiscBeanList().addAll(foundDiscNotes);
                } else {
                    // the parameter passed to the servlet
                    for (DiscrepancyNoteBean discBean : foundDiscNotes) {
                        if (discBean.getResolutionStatusId() == resolutionStatus) {
                            studyEventBean.getDiscBeanList().add(discBean);
                        }
                    }
                }
            }
        // end if(! foundDiscNotes.isEmpty()){
        }
    // end for(EventCRFBean...
    }
// end for (DisplayStudyEventBean
}
Also used : DiscrepancyNoteDAO(org.akaza.openclinica.dao.managestudy.DiscrepancyNoteDAO) EventCRFBean(org.akaza.openclinica.bean.submit.EventCRFBean) DisplayEventCRFBean(org.akaza.openclinica.bean.submit.DisplayEventCRFBean) DisplayStudyEventBean(org.akaza.openclinica.bean.managestudy.DisplayStudyEventBean) DiscrepancyNoteBean(org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean) ArrayList(java.util.ArrayList) StudyEventBean(org.akaza.openclinica.bean.managestudy.StudyEventBean) DisplayStudyEventBean(org.akaza.openclinica.bean.managestudy.DisplayStudyEventBean) EventCRFDAO(org.akaza.openclinica.dao.submit.EventCRFDAO)

Example 8 with DiscrepancyNoteDAO

use of org.akaza.openclinica.dao.managestudy.DiscrepancyNoteDAO in project OpenClinica by OpenClinica.

the class DeleteEventCRFServlet method processRequest.

@Override
public void processRequest() throws Exception {
    FormProcessor fp = new FormProcessor(request);
    int studySubId = fp.getInt(STUDY_SUB_ID, true);
    int eventCRFId = fp.getInt(EVENT_CRF_ID);
    String action = request.getParameter("action");
    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_delete"));
        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);
        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());
        dnDao = new DiscrepancyNoteDAO(sm.getDataSource());
        ArrayList<ItemDataBean> itemData = iddao.findAllByEventCRFId(eventCRF.getId());
        request.setAttribute("items", itemData);
        if ("confirm".equalsIgnoreCase(action)) {
            request.setAttribute("displayEventCRF", dec);
            forwardPage(Page.DELETE_EVENT_CRF);
        } else {
            logger.info("submit to delete the event CRF from event");
            // OC-6303 Deleting Event CRF resets Show / Hide logic
            // delete records from DynamicItemForm and DynamicItemGroup
            // getDynamicsItemFormMetadataDao().delete(eventCRFId);
            // getDynamicsItemGroupMetadataDao().delete(eventCRFId);
            eventCRF.setOldStatus(eventCRF.getStatus());
            eventCRF.setStatus(Status.RESET);
            eventCRF.setUpdater(ub);
            ecdao.update(eventCRF);
            for (ItemDataBean itemdata : itemData) {
                // OC-6343 Rule behaviour must be reset if an Event CRF is deleted
                // delete the records from ruleActionRunLogDao
                List<RuleActionRunLogBean> ruleActionRunLog = getRuleActionRunLogDao().findAllItemData(itemdata.getId());
                if (ruleActionRunLog.size() != 0) {
                    getRuleActionRunLogDao().delete(itemdata.getId());
                }
                // OC-6344 Notes & Discrepancies must be set to "closed" when event CRF is deleted
                // parentDiscrepancyNoteList is the list of the parent DNs records only
                ArrayList<DiscrepancyNoteBean> parentDiscrepancyNoteList = getDnDao().findParentNotesOnlyByItemData(itemdata.getId());
                for (DiscrepancyNoteBean parentDiscrepancyNote : parentDiscrepancyNoteList) {
                    if (parentDiscrepancyNote.getResolutionStatusId() != 4) {
                        // if the DN's resolution status is
                        // not set to Closed
                        String description = resword.getString("dn_auto-closed_description");
                        String detailedNotes = resword.getString("dn_auto_closed_detailed_notes");
                        // create new DN record , new DN Map record , also update the parent record
                        createDiscrepancyNoteBean(description, detailedNotes, itemdata.getId(), study, ub, parentDiscrepancyNote);
                    }
                }
                iddao = new ItemDataDAO(sm.getDataSource());
                ifmdao = new ItemFormMetadataDAO(sm.getDataSource());
                ItemDataBean idBean = (ItemDataBean) iddao.findByPK(itemdata.getId());
                ItemFormMetadataBean ifmBean = ifmdao.findByItemIdAndCRFVersionId(idBean.getItemId(), crfVersionId);
                // Updating Dn_item_data_map actovated column into false for the existing DNs
                ArrayList<DiscrepancyNoteBean> dnBeans = getDnDao().findExistingNotesForItemData(itemdata.getId());
                if (dnBeans.size() != 0) {
                    DiscrepancyNoteBean dnBean = new DiscrepancyNoteBean();
                    dnBean.setEntityId(itemdata.getId());
                    dnBean.setActivated(false);
                    getDnDao().updateDnMapActivation(dnBean);
                }
                // Default Values are not addressed
                itemdata.setValue("");
                itemdata.setOldStatus(itemdata.getStatus());
                itemdata.setOwner(ub);
                itemdata.setStatus(Status.AVAILABLE);
                itemdata.setUpdater(ub);
                iddao.updateUser(itemdata);
                iddao.update(itemdata);
            }
            // OC-6291 event_crf status change
            eventCRF.setOldStatus(eventCRF.getStatus());
            eventCRF.setStatus(Status.AVAILABLE);
            eventCRF.setUpdater(ub);
            ecdao.update(eventCRF);
            if (event.getSubjectEventStatus().isCompleted() || event.getSubjectEventStatus().isSigned()) {
                event.setSubjectEventStatus(SubjectEventStatus.DATA_ENTRY_STARTED);
                event.setUpdater(ub);
                sedao = new StudyEventDAO(sm.getDataSource());
                sedao.update(event);
            }
            String emailBody = respage.getString("the_event_CRF") + cb.getName() + respage.getString("has_been_deleted_from_the_event") + event.getStudyEventDefinition().getName() + ". " + respage.getString("has_been_deleted_from_the_event_cont");
            addPageMessage(emailBody);
            // sendEmail(emailBody);
            request.setAttribute("id", new Integer(studySubId).toString());
            forwardPage(Page.VIEW_STUDY_SUBJECT_SERVLET);
        }
    }
}
Also used : 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) RuleActionRunLogBean(org.akaza.openclinica.domain.rule.action.RuleActionRunLogBean) 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) ItemFormMetadataDAO(org.akaza.openclinica.dao.submit.ItemFormMetadataDAO) EventDefinitionCRFDAO(org.akaza.openclinica.dao.managestudy.EventDefinitionCRFDAO) EventCRFDAO(org.akaza.openclinica.dao.submit.EventCRFDAO) CRFDAO(org.akaza.openclinica.dao.admin.CRFDAO) DiscrepancyNoteDAO(org.akaza.openclinica.dao.managestudy.DiscrepancyNoteDAO) 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) 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) DiscrepancyNoteBean(org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean) CRFVersionBean(org.akaza.openclinica.bean.submit.CRFVersionBean) EventDefinitionCRFBean(org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean) ItemFormMetadataBean(org.akaza.openclinica.bean.submit.ItemFormMetadataBean)

Example 9 with DiscrepancyNoteDAO

use of org.akaza.openclinica.dao.managestudy.DiscrepancyNoteDAO in project OpenClinica by OpenClinica.

the class UpdateSubjectServlet method processRequest.

@Override
public void processRequest() throws Exception {
    SubjectDAO sdao = new SubjectDAO(sm.getDataSource());
    FormProcessor fp = new FormProcessor(request);
    FormDiscrepancyNotes discNotes = new FormDiscrepancyNotes();
    String fromResolvingNotes = fp.getString("fromResolvingNotes", true);
    if (StringUtils.isBlank(fromResolvingNotes)) {
        session.removeAttribute(ViewNotesServlet.WIN_LOCATION);
        session.removeAttribute(ViewNotesServlet.NOTES_TABLE);
        checkStudyLocked(Page.LIST_SUBJECT_SERVLET, respage.getString("current_study_locked"));
        checkStudyFrozen(Page.LIST_SUBJECT_SERVLET, respage.getString("current_study_frozen"));
    }
    int subjectId = fp.getInt("id", true);
    int studySubId = fp.getInt("studySubId", true);
    if (subjectId == 0) {
        addPageMessage(respage.getString("please_choose_subject_to_edit"));
        forwardPage(Page.LIST_SUBJECT_SERVLET);
    } else {
        String action = fp.getString("action", true);
        if (StringUtils.isBlank("action")) {
            addPageMessage(respage.getString("no_action_specified"));
            forwardPage(Page.LIST_SUBJECT_SERVLET);
            return;
        }
        SubjectBean subject = (SubjectBean) sdao.findByPK(subjectId);
        if (action.equals("show") || action.equals("confirm")) {
            request.setAttribute("studySubId", new Integer(studySubId));
            request.setAttribute("id", new Integer(subjectId));
            request.setAttribute(AddNewSubjectServlet.FORM_DISCREPANCY_NOTES_NAME, discNotes);
        }
        if ("show".equalsIgnoreCase(action)) {
            //no DOB collected
            request.setAttribute("localBirthDate", "");
            if (!currentStudy.getStudyParameterConfig().getCollectDob().equals("3") && subject.getDateOfBirth() != null) {
                setLocalDOB(subject);
            }
            discNotes = new FormDiscrepancyNotes();
            request.setAttribute("genderDNFlag", "icon_noNote");
            request.setAttribute("birthDNFlag", "icon_noNote");
            request.setAttribute("subjectToUpdate", subject);
            setDNFlag(subjectId);
            forwardPage(Page.UPDATE_SUBJECT);
        } else if ("confirm".equalsIgnoreCase(action)) {
            confirm(subject, subjectId);
        } else {
            String gender = fp.getString("gender");
            subject.setGender(gender.charAt(0));
            if (currentStudy.getStudyParameterConfig().getSubjectPersonIdRequired().equals("required") || currentStudy.getStudyParameterConfig().getSubjectPersonIdRequired().equals("optional")) {
                subject.setUniqueIdentifier(fp.getString("uniqueIdentifier"));
            }
            subject.setUpdater(ub);
            if (!currentStudy.getStudyParameterConfig().getCollectDob().equals("3")) {
                if (currentStudy.getStudyParameterConfig().getCollectDob().equals("2")) {
                    String d_date = fp.getString(DATE_DOB_TO_SAVE);
                    if (!(d_date == null || d_date.trim().length() == 0)) {
                        Date date_new = yformat.parse(fp.getString(DATE_DOB_TO_SAVE));
                        subject.setDateOfBirth(date_new);
                    }
                }
                if (currentStudy.getStudyParameterConfig().getCollectDob().equals("1")) {
                    Date date_new = local_df.parse(fp.getString(DATE_DOB_TO_SAVE));
                    subject.setDateOfBirth(date_new);
                }
            }
            sdao.update(subject);
            // save discrepancy notes into DB
            DiscrepancyNoteDAO dndao = new DiscrepancyNoteDAO(sm.getDataSource());
            FormDiscrepancyNotes fdn = (FormDiscrepancyNotes) session.getAttribute(AddNewSubjectServlet.FORM_DISCREPANCY_NOTES_NAME);
            AddNewSubjectServlet.saveFieldNotes("gender", fdn, dndao, subject.getId(), "subject", currentStudy);
            AddNewSubjectServlet.saveFieldNotes(DATE_DOB, fdn, dndao, subject.getId(), "subject", currentStudy);
            addPageMessage(respage.getString("subject_updated_succcesfully"));
            if (studySubId > 0) {
                request.setAttribute("id", new Integer(studySubId).toString());
                forwardPage(Page.VIEW_STUDY_SUBJECT_SERVLET);
            } else {
                forwardPage(Page.LIST_SUBJECT_SERVLET);
            }
        }
    }
}
Also used : SubjectBean(org.akaza.openclinica.bean.submit.SubjectBean) DiscrepancyNoteDAO(org.akaza.openclinica.dao.managestudy.DiscrepancyNoteDAO) FormDiscrepancyNotes(org.akaza.openclinica.control.form.FormDiscrepancyNotes) SubjectDAO(org.akaza.openclinica.dao.submit.SubjectDAO) FormProcessor(org.akaza.openclinica.control.form.FormProcessor) Date(java.util.Date)

Example 10 with DiscrepancyNoteDAO

use of org.akaza.openclinica.dao.managestudy.DiscrepancyNoteDAO in project OpenClinica by OpenClinica.

the class RuleExecutionBusinessObject method createDiscrepancyNote.

private void createDiscrepancyNote(String description, ItemDataBean targetItemDataBean, ItemDataBean sourceItemDataBean) {
    DiscrepancyNoteBean note = new DiscrepancyNoteBean();
    note.setDescription(description);
    note.setDetailedNotes("");
    note.setOwner(ub);
    note.setCreatedDate(new Date());
    note.setResolutionStatusId(1);
    note.setDiscrepancyNoteTypeId(1);
    // note.setParentDnId(parentId);
    // note.setField(field);
    note.setEntityId(targetItemDataBean.getId());
    note.setEntityType(DiscrepancyNoteBean.ITEM_DATA);
    note.setColumn("value");
    note.setStudyId(currentStudy.getId());
    DiscrepancyNoteDAO discrepancyNoteDao = new DiscrepancyNoteDAO(sm.getDataSource());
    note = (DiscrepancyNoteBean) discrepancyNoteDao.create(note);
    discrepancyNoteDao.createMapping(note);
}
Also used : DiscrepancyNoteDAO(org.akaza.openclinica.dao.managestudy.DiscrepancyNoteDAO) DiscrepancyNoteBean(org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean) Date(java.util.Date)

Aggregations

DiscrepancyNoteDAO (org.akaza.openclinica.dao.managestudy.DiscrepancyNoteDAO)44 DiscrepancyNoteBean (org.akaza.openclinica.bean.managestudy.DiscrepancyNoteBean)34 ArrayList (java.util.ArrayList)32 StudySubjectDAO (org.akaza.openclinica.dao.managestudy.StudySubjectDAO)22 StudySubjectBean (org.akaza.openclinica.bean.managestudy.StudySubjectBean)20 EventCRFDAO (org.akaza.openclinica.dao.submit.EventCRFDAO)19 StudyEventBean (org.akaza.openclinica.bean.managestudy.StudyEventBean)18 Date (java.util.Date)17 StudyBean (org.akaza.openclinica.bean.managestudy.StudyBean)17 EventCRFBean (org.akaza.openclinica.bean.submit.EventCRFBean)17 FormProcessor (org.akaza.openclinica.control.form.FormProcessor)17 StudyDAO (org.akaza.openclinica.dao.managestudy.StudyDAO)17 StudyEventDAO (org.akaza.openclinica.dao.managestudy.StudyEventDAO)16 HashMap (java.util.HashMap)14 FormDiscrepancyNotes (org.akaza.openclinica.control.form.FormDiscrepancyNotes)13 StudyEventDefinitionDAO (org.akaza.openclinica.dao.managestudy.StudyEventDefinitionDAO)13 StudyEventDefinitionBean (org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean)11 SubjectDAO (org.akaza.openclinica.dao.submit.SubjectDAO)11 EventDefinitionCRFDAO (org.akaza.openclinica.dao.managestudy.EventDefinitionCRFDAO)10 ItemDataDAO (org.akaza.openclinica.dao.submit.ItemDataDAO)10