use of org.hisp.dhis.trackedentity.TrackedEntityAttributeDimension in project dhis2-core by dhis2.
the class EventDataQueryServiceTest method testGetFromAnalyticalObjectA.
@Test
void testGetFromAnalyticalObjectA() {
EventChart eventChart = new EventChart();
eventChart.setAutoFields();
eventChart.setProgram(prA);
eventChart.getColumnDimensions().add(atA.getUid());
eventChart.getRowDimensions().add(DimensionalObject.ORGUNIT_DIM_ID);
eventChart.getFilterDimensions().add(DimensionalObject.PERIOD_DIM_ID);
eventChart.getAttributeDimensions().add(new TrackedEntityAttributeDimension(atA, null, "LE:5"));
eventChart.getPeriods().add(peA);
eventChart.getPeriods().add(peB);
eventChart.getOrganisationUnits().add(ouA);
eventChart.getOrganisationUnits().add(ouB);
EventQueryParams params = dataQueryService.getFromAnalyticalObject(eventChart);
assertNotNull(params);
assertEquals(1, params.getItems().size());
assertEquals(2, params.getOrganisationUnits().size());
assertEquals(2, params.getFilterPeriods().size());
}
use of org.hisp.dhis.trackedentity.TrackedEntityAttributeDimension in project dhis2-core by dhis2.
the class EventDataQueryServiceTest method testGetFromAnalyticalObjectC.
@Test
void testGetFromAnalyticalObjectC() {
EventChart eventChart = new EventChart();
eventChart.setAutoFields();
eventChart.setProgram(prA);
eventChart.getColumnDimensions().add(deA.getUid());
eventChart.getColumnDimensions().add(atA.getUid());
eventChart.getRowDimensions().add(DimensionalObject.ORGUNIT_DIM_ID);
eventChart.getFilterDimensions().add(DimensionalObject.PERIOD_DIM_ID);
eventChart.getDataElementDimensions().add(new TrackedEntityDataElementDimension(deA, null, null, "GT:2000"));
eventChart.getAttributeDimensions().add(new TrackedEntityAttributeDimension(atA, null, "LE:5"));
eventChart.getPeriods().add(peA);
eventChart.getPeriods().add(peB);
eventChart.getOrganisationUnits().add(ouA);
EventQueryParams params = dataQueryService.getFromAnalyticalObject(eventChart);
assertNotNull(params);
assertEquals(2, params.getItems().size());
assertEquals(1, params.getOrganisationUnits().size());
assertEquals(2, params.getFilterPeriods().size());
}
Aggregations