Search in sources :

Example 11 with DisplayTableOfContentsBean

use of org.akaza.openclinica.bean.submit.DisplayTableOfContentsBean in project OpenClinica by OpenClinica.

the class TableOfContentsServlet method getDisplayBean.

public static DisplayTableOfContentsBean getDisplayBean(EventCRFBean ecb, DataSource ds, StudyBean currentStudy) {
    DisplayTableOfContentsBean answer = new DisplayTableOfContentsBean();
    answer.setEventCRF(ecb);
    // get data
    StudySubjectDAO ssdao = new StudySubjectDAO(ds);
    StudySubjectBean ssb = (StudySubjectBean) ssdao.findByPK(ecb.getStudySubjectId());
    answer.setStudySubject(ssb);
    StudyEventDAO sedao = new StudyEventDAO(ds);
    StudyEventBean seb = (StudyEventBean) sedao.findByPK(ecb.getStudyEventId());
    answer.setStudyEvent(seb);
    SectionDAO sdao = new SectionDAO(ds);
    ArrayList sections = getSections(ecb, ds);
    answer.setSections(sections);
    // get metadata
    StudyEventDefinitionDAO seddao = new StudyEventDefinitionDAO(ds);
    StudyEventDefinitionBean sedb = (StudyEventDefinitionBean) seddao.findByPK(seb.getStudyEventDefinitionId());
    answer.setStudyEventDefinition(sedb);
    CRFVersionDAO cvdao = new CRFVersionDAO(ds);
    CRFVersionBean cvb = (CRFVersionBean) cvdao.findByPK(ecb.getCRFVersionId());
    answer.setCrfVersion(cvb);
    CRFDAO cdao = new CRFDAO(ds);
    CRFBean cb = (CRFBean) cdao.findByPK(cvb.getCrfId());
    answer.setCrf(cb);
    StudyBean studyForStudySubject = new StudyDAO(ds).findByStudySubjectId(ssb.getId());
    EventDefinitionCRFDAO edcdao = new EventDefinitionCRFDAO(ds);
    EventDefinitionCRFBean edcb = edcdao.findByStudyEventDefinitionIdAndCRFId(studyForStudySubject, sedb.getId(), cb.getId());
    answer.setEventDefinitionCRF(edcb);
    answer.setAction(getActionForStage(ecb.getStage()));
    return answer;
}
Also used : 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) StudyBean(org.akaza.openclinica.bean.managestudy.StudyBean) ArrayList(java.util.ArrayList) DisplayTableOfContentsBean(org.akaza.openclinica.bean.submit.DisplayTableOfContentsBean) StudyEventDefinitionBean(org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean) EventDefinitionCRFDAO(org.akaza.openclinica.dao.managestudy.EventDefinitionCRFDAO) StudyEventBean(org.akaza.openclinica.bean.managestudy.StudyEventBean) StudySubjectDAO(org.akaza.openclinica.dao.managestudy.StudySubjectDAO) EventDefinitionCRFBean(org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean) EventCRFBean(org.akaza.openclinica.bean.submit.EventCRFBean) CRFBean(org.akaza.openclinica.bean.admin.CRFBean) DisplayEventCRFBean(org.akaza.openclinica.bean.submit.DisplayEventCRFBean) StudySubjectBean(org.akaza.openclinica.bean.managestudy.StudySubjectBean) StudyEventDefinitionDAO(org.akaza.openclinica.dao.managestudy.StudyEventDefinitionDAO) StudyEventDAO(org.akaza.openclinica.dao.managestudy.StudyEventDAO) CRFVersionBean(org.akaza.openclinica.bean.submit.CRFVersionBean) EventDefinitionCRFBean(org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean) StudyDAO(org.akaza.openclinica.dao.managestudy.StudyDAO) SectionDAO(org.akaza.openclinica.dao.submit.SectionDAO)

Aggregations

DisplayTableOfContentsBean (org.akaza.openclinica.bean.submit.DisplayTableOfContentsBean)11 ArrayList (java.util.ArrayList)9 EventCRFBean (org.akaza.openclinica.bean.submit.EventCRFBean)9 StudyEventBean (org.akaza.openclinica.bean.managestudy.StudyEventBean)7 FormProcessor (org.akaza.openclinica.control.form.FormProcessor)7 StudySubjectBean (org.akaza.openclinica.bean.managestudy.StudySubjectBean)6 CRFVersionBean (org.akaza.openclinica.bean.submit.CRFVersionBean)6 StudyEventDAO (org.akaza.openclinica.dao.managestudy.StudyEventDAO)6 StudySubjectDAO (org.akaza.openclinica.dao.managestudy.StudySubjectDAO)6 EventCRFDAO (org.akaza.openclinica.dao.submit.EventCRFDAO)6 HttpSession (javax.servlet.http.HttpSession)5 EventDefinitionCRFBean (org.akaza.openclinica.bean.managestudy.EventDefinitionCRFBean)5 StudyBean (org.akaza.openclinica.bean.managestudy.StudyBean)5 StudyEventDefinitionBean (org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean)5 DisplaySectionBean (org.akaza.openclinica.bean.submit.DisplaySectionBean)5 SectionBean (org.akaza.openclinica.bean.submit.SectionBean)5 EventDefinitionCRFDAO (org.akaza.openclinica.dao.managestudy.EventDefinitionCRFDAO)5 SectionDAO (org.akaza.openclinica.dao.submit.SectionDAO)5 Date (java.util.Date)4 DisplayItemBean (org.akaza.openclinica.bean.submit.DisplayItemBean)4