Search in sources :

Example 6 with StudyParameterValueBean

use of org.akaza.openclinica.bean.service.StudyParameterValueBean in project OpenClinica by OpenClinica.

the class StudyParameterValueDAO method update.

public EntityBean update(EntityBean eb) {
    StudyParameterValueBean spvb = (StudyParameterValueBean) eb;
    HashMap variables = new HashMap();
    variables.put(new Integer(1), spvb.getValue());
    variables.put(new Integer(2), new Integer(spvb.getStudyId()));
    variables.put(new Integer(3), spvb.getParameter());
    this.execute(digester.getQuery("update"), variables);
    return spvb;
}
Also used : StudyParameterValueBean(org.akaza.openclinica.bean.service.StudyParameterValueBean) HashMap(java.util.HashMap)

Example 7 with StudyParameterValueBean

use of org.akaza.openclinica.bean.service.StudyParameterValueBean in project OpenClinica by OpenClinica.

the class StudyParameterValueDAO method getEntityFromHashMap.

public Object getEntityFromHashMap(HashMap hm) {
    // study_id numeric,
    // value varchar(50),
    // study_parameter_id int4,
    StudyParameterValueBean spvb = new StudyParameterValueBean();
    // super.setEntityAuditInformation(spvb, hm);
    spvb.setValue((String) hm.get("value"));
    spvb.setStudyId(((Integer) hm.get("study_id")).intValue());
    spvb.setId(((Integer) hm.get("study_parameter_value_id")).intValue());
    // YW 10-15-2007 <<
    spvb.setParameter((String) hm.get("parameter"));
    return spvb;
}
Also used : StudyParameterValueBean(org.akaza.openclinica.bean.service.StudyParameterValueBean)

Example 8 with StudyParameterValueBean

use of org.akaza.openclinica.bean.service.StudyParameterValueBean in project OpenClinica by OpenClinica.

the class StudyParameterValueDAO method create.

public EntityBean create(EntityBean eb) {
    StudyParameterValueBean spvb = (StudyParameterValueBean) eb;
    HashMap variables = new HashMap();
    variables.put(new Integer(1), new Integer(spvb.getStudyId()));
    variables.put(new Integer(2), spvb.getValue());
    variables.put(new Integer(3), spvb.getParameter());
    this.execute(digester.getQuery("create"), variables);
    return spvb;
}
Also used : StudyParameterValueBean(org.akaza.openclinica.bean.service.StudyParameterValueBean) HashMap(java.util.HashMap)

Example 9 with StudyParameterValueBean

use of org.akaza.openclinica.bean.service.StudyParameterValueBean in project OpenClinica by OpenClinica.

the class RandomizeActionProcessor method mayProceed.

private boolean mayProceed(String studyOid) throws Exception {
    boolean accessPermission = false;
    StudyBean siteStudy = getStudy(studyOid);
    StudyBean study = getParentStudy(studyOid);
    StudyParameterValueDAO spvdao = new StudyParameterValueDAO(ds);
    StudyParameterValueBean pStatus = spvdao.findByHandleAndStudy(study.getId(), "randomization");
    randomizationRegistrar = new RandomizationRegistrar();
    SeRandomizationDTO seRandomizationDTO = randomizationRegistrar.getCachedRandomizationDTOObject(study.getOid().toString(), false);
    String randomizationStatusFromOCUI = seRandomizationDTO.getStatus();
    // enabled , disabled
    String randomizationStatusFromOC = pStatus.getValue().toString();
    // available , pending , frozen , locked
    String studyStatus = study.getStatus().getName().toString();
    // available , pending , frozen , locked
    String siteStatus = siteStudy.getStatus().getName().toString();
    System.out.println("randomizationStatusFromOCUI: " + randomizationStatusFromOCUI + "  randomizationStatusFromOC: " + randomizationStatusFromOC + "   studyStatus: " + studyStatus + "   siteStatus: " + siteStatus);
    logger.info("randomizationStatusFromOCUI: " + randomizationStatusFromOCUI + "  randomizationStatusFromOC: " + randomizationStatusFromOC + "   studyStatus: " + studyStatus + "   siteStatus: " + siteStatus);
    if (randomizationStatusFromOC.equalsIgnoreCase("enabled") && studyStatus.equalsIgnoreCase("available") && siteStatus.equalsIgnoreCase("available") && randomizationStatusFromOCUI.equalsIgnoreCase("ACTIVE")) {
        accessPermission = true;
    }
    return accessPermission;
}
Also used : StudyParameterValueBean(org.akaza.openclinica.bean.service.StudyParameterValueBean) StudyBean(org.akaza.openclinica.bean.managestudy.StudyBean) RandomizationRegistrar(org.akaza.openclinica.service.pmanage.RandomizationRegistrar) StudyParameterValueDAO(org.akaza.openclinica.dao.service.StudyParameterValueDAO) SeRandomizationDTO(org.akaza.openclinica.service.pmanage.SeRandomizationDTO)

Example 10 with StudyParameterValueBean

use of org.akaza.openclinica.bean.service.StudyParameterValueBean in project OpenClinica by OpenClinica.

the class MetadataUnit method collectMetaDataVersion.

private void collectMetaDataVersion() {
    ArrayList<StudyEventDefinitionBean> sedBeansInStudy = (ArrayList<StudyEventDefinitionBean>) studyBase.getSedBeansInStudy();
    if (sedBeansInStudy == null || sedBeansInStudy.size() < 1) {
        logger.info("null, because there is no study event definition in this study.");
        return;
    }
    StudyBean study = studyBase.getStudy();
    StudyConfigService studyConfig = new StudyConfigService(this.ds);
    study = studyConfig.setParametersForStudy(study);
    MetaDataVersionBean metadata = this.odmStudy.getMetaDataVersion();
    metadata.setStudy(study);
    StudyParameterValueDAO spvdao = new StudyParameterValueDAO(this.ds);
    int parentId = study.getParentStudyId() > 0 ? study.getParentStudyId() : study.getId();
    StudyParameterValueBean spv = spvdao.findByHandleAndStudy(parentId, "discrepancyManagement");
    metadata.setSoftHard(spv.getValue().equalsIgnoreCase("true") ? "Hard" : "Soft");
    OdmExtractDAO oedao = new OdmExtractDAO(this.ds);
    int studyId = study.getId();
    int parentStudyId = study.getParentStudyId() > 0 ? study.getParentStudyId() : studyId;
    if (this.getCategory() == 1 && study.isSite(study.getParentStudyId())) {
        // populate MetaDataVersion attributes
        if (dataset != null) {
            metadata.setOid(dataset.getODMMetaDataVersionOid() + "-" + study.getOid());
            metadata.setName(dataset.getODMMetaDataVersionName() + "-" + study.getOid());
            this.setParentMetaDataVersionOid(dataset.getODMMetaDataVersionOid());
        }
        if (metadata.getOid() == null || metadata.getOid().length() <= 0) {
            metadata.setOid("v1.0.0" + "-" + study.getOid());
            this.setParentMetaDataVersionOid("v1.0.0");
        }
        if (metadata.getName() == null || metadata.getName().length() <= 0) {
            metadata.setName("MetaDataVersion_v1.0.0" + "-" + study.getOid());
        }
        // populate Include
        this.collectIncludeFromParentInSameFile();
        // populate protocol
        oedao.getUpdatedSiteMetadata(parentStudyId, studyId, metadata, this.odmBean.getODMVersion());
    } else {
        if (dataset != null) {
            metadata.setOid(dataset.getODMMetaDataVersionOid());
            metadata.setName(dataset.getODMMetaDataVersionName());
        }
        if (metadata.getOid() == null || metadata.getOid().length() <= 0) {
            metadata.setOid("v1.0.0");
        }
        if (metadata.getName() == null || metadata.getName().length() <= 0) {
            metadata.setName("MetaDataVersion_v1.0.0");
        }
        // populate Include
        String psOid = new String();
        String pmOid = new String();
        if (dataset != null) {
            psOid = dataset.getODMPriorStudyOid();
            pmOid = dataset.getODMPriorMetaDataVersionOid();
        }
        if (pmOid != null && pmOid.length() > 0) {
            MetaDataVersionIncludeBean ib = metadata.getInclude();
            ib.setMetaDataVersionOID(pmOid);
            if (psOid != null && psOid.length() > 0) {
                ib.setStudyOID(psOid);
            } else {
                ib.setStudyOID(study.getOid());
            }
        }
        // populate protocol
        // Set<Integer> nullCodeSet = oedao.getMetadata(parentStudyId,
        // studyId,
        // metadata, this.getODMBean().getODMVersion());
        // studyBase.setNullClSet(nullCodeSet);
        oedao.getMetadata(parentStudyId, studyId, metadata, this.odmBean.getODMVersion());
        metadata.setRuleSetRules(getRuleSetRuleDao().findByRuleSetStudyIdAndStatusAvail(parentStudyId));
    }
}
Also used : StudyConfigService(org.akaza.openclinica.dao.service.StudyConfigService) StudyParameterValueBean(org.akaza.openclinica.bean.service.StudyParameterValueBean) MetaDataVersionIncludeBean(org.akaza.openclinica.bean.odmbeans.MetaDataVersionIncludeBean) MetaDataVersionBean(org.akaza.openclinica.bean.odmbeans.MetaDataVersionBean) StudyBean(org.akaza.openclinica.bean.managestudy.StudyBean) OdmStudyBean(org.akaza.openclinica.bean.odmbeans.OdmStudyBean) ArrayList(java.util.ArrayList) OdmExtractDAO(org.akaza.openclinica.dao.extract.OdmExtractDAO) StudyEventDefinitionBean(org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean) StudyParameterValueDAO(org.akaza.openclinica.dao.service.StudyParameterValueDAO)

Aggregations

StudyParameterValueBean (org.akaza.openclinica.bean.service.StudyParameterValueBean)46 StudyBean (org.akaza.openclinica.bean.managestudy.StudyBean)31 StudyParameterValueDAO (org.akaza.openclinica.dao.service.StudyParameterValueDAO)27 StudyDAO (org.akaza.openclinica.dao.managestudy.StudyDAO)18 ArrayList (java.util.ArrayList)16 Date (java.util.Date)9 HashMap (java.util.HashMap)9 ParticipantPortalRegistrar (org.akaza.openclinica.service.pmanage.ParticipantPortalRegistrar)9 StudySubjectBean (org.akaza.openclinica.bean.managestudy.StudySubjectBean)6 FormProcessor (org.akaza.openclinica.control.form.FormProcessor)6 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)6 Iterator (java.util.Iterator)5 UserAccountBean (org.akaza.openclinica.bean.login.UserAccountBean)4 StudyParamsConfig (org.akaza.openclinica.bean.service.StudyParamsConfig)4 ParseException (java.text.ParseException)3 SimpleDateFormat (java.text.SimpleDateFormat)3 StudyEventDefinitionBean (org.akaza.openclinica.bean.managestudy.StudyEventDefinitionBean)3 StudyParameter (org.akaza.openclinica.bean.service.StudyParameter)3 RandomizationRegistrar (org.akaza.openclinica.service.pmanage.RandomizationRegistrar)3 IOException (java.io.IOException)2