Search in sources :

Example 41 with ProgramStageDataElement

use of org.hisp.dhis.program.ProgramStageDataElement in project dhis2-core by dhis2.

the class DhisConvenienceTest method createProgramStageDataElement.

public static ProgramStageDataElement createProgramStageDataElement(ProgramStage programStage, DataElement dataElement, Integer sortOrder, boolean compulsory) {
    ProgramStageDataElement psde = new ProgramStageDataElement(programStage, dataElement, compulsory, sortOrder);
    psde.setAutoFields();
    return psde;
}
Also used : ProgramStageDataElement(org.hisp.dhis.program.ProgramStageDataElement)

Example 42 with ProgramStageDataElement

use of org.hisp.dhis.program.ProgramStageDataElement in project dhis2-core by dhis2.

the class DhisConvenienceTest method createProgramStageDataElement.

public static ProgramStageDataElement createProgramStageDataElement(ProgramStage programStage, DataElement dataElement, Integer sortOrder) {
    ProgramStageDataElement psde = new ProgramStageDataElement(programStage, dataElement, false, sortOrder);
    psde.setAutoFields();
    return psde;
}
Also used : ProgramStageDataElement(org.hisp.dhis.program.ProgramStageDataElement)

Example 43 with ProgramStageDataElement

use of org.hisp.dhis.program.ProgramStageDataElement in project dhis2-core by dhis2.

the class DhisConvenienceTest method createProgramStage.

public static ProgramStage createProgramStage(char uniqueCharacter, Set<DataElement> dataElements) {
    ProgramStage programStage = createProgramStage(uniqueCharacter, 0);
    if (dataElements != null) {
        int sortOrder = 1;
        for (DataElement dataElement : dataElements) {
            ProgramStageDataElement psd = createProgramStageDataElement(programStage, dataElement, sortOrder);
            psd.setAutoFields();
            programStage.getProgramStageDataElements().add(psd);
        }
    }
    return programStage;
}
Also used : ProgramStageDataElement(org.hisp.dhis.program.ProgramStageDataElement) ProgramStageDataElement(org.hisp.dhis.program.ProgramStageDataElement) DataElement(org.hisp.dhis.dataelement.DataElement) ProgramStage(org.hisp.dhis.program.ProgramStage) RelationshipConstraint(org.hisp.dhis.relationship.RelationshipConstraint)

Aggregations

ProgramStageDataElement (org.hisp.dhis.program.ProgramStageDataElement)43 DataElement (org.hisp.dhis.dataelement.DataElement)21 ProgramStage (org.hisp.dhis.program.ProgramStage)15 HashSet (java.util.HashSet)12 ProgramInstance (org.hisp.dhis.program.ProgramInstance)7 TrackedEntityType (org.hisp.dhis.trackedentity.TrackedEntityType)7 User (org.hisp.dhis.user.User)7 ArrayList (java.util.ArrayList)6 Date (java.util.Date)6 Program (org.hisp.dhis.program.Program)6 Test (org.junit.jupiter.api.Test)6 OrganisationUnit (org.hisp.dhis.organisationunit.OrganisationUnit)5 List (java.util.List)4 ProgramStageSection (org.hisp.dhis.program.ProgramStageSection)4 Event (org.hisp.dhis.tracker.domain.Event)4 HashMap (java.util.HashMap)3 TransactionalIntegrationTest (org.hisp.dhis.TransactionalIntegrationTest)3 IdentifiableObject (org.hisp.dhis.common.IdentifiableObject)3 ObjectBundleValidationReport (org.hisp.dhis.dxf2.metadata.objectbundle.feedback.ObjectBundleValidationReport)3 PeriodType (org.hisp.dhis.period.PeriodType)3