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