use of org.akaza.openclinica.bean.rule.RuleSetBean in project OpenClinica by OpenClinica.
the class RuleSetRuleDAO method autoRemoveByRuleSet.
public void autoRemoveByRuleSet(RuleSetBean eb, UserAccountBean ub) {
RuleSetBean ruleSetBean = eb;
HashMap<Integer, Integer> variables = new HashMap<Integer, Integer>();
variables.put(new Integer(1), ruleSetBean.getUpdaterId());
variables.put(new Integer(2), Status.AUTO_DELETED.getId());
variables.put(new Integer(3), ruleSetBean.getId());
variables.put(new Integer(4), Status.AVAILABLE.getId());
execute(digester.getQuery("updateStatusByRuleSetAuto"), variables);
}
use of org.akaza.openclinica.bean.rule.RuleSetBean in project OpenClinica by OpenClinica.
the class RuleSetDAO method getEntityFromHashMap.
public Object getEntityFromHashMap(HashMap hm) {
RuleSetBean ruleSetBean = new RuleSetBean();
this.setEntityAuditInformation(ruleSetBean, hm);
ruleSetBean.setId(((Integer) hm.get("rule_set_id")).intValue());
int expressionId = ((Integer) hm.get("rule_expression_id")).intValue();
ExpressionBean expression = (ExpressionBean) getExpressionDao().findByPK(expressionId);
ruleSetBean.setTarget(expression);
ruleSetBean.setOriginalTarget(expression);
ruleSetBean.setItemGroup(getExpressionService().getItemGroupExpression(ruleSetBean.getTarget().getValue()));
ruleSetBean.setItem(getExpressionService().getItemExpression(ruleSetBean.getTarget().getValue(), ruleSetBean.getItemGroup()));
int studyEventDefenitionId = ((Integer) hm.get("study_event_definition_id")).intValue();
ruleSetBean.setStudyEventDefinition((StudyEventDefinitionBean) getStudyEventDefinitionDao().findByPK(studyEventDefenitionId));
int crfId = ((Integer) hm.get("crf_id")).intValue();
ruleSetBean.setCrf((CRFBean) getCrfDao().findByPK(crfId));
if ((Integer) hm.get("crf_version_id") != 0) {
int crfVersionId = ((Integer) hm.get("crf_version_id")).intValue();
ruleSetBean.setCrfVersion((CRFVersionBean) getCrfVersionDao().findByPK(crfVersionId));
} else {
ruleSetBean.setCrfVersion(null);
}
return ruleSetBean;
}
use of org.akaza.openclinica.bean.rule.RuleSetBean in project OpenClinica by OpenClinica.
the class RuleSetDAO method findByCrfVersionStudyAndStudyEventDefinition.
public ArrayList<RuleSetBean> findByCrfVersionStudyAndStudyEventDefinition(CRFVersionBean crfVersionBean, StudyBean currentStudy, StudyEventDefinitionBean sed) {
ArrayList<RuleSetBean> ruleSetBeans = new ArrayList<RuleSetBean>();
this.setTypesExpected();
HashMap<Integer, Object> variables = new HashMap<Integer, Object>();
variables.put(new Integer(1), crfVersionBean.getId());
variables.put(new Integer(2), getStudyId(currentStudy));
variables.put(new Integer(3), sed.getId());
String sql = digester.getQuery("findByCrfVersionStudyAndStudyEventDefinition");
ArrayList<?> alist = this.select(sql, variables);
Iterator<?> it = alist.iterator();
while (it.hasNext()) {
RuleSetBean ruleSet = (RuleSetBean) this.getEntityFromHashMap((HashMap<?, ?>) it.next());
ruleSetBeans.add(ruleSet);
}
return ruleSetBeans;
}
use of org.akaza.openclinica.bean.rule.RuleSetBean in project OpenClinica by OpenClinica.
the class RuleSetDAO method findAll.
public Collection findAll() {
this.setTypesExpected();
ArrayList alist = this.select(digester.getQuery("findAll"));
ArrayList<RuleSetBean> ruleSetBeans = new ArrayList<RuleSetBean>();
Iterator it = alist.iterator();
while (it.hasNext()) {
RuleSetBean ruleSet = (RuleSetBean) this.getEntityFromHashMap((HashMap) it.next());
ruleSetBeans.add(ruleSet);
}
return ruleSetBeans;
}
use of org.akaza.openclinica.bean.rule.RuleSetBean in project OpenClinica by OpenClinica.
the class RuleSetRuleDAO method findByStudyEventDefinition.
public RuleSetBean findByStudyEventDefinition(StudyEventDefinitionBean studyEventDefinition) {
RuleSetBean ruleSetBean = null;
this.setTypesExpected();
HashMap<Integer, Object> variables = new HashMap<Integer, Object>();
Integer studyEventDefinitionId = Integer.valueOf(studyEventDefinition.getId());
variables.put(new Integer(1), studyEventDefinitionId);
String sql = digester.getQuery("findByStudyEventDefinition");
ArrayList alist = this.select(sql, variables);
Iterator it = alist.iterator();
if (it.hasNext()) {
ruleSetBean = (RuleSetBean) this.getEntityFromHashMap((HashMap) it.next());
}
return ruleSetBean;
}
Aggregations