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