=== 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 2010-01-29 17:10:33 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/ValidationAction.java 2010-03-15 12:08:51 +0000 @@ -53,6 +53,7 @@ /** * @author Margrethe Store + * @author Lars Helge Overland * @version $Id: ValidationAction.java 5426 2008-06-16 04:33:05Z larshelg $ */ public class ValidationAction @@ -157,15 +158,29 @@ DataSet dataSet = selectedStateManager.getSelectedDataSet(); + // --------------------------------------------------------------------- + // Min-max and outlier analysis + // --------------------------------------------------------------------- + + Collection stdDevs = stdDevOutlierAnalysisService. + analyse( orgUnit, dataSet.getDataElements(), ListUtils.getCollection( period ), STD_DEV ); + + Collection minMaxs = minMaxOutlierAnalysisService. + analyse( orgUnit, dataSet.getDataElements(), ListUtils.getCollection( period ), null ); + + dataValues = CollectionUtils.union( stdDevs, minMaxs ); + + log.info( "Number of outlier values: " + dataValues.size() ); + + // --------------------------------------------------------------------- + // Validation rule analysis + // --------------------------------------------------------------------- + results = new ArrayList( validationRuleService.validate( dataSet, period, orgUnit ) ); log.info( "Number of validation violations: " + results.size() ); - - if ( results.size() == 0 ) - { - return NONE; - } - else + + if ( results.size()> 0 ) { leftsideFormulaMap = new HashMap( results.size() ); rightsideFormulaMap = new HashMap( results.size() ); @@ -179,16 +194,6 @@ } } - Collection stdDevs = stdDevOutlierAnalysisService. - analyse( orgUnit, dataSet.getDataElements(), ListUtils.getCollection( period ), STD_DEV ); - - Collection minMaxs = minMaxOutlierAnalysisService. - analyse( orgUnit, dataSet.getDataElements(), ListUtils.getCollection( period ), null ); - - dataValues = CollectionUtils.union( stdDevs, minMaxs ); - - log.info( "Number of outlier values: " + dataValues.size() ); - - return SUCCESS; + return dataValues.size() == 0 && results.size() == 0 ? NONE : SUCCESS; } } === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties 2010-03-11 10:42:29 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties 2010-03-15 12:08:51 +0000 @@ -78,10 +78,12 @@ run_validation = Run validation validation_result = Validation Result expression = Expression -successful_validation = The values successfully passed validation. +successful_validation = The data entry screen successfully passed validation +unsuccessful_validation = The data entry screen has validation errors, please fix these errors before proceeding +the_following_values_violates_rules = The following values violates validation rules +the_following_values_are_outliers = The following values are considered as outliers (min-max or std dev) value = Value operator = Operator -unsuccessful_validation = The following values did not pass validation. right_description = Right Description left_description = Left Description description = Description @@ -114,5 +116,4 @@ followup = Follow-up interpolation = Interpolation validation_rule = Validation rule -the_following_values_are_outliers = The following values are considered as outliers (min-max or std dev). no_outlier_values_found = No outlier values found. \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/validationResult.vm' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/validationResult.vm 2010-01-29 17:10:33 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/validationResult.vm 2010-03-15 12:08:51 +0000 @@ -1,9 +1,13 @@

$encoder.htmlEncode( $i18n.getString( "validation_result" ) )

-#if( $results.size() == 0) +#if( $results.size() == 0 && $dataValues.size() == 0 )

$encoder.htmlEncode( $i18n.getString( "successful_validation" ) )

#else

$encoder.htmlEncode( $i18n.getString( "unsuccessful_validation" ) )

+#end + +#if( $results.size() > 0) +

$encoder.htmlEncode( $i18n.getString( "the_following_values_violates_rules" ) )

@@ -34,14 +38,10 @@ #set( $mark = true ) #end #end -
$encoder.htmlEncode( $i18n.getString( "validation_rule" ) )
+
#end -
- -#if( $dataValues.size() == 0 ) -

$encoder.htmlEncode( $i18n.getString( "no_outlier_values_found" ) )

-#else +#if( $dataValues.size() > 0 )

$encoder.htmlEncode( $i18n.getString( "the_following_values_are_outliers" ) )