dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #21038
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9857: Only load datasets which have dataelements which are defined into Aggregate Query Builder formula .
------------------------------------------------------------
revno: 9857
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-02-21 10:39:25 +0700
message:
Only load datasets which have dataelements which are defined into Aggregate Query Builder formula .
modified:
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/scheduling/CaseAggregateConditionTask.java
dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/scheduling/CaseAggregateConditionTask.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/scheduling/CaseAggregateConditionTask.java 2013-01-03 07:07:04 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/scheduling/CaseAggregateConditionTask.java 2013-02-21 03:39:25 +0000
@@ -30,6 +30,8 @@
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
import org.hisp.dhis.caseaggregation.CaseAggregationCondition;
import org.hisp.dhis.caseaggregation.CaseAggregationConditionService;
@@ -38,7 +40,6 @@
import org.hisp.dhis.dataelement.DataElementCategoryService;
import org.hisp.dhis.dataelement.DataElementService;
import org.hisp.dhis.dataset.DataSet;
-import org.hisp.dhis.dataset.DataSetService;
import org.hisp.dhis.datavalue.DataValue;
import org.hisp.dhis.datavalue.DataValueService;
import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -69,17 +70,14 @@
private DataElementService dataElementService;
private DataElementCategoryService categoryService;
-
- private DataSetService dataSetService;
-
+
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
public CaseAggregateConditionTask( OrganisationUnitService organisationUnitService,
CaseAggregationConditionService aggregationConditionService, DataValueService dataValueService,
- JdbcTemplate jdbcTemplate, DataElementService dataElementService, DataElementCategoryService categoryService,
- DataSetService dataSetService )
+ JdbcTemplate jdbcTemplate, DataElementService dataElementService, DataElementCategoryService categoryService )
{
this.organisationUnitService = organisationUnitService;
this.aggregationConditionService = aggregationConditionService;
@@ -87,7 +85,6 @@
this.jdbcTemplate = jdbcTemplate;
this.dataElementService = dataElementService;
this.categoryService = categoryService;
- this.dataSetService = dataSetService;
}
// -------------------------------------------------------------------------
@@ -99,8 +96,18 @@
{
Collection<OrganisationUnit> orgunits = organisationUnitService.getAllOrganisationUnits();
- Collection<DataSet> dataSets = dataSetService.getAllDataSets();
-
+ Set<DataSet> dataSets = new HashSet<DataSet>();
+
+ Collection<CaseAggregationCondition> aggConditions = aggregationConditionService
+ .getAllCaseAggregationCondition();
+
+ for ( CaseAggregationCondition aggCondition : aggConditions )
+ {
+ DataElement dataElement = aggCondition.getAggregationDataElement();
+
+ dataSets.addAll( dataElement.getDataSets() );
+ }
+
for ( DataSet dataSet : dataSets )
{
Period period = getPeriod( dataSet.getPeriodType().getName() );
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml 2013-02-19 06:54:22 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml 2013-02-21 03:39:25 +0000
@@ -486,7 +486,6 @@
<constructor-arg ref="jdbcTemplate" />
<constructor-arg ref="org.hisp.dhis.dataelement.DataElementService" />
<constructor-arg ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
- <constructor-arg ref="org.hisp.dhis.dataset.DataSetService" />
</bean>
<bean id="aggregateQueryBuilder" class="org.hisp.dhis.patient.scheduling.CaseAggregateConditionTask"