Search in sources :

Example 11 with ProgramRuleVariable

use of org.hisp.dhis.programrule.ProgramRuleVariable in project dhis2-core by dhis2.

the class DhisConvenienceTest method createProgramRuleVariableWithSourceType.

public static ProgramRuleVariable createProgramRuleVariableWithSourceType(char uniqueCharacter, Program parentProgram, ProgramRuleVariableSourceType sourceType, ValueType valueType) {
    ProgramRuleVariable programRuleVariable = new ProgramRuleVariable();
    programRuleVariable.setAutoFields();
    programRuleVariable.setName(PROGRAM_RULE_VARIABLE + uniqueCharacter);
    programRuleVariable.setProgram(parentProgram);
    programRuleVariable.setSourceType(sourceType);
    programRuleVariable.setValueType(valueType);
    return programRuleVariable;
}
Also used : ProgramRuleVariable(org.hisp.dhis.programrule.ProgramRuleVariable)

Example 12 with ProgramRuleVariable

use of org.hisp.dhis.programrule.ProgramRuleVariable in project dhis2-core by dhis2.

the class DhisConvenienceTest method createProgramRuleVariableWithTEA.

public static ProgramRuleVariable createProgramRuleVariableWithTEA(char uniqueCharacter, Program parentProgram, TrackedEntityAttribute attribute) {
    ProgramRuleVariable programRuleVariable = new ProgramRuleVariable();
    programRuleVariable.setAutoFields();
    programRuleVariable.setName(PROGRAM_RULE_VARIABLE + uniqueCharacter);
    programRuleVariable.setProgram(parentProgram);
    programRuleVariable.setAttribute(attribute);
    programRuleVariable.setSourceType(ProgramRuleVariableSourceType.TEI_ATTRIBUTE);
    programRuleVariable.setValueType(attribute.getValueType());
    return programRuleVariable;
}
Also used : ProgramRuleVariable(org.hisp.dhis.programrule.ProgramRuleVariable)

Example 13 with ProgramRuleVariable

use of org.hisp.dhis.programrule.ProgramRuleVariable in project dhis2-core by dhis2.

the class DhisConvenienceTest method createProgramRuleVariable.

public static ProgramRuleVariable createProgramRuleVariable(char uniqueCharacter, Program parentProgram) {
    ProgramRuleVariable programRuleVariable = new ProgramRuleVariable();
    programRuleVariable.setAutoFields();
    programRuleVariable.setName(PROGRAM_RULE_VARIABLE + uniqueCharacter);
    programRuleVariable.setProgram(parentProgram);
    programRuleVariable.setSourceType(ProgramRuleVariableSourceType.DATAELEMENT_CURRENT_EVENT);
    programRuleVariable.setValueType(ValueType.TEXT);
    return programRuleVariable;
}
Also used : ProgramRuleVariable(org.hisp.dhis.programrule.ProgramRuleVariable)

Example 14 with ProgramRuleVariable

use of org.hisp.dhis.programrule.ProgramRuleVariable in project dhis2-core by dhis2.

the class DhisConvenienceTest method createConstantProgramRuleVariable.

public static ProgramRuleVariable createConstantProgramRuleVariable(char uniqueCharacter, Program parentProgram) {
    ProgramRuleVariable programRuleVariable = new ProgramRuleVariable();
    programRuleVariable.setAutoFields();
    programRuleVariable.setName(uniqueCharacter + "1234567890");
    programRuleVariable.setProgram(parentProgram);
    programRuleVariable.setSourceType(ProgramRuleVariableSourceType.DATAELEMENT_CURRENT_EVENT);
    return programRuleVariable;
}
Also used : ProgramRuleVariable(org.hisp.dhis.programrule.ProgramRuleVariable)

Aggregations

ProgramRuleVariable (org.hisp.dhis.programrule.ProgramRuleVariable)14 Test (org.junit.jupiter.api.Test)6 Program (org.hisp.dhis.program.Program)5 ErrorReport (org.hisp.dhis.feedback.ErrorReport)4 List (java.util.List)3 Session (org.hibernate.Session)3 ObjectBundle (org.hisp.dhis.dxf2.metadata.objectbundle.ObjectBundle)3 ImmutableList (com.google.common.collect.ImmutableList)2 Collections (java.util.Collections)2 SessionFactory (org.hibernate.SessionFactory)2 Query (org.hibernate.query.Query)2 TransactionalIntegrationTest (org.hisp.dhis.TransactionalIntegrationTest)2 PROGRAM_RULE_VARIABLE_NAME_INVALID_KEYWORDS (org.hisp.dhis.dxf2.Constants.PROGRAM_RULE_VARIABLE_NAME_INVALID_KEYWORDS)2 E4051 (org.hisp.dhis.feedback.ErrorCode.E4051)2 E4052 (org.hisp.dhis.feedback.ErrorCode.E4052)2 ImportStrategy (org.hisp.dhis.importexport.ImportStrategy)2 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)2 Assertions.assertTrue (org.junit.jupiter.api.Assertions.assertTrue)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 ExtendWith (org.junit.jupiter.api.extension.ExtendWith)2