Search in sources :

Example 16 with StudyDAO

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

the class StudyModuleController method registerRandimization.

@RequestMapping(value = "/{study}/randomize", method = RequestMethod.POST)
public String registerRandimization(@PathVariable("study") String studyOid, HttpServletRequest request) throws Exception {
    studyDao = new StudyDAO(dataSource);
    StudyBean study = studyDao.findByOid(studyOid);
    StudyParameterValueDAO spvdao = new StudyParameterValueDAO(dataSource);
    StudyParameterValueBean spv = spvdao.findByHandleAndStudy(study.getId(), "randomization");
    RandomizationRegistrar randomizationRegistrar = new RandomizationRegistrar();
    Locale locale = LocaleResolver.getLocale(request);
    ResourceBundleProvider.updateLocale(locale);
    respage = ResourceBundleProvider.getPageMessagesBundle(locale);
    String status = "";
    UserAccountBean userBean = (UserAccountBean) request.getSession().getAttribute("userBean");
    // Update OC Study configuration
    // send another email to sales@openclinica.com thru MandrillViaOcUi
    status = randomizationRegistrar.randomizeStudy(study.getOid(), study.getIdentifier(), userBean);
    if (status.equals("")) {
    // addRegMessage(request, respage.getString("randomization_not_available"));
    } else {
        // Update OC Study configuration
        randomizationRegistrar.sendEmail(mailSender, userBean, respage.getString("randomization_email_subject_sent_to_user"), respage.getString("randomization_email_content_message_sent_to_user"));
        spv.setStudyId(study.getId());
        spv.setParameter("randomization");
        spv.setValue("enabled");
        if (spv.getId() > 0)
            spvdao.update(spv);
        else
            spvdao.create(spv);
        StudyBean currentStudy = (StudyBean) request.getSession().getAttribute("study");
        currentStudy.getStudyParameterConfig().setRandomization("enabled");
    }
    return "redirect:/pages/studymodule";
}
Also used : Locale(java.util.Locale) StudyParameterValueBean(org.akaza.openclinica.bean.service.StudyParameterValueBean) StudyBean(org.akaza.openclinica.bean.managestudy.StudyBean) UserAccountBean(org.akaza.openclinica.bean.login.UserAccountBean) RandomizationRegistrar(org.akaza.openclinica.service.pmanage.RandomizationRegistrar) StudyParameterValueDAO(org.akaza.openclinica.dao.service.StudyParameterValueDAO) StudyDAO(org.akaza.openclinica.dao.managestudy.StudyDAO) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 17 with StudyDAO

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

the class UserAccountController method getStudyByName.

private StudyBean getStudyByName(String name) {
    sdao = new StudyDAO(dataSource);
    StudyBean studyBean = (StudyBean) sdao.findByName(name);
    return studyBean;
}
Also used : StudyBean(org.akaza.openclinica.bean.managestudy.StudyBean) StudyDAO(org.akaza.openclinica.dao.managestudy.StudyDAO)

Example 18 with StudyDAO

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

the class UserAccountController method getStudy.

private StudyBean getStudy(String oid) {
    sdao = new StudyDAO(dataSource);
    StudyBean studyBean = (StudyBean) sdao.findByOid(oid);
    return studyBean;
}
Also used : StudyBean(org.akaza.openclinica.bean.managestudy.StudyBean) StudyDAO(org.akaza.openclinica.dao.managestudy.StudyDAO)

Example 19 with StudyDAO

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

the class UserInfoController method getStudy.

private StudyBean getStudy(Integer id) {
    sdao = new StudyDAO(dataSource);
    StudyBean studyBean = (StudyBean) sdao.findByPK(id);
    return studyBean;
}
Also used : StudyBean(org.akaza.openclinica.bean.managestudy.StudyBean) StudyDAO(org.akaza.openclinica.dao.managestudy.StudyDAO)

Example 20 with StudyDAO

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

the class XsltTransformJob method initDependencies.

/**
 * Initializes the dependencies of this job with the components from the Spring application context.
 *
 * @param scheduler
 */
private void initDependencies(Scheduler scheduler) {
    try {
        ApplicationContext ctx = (ApplicationContext) scheduler.getContext().get("applicationContext");
        DataSource dataSource = ctx.getBean(DataSource.class);
        mailSender = ctx.getBean(OpenClinicaMailSender.class);
        auditEventDAO = ctx.getBean(AuditEventDAO.class);
        datasetDao = ctx.getBean(DatasetDAO.class);
        userAccountDao = ctx.getBean(UserAccountDAO.class);
        studyDao = new StudyDAO(dataSource);
        archivedDatasetFileDao = ctx.getBean(ArchivedDatasetFileDAO.class);
        generateFileService = ctx.getBean(GenerateExtractFileService.class);
        odmFileCreation = ctx.getBean(OdmFileCreation.class);
    } catch (SchedulerException e) {
        throw new IllegalStateException("Could not load dependencies from scheduler context", e);
    }
}
Also used : ArchivedDatasetFileDAO(org.akaza.openclinica.dao.extract.ArchivedDatasetFileDAO) ApplicationContext(org.springframework.context.ApplicationContext) GenerateExtractFileService(org.akaza.openclinica.service.extract.GenerateExtractFileService) SchedulerException(org.quartz.SchedulerException) OpenClinicaMailSender(org.akaza.openclinica.core.OpenClinicaMailSender) AuditEventDAO(org.akaza.openclinica.dao.admin.AuditEventDAO) OdmFileCreation(org.akaza.openclinica.service.extract.OdmFileCreation) DatasetDAO(org.akaza.openclinica.dao.extract.DatasetDAO) UserAccountDAO(org.akaza.openclinica.dao.login.UserAccountDAO) StudyDAO(org.akaza.openclinica.dao.managestudy.StudyDAO) DataSource(javax.sql.DataSource)

Aggregations

StudyDAO (org.akaza.openclinica.dao.managestudy.StudyDAO)205 StudyBean (org.akaza.openclinica.bean.managestudy.StudyBean)184 ArrayList (java.util.ArrayList)116 FormProcessor (org.akaza.openclinica.control.form.FormProcessor)73 StudySubjectDAO (org.akaza.openclinica.dao.managestudy.StudySubjectDAO)59 StudyEventDefinitionDAO (org.akaza.openclinica.dao.managestudy.StudyEventDefinitionDAO)57 StudySubjectBean (org.akaza.openclinica.bean.managestudy.StudySubjectBean)50 Date (java.util.Date)49 StudyEventDAO (org.akaza.openclinica.dao.managestudy.StudyEventDAO)49 StudyEventBean (org.akaza.openclinica.bean.managestudy.StudyEventBean)47 EventCRFDAO (org.akaza.openclinica.dao.submit.EventCRFDAO)46 StudyEventDefinitionBean (org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean)45 UserAccountDAO (org.akaza.openclinica.dao.login.UserAccountDAO)43 EventDefinitionCRFDAO (org.akaza.openclinica.dao.managestudy.EventDefinitionCRFDAO)43 HashMap (java.util.HashMap)42 UserAccountBean (org.akaza.openclinica.bean.login.UserAccountBean)39 EventCRFBean (org.akaza.openclinica.bean.submit.EventCRFBean)37 CRFVersionDAO (org.akaza.openclinica.dao.submit.CRFVersionDAO)35 CRFDAO (org.akaza.openclinica.dao.admin.CRFDAO)34 CRFVersionBean (org.akaza.openclinica.bean.submit.CRFVersionBean)30