Search in sources :

Example 6 with ReportingRate

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

the class ReportTableStoreTest method setUpTest.

@Override
public void setUpTest() throws Exception {
    dataElements = new ArrayList<>();
    indicators = new ArrayList<>();
    reportingRates = new ArrayList<>();
    periods = new ArrayList<>();
    units = new ArrayList<>();
    indicatorType = createIndicatorType('A');
    indicatorService.addIndicatorType(indicatorType);
    periodType = PeriodType.getPeriodTypeByName(MonthlyPeriodType.NAME);
    dataElementA = createDataElement('A');
    dataElementB = createDataElement('B');
    dataElementService.addDataElement(dataElementA);
    dataElementService.addDataElement(dataElementB);
    dataElements.add(dataElementA);
    dataElements.add(dataElementB);
    indicatorA = createIndicator('A', indicatorType);
    indicatorB = createIndicator('B', indicatorType);
    indicatorService.addIndicator(indicatorA);
    indicatorService.addIndicator(indicatorB);
    indicators.add(indicatorA);
    indicators.add(indicatorB);
    DataSet dataSetA = createDataSet('A', periodType);
    DataSet dataSetB = createDataSet('B', periodType);
    dataSetService.addDataSet(dataSetA);
    dataSetService.addDataSet(dataSetB);
    reportingRateA = new ReportingRate(dataSetA);
    reportingRateB = new ReportingRate(dataSetB);
    reportingRates.add(reportingRateA);
    reportingRates.add(reportingRateB);
    periodA = createPeriod(periodType, getDate(2000, 1, 1), getDate(2000, 1, 31));
    periodB = createPeriod(periodType, getDate(2000, 2, 1), getDate(2000, 2, 28));
    periodService.addPeriod(periodA);
    periodService.addPeriod(periodB);
    periods.add(periodA);
    periods.add(periodB);
    unitA = createOrganisationUnit('A');
    unitB = createOrganisationUnit('B');
    organisationUnitService.addOrganisationUnit(unitA);
    organisationUnitService.addOrganisationUnit(unitB);
    units.add(unitA);
    units.add(unitB);
    relativesA = new RelativePeriods();
    relativesA.setLastMonth(true);
    relativesA.setThisYear(true);
    relativesB = new RelativePeriods();
    relativesB.setLastMonth(true);
    relativesB.setThisYear(true);
    relativesC = new RelativePeriods();
    relativesC.setLastMonth(true);
    relativesC.setThisYear(true);
}
Also used : RelativePeriods(org.hisp.dhis.period.RelativePeriods) DataSet(org.hisp.dhis.dataset.DataSet) ReportingRate(org.hisp.dhis.common.ReportingRate)

Aggregations

ReportingRate (org.hisp.dhis.common.ReportingRate)6 DataSet (org.hisp.dhis.dataset.DataSet)5 Period (org.hisp.dhis.period.Period)2 RelativePeriods (org.hisp.dhis.period.RelativePeriods)2 ProgramDataElementDimensionItem (org.hisp.dhis.program.ProgramDataElementDimensionItem)2 AnalyticalObject (org.hisp.dhis.common.AnalyticalObject)1 DimensionalItemObject (org.hisp.dhis.common.DimensionalItemObject)1 DataElement (org.hisp.dhis.dataelement.DataElement)1 DataElementCategoryCombo (org.hisp.dhis.dataelement.DataElementCategoryCombo)1 DataElementOperand (org.hisp.dhis.dataelement.DataElementOperand)1 Indicator (org.hisp.dhis.indicator.Indicator)1 IndicatorType (org.hisp.dhis.indicator.IndicatorType)1 MockI18nFormat (org.hisp.dhis.mock.MockI18nFormat)1 MonthlyPeriodType (org.hisp.dhis.period.MonthlyPeriodType)1 PeriodType (org.hisp.dhis.period.PeriodType)1 QuarterlyPeriodType (org.hisp.dhis.period.QuarterlyPeriodType)1 YearlyPeriodType (org.hisp.dhis.period.YearlyPeriodType)1 ProgramTrackedEntityAttributeDimensionItem (org.hisp.dhis.program.ProgramTrackedEntityAttributeDimensionItem)1 ReportTable (org.hisp.dhis.reporttable.ReportTable)1