~dhis2-devs-core/dhis2/trunk

« back to all changes in this revision

Viewing changes to dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValueService.java

  • Committer: jimgrace at gmail
  • Date: 2014-05-18 00:49:40 UTC
  • Revision ID: jimgrace@gmail.com-20140518004940-wbw1bxjhfdmf33yl
Support attribute categories in validation

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
import java.util.Date;
33
33
import java.util.Map;
34
34
 
 
35
import org.hisp.dhis.common.MapMap;
35
36
import org.hisp.dhis.dataelement.DataElement;
36
37
import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
37
38
import org.hisp.dhis.dataelement.DataElementOperand;
296
297
     * @return the number of DataValues.
297
298
     */
298
299
    int getDataValueCount( int days );
299
 
    
300
 
    /**
301
 
     * Returns a map of values indexed by DataElementOperand.
302
 
     * 
303
 
     * @param dataElements collection of DataElements to fetch for
304
 
     * @param period period for which to fetch the values
305
 
     * @param unit OrganisationUnit for which to fetch the values
306
 
     * @return
307
 
     */
308
 
    Map<DataElementOperand, Double> getDataValueMap( Collection<DataElement> dataElements, Period period, OrganisationUnit source );
309
300
 
310
301
    /**
311
 
     * Returns a map of values indexed by DataElementOperand.
312
 
     * 
 
302
     * Returns a map of values for each attribute option combo found.
 
303
     * <p>
313
304
     * In the (unlikely) event that the same dataElement/optionCombo is found in
314
 
     * more than one period for the same organisationUnit and date, the value
315
 
     * is returned from the period with the shortest duration.
316
 
     * 
 
305
     * more than one period for the same organisationUnit, date, and attribute
 
306
     * combo, the value is returned from the period with the shortest duration.
 
307
     *
317
308
     * @param dataElements collection of DataElements to fetch for
318
309
     * @param date date which must be present in the period
319
 
     * @param unit OrganisationUnit for which to fetch the values
 
310
     * @param source OrganisationUnit for which to fetch the values
320
311
     * @param periodTypes allowable period types in which to find the data
 
312
     * @param attributeCombo the attribute combo to check (if restricted)
321
313
     * @param lastUpdatedMap map in which to return the lastUpdated date for each value
322
 
     * @return
 
314
     * @return map of values by attribute option combo id, then DataElementOperand
323
315
     */
324
 
    Map<DataElementOperand, Double> getDataValueMap( Collection<DataElement> dataElements, Date date, OrganisationUnit source,
325
 
                Collection<PeriodType> periodTypes, Map<DataElementOperand, Date> lastUpdatedMap );
 
316
    MapMap<Integer, DataElementOperand, Double> getDataValueMapByAttributeCombo( Collection<DataElement> dataElements, Date date,
 
317
            OrganisationUnit source, Collection<PeriodType> periodTypes, DataElementCategoryOptionCombo attributeCombo,
 
318
            MapMap<Integer, DataElementOperand, Date> lastUpdatedMap );
326
319
 
327
320
    /**
328
321
     * Gets a Collection of DeflatedDataValues.