dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #03844
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1278: Generalised outlier analysis service layer, will reuse for gap analysis.
------------------------------------------------------------
revno: 1278
committer: Lars Helge Oeverland <larshelge@xxxxxxxxx>
branch nick: trunk
timestamp: Wed 2009-12-23 18:34:18 +0100
message:
Generalised outlier analysis service layer, will reuse for gap analysis.
removed:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/outlieranalysis/
dhis-2/dhis-api/src/main/java/org/hisp/dhis/outlieranalysis/OutlierAnalysisService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/outlieranalysis/OutlierAnalysisStore.java
added:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataanalysis/
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataanalysis/DataAnalysisService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataanalysis/DataAnalysisStore.java
renamed:
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/outlieranalysis/ => dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/outlieranalysis/jdbc/JdbcOutlierAnalysisStore.java => dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/jdbc/JdbcDataAnalysisStore.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/outlieranalysis/ => dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataanalysis/
modified:
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/MinMaxOutlierAnalysisService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/MinMaxValueMap.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/StdDevOutlierAnalysisService.java
dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataanalysis/MinMaxOutlierAnalysisServiceTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataanalysis/StdDevOutlierAnalysisServiceTest.java
dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/outlieranalysis/GetOutliersAction.java
dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/jdbc/JdbcDataAnalysisStore.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.
=== added directory 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataanalysis'
=== added file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataanalysis/DataAnalysisService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataanalysis/DataAnalysisService.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataanalysis/DataAnalysisService.java 2009-12-23 17:34:18 +0000
@@ -0,0 +1,47 @@
+package org.hisp.dhis.dataanalysis;
+
+/*
+ * Copyright (c) 2004-2009, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import java.util.Collection;
+
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.datavalue.DeflatedDataValue;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.period.Period;
+
+/**
+ * @author Dag Haavi Finstad
+ * @version $Id: StdDevOutlierAnalysisService.java 882 2009-05-14 23:09:31Z daghf $
+ */
+public interface DataAnalysisService
+{
+ String ID = DataAnalysisService.class.getName();
+
+ Collection<DeflatedDataValue> analyse( OrganisationUnit organisationUnit, Collection<DataElement> dataElements,
+ Collection<Period> periods, Double stdDevFactor );
+}
=== added file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataanalysis/DataAnalysisStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataanalysis/DataAnalysisStore.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataanalysis/DataAnalysisStore.java 2009-12-23 17:34:18 +0000
@@ -0,0 +1,50 @@
+package org.hisp.dhis.dataanalysis;
+
+/*
+ * Copyright (c) 2004-${year}, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import java.util.Collection;
+
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
+import org.hisp.dhis.datavalue.DeflatedDataValue;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.period.Period;
+import org.hisp.dhis.period.PeriodType;
+
+/**
+ * @author Lars Helge Overland
+ */
+public interface DataAnalysisStore
+{
+ Double getStandardDeviation( DataElement dataElement, DataElementCategoryOptionCombo categoryOptionCombo, OrganisationUnit organisationUnit );
+
+ Double getAverage( DataElement dataElement, DataElementCategoryOptionCombo categoryOptionCombo, OrganisationUnit organisationUnit );
+
+ Collection<DeflatedDataValue> getDeflatedDataValues( DataElement dataElement, DataElementCategoryOptionCombo categoryOptionCombo,
+ Collection<Period> periods, OrganisationUnit organisationUnit, PeriodType periodType, int lowerBound, int upperBound );
+}
=== removed directory 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/outlieranalysis'
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/outlieranalysis/OutlierAnalysisService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/outlieranalysis/OutlierAnalysisService.java 2009-12-23 12:09:02 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/outlieranalysis/OutlierAnalysisService.java 1970-01-01 00:00:00 +0000
@@ -1,66 +0,0 @@
-package org.hisp.dhis.outlieranalysis;
-
-/*
- * Copyright (c) 2004-2009, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Collection;
-
-import org.hisp.dhis.dataelement.DataElement;
-import org.hisp.dhis.datavalue.DeflatedDataValue;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.period.Period;
-
-
-/**
- * Defines service functionality for finding outlier DataValues.
- *
- * @author Dag Haavi Finstad
- * @version $Id: StdDevOutlierAnalysisService.java 882 2009-05-14 23:09:31Z daghf $
- *
- */
-public interface OutlierAnalysisService
-{
- String ID = OutlierAnalysisService.class.getName();
-
- /**
- * Finds possible outliers for a collection of sources, dataelements and periods.
- *
- * Checks for every combination in the cartesian product of sources,
- * dataelements and periods if the corresponding datavalues are possible
- * outliers.
- *
- * @param organisationUnits The organisation units.
- * @param dataElement The DataElement.
- * @param period The period.
- * @param stdDevFactor The standard deviation factor.
- * @return A collection of OutlierValue objects. If no values were found, an
- * empty collection is returned.
- */
- Collection<DeflatedDataValue> findOutliers( OrganisationUnit organisationUnit, Collection<DataElement> dataElements,
- Collection<Period> periods, Double stdDevFactor );
-
-}
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/outlieranalysis/OutlierAnalysisStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/outlieranalysis/OutlierAnalysisStore.java 2009-12-23 17:00:56 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/outlieranalysis/OutlierAnalysisStore.java 1970-01-01 00:00:00 +0000
@@ -1,50 +0,0 @@
-package org.hisp.dhis.outlieranalysis;
-
-/*
- * Copyright (c) 2004-${year}, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Collection;
-
-import org.hisp.dhis.dataelement.DataElement;
-import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
-import org.hisp.dhis.datavalue.DeflatedDataValue;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.period.Period;
-import org.hisp.dhis.period.PeriodType;
-
-/**
- * @author Lars Helge Overland
- */
-public interface OutlierAnalysisStore
-{
- Double getStandardDeviation( DataElement dataElement, DataElementCategoryOptionCombo categoryOptionCombo, OrganisationUnit organisationUnit );
-
- Double getAverage( DataElement dataElement, DataElementCategoryOptionCombo categoryOptionCombo, OrganisationUnit organisationUnit );
-
- Collection<DeflatedDataValue> getDeflatedDataValues( DataElement dataElement, DataElementCategoryOptionCombo categoryOptionCombo,
- Collection<Period> periods, OrganisationUnit organisationUnit, PeriodType periodType, int lowerBound, int upperBound );
-}
=== renamed directory 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/outlieranalysis' => 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis'
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/MinMaxOutlierAnalysisService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/outlieranalysis/MinMaxOutlierAnalysisService.java 2009-12-23 17:00:56 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/MinMaxOutlierAnalysisService.java 2009-12-23 17:34:18 +0000
@@ -1,4 +1,4 @@
-package org.hisp.dhis.outlieranalysis;
+package org.hisp.dhis.dataanalysis;
/*
* Copyright (c) 2004-${year}, University of Oslo
@@ -44,7 +44,7 @@
* @author Lars Helge Overland
*/
public class MinMaxOutlierAnalysisService
- implements OutlierAnalysisService
+ implements DataAnalysisService
{
// -------------------------------------------------------------------------
// Dependencies
@@ -64,18 +64,18 @@
this.organisationUnitService = organisationUnitService;
}
- private OutlierAnalysisStore outlierAnalysisStore;
+ private DataAnalysisStore dataAnalysisStore;
- public void setOutlierAnalysisStore( OutlierAnalysisStore outlierAnalysisStore )
+ public void setDataAnalysisStore( DataAnalysisStore dataAnalysisStore )
{
- this.outlierAnalysisStore = outlierAnalysisStore;
+ this.dataAnalysisStore = dataAnalysisStore;
}
-
+
// -------------------------------------------------------------------------
// MinMaxOutlierAnalysisService implementation
// -------------------------------------------------------------------------
- public final Collection<DeflatedDataValue> findOutliers( OrganisationUnit organisationUnit,
+ public final Collection<DeflatedDataValue> analyse( OrganisationUnit organisationUnit,
Collection<DataElement> dataElements, Collection<Period> periods, Double stdDevFactor )
{
Collection<OrganisationUnit> units = organisationUnitService.getOrganisationUnitWithChildren( organisationUnit.getId() );
@@ -114,7 +114,7 @@
if ( minMaxDataElement != null )
{
- return outlierAnalysisStore.getDeflatedDataValues( dataElement, categoryOptionCombo, periods,
+ return dataAnalysisStore.getDeflatedDataValues( dataElement, categoryOptionCombo, periods,
organisationUnit, dataElement.getPeriodType(), minMaxDataElement.getMin(), minMaxDataElement.getMax() );
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/MinMaxValueMap.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/outlieranalysis/MinMaxValueMap.java 2009-12-23 12:54:35 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/MinMaxValueMap.java 2009-12-23 17:34:18 +0000
@@ -1,4 +1,4 @@
-package org.hisp.dhis.outlieranalysis;
+package org.hisp.dhis.dataanalysis;
/*
* Copyright (c) 2004-${year}, University of Oslo
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/StdDevOutlierAnalysisService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/outlieranalysis/StdDevOutlierAnalysisService.java 2009-12-23 17:00:56 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/StdDevOutlierAnalysisService.java 2009-12-23 17:34:18 +0000
@@ -1,4 +1,4 @@
-package org.hisp.dhis.outlieranalysis;
+package org.hisp.dhis.dataanalysis;
/*
* Copyright (c) 2004-${year}, University of Oslo
@@ -44,17 +44,17 @@
* @author Lars Helge Overland
*/
public class StdDevOutlierAnalysisService
- implements OutlierAnalysisService
+ implements DataAnalysisService
{
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
- private OutlierAnalysisStore outlierAnalysisStore;
+ private DataAnalysisStore dataAnalysisStore;
- public void setOutlierAnalysisStore( OutlierAnalysisStore outlierAnalysisStore )
+ public void setDataAnalysisStore( DataAnalysisStore dataAnalysisStore )
{
- this.outlierAnalysisStore = outlierAnalysisStore;
+ this.dataAnalysisStore = dataAnalysisStore;
}
private OrganisationUnitService organisationUnitService;
@@ -68,7 +68,7 @@
// OutlierAnalysisService implementation
// -------------------------------------------------------------------------
- public final Collection<DeflatedDataValue> findOutliers( OrganisationUnit organisationUnit,
+ public final Collection<DeflatedDataValue> analyse( OrganisationUnit organisationUnit,
Collection<DataElement> dataElements, Collection<Period> periods, Double stdDevFactor )
{
Collection<OrganisationUnit> units = organisationUnitService.getOrganisationUnitWithChildren( organisationUnit.getId() );
@@ -101,17 +101,17 @@
private Collection<DeflatedDataValue> findOutliers( OrganisationUnit organisationUnit, DataElement dataElement,
DataElementCategoryOptionCombo categoryOptionCombo, Collection<Period> periods, Double stdDevFactor )
{
- Double stdDev = outlierAnalysisStore.getStandardDeviation( dataElement, categoryOptionCombo, organisationUnit );
+ Double stdDev = dataAnalysisStore.getStandardDeviation( dataElement, categoryOptionCombo, organisationUnit );
if ( !isEqual( stdDev, 0.0 ) ) // No values found or no outliers exist when 0.0
{
- Double avg = outlierAnalysisStore.getAverage( dataElement, categoryOptionCombo, organisationUnit );
+ Double avg = dataAnalysisStore.getAverage( dataElement, categoryOptionCombo, organisationUnit );
double deviation = stdDev * stdDevFactor;
Double lowerBound = avg - deviation;
Double upperBound = avg + deviation;
- return outlierAnalysisStore.getDeflatedDataValues( dataElement, categoryOptionCombo, periods,
+ return dataAnalysisStore.getDeflatedDataValues( dataElement, categoryOptionCombo, periods,
organisationUnit, dataElement.getPeriodType(), lowerBound.intValue(), upperBound.intValue() );
}
=== renamed file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/outlieranalysis/jdbc/JdbcOutlierAnalysisStore.java' => 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/jdbc/JdbcDataAnalysisStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/outlieranalysis/jdbc/JdbcOutlierAnalysisStore.java 2009-12-23 17:00:56 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/jdbc/JdbcDataAnalysisStore.java 2009-12-23 17:34:18 +0000
@@ -1,4 +1,4 @@
-package org.hisp.dhis.outlieranalysis.jdbc;
+package org.hisp.dhis.dataanalysis.jdbc;
/*
* Copyright (c) 2004-${year}, University of Oslo
@@ -34,12 +34,12 @@
import org.amplecode.quick.StatementHolder;
import org.amplecode.quick.StatementManager;
import org.amplecode.quick.mapper.ObjectMapper;
+import org.hisp.dhis.dataanalysis.DataAnalysisStore;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
import org.hisp.dhis.datavalue.DeflatedDataValue;
import org.hisp.dhis.jdbc.StatementBuilder;
import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.outlieranalysis.OutlierAnalysisStore;
import org.hisp.dhis.period.Period;
import org.hisp.dhis.period.PeriodType;
import org.hisp.dhis.system.objectmapper.DeflatedDataValueNameMinMaxRowMapper;
@@ -49,8 +49,8 @@
/**
* @author Lars Helge Overland
*/
-public class JdbcOutlierAnalysisStore
- implements OutlierAnalysisStore
+public class JdbcDataAnalysisStore
+ implements DataAnalysisStore
{
// -------------------------------------------------------------------------
// Dependencies
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml 2009-12-23 12:54:35 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml 2009-12-23 17:34:18 +0000
@@ -169,8 +169,8 @@
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
- <bean id="org.hisp.dhis.outlieranalysis.jdbc.OutlierAnalysisStore"
- class="org.hisp.dhis.outlieranalysis.jdbc.JdbcOutlierAnalysisStore">
+ <bean id="org.hisp.dhis.dataanalysis.jdbc.DataAnalysisStore"
+ class="org.hisp.dhis.dataanalysis.jdbc.JdbcDataAnalysisStore">
<property name="statementManager" ref="statementManager"/>
<property name="statementBuilder" ref="statementBuilder"/>
</bean>
@@ -323,22 +323,22 @@
ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetStore"/>
</bean>
- <bean id="org.hisp.dhis.outlieranalysis.StdDevOutlierAnalysisService"
- class="org.hisp.dhis.outlieranalysis.StdDevOutlierAnalysisService">
+ <bean id="org.hisp.dhis.dataanalysis.StdDevOutlierAnalysisService"
+ class="org.hisp.dhis.dataanalysis.StdDevOutlierAnalysisService">
<property name="organisationUnitService"
ref="org.hisp.dhis.organisationunit.OrganisationUnitService"/>
- <property name="outlierAnalysisStore"
- ref="org.hisp.dhis.outlieranalysis.jdbc.OutlierAnalysisStore"/>
+ <property name="dataAnalysisStore"
+ ref="org.hisp.dhis.dataanalysis.jdbc.DataAnalysisStore"/>
</bean>
- <bean id="org.hisp.dhis.outlieranalysis.MinMaxOutlierAnalysisService"
- class="org.hisp.dhis.outlieranalysis.MinMaxOutlierAnalysisService">
+ <bean id="org.hisp.dhis.dataanalysis.MinMaxOutlierAnalysisService"
+ class="org.hisp.dhis.dataanalysis.MinMaxOutlierAnalysisService">
<property name="organisationUnitService"
ref="org.hisp.dhis.organisationunit.OrganisationUnitService"/>
<property name="minMaxDataElementService"
ref="org.hisp.dhis.minmax.MinMaxDataElementService" />
- <property name="outlierAnalysisStore"
- ref="org.hisp.dhis.outlieranalysis.jdbc.OutlierAnalysisStore"/>
+ <property name="dataAnalysisStore"
+ ref="org.hisp.dhis.dataanalysis.jdbc.DataAnalysisStore"/>
</bean>
<!-- Startup routine definitions -->
@@ -616,7 +616,7 @@
<aop:aspect ref="statementInterceptor">
<aop:around pointcut="execution( * org.hisp.dhis.validation.ValidationRuleService.validate(..) )" method="intercept"/>
- <aop:around pointcut="execution( * org.hisp.dhis.outlieranalysis.OutlierAnalysisService.findOutliers(..) )" method="intercept"/>
+ <aop:around pointcut="execution( * org.hisp.dhis.dataanalysis.DataAnalysisService.analyse(..) )" method="intercept"/>
</aop:aspect>
<!--
=== renamed directory 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/outlieranalysis' => 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataanalysis'
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataanalysis/MinMaxOutlierAnalysisServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/outlieranalysis/MinMaxOutlierAnalysisServiceTest.java 2009-12-23 12:54:35 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataanalysis/MinMaxOutlierAnalysisServiceTest.java 2009-12-23 17:34:18 +0000
@@ -1,4 +1,4 @@
-package org.hisp.dhis.outlieranalysis;
+package org.hisp.dhis.dataanalysis;
/*
* Copyright (c) 2004-2007, University of Oslo
@@ -27,8 +27,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import static junit.framework.Assert.assertEquals;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
@@ -43,7 +41,6 @@
import org.hisp.dhis.dataset.DataSetService;
import org.hisp.dhis.datavalue.DataValue;
import org.hisp.dhis.datavalue.DataValueService;
-import org.hisp.dhis.datavalue.DeflatedDataValue;
import org.hisp.dhis.minmax.MinMaxDataElement;
import org.hisp.dhis.minmax.MinMaxDataElementService;
import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -61,7 +58,7 @@
public class MinMaxOutlierAnalysisServiceTest
extends DhisTest
{
- private OutlierAnalysisService minMaxOutlierAnalysisService;
+ private DataAnalysisService minMaxOutlierAnalysisService;
private MinMaxDataElementService minMaxDataElementService;
@@ -104,7 +101,7 @@
public void setUpTest()
throws Exception
{
- minMaxOutlierAnalysisService = (OutlierAnalysisService) getBean( "org.hisp.dhis.outlieranalysis.MinMaxOutlierAnalysisService" );
+ minMaxOutlierAnalysisService = (DataAnalysisService) getBean( "org.hisp.dhis.dataanalysis.MinMaxOutlierAnalysisService" );
dataElementService = (DataElementService) getBean( DataElementService.ID );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataanalysis/StdDevOutlierAnalysisServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/outlieranalysis/StdDevOutlierAnalysisServiceTest.java 2009-12-23 12:54:35 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataanalysis/StdDevOutlierAnalysisServiceTest.java 2009-12-23 17:34:18 +0000
@@ -1,4 +1,4 @@
-package org.hisp.dhis.outlieranalysis;
+package org.hisp.dhis.dataanalysis;
/*
* Copyright (c) 2004-2007, University of Oslo
@@ -27,8 +27,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import static junit.framework.Assert.assertEquals;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
@@ -43,7 +41,6 @@
import org.hisp.dhis.dataset.DataSetService;
import org.hisp.dhis.datavalue.DataValue;
import org.hisp.dhis.datavalue.DataValueService;
-import org.hisp.dhis.datavalue.DeflatedDataValue;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.organisationunit.OrganisationUnitService;
import org.hisp.dhis.period.MonthlyPeriodType;
@@ -59,7 +56,7 @@
public class StdDevOutlierAnalysisServiceTest
extends DhisTest
{
- private OutlierAnalysisService stdDevOutlierAnalysisService;
+ private DataAnalysisService stdDevOutlierAnalysisService;
private DataElement dataElementA;
private DataElement dataElementB;
@@ -95,7 +92,7 @@
@Override
public void setUpTest()
{
- stdDevOutlierAnalysisService = (OutlierAnalysisService) getBean( "org.hisp.dhis.outlieranalysis.StdDevOutlierAnalysisService" );
+ stdDevOutlierAnalysisService = (DataAnalysisService) getBean( "org.hisp.dhis.dataanalysis.StdDevOutlierAnalysisService" );
dataElementService = (DataElementService) getBean( DataElementService.ID );
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/outlieranalysis/GetOutliersAction.java'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/outlieranalysis/GetOutliersAction.java 2009-12-23 13:24:39 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/outlieranalysis/GetOutliersAction.java 2009-12-23 17:34:18 +0000
@@ -31,6 +31,7 @@
import java.util.Date;
import java.util.List;
+import org.hisp.dhis.dataanalysis.DataAnalysisService;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementService;
import org.hisp.dhis.dataset.DataSet;
@@ -39,7 +40,6 @@
import org.hisp.dhis.i18n.I18nFormat;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.oust.manager.SelectionTreeManager;
-import org.hisp.dhis.outlieranalysis.OutlierAnalysisService;
import org.hisp.dhis.period.Period;
import org.hisp.dhis.period.PeriodService;
import org.hisp.dhis.system.util.ConversionUtils;
@@ -63,16 +63,16 @@
// Dependencies
// -------------------------------------------------------------------------
- private OutlierAnalysisService minMaxOutlierAnalysisService;
+ private DataAnalysisService minMaxOutlierAnalysisService;
- public void setMinMaxOutlierAnalysisService( OutlierAnalysisService minMaxOutlierAnalysisService )
+ public void setMinMaxOutlierAnalysisService( DataAnalysisService minMaxOutlierAnalysisService )
{
this.minMaxOutlierAnalysisService = minMaxOutlierAnalysisService;
}
- private OutlierAnalysisService stdDevOutlierAnalysisService;
+ private DataAnalysisService stdDevOutlierAnalysisService;
- public void setStdDevOutlierAnalysisService( OutlierAnalysisService stdDevOutlierAnalysisService )
+ public void setStdDevOutlierAnalysisService( DataAnalysisService stdDevOutlierAnalysisService )
{
this.stdDevOutlierAnalysisService = stdDevOutlierAnalysisService;
}
@@ -207,11 +207,11 @@
if ( outlierType.equals( TYPE_MINMAX ) )
{
- dataValues = minMaxOutlierAnalysisService.findOutliers( organisationUnit, dataElements, periods, null );
+ dataValues = minMaxOutlierAnalysisService.analyse( organisationUnit, dataElements, periods, null );
}
else if ( outlierType.equals( TYPE_STDDEV ) )
{
- dataValues = stdDevOutlierAnalysisService.findOutliers( organisationUnit, dataElements, periods, standardDeviation );
+ dataValues = stdDevOutlierAnalysisService.analyse( organisationUnit, dataElements, periods, standardDeviation );
}
else
{
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/META-INF/dhis/beans.xml 2009-12-23 14:17:58 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/META-INF/dhis/beans.xml 2009-12-23 17:34:18 +0000
@@ -251,9 +251,9 @@
class="org.hisp.dhis.validationrule.action.outlieranalysis.GetOutliersAction"
scope="prototype">
<property name="minMaxOutlierAnalysisService"
- ref="org.hisp.dhis.outlieranalysis.MinMaxOutlierAnalysisService" />
+ ref="org.hisp.dhis.dataanalysis.MinMaxOutlierAnalysisService" />
<property name="stdDevOutlierAnalysisService"
- ref="org.hisp.dhis.outlieranalysis.StdDevOutlierAnalysisService" />
+ ref="org.hisp.dhis.dataanalysis.StdDevOutlierAnalysisService" />
<property name="dataElementService"
ref="org.hisp.dhis.dataelement.DataElementService" />
<property name="selectionTreeManager"