← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12761: Fix threshold for reducing validation outlier limits

 

------------------------------------------------------------
revno: 12761
committer: dhis2-c <dhis2@xxxxxxxxxxxxxx>
branch nick: trunk
timestamp: Thu 2013-10-17 00:03:14 -0400
message:
  Fix threshold for reducing validation outlier limits
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/ValidatorThread.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-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/ValidatorThread.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/ValidatorThread.java	2013-10-16 16:00:05 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/validation/ValidatorThread.java	2013-10-17 04:03:14 +0000
@@ -440,7 +440,7 @@
      * @param sampleValues sample values actually collected
      * @param annualSampleCount number of annual samples tried for
      * @param sequentialSampleCount number of sequential samples tried for
-     * @return
+     * @return average right-side sample value
      */
     Double rightSideAverage( ValidationRule rule, List<Double> sampleValues, int annualSampleCount,
         int sequentialSampleCount )
@@ -458,7 +458,7 @@
             int lowOutliers = rule.getLowOutliers() == null ? 0 : rule.getLowOutliers();
 
             // If fewer than the expected number of samples, then scale back
-            if ( highOutliers + lowOutliers > sampleValues.size() )
+            if ( sampleValues.size() < expectedSampleCount )
             {
                 highOutliers = (highOutliers * sampleValues.size()) / expectedSampleCount;
                 lowOutliers = (lowOutliers * sampleValues.size()) / expectedSampleCount;