use of org.hisp.dhis.analytics.ColumnDataType.CHARACTER_11 in project dhis2-core by dhis2.
the class JdbcEventAnalyticsTableManager method getDimensionColumns.
/**
* Returns dimensional analytics table columns.
*
* @param program the program.
* @return a list of {@link AnalyticsTableColumn}.
*/
private List<AnalyticsTableColumn> getDimensionColumns(Program program) {
List<AnalyticsTableColumn> columns = new ArrayList<>();
if (program.hasNonDefaultCategoryCombo()) {
List<Category> categories = program.getCategoryCombo().getCategories();
for (Category category : categories) {
if (category.isDataDimension()) {
columns.add(new AnalyticsTableColumn(quote(category.getUid()), CHARACTER_11, "acs." + quote(category.getUid())).withCreated(category.getCreated()));
}
}
}
columns.addAll(addOrganisationUnitLevels());
columns.addAll(addOrganisationUnitGroupSets());
columns.addAll(categoryService.getAttributeCategoryOptionGroupSetsNoAcl().stream().map(l -> toCharColumn(quote(l.getUid()), "acs", l.getCreated())).collect(Collectors.toList()));
columns.addAll(addPeriodTypeColumns("dps"));
columns.addAll(program.getAnalyticsDataElements().stream().map(de -> getColumnFromDataElement(de, false)).flatMap(Collection::stream).collect(Collectors.toList()));
columns.addAll(program.getAnalyticsDataElementsWithLegendSet().stream().map(de -> getColumnFromDataElement(de, true)).flatMap(Collection::stream).collect(Collectors.toList()));
columns.addAll(program.getNonConfidentialTrackedEntityAttributes().stream().map(tea -> getColumnFromTrackedEntityAttribute(tea, getNumericClause(), getDateClause(), false)).flatMap(Collection::stream).collect(Collectors.toList()));
columns.addAll(program.getNonConfidentialTrackedEntityAttributesWithLegendSet().stream().map(tea -> getColumnFromTrackedEntityAttribute(tea, getNumericClause(), getDateClause(), true)).flatMap(Collection::stream).collect(Collectors.toList()));
columns.addAll(getFixedColumns());
if (program.isRegistration()) {
columns.add(new AnalyticsTableColumn(quote("tei"), CHARACTER_11, "tei.uid"));
}
return filterDimensionColumns(columns);
}
Aggregations