Search in sources :

Example 1 with ReportingRateMetric

use of org.hisp.dhis.common.ReportingRateMetric in project dhis2-core by dhis2.

the class DefaultAnalyticsService method addReportingRates.

/**
     * Adds reporting rates to the given grid based on the given data query
     * parameters.
     *
     * @param params the {@link DataQueryParams}.
     * @param grid the grid.
     */
private void addReportingRates(DataQueryParams params, Grid grid) {
    if (!params.getReportingRates().isEmpty() && !params.isSkipData()) {
        for (ReportingRateMetric metric : ReportingRateMetric.values()) {
            DataQueryParams dataSourceParams = DataQueryParams.newBuilder(params).retainDataDimensionReportingRates(metric).ignoreDataApproval().withAggregationType(AggregationType.COUNT).withTimely((REPORTING_RATE_ON_TIME == metric || ACTUAL_REPORTS_ON_TIME == metric)).build();
            addReportingRates(dataSourceParams, grid, metric);
        }
    }
}
Also used : DataQueryParams(org.hisp.dhis.analytics.DataQueryParams) ReportingRateMetric(org.hisp.dhis.common.ReportingRateMetric)

Aggregations

DataQueryParams (org.hisp.dhis.analytics.DataQueryParams)1 ReportingRateMetric (org.hisp.dhis.common.ReportingRateMetric)1