Search in sources :

Example 16 with Section

use of org.hisp.dhis.dataset.Section in project dhis2-core by dhis2.

the class GetSectionIndicatorsAction method execute.

// -------------------------------------------------------------------------
// Action Implementation
// -------------------------------------------------------------------------
@Override
public String execute() throws Exception {
    if (dataSetId == null) {
        return SUCCESS;
    }
    DataSet dataSet = dataSetService.getDataSet(dataSetId);
    indicators = new ArrayList<>(dataSet.getIndicators());
    for (Section section : dataSet.getSections()) {
        indicators.removeAll(section.getIndicators());
    }
    Collections.sort(indicators);
    return SUCCESS;
}
Also used : DataSet(org.hisp.dhis.dataset.DataSet) Section(org.hisp.dhis.dataset.Section)

Aggregations

Section (org.hisp.dhis.dataset.Section)16 DataElement (org.hisp.dhis.dataelement.DataElement)9 DataSet (org.hisp.dhis.dataset.DataSet)8 OrganisationUnit (org.hisp.dhis.organisationunit.OrganisationUnit)7 List (java.util.List)6 DataElementCategoryCombo (org.hisp.dhis.dataelement.DataElementCategoryCombo)6 IdentifiableObject (org.hisp.dhis.common.IdentifiableObject)5 ArrayList (java.util.ArrayList)4 HashSet (java.util.HashSet)4 DhisSpringTest (org.hisp.dhis.DhisSpringTest)4 DataElementCategoryOptionCombo (org.hisp.dhis.dataelement.DataElementCategoryOptionCombo)4 DataElementOperand (org.hisp.dhis.dataelement.DataElementOperand)4 ObjectBundleValidationReport (org.hisp.dhis.dxf2.metadata.objectbundle.feedback.ObjectBundleValidationReport)4 User (org.hisp.dhis.user.User)4 UserAuthorityGroup (org.hisp.dhis.user.UserAuthorityGroup)4 Test (org.junit.Test)4 ClassPathResource (org.springframework.core.io.ClassPathResource)4 HashMap (java.util.HashMap)3 DataElementCategory (org.hisp.dhis.dataelement.DataElementCategory)3 DataElementCategoryOption (org.hisp.dhis.dataelement.DataElementCategoryOption)3