dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #19853
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8832: Minor fix.
------------------------------------------------------------
revno: 8832
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-11-02 12:10:24 +0700
message:
Minor fix.
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultAction.java
--
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-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultAction.java 2012-11-02 04:25:31 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseaggregation/CaseAggregationResultAction.java 2012-11-02 05:10:24 +0000
@@ -29,7 +29,6 @@
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
@@ -39,7 +38,6 @@
import org.hisp.dhis.caseaggregation.CaseAggregationCondition;
import org.hisp.dhis.caseaggregation.CaseAggregationConditionService;
-import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
import org.hisp.dhis.dataset.DataSet;
@@ -222,13 +220,13 @@
}
// ---------------------------------------------------------------------
- // Get DataElement list of selected dataset
+ // Get CaseAggregateCondition list
// ---------------------------------------------------------------------
DataSet selectedDataSet = dataSetService.getDataSet( dataSetId );
Collection<CaseAggregationCondition> aggregationConditions = aggregationConditionService
- .getAllCaseAggregationCondition();
+ .getCaseAggregationCondition( selectedDataSet.getDataElements() );
// ---------------------------------------------------------------------
// Get selected periods list
@@ -255,7 +253,7 @@
Integer resultValue = aggregationConditionService.parseConditition( condition, orgUnit, period );
DataValue dataValue = dataValueService.getDataValue( orgUnit, dElement, period, optionCombo );
- String key = orgUnit.getId() + "-" + format.formatPeriod( period );
+ String key = orgUnitId + "-" + format.formatPeriod( period );
String keyStatus = key + "-" + dElement.getId();
if ( resultValue != null && resultValue != 0 )
@@ -264,15 +262,12 @@
{
dataValue = new DataValue( dElement, period, orgUnit, "" + resultValue, "", new Date(),
null, optionCombo );
-
mapStatusValues.put( keyStatus, i18n.getString( ADD_STATUS ) );
- orgunits.add( orgUnit );
}
else
{
dataValue.setValue( "" + resultValue );
dataValue.setTimestamp( new Date() );
-
mapStatusValues.put( keyStatus, i18n.getString( UPDATE_STATUS ) );
}
mapCaseAggCondition.put( dataValue, condition );