dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #14126
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4678: minor fix
------------------------------------------------------------
revno: 4678
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2011-09-24 14:36:14 +0200
message:
minor fix
modified:
dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SaveMinMaxLimitsAction.java
dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/ValidationAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/action/SaveSectionFormAction.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-dataentry/src/main/java/org/hisp/dhis/de/action/SaveMinMaxLimitsAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SaveMinMaxLimitsAction.java 2011-08-20 12:10:52 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SaveMinMaxLimitsAction.java 2011-09-24 12:36:14 +0000
@@ -43,7 +43,7 @@
*/
public class SaveMinMaxLimitsAction
implements Action
-{
+{
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
@@ -70,7 +70,7 @@
}
private DataElementCategoryService categoryService;
-
+
public void setCategoryService( DataElementCategoryService categoryService )
{
this.categoryService = categoryService;
@@ -135,20 +135,22 @@
{
minLimit = minLimit != null ? minLimit : 0;
maxLimit = maxLimit != null ? maxLimit : 0;
-
+
OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( organisationUnitId );
DataElement dataElement = dataElementService.getDataElement( dataElementId );
-
- DataElementCategoryOptionCombo optionCombo = categoryService.getDataElementCategoryOptionCombo( categoryOptionComboId );
+
+ DataElementCategoryOptionCombo optionCombo = categoryService
+ .getDataElementCategoryOptionCombo( categoryOptionComboId );
MinMaxDataElement minMaxDataElement = minMaxDataElementService.getMinMaxDataElement( organisationUnit,
dataElement, optionCombo );
if ( minMaxDataElement == null )
{
- minMaxDataElement = new MinMaxDataElement( organisationUnit, dataElement, optionCombo, minLimit, maxLimit, false );
-
+ minMaxDataElement = new MinMaxDataElement( organisationUnit, dataElement, optionCombo, minLimit, maxLimit,
+ false );
+
minMaxDataElementService.addMinMaxDataElement( minMaxDataElement );
}
else
@@ -159,7 +161,7 @@
minMaxDataElementService.updateMinMaxDataElement( minMaxDataElement );
}
-
+
return SUCCESS;
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/ValidationAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/ValidationAction.java 2011-08-13 18:03:46 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/ValidationAction.java 2011-09-24 12:36:14 +0000
@@ -214,26 +214,27 @@
{
Period period = periodService.getPeriod( selectedPeriod.getStartDate(), selectedPeriod.getEndDate(),
selectedPeriod.getPeriodType() );
-
+
DataSet dataSet = dataSetService.getDataSet( dataSetId );
-
+
// ---------------------------------------------------------------------
// Min-max and outlier analysis
// ---------------------------------------------------------------------
-
- Collection<MinMaxDataElement> minmaxs = minMaxDataElementService.getMinMaxDataElements( orgUnit, dataSet.getDataElements() );
-
+
+ Collection<MinMaxDataElement> minmaxs = minMaxDataElementService.getMinMaxDataElements( orgUnit,
+ dataSet.getDataElements() );
+
if ( minmaxs == null )
- {
+ {
Double factor = (Double) systemSettingManager.getSystemSetting(
SystemSettingManager.KEY_FACTOR_OF_DEVIATION, 2.0 );
-
- Collection<DeflatedDataValue> stdDevs = stdDevOutlierAnalysisService.analyse( orgUnit, dataSet
- .getDataElements(), ListUtils.getCollection( period ), factor );
-
- Collection<DeflatedDataValue> minMaxs = minMaxOutlierAnalysisService.analyse( orgUnit, dataSet
- .getDataElements(), ListUtils.getCollection( period ), null );
-
+
+ Collection<DeflatedDataValue> stdDevs = stdDevOutlierAnalysisService.analyse( orgUnit,
+ dataSet.getDataElements(), ListUtils.getCollection( period ), factor );
+
+ Collection<DeflatedDataValue> minMaxs = minMaxOutlierAnalysisService.analyse( orgUnit,
+ dataSet.getDataElements(), ListUtils.getCollection( period ), null );
+
dataValues = CollectionUtils.union( stdDevs, minMaxs );
}
else
@@ -241,35 +242,35 @@
dataValues = minMaxValuesGenerationService.findOutliers( orgUnit, ListUtils.getCollection( period ),
minmaxs );
}
-
+
log.debug( "Number of outlier values: " + dataValues.size() );
-
+
// ---------------------------------------------------------------------
// Validation rule analysis
// ---------------------------------------------------------------------
-
+
results = new ArrayList<ValidationResult>( validationRuleService.validate( dataSet, period, orgUnit ) );
-
+
log.debug( "Number of validation violations: " + results.size() );
-
+
if ( results.size() > 0 )
{
leftsideFormulaMap = new HashMap<Integer, String>( results.size() );
rightsideFormulaMap = new HashMap<Integer, String>( results.size() );
-
+
for ( ValidationResult result : results )
{
ValidationRule rule = result.getValidationRule();
-
- leftsideFormulaMap.put( rule.getId(), expressionService.getExpressionDescription( rule.getLeftSide()
- .getExpression() ) );
-
- rightsideFormulaMap.put( rule.getId(), expressionService.getExpressionDescription( rule.getRightSide()
- .getExpression() ) );
+
+ leftsideFormulaMap.put( rule.getId(),
+ expressionService.getExpressionDescription( rule.getLeftSide().getExpression() ) );
+
+ rightsideFormulaMap.put( rule.getId(),
+ expressionService.getExpressionDescription( rule.getRightSide().getExpression() ) );
}
}
}
-
+
return dataValues.size() == 0 && results.size() == 0 ? SUCCESS : INPUT;
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/action/SaveSectionFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/action/SaveSectionFormAction.java 2011-09-23 23:07:18 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/action/SaveSectionFormAction.java 2011-09-24 12:36:14 +0000
@@ -154,7 +154,7 @@
if ( dataValue == null )
{
- if ( value.length() != 0 && value != null )
+ if ( value != null && value.length() != 0 )
{
dataValue = new DataValue( dataElement, period, organisationUnit, value, storedBy, new Date(),
null, optionCombo );