class MinMaxOutlierAnalysisService implements MinMaxDataAnalysisService {

    @Override
    public List<DeflatedDataValue> analyse( Collection<OrganisationUnit> parents,
        Collection<DataElement> dataElements, Collection<Period> periods, Double stdDevFactor, Date from )
    {
        Set<DataElement> elements = dataElements.stream()
            .filter( de -> ValueType.NUMERIC_TYPES.contains( de.getValueType() ) )
            .collect( Collectors.toSet() );
        Set<CategoryOptionCombo> categoryOptionCombos = new HashSet<>();

        for ( DataElement dataElement : elements )
        {
            categoryOptionCombos.addAll( dataElement.getCategoryOptionCombos() );
        }

        log.debug( "Starting min-max analysis, no of data elements: " + elements.size() + ", no of parent org units: " + parents.size() );

        return dataAnalysisStore.getMinMaxViolations( elements, categoryOptionCombos, periods, parents, MAX_OUTLIERS );
    }

    public  MinMaxOutlierAnalysisService( DataAnalysisStore dataAnalysisStore,
        MinMaxDataElementService minMaxDataElementService, BatchHandlerFactory batchHandlerFactory );

}