Search in sources :

Example 6 with RuleSetRuleBean

use of org.akaza.openclinica.domain.rule.RuleSetRuleBean in project OpenClinica by OpenClinica.

the class RuleSetRuleDaoTest method testFindById.

public void testFindById() {
    //        RuleSetRuleDao ruleSetRuleDao = (RuleSetRuleDao) getContext().getBean("ruleSetRuleDao");
    RuleSetRuleBean ruleSetRuleBean = null;
    ruleSetRuleBean = ruleSetRuleDao.findById(3);
    // Test RuleSetRule
    assertNotNull("RuleSet is null", ruleSetRuleBean);
    assertEquals("The id of the retrieved RuleSet should be 1", new Integer(3), ruleSetRuleBean.getId());
}
Also used : RuleSetRuleBean(org.akaza.openclinica.domain.rule.RuleSetRuleBean)

Example 7 with RuleSetRuleBean

use of org.akaza.openclinica.domain.rule.RuleSetRuleBean in project OpenClinica by OpenClinica.

the class RuleSetRuleDaoTest method testFindByIdEmptyResultSet.

public void testFindByIdEmptyResultSet() {
    //    RuleSetRuleDao ruleSetRuleDao = (RuleSetRuleDao) getContext().getBean("ruleSetRuleDao");
    RuleSetRuleBean ruleSetRuleBean = null;
    ruleSetRuleBean = ruleSetRuleDao.findById(6);
    // Test Rule
    assertNull("RuleSet is null", ruleSetRuleBean);
}
Also used : RuleSetRuleBean(org.akaza.openclinica.domain.rule.RuleSetRuleBean)

Example 8 with RuleSetRuleBean

use of org.akaza.openclinica.domain.rule.RuleSetRuleBean in project OpenClinica by OpenClinica.

the class RuleSetDaoTest method createStubRuleSetBean.

private RuleSetBean createStubRuleSetBean(RuleBean ruleBean) {
    RuleSetBean ruleSet = new RuleSetBean();
    ruleSet.setOriginalTarget(createExpression(Context.OC_RULES_V1, "SE_ED2REPEA.F_CONC_V20.IG_CONC_CONCOMITANTMEDICATIONS.I_CONC_CON_MED_N"));
    ruleSet.setStudyId(1);
    RuleSetRuleBean ruleSetRule = createRuleSetRule(ruleSet, ruleBean);
    ruleSet.addRuleSetRule(ruleSetRule);
    return ruleSet;
}
Also used : RuleSetRuleBean(org.akaza.openclinica.domain.rule.RuleSetRuleBean) RuleSetBean(org.akaza.openclinica.domain.rule.RuleSetBean)

Example 9 with RuleSetRuleBean

use of org.akaza.openclinica.domain.rule.RuleSetRuleBean in project OpenClinica by OpenClinica.

the class RulesPostImportContainerServiceTest method createRuleSetRule.

private RuleSetRuleBean createRuleSetRule(RuleSetBean ruleSet, String ruleOid, String oidRef) {
    RuleSetRuleBean ruleSetRule = new RuleSetRuleBean();
    //DiscrepancyNoteActionBean ruleAction = new DiscrepancyNoteActionBean();
    EventActionBean ruleAction = new EventActionBean();
    ruleAction.setOc_oid_reference(oidRef);
    ruleAction.setExpressionEvaluatesTo(true);
    ruleSetRule.addAction(ruleAction);
    ruleSetRule.setRuleSetBean(ruleSet);
    ruleSetRule.setOid(ruleOid);
    return ruleSetRule;
}
Also used : EventActionBean(org.akaza.openclinica.domain.rule.action.EventActionBean) RuleSetRuleBean(org.akaza.openclinica.domain.rule.RuleSetRuleBean)

Example 10 with RuleSetRuleBean

use of org.akaza.openclinica.domain.rule.RuleSetRuleBean in project OpenClinica by OpenClinica.

the class DownloadRuleSetXmlServlet method prepareRulesPostImportRuleSetRuleContainer.

private RulesPostImportContainer prepareRulesPostImportRuleSetRuleContainer(String ruleSetRuleIds) {
    List<RuleSetRuleBean> ruleSetRules = new ArrayList<RuleSetRuleBean>();
    RulesPostImportContainer rpic = new RulesPostImportContainer();
    if (ruleSetRuleIds != "") {
        String[] splitExpression = ruleSetRuleIds.split(",");
        for (String string : splitExpression) {
            RuleSetRuleBean rsr = getRuleSetService().getRuleSetRuleDao().findById(Integer.valueOf(string));
            ruleSetRules.add(rsr);
        }
        rpic.populate(ruleSetRules);
    }
    return rpic;
}
Also used : RulesPostImportContainer(org.akaza.openclinica.domain.rule.RulesPostImportContainer) RuleSetRuleBean(org.akaza.openclinica.domain.rule.RuleSetRuleBean) ArrayList(java.util.ArrayList)

Aggregations

RuleSetRuleBean (org.akaza.openclinica.domain.rule.RuleSetRuleBean)33 RuleSetBean (org.akaza.openclinica.domain.rule.RuleSetBean)20 ArrayList (java.util.ArrayList)12 RuleBean (org.akaza.openclinica.domain.rule.RuleBean)10 RuleActionBean (org.akaza.openclinica.domain.rule.action.RuleActionBean)10 ExpressionBean (org.akaza.openclinica.domain.rule.expression.ExpressionBean)9 HashMap (java.util.HashMap)7 ExpressionObjectWrapper (org.akaza.openclinica.domain.rule.expression.ExpressionObjectWrapper)7 OpenClinicaSystemException (org.akaza.openclinica.exception.OpenClinicaSystemException)7 OpenClinicaExpressionParser (org.akaza.openclinica.logic.expressionTree.OpenClinicaExpressionParser)7 ItemDataBean (org.akaza.openclinica.bean.submit.ItemDataBean)6 RuleActionRunLogBean (org.akaza.openclinica.domain.rule.action.RuleActionRunLogBean)6 ActionProcessor (org.akaza.openclinica.domain.rule.action.ActionProcessor)5 EventActionBean (org.akaza.openclinica.domain.rule.action.EventActionBean)5 Map (java.util.Map)3 AuditableBeanWrapper (org.akaza.openclinica.domain.rule.AuditableBeanWrapper)3 ShowActionBean (org.akaza.openclinica.domain.rule.action.ShowActionBean)3 HashSet (java.util.HashSet)2 List (java.util.List)2 Set (java.util.Set)2