Search in sources :

Example 1 with ExecuteIndividualCrfObject

use of org.akaza.openclinica.service.crfdata.ExecuteIndividualCrfObject in project OpenClinica by OpenClinica.

the class OdmImportServiceImpl method saveOrUpdateCrfAndFormLayouts.

private void saveOrUpdateCrfAndFormLayouts(String crfOid, List<OCodmComplexTypeDefinitionFormLayoutDef> formLayoutDefs, Form[] fmCrfs, UserAccount userAccount, Study study, String crfName) {
    DataBinder dataBinder = new DataBinder(new FormLayout());
    Errors errors = dataBinder.getBindingResult();
    StudyBean currentStudy = new StudyBean();
    currentStudy.setId(study.getStudyId());
    UserAccountBean ub = new UserAccountBean();
    ub.setId(userAccount.getUserId());
    ub.setActiveStudyId(currentStudy.getId());
    for (Form crf : fmCrfs) {
        if (crf.getOcoid().equals(crfOid)) {
            ExecuteIndividualCrfObject eicObj = new ExecuteIndividualCrfObject(crf, formLayoutDefs, errors, currentStudy, ub, true, null);
            xformService.executeIndividualCrf(eicObj);
        }
    }
}
Also used : FormLayout(org.akaza.openclinica.domain.datamap.FormLayout) Errors(org.springframework.validation.Errors) ExecuteIndividualCrfObject(org.akaza.openclinica.service.crfdata.ExecuteIndividualCrfObject) Form(org.akaza.openclinica.service.dto.Form) StudyBean(org.akaza.openclinica.bean.managestudy.StudyBean) UserAccountBean(org.akaza.openclinica.bean.login.UserAccountBean) DataBinder(org.springframework.validation.DataBinder)

Aggregations

UserAccountBean (org.akaza.openclinica.bean.login.UserAccountBean)1 StudyBean (org.akaza.openclinica.bean.managestudy.StudyBean)1 FormLayout (org.akaza.openclinica.domain.datamap.FormLayout)1 ExecuteIndividualCrfObject (org.akaza.openclinica.service.crfdata.ExecuteIndividualCrfObject)1 Form (org.akaza.openclinica.service.dto.Form)1 DataBinder (org.springframework.validation.DataBinder)1 Errors (org.springframework.validation.Errors)1