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

« back to all changes in this revision

Viewing changes to local/vn/dhis-web-hcmc-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
 
 
33
import org.hisp.dhis.dataelement.DataElement;
 
34
import org.hisp.dhis.dataelement.DataElementGroup;
 
35
import org.hisp.dhis.dataset.DataSet;
 
36
import org.hisp.dhis.indicator.Indicator;
 
37
import org.hisp.dhis.indicator.IndicatorGroup;
 
38
 
 
39
/**
 
40
 * @author Lars Helge Overland
 
41
 * @version $Id: ReportDataAccess.java 2871 2007-02-20 16:04:11Z andegje $
 
42
 */
 
43
public interface ReportDataAccess
 
44
{
 
45
    String BEAN_ID = ReportDataAccess.class.getName();
 
46
    
 
47
    /**
 
48
     * Retrieves all DataElements.
 
49
     * @throws ReportDataAccessException
 
50
     */
 
51
    Collection<DataElement> getAllDataElements()
 
52
        throws ReportDataAccessException;
 
53
    
 
54
    /**
 
55
     * Retrieves DataElement.
 
56
     * @throws ReportDataAccessException
 
57
     */
 
58
    DataElement getDataElement(int dataElmentId)
 
59
        throws ReportDataAccessException;
 
60
    
 
61
    /**
 
62
     * Retrieves all DataElementGroups.
 
63
     * @throws ReportDataAccessException
 
64
     */
 
65
    Collection<DataElementGroup> getAllDataElementGroups()
 
66
        throws ReportDataAccessException;
 
67
    
 
68
    /**
 
69
     * Retrieves members of DataElementGroup.
 
70
     * @throws ReportDataAccessException
 
71
     */
 
72
    Collection<DataElement> getMembersOfDataElementGroup( int dataElementGroupId )
 
73
        throws ReportDataAccessException;
 
74
    
 
75
    /**
 
76
     * Retrieves all Indicators.
 
77
     * @throws ReportDataAccessException
 
78
     */
 
79
    Collection<Indicator> getAllIndicators()
 
80
        throws ReportDataAccessException;
 
81
    
 
82
    /**
 
83
     * Retrieves all IndicatorGroups.
 
84
     * @throws ReportDataAccessException
 
85
     */
 
86
    Collection<IndicatorGroup> getAllIndicatorGroups()
 
87
        throws ReportDataAccessException;
 
88
    
 
89
    /**
 
90
     * Retrieves members of IndicatorGroup.
 
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 between start date and end date.
 
98
     * @throws ReportDataAccessException
 
99
     */
 
100
    double getAggregatedDataValue( int dataElementId, Date startDate, Date endDate, String source )
 
101
        throws ReportDataAccessException;
 
102
    
 
103
    /**
 
104
     * Calculates the aggregated value of the given Indicator and source between start date and end date.
 
105
     * @throws ReportDataAccessException
 
106
     */
 
107
    double getAggregatedIndicatorValue( int indicatorId, Date startDate, Date endDate, String source )
 
108
        throws ReportDataAccessException;
 
109
    
 
110
    /**
 
111
     * Gets the name of the Organisation Unit with the given identifier.
 
112
     * @throws ReportDataAccessException
 
113
     */
 
114
    String getOrganisationUnitName( int organisationUnitId )
 
115
        throws ReportDataAccessException;
 
116
    
 
117
    /**
 
118
     * Gets the short-name of the Organisation Unit with the given identifier.
 
119
     * @throws ReportDataAccessException
 
120
     */
 
121
    String getOrganisationUnitShortName( int organisationUnitId )
 
122
        throws ReportDataAccessException;
 
123
    
 
124
    /**
 
125
     * Gets the children of the Organisation Unit with the given identifer. 
 
126
     * @throws ReportDataAccessException
 
127
     */
 
128
    Collection<Integer> getChildrenOfOrganisationUnit( int organisationUnitId )
 
129
        throws ReportDataAccessException;
 
130
    
 
131
    /**
 
132
     * Gets the name of the DataElement with the given identifier.
 
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
     * @throws ReportDataAccessException
 
141
     */
 
142
    String getDataElementShortName( int dataElementId )
 
143
        throws ReportDataAccessException;
 
144
    
 
145
    /**
 
146
     * Gets the name of the Indicator with the given identifier.
 
147
     * @throws ReportDataAccessException
 
148
     */
 
149
    String getIndicatorName( int indicatorId )
 
150
        throws ReportDataAccessException;
 
151
    
 
152
    /**
 
153
     * Gets the short name of the Indicator with the given identifier.
 
154
     * @throws ReportDataAccessException
 
155
     */
 
156
    String getIndicatorShortName( int indicatorId )
 
157
        throws ReportDataAccessException;
 
158
 
 
159
    /**
 
160
     * Gets the DataSet with the given identifier.
 
161
     * @throws ReportDataAccessException
 
162
     */
 
163
    public DataSet getDataSet( int dataSetId )
 
164
        throws ReportDataAccessException;
 
165
 
 
166
    /**
 
167
     * Gets all of DataSets.
 
168
     * @throws ReportDataAccessException
 
169
     */    
 
170
    Collection<DataSet> getAllDataSets()
 
171
        throws ReportDataAccessException;
 
172
 
 
173
    /**
 
174
     * Gets all of Semi DataSets.
 
175
     * @throws ReportDataAccessException
 
176
     */    
 
177
    Collection<DataSet> getAllSemiDataSets()
 
178
        throws ReportDataAccessException;
 
179
 
 
180
}