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.setTarget(createExpression(Context.OC_RULES_V1, "SE_ED2REPEA.F_CONC_V20.IG_CONC_CONCOMITANTMEDICATIONS.I_CONC_CON_MED_N"));
RuleSetRuleBean ruleSetRule = createRuleSetRule(ruleSet, ruleBean);
ruleSet.addRuleSetRule(ruleSetRule);
return ruleSet;
}
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());
}
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);
}
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;
}
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;
}
Aggregations