=== renamed file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/outlieranalysis/EditOutlierAction.java' => 'dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/EditDataValueAction.java' --- dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/outlieranalysis/EditOutlierAction.java 2009-11-25 16:25:53 +0000 +++ dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/EditDataValueAction.java 2009-12-23 13:24:39 +0000 @@ -1,4 +1,4 @@ -package org.hisp.dhis.validationrule.action.outlieranalysis; +package org.hisp.dhis.validationrule.action; /* * Copyright (c) 2004-${year}, University of Oslo @@ -27,6 +27,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.hisp.dhis.dataelement.DataElement; import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo; import org.hisp.dhis.dataelement.DataElementCategoryService; @@ -49,9 +51,11 @@ * @author Jon Moen Drange * */ -public class EditOutlierAction +public class EditDataValueAction implements Action { + private static final Log log = LogFactory.getLog( EditDataValueAction.class ); + // ------------------------------------------------------------------------- // Dependencies // ------------------------------------------------------------------------- @@ -203,6 +207,8 @@ statusCode = 0; message = ""; + log.info( "Updated data value: " + value ); + return SUCCESS; } } === 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 12:09:02 +0000 +++ 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 @@ -113,16 +113,11 @@ } // ------------------------------------------------------------------------- - // Input & Output + // Input // ------------------------------------------------------------------------- private String toDateString; - public String getToDate() - { - return toDateString; - } - public void setToDate( String toDate ) { this.toDateString = toDate.trim(); @@ -130,20 +125,11 @@ private String fromDateString; - public String getFromDate() - { - return fromDateString; - } - public void setFromDate( String fromDate ) { this.fromDateString = fromDate.trim(); } - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - private String dataSetId; public void setDataset( String dataSet ) @@ -176,18 +162,11 @@ // Output // ------------------------------------------------------------------------- - private Collection outlierValues; - - public Collection getOutlierValues() - { - return outlierValues; - } - - private long searchTime; - - public long getSearchTime() - { - return searchTime; + private Collection dataValues; + + public Collection getDataValues() + { + return dataValues; } // ------------------------------------------------------------------------- @@ -196,8 +175,6 @@ public String execute() { - long startTime = System.currentTimeMillis(); - Collection dataElements = dataElementService.getDataElements( ConversionUtils.getIntegerCollection( dataElementsById ) ); OrganisationUnit organisationUnit = selectionTreeManager.getSelectedOrganisationUnit(); @@ -211,7 +188,6 @@ { Date epoch = new Date( 0 ); fromDate = epoch; - fromDateString = "earliest"; } else { @@ -221,7 +197,6 @@ if ( toDateString == null || toDateString.trim().length() == 0 ) { toDate = new Date(); - toDateString = "now"; } else { @@ -232,19 +207,17 @@ if ( outlierType.equals( TYPE_MINMAX ) ) { - outlierValues = minMaxOutlierAnalysisService.findOutliers( organisationUnit, dataElements, periods, null ); + dataValues = minMaxOutlierAnalysisService.findOutliers( organisationUnit, dataElements, periods, null ); } else if ( outlierType.equals( TYPE_STDDEV ) ) { - outlierValues = stdDevOutlierAnalysisService.findOutliers( organisationUnit, dataElements, periods, standardDeviation ); + dataValues = stdDevOutlierAnalysisService.findOutliers( organisationUnit, dataElements, periods, standardDeviation ); } else { return ERROR; } - searchTime = System.currentTimeMillis() - startTime; - return SUCCESS; } } === 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 07:35:17 +0000 +++ dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/META-INF/dhis/beans.xml 2009-12-23 13:24:39 +0000 @@ -271,8 +271,8 @@ ref="org.hisp.dhis.dataset.DataSetService"/> - === modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/org/hisp/dhis/validationrule/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/org/hisp/dhis/validationrule/i18n_module.properties 2009-12-17 09:05:15 +0000 +++ dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/org/hisp/dhis/validationrule/i18n_module.properties 2009-12-23 13:24:39 +0000 @@ -134,8 +134,8 @@ waiting_for_user_to_choose_dataset = Waiting for user to select a data set select_parent_organisation_unit = Select parent organisation unit outlier_analysis = Outlier Analysis -outlier_analysis_search_result = Search result for outlier analysis -no_outlier_values_found = No outlier values found +search_result = Search result +no_values_found = No values found intro_validation_rule = Add, modify, view and delete validation rules. A validation rule defines certain criterias. Anomalies can be discovered by running validation rules against the data. intro_validation_rule_group = Add, modify, view and delete validation rule groups. Provides the ability to group and run validation rules together. intro_run_validation = Run validation rules in order to unveil anomalies and errors in the data in the database. === modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/struts.xml 2009-12-23 07:35:17 +0000 +++ dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/struts.xml 2009-12-23 13:24:39 +0000 @@ -211,12 +211,12 @@ /main.vm - /dhis-web-validationrule/outlierSearchResult.vm + /dhis-web-validationrule/searchResult.vm /dhis-web-validationrule/menu.vm - javascript/outlierAnalysisEditValue.js + javascript/editDataValue.js - + responseStatus.vm responseStatus.vm === renamed file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/outlierAnalysisEditValue.js' => 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/editDataValue.js' --- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/outlierAnalysisEditValue.js 2009-12-23 07:35:17 +0000 +++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/editDataValue.js 2009-12-23 13:24:39 +0000 @@ -1,21 +1,12 @@ -/** - * @author Jon Moen Drange - * - * Javascript file for outlier analysis web UI - update outlier value. - * Included in outlierSearchResult: updates a outlier value by sending - * AJAX requests to the server on-the-fly when an user has updated a - * outlier value. - * - */ -function editOutlierValue( outlierId ) +function editValue( valueId ) { - var field = document.getElementById( 'outlier[' + outlierId + '].value' ); + var field = document.getElementById( 'value[' + valueId + '].value' ); - var dataElementId = document.getElementById( 'outlier[' + outlierId + '].dataElement' ).value; - var categoryOptionComboId = document.getElementById( 'outlier[' + outlierId + '].categoryOptionCombo' ).value; - var periodId = document.getElementById( 'outlier[' + outlierId + '].period' ).value; - var sourceId = document.getElementById( 'outlier[' + outlierId + '].source' ).value; + var dataElementId = document.getElementById( 'value[' + valueId + '].dataElement' ).value; + var categoryOptionComboId = document.getElementById( 'value[' + valueId + '].categoryOptionCombo' ).value; + var periodId = document.getElementById( 'value[' + valueId + '].period' ).value; + var sourceId = document.getElementById( 'value[' + valueId + '].source' ).value; if ( field.value != '' ) { @@ -30,8 +21,8 @@ } else { - var minString = document.getElementById('outlier[' + outlierId + '].min').value; - var maxString = document.getElementById('outlier[' + outlierId + '].max').value; + var minString = document.getElementById('value[' + valueId + '].min').value; + var maxString = document.getElementById('value[' + valueId + '].max').value; var min = new Number( minString ); var max = new Number( maxString ); @@ -39,7 +30,7 @@ if ( value < min ) { - var valueSaver = new ValueSaver( dataElementId, periodId, sourceId, categoryOptionComboId, field.value, outlierId, '#ffcccc' ); + var valueSaver = new ValueSaver( dataElementId, periodId, sourceId, categoryOptionComboId, field.value, valueId, '#ffcccc' ); valueSaver.save(); alert( "Value is still lower than the lower boundary." ); @@ -48,7 +39,7 @@ if ( value > max ) { - var valueSaver = new ValueSaver( dataElementId, periodId, sourceId, categoryOptionComboId, field.value, outlierId, '#ffcccc' ); + var valueSaver = new ValueSaver( dataElementId, periodId, sourceId, categoryOptionComboId, field.value, valueId, '#ffcccc' ); valueSaver.save(); alert( "Value is still higher than the upper boundary." ); @@ -57,7 +48,7 @@ } } - var valueSaver = new ValueSaver( dataElementId, periodId, sourceId, categoryOptionComboId, field.value, outlierId, '#ccffcc', ''); + var valueSaver = new ValueSaver( dataElementId, periodId, sourceId, categoryOptionComboId, field.value, valueId, '#ccffcc', ''); valueSaver.save(); } @@ -79,7 +70,7 @@ // Saver object (modified version of dataentry/javascript/general.js) //----------------------------------------------------------------------------- -function ValueSaver( dataElementId_, periodId_, sourceId_, categoryOptionComboId_, value_, outlierId_, resultColor_, selectedOption_ ) +function ValueSaver( dataElementId_, periodId_, sourceId_, categoryOptionComboId_, value_, valueId_, resultColor_, selectedOption_ ) { var SUCCESS = '#ccffcc'; var ERROR = '#ccccff'; @@ -89,7 +80,7 @@ var sourceId = sourceId_; var categoryOptionComboId = categoryOptionComboId_; var value = value_; - var outlierId = outlierId_; + var valueId = valueId_; var resultColor = resultColor_; var selecteOption = selectedOption_; @@ -99,7 +90,7 @@ request.setCallbackSuccess( handleResponse ); request.setCallbackError( handleHttpError ); request.setResponseTypeXML( 'status' ); - request.send( 'editOutlier.action?' + request.send( 'editDataValue.action?' + 'dataElementId=' + dataElementId + '&periodId=' + periodId + '&organisationUnitId=' + sourceId @@ -131,7 +122,7 @@ function markValue( color ) { - var element = document.getElementById( 'outlier[' + outlierId + '].value' ); + var element = document.getElementById( 'value[' + valueId + '].value' ); element.style.backgroundColor = color; } } === renamed file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/outlierSearchResult.vm' => 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/searchResult.vm' --- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/outlierSearchResult.vm 2009-12-23 12:09:02 +0000 +++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/searchResult.vm 2009-12-23 13:24:39 +0000 @@ -1,17 +1,13 @@ -

$i18n.getString( "outlier_analysis_search_result" )

- -#if ( $outlierValues.size() == 0 ) - -$i18n.getString( "no_outlier_values_found" ) ($searchTime ms). +

$i18n.getString( "search_result" )

+ +#if ( $dataValues.size() == 0 ) + +$i18n.getString( "no_values_found" ) -

$i18n.getString( "from_date" ): $fromDate $i18n.getString( "to_date" ): $toDate

- #else -$outlierValues.size() $i18n.getString( "values_found" ) ($searchTime ms). - -

$i18n.getString( "from_date" ): $fromDate $i18n.getString( "to_date" ): $toDate

+$dataValues.size() $i18n.getString( "values_found" ) @@ -25,7 +21,7 @@ #set( $count = 0 ) #set( $mark = 0 ) - #foreach( $outlierValue in $outlierValues ) + #foreach( $value in $dataValues ) #if( $mark == 1 ) #set( $mark = 0 ) @@ -38,41 +34,41 @@ ## data element ## organisation unit ## period ## lower bound (min) ## value ## upper bound (max)
- - $outlierValue.dataElementName + + $value.dataElementName - $outlierValue.sourceName + $value.sourceName - $format.formatPeriod( $outlierValue.period ) + $format.formatPeriod( $value.period ) -
$outlierValue.min
+
$value.min
- - - - - - - + + + + + + + -
$outlierValue.max
+
$value.max