dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #18563
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7865: local vn - Fixed bug - Sorted order in data entry hospital forms.
------------------------------------------------------------
revno: 7865
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-08-07 00:06:50 +0700
message:
local vn - Fixed bug - Sorted order in data entry hospital forms.
modified:
local/vn/dhis-service-vn/src/main/java/org/hisp/dhis/dataelement/DataElementFormNameComparator.java
local/vn/dhis-web-dataentry-hospital/src/main/java/org/hisp/dhis/de/action/LoadAttributeValuesAction.java
local/vn/dhis-web-dataentry-hospital/src/main/java/org/hisp/dhis/de/action/ValidationAction.java
local/vn/dhis-web-dataentry-hospital/src/main/resources/META-INF/dhis/beans.xml
local/vn/dhis-web-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/avgroup/action/GetAttributeValuesByChapterAction.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 'local/vn/dhis-service-vn/src/main/java/org/hisp/dhis/dataelement/DataElementFormNameComparator.java'
--- local/vn/dhis-service-vn/src/main/java/org/hisp/dhis/dataelement/DataElementFormNameComparator.java 2012-04-06 04:23:28 +0000
+++ local/vn/dhis-service-vn/src/main/java/org/hisp/dhis/dataelement/DataElementFormNameComparator.java 2012-08-06 17:06:50 +0000
@@ -31,17 +31,17 @@
/**
* @author Chau Thu Tran
- *
+ *
* @version $DataElementFormNameComparator.java Mar 29, 2012 11:26:55 AM$
*/
-public class DataElementFormNameComparator
-implements Comparator<DataElement>
+public class DataElementFormNameComparator
+ implements Comparator<DataElement>
{
public int compare( DataElement dataElement0, DataElement dataElement1 )
{
- String name0 = ( dataElement0.getFormName() != null && !dataElement0.getFormName().isEmpty() ) ? dataElement0.getFormName() : dataElement0.getName();
- String name1 = ( dataElement1.getFormName() != null && !dataElement1.getFormName().isEmpty() ) ? dataElement1.getFormName() : dataElement1.getName();
-
+ String name0 = dataElement0.getFormNameFallback();
+ String name1 = dataElement1.getFormNameFallback();
+
return name0.compareToIgnoreCase( name1 );
}
}
=== modified file 'local/vn/dhis-web-dataentry-hospital/src/main/java/org/hisp/dhis/de/action/LoadAttributeValuesAction.java'
--- local/vn/dhis-web-dataentry-hospital/src/main/java/org/hisp/dhis/de/action/LoadAttributeValuesAction.java 2012-07-23 15:46:02 +0000
+++ local/vn/dhis-web-dataentry-hospital/src/main/java/org/hisp/dhis/de/action/LoadAttributeValuesAction.java 2012-08-06 17:06:50 +0000
@@ -27,7 +27,9 @@
package org.hisp.dhis.de.action;
-import java.util.Collection;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
import org.hisp.dhis.attribute.LocalAttributeValueService;
import org.hisp.dhis.dataset.DataSet;
@@ -67,9 +69,9 @@
private Integer dataSetId;
- private Collection<String> values;
+ private List<String> values;
- public Collection<String> getValues()
+ public List<String> getValues()
{
return values;
}
@@ -89,7 +91,9 @@
{
DataSet dataset = dataSetService.getDataSet( dataSetId );
- values = localAttributeValueService.getValuesByDataSet( dataset );
+ values = new ArrayList<String>( localAttributeValueService.getValuesByDataSet( dataset ) );
+
+ Collections.sort( values );
return SUCCESS;
}
=== modified file 'local/vn/dhis-web-dataentry-hospital/src/main/java/org/hisp/dhis/de/action/ValidationAction.java'
--- local/vn/dhis-web-dataentry-hospital/src/main/java/org/hisp/dhis/de/action/ValidationAction.java 2012-05-03 02:23:12 +0000
+++ local/vn/dhis-web-dataentry-hospital/src/main/java/org/hisp/dhis/de/action/ValidationAction.java 2012-08-06 17:06:50 +0000
@@ -27,8 +27,15 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import com.opensymphony.xwork2.Action;
-import org.apache.commons.collections.CollectionUtils;
+import static org.hisp.dhis.system.util.ListUtils.getCollection;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hisp.dhis.dataanalysis.DataAnalysisService;
@@ -36,21 +43,16 @@
import org.hisp.dhis.dataset.DataSetService;
import org.hisp.dhis.datavalue.DeflatedDataValue;
import org.hisp.dhis.expression.ExpressionService;
-import org.hisp.dhis.minmax.MinMaxDataElement;
-import org.hisp.dhis.minmax.MinMaxDataElementService;
-import org.hisp.dhis.minmax.validation.MinMaxValuesGenerationService;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.organisationunit.OrganisationUnitService;
import org.hisp.dhis.period.Period;
import org.hisp.dhis.period.PeriodService;
import org.hisp.dhis.period.PeriodType;
-import org.hisp.dhis.setting.SystemSettingManager;
-import org.hisp.dhis.system.util.ListUtils;
import org.hisp.dhis.validation.ValidationResult;
import org.hisp.dhis.validation.ValidationRule;
import org.hisp.dhis.validation.ValidationRuleService;
-import java.util.*;
+import com.opensymphony.xwork2.Action;
/**
* @author Margrethe Store
@@ -86,13 +88,6 @@
this.periodService = periodService;
}
- private DataAnalysisService stdDevOutlierAnalysisService;
-
- public void setStdDevOutlierAnalysisService( DataAnalysisService stdDevOutlierAnalysisService )
- {
- this.stdDevOutlierAnalysisService = stdDevOutlierAnalysisService;
- }
-
private DataAnalysisService minMaxOutlierAnalysisService;
public void setMinMaxOutlierAnalysisService( DataAnalysisService minMaxOutlierAnalysisService )
@@ -100,27 +95,6 @@
this.minMaxOutlierAnalysisService = minMaxOutlierAnalysisService;
}
- private SystemSettingManager systemSettingManager;
-
- public void setSystemSettingManager( SystemSettingManager systemSettingManager )
- {
- this.systemSettingManager = systemSettingManager;
- }
-
- private MinMaxValuesGenerationService minMaxValuesGenerationService;
-
- public void setMinMaxValuesGenerationService( MinMaxValuesGenerationService minMaxValuesGenerationService )
- {
- this.minMaxValuesGenerationService = minMaxValuesGenerationService;
- }
-
- private MinMaxDataElementService minMaxDataElementService;
-
- public void setMinMaxDataElementService( MinMaxDataElementService minMaxDataElementService )
- {
- this.minMaxDataElementService = minMaxDataElementService;
- }
-
private DataSetService dataSetService;
public void setDataSetService( DataSetService dataSetService )
@@ -196,7 +170,6 @@
// Action implementation
// -------------------------------------------------------------------------
- @SuppressWarnings( "unchecked" )
public String execute()
throws Exception
{
@@ -215,28 +188,8 @@
// Min-max and outlier analysis
// ---------------------------------------------------------------------
- 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 );
-
- dataValues = CollectionUtils.union( stdDevs, minMaxs );
- }
- else
- {
- dataValues = minMaxValuesGenerationService.findOutliers( orgUnit, ListUtils.getCollection( period ),
- minmaxs );
- }
-
+ dataValues = minMaxOutlierAnalysisService.analyse( getCollection( orgUnit ), dataSet.getDataElements(), getCollection( period ), null );
+
log.debug( "Number of outlier values: " + dataValues.size() );
// ---------------------------------------------------------------------
=== modified file 'local/vn/dhis-web-dataentry-hospital/src/main/resources/META-INF/dhis/beans.xml'
--- local/vn/dhis-web-dataentry-hospital/src/main/resources/META-INF/dhis/beans.xml 2012-06-28 08:17:52 +0000
+++ local/vn/dhis-web-dataentry-hospital/src/main/resources/META-INF/dhis/beans.xml 2012-08-06 17:06:50 +0000
@@ -105,12 +105,7 @@
<property name="validationRuleService" ref="org.hisp.dhis.validation.ValidationRuleService" />
<property name="expressionService" ref="org.hisp.dhis.expression.ExpressionService" />
<property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
- <property name="stdDevOutlierAnalysisService" ref="org.hisp.dhis.dataanalysis.StdDevOutlierAnalysisService" />
<property name="minMaxOutlierAnalysisService" ref="org.hisp.dhis.dataanalysis.MinMaxOutlierAnalysisService" />
- <property name="minMaxValuesGenerationService"
- ref="org.hisp.dhis.minmax.validation.MinMaxValuesGenerationService" />
- <property name="minMaxDataElementService" ref="org.hisp.dhis.minmax.MinMaxDataElementService" />
- <property name="systemSettingManager" ref="org.hisp.dhis.setting.SystemSettingManager" />
<property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
<property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
</bean>
=== modified file 'local/vn/dhis-web-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/avgroup/action/GetAttributeValuesByChapterAction.java'
--- local/vn/dhis-web-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/avgroup/action/GetAttributeValuesByChapterAction.java 2012-07-06 19:43:15 +0000
+++ local/vn/dhis-web-spreadsheet-reporting/src/main/java/org/hisp/dhis/reportsheet/avgroup/action/GetAttributeValuesByChapterAction.java 2012-08-06 17:06:50 +0000
@@ -28,7 +28,8 @@
package org.hisp.dhis.reportsheet.avgroup.action;
import java.util.ArrayList;
-import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
import org.hisp.dhis.reportsheet.AttributeValueGroupOrder;
import org.hisp.dhis.reportsheet.AttributeValueGroupOrderService;
@@ -64,9 +65,9 @@
this.chapterId = chapterId;
}
- private Collection<String> values = new ArrayList<String>();
+ private List<String> values = new ArrayList<String>();
- public Collection<String> getValues()
+ public List<String> getValues()
{
return values;
}
@@ -86,6 +87,8 @@
values = group.getAttributeValues();
}
+ Collections.sort( values );
+
return SUCCESS;
}
}