~mortenoh/+junk/dhis2-detailed-import-export

« back to all changes in this revision

Viewing changes to local/vn/dhis-web-hue-reporttool/src/main/java/org/hisp/dhis/rt/dataaccess/ReportDataAccess.java

  • Committer: larshelge at gmail
  • Date: 2009-03-03 16:46:36 UTC
  • Revision ID: larshelge@gmail.com-20090303164636-2sjlrquo7ib1gf7r
Initial check-in

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.hisp.dhis.rt.dataaccess;
 
2
 
 
3
/*
 
4
 * Copyright (c) 2004-2007, University of Oslo
 
5
 * All rights reserved.
 
6
 *
 
7
 * Redistribution and use in source and binary forms, with or without
 
8
 * modification, are permitted provided that the following conditions are met:
 
9
 * * Redistributions of source code must retain the above copyright notice, this
 
10
 *   list of conditions and the following disclaimer.
 
11
 * * Redistributions in binary form must reproduce the above copyright notice,
 
12
 *   this list of conditions and the following disclaimer in the documentation
 
13
 *   and/or other materials provided with the distribution.
 
14
 * * Neither the name of the HISP project nor the names of its contributors may
 
15
 *   be used to endorse or promote products derived from this software without
 
16
 *   specific prior written permission.
 
17
 *
 
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 
19
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 
20
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 
21
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
 
22
 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 
23
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 
24
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 
25
 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 
26
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 
27
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
28
 */
 
29
 
 
30
import java.util.Collection;
 
31
import java.util.Date;
 
32
import java.util.Set;
 
33
 
 
34
import org.hisp.dhis.dataelement.DataElement;
 
35
import org.hisp.dhis.dataelement.DataElementGroup;
 
36
import org.hisp.dhis.indicator.Indicator;
 
37
import org.hisp.dhis.indicator.IndicatorGroup;
 
38
import org.hisp.dhis.organisationunit.OrganisationUnit;
 
39
 
 
40
/**
 
41
 * @author Lars Helge Overland
 
42
 * @version $Id: ReportDataAccess.java 2871 2007-02-20 16:04:11Z andegje $
 
43
 */
 
44
public interface ReportDataAccess
 
45
{
 
46
    String BEAN_ID = ReportDataAccess.class.getName();
 
47
 
 
48
    /**
 
49
     * Retrieves all DataElements.
 
50
     * 
 
51
     * @throws ReportDataAccessException
 
52
     */
 
53
    Collection<DataElement> getAllDataElements()
 
54
        throws ReportDataAccessException;
 
55
 
 
56
    /**
 
57
     * Retrieves all DataElementGroups.
 
58
     * 
 
59
     * @throws ReportDataAccessException
 
60
     */
 
61
    Collection<DataElementGroup> getAllDataElementGroups()
 
62
        throws ReportDataAccessException;
 
63
 
 
64
    /**
 
65
     * Retrieves members of DataElementGroup.
 
66
     * 
 
67
     * @throws ReportDataAccessException
 
68
     */
 
69
    Collection<DataElement> getMembersOfDataElementGroup( int dataElementGroupId )
 
70
        throws ReportDataAccessException;
 
71
 
 
72
    /**
 
73
     * Retrieves all Indicators.
 
74
     * 
 
75
     * @throws ReportDataAccessException
 
76
     */
 
77
    Collection<Indicator> getAllIndicators()
 
78
        throws ReportDataAccessException;
 
79
 
 
80
    /**
 
81
     * Retrieves all IndicatorGroups.
 
82
     * 
 
83
     * @throws ReportDataAccessException
 
84
     */
 
85
    Collection<IndicatorGroup> getAllIndicatorGroups()
 
86
        throws ReportDataAccessException;
 
87
 
 
88
    /**
 
89
     * Retrieves members of IndicatorGroup.
 
90
     * 
 
91
     * @throws ReportDataAccessException
 
92
     */
 
93
    Collection<Indicator> getMembersOfIndicatorGroup( int indicatorGroupId )
 
94
        throws ReportDataAccessException;
 
95
 
 
96
    /**
 
97
     * Calculates the aggregated value of the given DataElement and source
 
98
     * between start date and end date.
 
99
     * 
 
100
     * @throws ReportDataAccessException
 
101
     */
 
102
    double getAggregatedDataValue( int dataElementId, Date startDate, Date endDate, String source )
 
103
        throws ReportDataAccessException;
 
104
 
 
105
    /**
 
106
     * Calculates the aggregated value of the given Indicator and source between
 
107
     * start date and end date.
 
108
     * 
 
109
     * @throws ReportDataAccessException
 
110
     */
 
111
    double getAggregatedIndicatorValue( int indicatorId, Date startDate, Date endDate, String source )
 
112
        throws ReportDataAccessException;
 
113
 
 
114
    /**
 
115
     * Gets the name of the Organisation Unit with the given identifier.
 
116
     * 
 
117
     * @throws ReportDataAccessException
 
118
     */
 
119
    String getOrganisationUnitName( int organisationUnitId )
 
120
        throws ReportDataAccessException;
 
121
 
 
122
    /**
 
123
     * Gets the short-name of the Organisation Unit with the given identifier.
 
124
     * 
 
125
     * @throws ReportDataAccessException
 
126
     */
 
127
    String getOrganisationUnitShortName( int organisationUnitId )
 
128
        throws ReportDataAccessException;
 
129
 
 
130
    /**
 
131
     * Gets the name of the DataElement with the given identifier.
 
132
     * 
 
133
     * @throws ReportDataAccessException
 
134
     */
 
135
    String getDataElementName( int dataElementId )
 
136
        throws ReportDataAccessException;
 
137
 
 
138
    /**
 
139
     * Gets the short name of the DataElement with the given identifier.
 
140
     * 
 
141
     * @throws ReportDataAccessException
 
142
     */
 
143
    String getDataElementShortName( int dataElementId )
 
144
        throws ReportDataAccessException;
 
145
 
 
146
    /**
 
147
     * Gets the name of the Indicator with the given identifier.
 
148
     * 
 
149
     * @throws ReportDataAccessException
 
150
     */
 
151
    String getIndicatorName( int indicatorId )
 
152
        throws ReportDataAccessException;
 
153
 
 
154
    /**
 
155
     * Gets the short name of the Indicator with the given identifier.
 
156
     * 
 
157
     * @throws ReportDataAccessException
 
158
     */
 
159
    String getIndicatorShortName( int indicatorId )
 
160
        throws ReportDataAccessException;
 
161
 
 
162
    /**
 
163
     * Add this menthod for Hue's report.
 
164
     */
 
165
    Set<OrganisationUnit> getOrganisationUnitChildren( int organisationUnitId )
 
166
        throws ReportDataAccessException;
 
167
 
 
168
    int getOrganisationUnitByName( String name )
 
169
        throws ReportDataAccessException;
 
170
}