use of org.hisp.dhis.analytics.AnalyticsTable in project dhis2-core by dhis2.
the class JdbcEnrollmentAnalyticsTableManager method getTables.
private List<AnalyticsTable> getTables() {
List<AnalyticsTable> tables = new UniqueArrayList<>();
List<Program> programs = idObjectManager.getAllNoAcl(Program.class);
String baseName = getTableName();
for (Program program : programs) {
AnalyticsTable table = new AnalyticsTable(baseName, null, null, program);
List<AnalyticsTableColumn> dimensionColumns = getDimensionColumns(table);
table.setDimensionColumns(dimensionColumns);
tables.add(table);
}
return tables;
}
use of org.hisp.dhis.analytics.AnalyticsTable in project dhis2-core by dhis2.
the class AbstractJdbcTableManager method getTables.
/**
* Generates a list of {@link AnalyticsTable} based on a list of years with data.
*
* @param dataYears the list of years of data.
*/
protected List<AnalyticsTable> getTables(List<Integer> dataYears) {
List<AnalyticsTable> tables = new UniqueArrayList<>();
Calendar calendar = PeriodType.getCalendar();
Collections.sort(dataYears);
String baseName = getAnalyticsTableType().getTableName();
for (Integer year : dataYears) {
Period period = PartitionUtils.getPeriod(calendar, year);
AnalyticsTable table = new AnalyticsTable(baseName, getDimensionColumns(null), period);
tables.add(table);
}
return tables;
}
Aggregations