dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #15480
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5625: (mobile) proper min/max validation for section in dataEntry
------------------------------------------------------------
revno: 5625
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-12-27 14:06:26 +0100
message:
(mobile) proper min/max validation for section in dataEntry
modified:
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetSectionFormAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/utils/FormUtils.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-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetSectionFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetSectionFormAction.java 2011-12-27 12:16:47 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetSectionFormAction.java 2011-12-27 13:06:26 +0000
@@ -210,8 +210,6 @@
dataValues = formUtils.getDataValueMap( organisationUnit, dataSet, period );
- validationViolations = formUtils.getValidationViolations( organisationUnit, dataSet, period );
-
validationRuleViolations = formUtils.getValidationRuleViolations( organisationUnit, dataSet, period );
if ( dataSet.getDataSetType().equals( DataSet.TYPE_SECTION ) )
@@ -237,8 +235,11 @@
name = "Default";
dataElements = new ArrayList<DataElement>( dataSet.getDataElements() );
Collections.sort( dataElements, new IdentifiableObjectNameComparator() );
+
}
+ validationViolations = formUtils.getValidationViolations( organisationUnit, dataElements, period );
+
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java 2011-12-27 12:16:47 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java 2011-12-27 13:06:26 +0000
@@ -452,7 +452,7 @@
dataValues = formUtils.getDataValueMap( organisationUnit, dataSet, period );
- validationViolations = formUtils.getValidationViolations( organisationUnit, dataSet, period );
+ validationViolations = formUtils.getValidationViolations( organisationUnit, dataElements, period );
validationRuleViolations = formUtils.getValidationRuleViolations( organisationUnit, dataSet, period );
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/utils/FormUtils.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/utils/FormUtils.java 2011-12-27 12:51:59 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/utils/FormUtils.java 2011-12-27 13:06:26 +0000
@@ -124,15 +124,13 @@
// -------------------------------------------------------------------------
@SuppressWarnings( "unchecked" )
- public Map<String, DeflatedDataValue> getValidationViolations( OrganisationUnit organisationUnit, DataSet dataSet,
+ public Map<String, DeflatedDataValue> getValidationViolations( OrganisationUnit organisationUnit, Collection<DataElement> dataElements,
Period period )
{
Map<String, DeflatedDataValue> validationErrorMap = new HashMap<String, DeflatedDataValue>();
- Collection<MinMaxDataElement> minmaxs = minMaxDataElementService.getMinMaxDataElements( organisationUnit,
- dataSet.getDataElements() );
-
- Collection<DeflatedDataValue> deflatedDataValues = new HashSet<DeflatedDataValue>();
+ Collection<MinMaxDataElement> minmaxs = minMaxDataElementService.getMinMaxDataElements( organisationUnit, dataElements );
+ Collection<DeflatedDataValue> deflatedDataValues;
if ( minmaxs == null )
{
@@ -140,10 +138,10 @@
SystemSettingManager.KEY_FACTOR_OF_DEVIATION, 2.0 );
Collection<DeflatedDataValue> stdDevs = stdDevOutlierAnalysisService.analyse( organisationUnit,
- dataSet.getDataElements(), ListUtils.getCollection( period ), factor );
+ dataElements, ListUtils.getCollection( period ), factor );
Collection<DeflatedDataValue> minMaxs = minMaxOutlierAnalysisService.analyse( organisationUnit,
- dataSet.getDataElements(), ListUtils.getCollection( period ), null );
+ dataElements, ListUtils.getCollection( period ), null );
deflatedDataValues = CollectionUtils.union( stdDevs, minMaxs );
}