dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #27910
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13908: Fixed bug in caseaggregationconditionservice, have to reload periods which are created in code fo...
------------------------------------------------------------
revno: 13908
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-01-31 17:50:42 +0200
message:
Fixed bug in caseaggregationconditionservice, have to reload periods which are created in code for it to get a database identifier to use in sql
modified:
dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/caseaggregation/DefaultCaseAggregationConditionService.java
dhis-2/dhis-services/dhis-service-eventreporting/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-eventreporting/src/main/java/org/hisp/dhis/caseaggregation/DefaultCaseAggregationConditionService.java'
--- dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/caseaggregation/DefaultCaseAggregationConditionService.java 2014-01-24 08:41:50 +0000
+++ dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/caseaggregation/DefaultCaseAggregationConditionService.java 2014-01-31 15:50:42 +0000
@@ -57,6 +57,7 @@
import org.hisp.dhis.patient.PatientAttribute;
import org.hisp.dhis.patient.PatientAttributeService;
import org.hisp.dhis.period.Period;
+import org.hisp.dhis.period.PeriodService;
import org.hisp.dhis.program.Program;
import org.hisp.dhis.program.ProgramService;
import org.hisp.dhis.program.ProgramStage;
@@ -91,8 +92,10 @@
private PatientAttributeService patientAttributeService;
+ private PeriodService periodService;
+
private I18nService i18nService;
-
+
// -------------------------------------------------------------------------
// Getters && Setters
// -------------------------------------------------------------------------
@@ -122,6 +125,11 @@
this.dataElementService = dataElementService;
}
+ public void setPeriodService( PeriodService periodService )
+ {
+ this.periodService = periodService;
+ }
+
public void setI18nService( I18nService service )
{
i18nService = service;
@@ -395,6 +403,8 @@
public Grid getAggregateValue( CaseAggregationCondition caseAggregationCondition, Collection<Integer> orgunitIds,
Period period, I18nFormat format, I18n i18n )
{
+ periodService.reloadPeriod( period );
+
return aggregationConditionStore.getAggregateValue( caseAggregationCondition, orgunitIds, period, format, i18n );
}
@@ -402,12 +412,16 @@
public Grid getAggregateValueDetails( CaseAggregationCondition aggregationCondition, OrganisationUnit orgunit,
Period period, I18nFormat format, I18n i18n )
{
+ periodService.reloadPeriod( period );
+
return aggregationConditionStore.getAggregateValueDetails( aggregationCondition, orgunit, period, format, i18n );
}
public void insertAggregateValue( CaseAggregationCondition caseAggregationCondition,
Collection<Integer> orgunitIds, Period period )
{
+ periodService.reloadPeriod( period );
+
Integer deSumId = (caseAggregationCondition.getDeSum() == null) ? null : caseAggregationCondition.getDeSum()
.getId();
@@ -419,6 +433,8 @@
@Override
public String parseExpressionDetailsToSql( String caseExpression, String operator, Integer orgunitId, Period period )
{
+ periodService.reloadPeriod( period );
+
return aggregationConditionStore.parseExpressionDetailsToSql( caseExpression, operator, orgunitId, period );
}
@@ -427,6 +443,8 @@
Integer aggregateDeId, String aggregateDeName, Integer optionComboId, String optionComboName, Integer deSumId,
Collection<Integer> orgunitIds, Period period )
{
+ periodService.reloadPeriod( period );
+
return aggregationConditionStore.parseExpressionToSql( isInsert, caseExpression, operator, aggregateDeId,
aggregateDeName, optionComboId, optionComboName, deSumId, orgunitIds, period );
}
=== modified file 'dhis-2/dhis-services/dhis-service-eventreporting/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-eventreporting/src/main/resources/META-INF/dhis/beans.xml 2013-11-29 09:24:58 +0000
+++ dhis-2/dhis-services/dhis-service-eventreporting/src/main/resources/META-INF/dhis/beans.xml 2014-01-31 15:50:42 +0000
@@ -39,8 +39,8 @@
<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
<property name="programStageService" ref="org.hisp.dhis.program.ProgramStageService" />
<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
- <property name="patientAttributeService"
- ref="org.hisp.dhis.patient.PatientAttributeService" />
+ <property name="patientAttributeService" ref="org.hisp.dhis.patient.PatientAttributeService" />
+ <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
<property name="i18nService" ref="org.hisp.dhis.i18n.I18nService" />
</bean>