dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #06510
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2076: Minor fix
------------------------------------------------------------
revno: 2076
committer: Lars <larshelg@larshelg-laptop>
branch nick: trunk
timestamp: Sun 2010-07-04 12:48:51 +0200
message:
Minor fix
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/MonthlyPeriodType.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/QuarterlyPeriodType.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/SixMonthlyPeriodType.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/TwoYearlyPeriodType.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/WeeklyPeriodType.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/YearlyPeriodType.java
dhis-2/dhis-services/dhis-service-aggregationengine-default/src/main/java/org/hisp/dhis/aggregation/impl/DefaultAggregationService.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-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java 2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java 2010-07-04 10:48:51 +0000
@@ -256,15 +256,6 @@
}
// -------------------------------------------------------------------------
- // Logic
- // -------------------------------------------------------------------------
-
- public boolean isZeroIsSignificant()
- {
- return zeroIsSignificant != null && zeroIsSignificant;
- }
-
- // -------------------------------------------------------------------------
// hashCode, equals and toString
// -------------------------------------------------------------------------
@@ -308,6 +299,14 @@
// -------------------------------------------------------------------------
/**
+ * Null-safe check.
+ */
+ public boolean isZeroIsSignificant()
+ {
+ return zeroIsSignificant != null && zeroIsSignificant;
+ }
+
+ /**
* Returns the PeriodType of the DataElement, based on the PeriodType of the
* DataSet which the DataElement is registered for.
*/
@@ -315,6 +314,17 @@
{
return dataSets != null && dataSets.size() > 0 ? dataSets.iterator().next().getPeriodType() : null;
}
+
+ /**
+ * Returns the frequency order for the PeriodType of this DataElement. If no
+ * PeriodType exists, 0 is returned.
+ */
+ public int getFrequencyOrder()
+ {
+ PeriodType periodType = getPeriodType();
+
+ return periodType != null ? periodType.getFrequencyOrder() : 0;
+ }
/**
* Tests whether a PeriodType can be defined for the DataElement, which
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/MonthlyPeriodType.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/MonthlyPeriodType.java 2010-06-14 15:51:12 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/MonthlyPeriodType.java 2010-07-04 10:48:51 +0000
@@ -84,7 +84,7 @@
@Override
public int getFrequencyOrder()
{
- return 3;
+ return 31;
}
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/QuarterlyPeriodType.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/QuarterlyPeriodType.java 2010-06-14 15:51:12 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/QuarterlyPeriodType.java 2010-07-04 10:48:51 +0000
@@ -86,7 +86,7 @@
@Override
public int getFrequencyOrder()
{
- return 4;
+ return 92;
}
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/SixMonthlyPeriodType.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/SixMonthlyPeriodType.java 2010-06-14 15:51:12 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/SixMonthlyPeriodType.java 2010-07-04 10:48:51 +0000
@@ -86,7 +86,7 @@
@Override
public int getFrequencyOrder()
{
- return 5;
+ return 182;
}
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/TwoYearlyPeriodType.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/TwoYearlyPeriodType.java 2010-06-14 15:51:12 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/TwoYearlyPeriodType.java 2010-07-04 10:48:51 +0000
@@ -86,7 +86,7 @@
@Override
public int getFrequencyOrder()
{
- return 7;
+ return 730;
}
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/WeeklyPeriodType.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/WeeklyPeriodType.java 2010-06-14 15:51:12 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/WeeklyPeriodType.java 2010-07-04 10:48:51 +0000
@@ -84,7 +84,7 @@
@Override
public int getFrequencyOrder()
{
- return 2;
+ return 7;
}
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/YearlyPeriodType.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/YearlyPeriodType.java 2010-06-14 15:51:12 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/YearlyPeriodType.java 2010-07-04 10:48:51 +0000
@@ -83,7 +83,7 @@
@Override
public int getFrequencyOrder()
{
- return 6;
+ return 365;
}
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-services/dhis-service-aggregationengine-default/src/main/java/org/hisp/dhis/aggregation/impl/DefaultAggregationService.java'
--- dhis-2/dhis-services/dhis-service-aggregationengine-default/src/main/java/org/hisp/dhis/aggregation/impl/DefaultAggregationService.java 2010-06-27 15:34:05 +0000
+++ dhis-2/dhis-services/dhis-service-aggregationengine-default/src/main/java/org/hisp/dhis/aggregation/impl/DefaultAggregationService.java 2010-07-04 10:48:51 +0000
@@ -38,6 +38,8 @@
import org.hisp.dhis.indicator.Indicator;
import org.hisp.dhis.organisationunit.OrganisationUnit;
+import static org.hisp.dhis.dataelement.DataElement.*;
+
/**
* @author Lars Helge Overland
* @version $Id: DefaultAggregationService.java 5116 2008-05-08 10:51:21Z larshelg $
@@ -137,23 +139,19 @@
private AbstractDataElementAggregation getInstance( String valueType, String aggregationOperator )
{
- if ( valueType.equals( DataElement.VALUE_TYPE_INT )
- && aggregationOperator.equals( DataElement.AGGREGATION_OPERATOR_SUM ) )
+ if ( valueType.equals( VALUE_TYPE_INT ) && aggregationOperator.equals( AGGREGATION_OPERATOR_SUM ) )
{
return sumIntDataElementAggregation;
}
- else if ( valueType.equals( DataElement.VALUE_TYPE_BOOL )
- && aggregationOperator.equals( DataElement.AGGREGATION_OPERATOR_SUM ) )
+ else if ( valueType.equals( VALUE_TYPE_BOOL ) && aggregationOperator.equals( AGGREGATION_OPERATOR_SUM ) )
{
return sumBoolDataElementAggregation;
}
- else if ( valueType.equals( DataElement.VALUE_TYPE_INT )
- && aggregationOperator.equals( DataElement.AGGREGATION_OPERATOR_AVERAGE ) )
+ else if ( valueType.equals( VALUE_TYPE_INT ) && aggregationOperator.equals( AGGREGATION_OPERATOR_AVERAGE ) )
{
return averageIntDataElementAggregation;
}
- else if ( valueType.equals( DataElement.VALUE_TYPE_BOOL )
- && aggregationOperator.equals( DataElement.AGGREGATION_OPERATOR_AVERAGE ) )
+ else if ( valueType.equals( VALUE_TYPE_BOOL ) && aggregationOperator.equals( AGGREGATION_OPERATOR_AVERAGE ) )
{
return averageBoolDataElementAggregation;
}