dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #18274
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7644: Removed ratio data set completeness, not useful
------------------------------------------------------------
revno: 7644
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-07-20 09:04:42 +0200
message:
Removed ratio data set completeness, not useful
removed:
dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/completeness/impl/RatioDataSetCompletenessService.java
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementStore.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.java
dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/compulsory/GetCompulsoryDataElementsAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDataCompletenessForm.vm
--
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/DataElementService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java 2012-07-19 20:35:47 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java 2012-07-20 07:04:42 +0000
@@ -448,27 +448,4 @@
int getDataElementGroupSetCount();
int getDataElementGroupSetCountByName( String name );
-
- // -------------------------------------------------------------------------
- // DataElementOperand
- // -------------------------------------------------------------------------
-
- /**
- * Returns all Operands. Requires the categoryoptioncomboname resource table
- * to be populated.
- *
- * @return a collection of all Operands.
- */
- Collection<DataElementOperand> getAllGeneratedOperands();
-
- /**
- * Returns all generated permutations of Operands for the given collection
- * of DataElements. Requires the categoryoptioncomboname resource table to
- * be populated.
- *
- * @param dataElements the DataElements.
- * @return a collection of all Operands.
- */
- Collection<DataElementOperand> getAllGeneratedOperands( Collection<DataElement> dataElements );
-
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementStore.java 2012-07-19 20:35:47 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementStore.java 2012-07-20 07:04:42 +0000
@@ -157,25 +157,4 @@
Map<Integer, Set<Integer>> getDataElementCategoryOptionCombos();
Collection<DataElement> get( DataSet dataSet, String key, Integer max );
-
- // -------------------------------------------------------------------------
- // DataElementOperand
- // -------------------------------------------------------------------------
-
- /**
- * Returns all generated permutations of Operands. Requires the
- * categoryoptioncomboname resource table to be populated.
- *
- * @return a collection of all Operands.
- */
- Collection<DataElementOperand> getAllGeneratedOperands();
-
- /**
- * Returns all generated permutations of Operands for the given collection of
- * DataElements. Requires the categoryoptioncomboname resource table to be populated.
- *
- * @param dataElements the DataElements.
- * @return a collection of all Operands.
- */
- Collection<DataElementOperand> getAllGeneratedOperands( Collection<DataElement> dataElements );
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java 2012-07-19 20:35:47 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java 2012-07-20 07:04:42 +0000
@@ -574,19 +574,4 @@
{
return getObjectsBetweenByName( i18nService, dataElementGroupSetStore, name, first, max );
}
-
- // -------------------------------------------------------------------------
- // DataElementOperand
- // -------------------------------------------------------------------------
-
- public Collection<DataElementOperand> getAllGeneratedOperands()
- {
- return dataElementStore.getAllGeneratedOperands();
- }
-
- public Collection<DataElementOperand> getAllGeneratedOperands( Collection<DataElement> dataElements )
- {
- return dataElementStore.getAllGeneratedOperands( dataElements );
- }
-
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.java 2012-07-19 20:35:47 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.java 2012-07-20 07:04:42 +0000
@@ -35,8 +35,6 @@
import java.util.Map;
import java.util.Set;
-import org.amplecode.quick.StatementManager;
-import org.amplecode.quick.mapper.ObjectMapper;
import org.hibernate.Criteria;
import org.hibernate.Query;
import org.hibernate.Session;
@@ -44,12 +42,9 @@
import org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementCategoryCombo;
-import org.hisp.dhis.dataelement.DataElementOperand;
import org.hisp.dhis.dataelement.DataElementStore;
import org.hisp.dhis.dataset.DataSet;
-import org.hisp.dhis.system.objectmapper.DataElementOperandMapper;
import org.hisp.dhis.system.util.ConversionUtils;
-import org.hisp.dhis.system.util.TextUtils;
import org.springframework.jdbc.core.RowCallbackHandler;
/**
@@ -62,17 +57,6 @@
implements DataElementStore
{
// -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private StatementManager statementManager;
-
- public void setStatementManager( StatementManager statementManager )
- {
- this.statementManager = statementManager;
- }
-
- // -------------------------------------------------------------------------
// DataElement
// -------------------------------------------------------------------------
@@ -273,56 +257,4 @@
return query.list();
}
-
- // -------------------------------------------------------------------------
- // DataElementOperand
- // -------------------------------------------------------------------------
-
- public Collection<DataElementOperand> getAllGeneratedOperands()
- {
- final ObjectMapper<DataElementOperand> mapper = new ObjectMapper<DataElementOperand>();
-
- final String sql = "SELECT de.dataelementid, de.name, cocn.categoryoptioncomboid, cocn.categoryoptioncomboname "
- + "FROM dataelement as de "
- + "JOIN categorycombo as cc on de.categorycomboid=cc.categorycomboid "
- + "JOIN categorycombos_optioncombos as ccoc on cc.categorycomboid=ccoc.categorycomboid "
- + "LEFT JOIN _categoryoptioncomboname as cocn on ccoc.categoryoptioncomboid=cocn.categoryoptioncomboid;";
-
- try
- {
- ResultSet resultSet = statementManager.getHolder().getStatement().executeQuery( sql );
-
- return mapper.getCollection( resultSet, new DataElementOperandMapper() );
- }
- catch ( SQLException ex )
- {
- throw new RuntimeException( "Failed to get all operands", ex );
- }
- }
-
- public Collection<DataElementOperand> getAllGeneratedOperands( Collection<DataElement> dataElements )
- {
- final String dataElementString = TextUtils.getCommaDelimitedString( ConversionUtils.getIdentifiers(
- DataElement.class, dataElements ) );
-
- final ObjectMapper<DataElementOperand> mapper = new ObjectMapper<DataElementOperand>();
-
- final String sql = "SELECT de.dataelementid, de.name, cocn.categoryoptioncomboid, cocn.categoryoptioncomboname "
- + "FROM dataelement as de "
- + "JOIN categorycombo as cc on de.categorycomboid=cc.categorycomboid "
- + "JOIN categorycombos_optioncombos as ccoc on cc.categorycomboid=ccoc.categorycomboid "
- + "LEFT JOIN _categoryoptioncomboname as cocn on ccoc.categoryoptioncomboid=cocn.categoryoptioncomboid "
- + "WHERE de.dataelementid IN (" + dataElementString + ");";
-
- try
- {
- ResultSet resultSet = statementManager.getHolder().getStatement().executeQuery( sql );
-
- return mapper.getCollection( resultSet, new DataElementOperandMapper() );
- }
- catch ( SQLException ex )
- {
- throw new RuntimeException( "Failed to get all operands", ex );
- }
- }
}
=== 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 2012-07-15 16:51:06 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml 2012-07-20 07:04:42 +0000
@@ -29,7 +29,6 @@
<bean id="org.hisp.dhis.dataelement.DataElementStore" class="org.hisp.dhis.dataelement.hibernate.HibernateDataElementStore">
<property name="clazz" value="org.hisp.dhis.dataelement.DataElement" />
<property name="sessionFactory" ref="sessionFactory" />
- <property name="statementManager" ref="statementManager" />
<property name="jdbcTemplate" ref="jdbcTemplate" />
<property name="cacheable" value="true" />
</bean>
=== removed file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/completeness/impl/RatioDataSetCompletenessService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/completeness/impl/RatioDataSetCompletenessService.java 2012-03-16 16:49:58 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/completeness/impl/RatioDataSetCompletenessService.java 1970-01-01 00:00:00 +0000
@@ -1,64 +0,0 @@
-package org.hisp.dhis.completeness.impl;
-
-/*
- * Copyright (c) 2004-2012, 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.DataElementOperand;
-import org.hisp.dhis.dataset.DataSet;
-import org.hisp.dhis.period.Period;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class RatioDataSetCompletenessService
- extends AbstractDataSetCompletenessService
-{
- @Override
- public int getRegistrations( DataSet dataSet, Collection<Integer> relevantSources, Collection<Integer> periods )
- {
- return completenessStore.getNumberOfValues( dataSet, relevantSources, periods );
- }
-
- @Override
- public int getRegistrationsOnTime( DataSet dataSet, Collection<Integer> relevantSources, Collection<Integer> periods, int completenessOffset )
- {
- return completenessStore.getNumberOfValues( dataSet, relevantSources, periods );
- }
-
- @Override
- public int getSources( DataSet dataSet, Collection<Integer> relevantSources, Period period )
- {
- Collection<DataElementOperand> operands = dataElementService.getAllGeneratedOperands( dataSet.getDataElements() );
-
- // Number of operands in data set times number of organisation units times number of periods
-
- return operands != null && relevantSources != null ? ( operands.size() * relevantSources.size() * period.getPeriodSpan( dataSet.getPeriodType() ) ) : 0;
- }
-}
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml 2012-07-19 19:20:26 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml 2012-07-20 07:04:42 +0000
@@ -87,12 +87,6 @@
</key>
<ref bean="compulsoryDataCompletenessService" />
</entry>
- <entry>
- <key>
- <value>ratio</value>
- </key>
- <ref bean="ratioDataCompletenessService" />
- </entry>
</map>
</property>
</bean>
@@ -118,9 +112,6 @@
<property name="systemSettingManager" ref="org.hisp.dhis.setting.SystemSettingManager" />
</bean>
- <bean id="ratioDataCompletenessService" class="org.hisp.dhis.completeness.impl.RatioDataSetCompletenessService"
- parent="compulsoryDataCompletenessService" />
-
<bean id="registrationDataCompletenessService" class="org.hisp.dhis.completeness.impl.RegistrationDataSetCompletenessService"
parent="compulsoryDataCompletenessService">
</bean>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/compulsory/GetCompulsoryDataElementsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/compulsory/GetCompulsoryDataElementsAction.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/compulsory/GetCompulsoryDataElementsAction.java 2012-07-20 07:04:42 +0000
@@ -32,8 +32,8 @@
import java.util.Iterator;
import java.util.List;
+import org.hisp.dhis.dataelement.DataElementCategoryService;
import org.hisp.dhis.dataelement.DataElementOperand;
-import org.hisp.dhis.dataelement.DataElementService;
import org.hisp.dhis.dataelement.comparator.DataElementOperandNameComparator;
import org.hisp.dhis.dataset.DataSet;
import org.hisp.dhis.dataset.DataSetService;
@@ -57,11 +57,11 @@
this.dataSetService = dataSetService;
}
- private DataElementService dataElementService;
+ private DataElementCategoryService dataElementCategoryService;
- public void setDataElementService( DataElementService dataElementService )
+ public void setDataElementCategoryService( DataElementCategoryService dataElementCategoryService )
{
- this.dataElementService = dataElementService;
+ this.dataElementCategoryService = dataElementCategoryService;
}
// -------------------------------------------------------------------------
@@ -108,20 +108,18 @@
selectedOperands = new ArrayList<DataElementOperand>( dataSet.getCompulsoryDataElementOperands() );
- availableOperands = new ArrayList<DataElementOperand>( dataElementService.getAllGeneratedOperands( dataSet
+ availableOperands = new ArrayList<DataElementOperand>( dataElementCategoryService.getOperands( dataSet
.getDataElements() ) );
-
for ( DataElementOperand selectedOperand : selectedOperands )
{
- Iterator<DataElementOperand> iter = availableOperands.iterator();
+ Iterator<DataElementOperand> availableIter = availableOperands.iterator();
- while ( iter.hasNext() )
+ while ( availableIter.hasNext() )
{
- DataElementOperand item = iter.next();
- if ( selectedOperand.getPersistedId().equals( item.getOperandId() + "" ))
+ if ( selectedOperand.getPersistedId().equals( availableIter.next().getOperandId() ) )
{
- iter.remove();
+ availableIter.remove();
}
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/META-INF/dhis/beans.xml 2012-04-23 14:30:21 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/META-INF/dhis/beans.xml 2012-07-20 07:04:42 +0000
@@ -305,8 +305,8 @@
<property name="dataSetService">
<ref bean="org.hisp.dhis.dataset.DataSetService" />
</property>
- <property name="dataElementService">
- <ref bean="org.hisp.dhis.dataelement.DataElementService" />
+ <property name="dataElementCategoryService">
+ <ref bean="org.hisp.dhis.dataelement.DataElementCategoryService" />
</property>
</bean>
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDataCompletenessForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDataCompletenessForm.vm 2012-04-16 14:54:22 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDataCompletenessForm.vm 2012-07-20 07:04:42 +0000
@@ -25,9 +25,7 @@
<input type="radio" name="criteria" id="registrationRadio" value="registration" checked="checked"/>
<label for="registrationRadio">$i18n.getString( 'based_on_registration' )</label><br/>
<input type="radio" name="criteria" id="compulsoryRadio" value="compulsory" />
- <label for="compulsoryRadio">$i18n.getString( 'based_on_compulsory' )</label><br/>
- <input type="radio" name="criteria" id="ratioRadio" value="ratio" />
- <label for="ratioRadio">$i18n.getString( 'based_on_ratio' )</label><br/><br/>
+ <label for="compulsoryRadio">$i18n.getString( 'based_on_compulsory' )</label><br/><br/>
<!-- DataSet -->