← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1126: Removed method getDataValue( DataElement, Period, Source ) as it is no longer guaranteed to retur...

 

------------------------------------------------------------
revno: 1126
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Wed 2009-11-25 17:25:53 +0100
message:
  Removed method getDataValue( DataElement, Period, Source ) as it is no longer guaranteed to return a unique object.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValueService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValueStore.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/DefaultDataValueService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/hibernate/HibernateDataValueStore.java
  dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/datavalue/DataValueServiceTest.java
  dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/datavalue/DataValueStoreTest.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/service/DefaultImportObjectService.java
  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/resources/META-INF/dhis/beans.xml
  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/outlierSearchResult.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/datavalue/DataValueService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValueService.java	2009-11-25 09:08:11 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValueService.java	2009-11-25 16:25:53 +0000
@@ -103,19 +103,17 @@
      * @return the DataValue which corresponds to the given parameters, or null
      *         if no match.
      */
-    DataValue getDataValue( Source source, DataElement dataElement, Period period );
-    
-    /**
-     * Returns a DataValue.
-     * 
-     * @param source the Source of the DataValue.
-     * @param dataElement the DataElement of the DataValue.
-     * @param period the Period of the DataValue.
-     * @return the DataValue which corresponds to the given parameters, or null
-     *         if no match.
-     */
     DataValue getDataValue( Source source, DataElement dataElement, Period period, DataElementCategoryOptionCombo optionCombo );
 
+    /**
+     * Returns a DataValue.
+     * 
+     * @param dataElementId the DataElement identifier.
+     * @param periodId the Period identifier.
+     * @param sourceId the Source identifier.
+     * @param categoryOptionComboId the DataElementCategoryOptionCombo identifier.
+     * @return the DataValue.
+     */
     String getValue( int dataElementId, int periodId, int sourceId, int categoryOptionComboId );
     
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValueStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValueStore.java	2009-11-25 09:08:11 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValueStore.java	2009-11-25 16:25:53 +0000
@@ -94,19 +94,17 @@
      * @return the DataValue which corresponds to the given parameters, or null
      *         if no match.
      */
-    DataValue getDataValue( Source source, DataElement dataElement, Period period );
-    
-    /**
-     * Returns a DataValue.
-     * 
-     * @param source the Source of the DataValue.
-     * @param dataElement the DataElement of the DataValue.
-     * @param period the Period of the DataValue.
-     * @return the DataValue which corresponds to the given parameters, or null
-     *         if no match.
-     */
     DataValue getDataValue( Source source, DataElement dataElement, Period period, DataElementCategoryOptionCombo optionCombo );
 
+    /**
+     * Returns a DataValue.
+     * 
+     * @param dataElementId the DataElement identifier.
+     * @param periodId the Period identifier.
+     * @param sourceId the Source identifier.
+     * @param categoryOptionComboId the DataElementCategoryOptionCombo identifier.
+     * @return the DataValue.
+     */
     String getValue( int dataElementId, int periodId, int sourceId, int categoryOptionComboId );
     
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/DefaultDataValueService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/DefaultDataValueService.java	2009-11-25 09:08:11 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/DefaultDataValueService.java	2009-11-25 16:25:53 +0000
@@ -94,11 +94,6 @@
         return dataValueStore.deleteDataValuesByDataElement( dataElement );
     }
 
-    public DataValue getDataValue( Source source, DataElement dataElement, Period period )
-    {
-        return dataValueStore.getDataValue( source, dataElement, period );
-    }
-
     public DataValue getDataValue( Source source, DataElement dataElement, Period period,
         DataElementCategoryOptionCombo optionCombo )
     {

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/hibernate/HibernateDataValueStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/hibernate/HibernateDataValueStore.java	2009-11-25 15:56:24 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/hibernate/HibernateDataValueStore.java	2009-11-25 16:25:53 +0000
@@ -158,26 +158,6 @@
         return query.executeUpdate();    
     }
 
-    @Deprecated
-    public DataValue getDataValue( Source source, DataElement dataElement, Period period )
-    {
-        Session session = sessionFactory.getCurrentSession();
-
-        Period storedPeriod = reloadPeriod( period );
-
-        if ( storedPeriod == null )
-        {
-            return null;
-        }
-
-        Criteria criteria = session.createCriteria( DataValue.class );
-        criteria.add( Restrictions.eq( "source", source ) );
-        criteria.add( Restrictions.eq( "dataElement", dataElement ) );
-        criteria.add( Restrictions.eq( "period", storedPeriod ) );
-
-        return (DataValue) criteria.uniqueResult();
-    }
-
     public DataValue getDataValue( Source source, DataElement dataElement, Period period, DataElementCategoryOptionCombo optionCombo )
     {
         Session session = sessionFactory.getCurrentSession();

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/datavalue/DataValueServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/datavalue/DataValueServiceTest.java	2009-10-18 22:44:41 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/datavalue/DataValueServiceTest.java	2009-11-25 16:25:53 +0000
@@ -173,21 +173,21 @@
             // Expected
         }
 
-        dataValueA = dataValueService.getDataValue( sourceA, dataElementA, periodA );
+        dataValueA = dataValueService.getDataValue( sourceA, dataElementA, periodA, optionCombo );
         assertNotNull( dataValueA );
         assertEquals( sourceA.getId(), dataValueA.getSource().getId() );
         assertEquals( dataElementA, dataValueA.getDataElement() );
         assertEquals( periodA, dataValueA.getPeriod() );
         assertEquals( "1", dataValueA.getValue() );
 
-        dataValueB = dataValueService.getDataValue( sourceA, dataElementB, periodA );
+        dataValueB = dataValueService.getDataValue( sourceA, dataElementB, periodA, optionCombo );
         assertNotNull( dataValueB );
         assertEquals( sourceA.getId(), dataValueB.getSource().getId() );
         assertEquals( dataElementB, dataValueB.getDataElement() );
         assertEquals( periodA, dataValueB.getPeriod() );
         assertEquals( "2", dataValueB.getValue() );
 
-        dataValueC = dataValueService.getDataValue( sourceA, dataElementC, periodC );
+        dataValueC = dataValueService.getDataValue( sourceA, dataElementC, periodC, optionCombo );
         assertNotNull( dataValueC );
         assertEquals( sourceA.getId(), dataValueC.getSource().getId() );
         assertEquals( dataElementC, dataValueC.getDataElement() );
@@ -207,17 +207,17 @@
         dataValueService.addDataValue( dataValueA );
         dataValueService.addDataValue( dataValueB );
 
-        assertNotNull( dataValueService.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNotNull( dataValueService.getDataValue( sourceB, dataElementB, periodA ) );
+        assertNotNull( dataValueService.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNotNull( dataValueService.getDataValue( sourceB, dataElementB, periodA, optionCombo ) );
 
         dataValueA.setValue( "5" );
         dataValueService.updateDataValue( dataValueA );
 
-        dataValueA = dataValueService.getDataValue( sourceA, dataElementA, periodA );
+        dataValueA = dataValueService.getDataValue( sourceA, dataElementA, periodA, optionCombo );
         assertNotNull( dataValueA );
         assertEquals( "5", dataValueA.getValue() );
 
-        dataValueB = dataValueService.getDataValue( sourceB, dataElementB, periodA );
+        dataValueB = dataValueService.getDataValue( sourceB, dataElementB, periodA, optionCombo );
         assertNotNull( dataValueB );
         assertEquals( "2", dataValueB.getValue() );
     }
@@ -240,34 +240,34 @@
         dataValueService.addDataValue( dataValueC );
         dataValueService.addDataValue( dataValueD );
 
-        assertNotNull( dataValueService.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNotNull( dataValueService.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNotNull( dataValueService.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNotNull( dataValueService.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNotNull( dataValueService.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNotNull( dataValueService.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNotNull( dataValueService.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNotNull( dataValueService.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
 
         dataValueService.deleteDataValue( dataValueA );
-        assertNull( dataValueService.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNotNull( dataValueService.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNotNull( dataValueService.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNotNull( dataValueService.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNull( dataValueService.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNotNull( dataValueService.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNotNull( dataValueService.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNotNull( dataValueService.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
 
         dataValueService.deleteDataValue( dataValueB );
-        assertNull( dataValueService.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNull( dataValueService.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNotNull( dataValueService.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNotNull( dataValueService.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNull( dataValueService.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNull( dataValueService.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNotNull( dataValueService.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNotNull( dataValueService.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
 
         dataValueService.deleteDataValue( dataValueC );
-        assertNull( dataValueService.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNull( dataValueService.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNull( dataValueService.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNotNull( dataValueService.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNull( dataValueService.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNull( dataValueService.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNull( dataValueService.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNotNull( dataValueService.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
 
         dataValueService.deleteDataValue( dataValueD );
-        assertNull( dataValueService.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNull( dataValueService.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNull( dataValueService.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNull( dataValueService.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNull( dataValueService.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNull( dataValueService.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNull( dataValueService.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNull( dataValueService.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
     }
 
     @Test
@@ -288,34 +288,34 @@
         dataValueService.addDataValue( dataValueC );
         dataValueService.addDataValue( dataValueD );
 
-        assertNotNull( dataValueService.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNotNull( dataValueService.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNotNull( dataValueService.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNotNull( dataValueService.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNotNull( dataValueService.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNotNull( dataValueService.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNotNull( dataValueService.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNotNull( dataValueService.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
 
         dataValueService.deleteDataValuesBySource( sourceA );
-        assertNull( dataValueService.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNull( dataValueService.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNotNull( dataValueService.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNotNull( dataValueService.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNull( dataValueService.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNull( dataValueService.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNotNull( dataValueService.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNotNull( dataValueService.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
 
         dataValueService.deleteDataValuesBySource( sourceB );
-        assertNull( dataValueService.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNull( dataValueService.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNotNull( dataValueService.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNull( dataValueService.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNull( dataValueService.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNull( dataValueService.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNotNull( dataValueService.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNull( dataValueService.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
 
         dataValueService.deleteDataValuesBySource( sourceC );
-        assertNull( dataValueService.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNull( dataValueService.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNotNull( dataValueService.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNull( dataValueService.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNull( dataValueService.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNull( dataValueService.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNotNull( dataValueService.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNull( dataValueService.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
 
         dataValueService.deleteDataValuesBySource( sourceD );
-        assertNull( dataValueService.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNull( dataValueService.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNull( dataValueService.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNull( dataValueService.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNull( dataValueService.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNull( dataValueService.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNull( dataValueService.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNull( dataValueService.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
     }
 
     @Test
@@ -336,34 +336,34 @@
         dataValueService.addDataValue( dataValueC );
         dataValueService.addDataValue( dataValueD );
 
-        assertNotNull( dataValueService.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNotNull( dataValueService.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNotNull( dataValueService.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNotNull( dataValueService.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNotNull( dataValueService.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNotNull( dataValueService.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNotNull( dataValueService.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNotNull( dataValueService.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
 
         dataValueService.deleteDataValuesByDataElement( dataElementA );
-        assertNull( dataValueService.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNotNull( dataValueService.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNotNull( dataValueService.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNotNull( dataValueService.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNull( dataValueService.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNotNull( dataValueService.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNotNull( dataValueService.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNotNull( dataValueService.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
 
         dataValueService.deleteDataValuesByDataElement( dataElementB );
-        assertNull( dataValueService.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNull( dataValueService.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNotNull( dataValueService.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNotNull( dataValueService.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNull( dataValueService.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNull( dataValueService.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNotNull( dataValueService.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNotNull( dataValueService.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
 
         dataValueService.deleteDataValuesByDataElement( dataElementC );
-        assertNull( dataValueService.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNull( dataValueService.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNull( dataValueService.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNotNull( dataValueService.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNull( dataValueService.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNull( dataValueService.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNull( dataValueService.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNotNull( dataValueService.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
 
         dataValueService.deleteDataValuesByDataElement( dataElementD );
-        assertNull( dataValueService.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNull( dataValueService.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNull( dataValueService.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNull( dataValueService.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNull( dataValueService.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNull( dataValueService.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNull( dataValueService.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNull( dataValueService.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
     }
 
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/datavalue/DataValueStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/datavalue/DataValueStoreTest.java	2009-10-18 22:44:41 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/datavalue/DataValueStoreTest.java	2009-11-25 16:25:53 +0000
@@ -182,21 +182,21 @@
             // Expected
         }
 
-        dataValueA = dataValueStore.getDataValue( sourceA, dataElementA, periodA );
+        dataValueA = dataValueStore.getDataValue( sourceA, dataElementA, periodA, optionCombo );
         assertNotNull( dataValueA );
         assertEquals( sourceA.getId(), dataValueA.getSource().getId() );
         assertEquals( dataElementA, dataValueA.getDataElement() );
         assertEquals( periodA, dataValueA.getPeriod() );
         assertEquals( "1", dataValueA.getValue() );
 
-        dataValueB = dataValueStore.getDataValue( sourceA, dataElementB, periodA );
+        dataValueB = dataValueStore.getDataValue( sourceA, dataElementB, periodA, optionCombo );
         assertNotNull( dataValueB );
         assertEquals( sourceA.getId(), dataValueB.getSource().getId() );
         assertEquals( dataElementB, dataValueB.getDataElement() );
         assertEquals( periodA, dataValueB.getPeriod() );
         assertEquals( "2", dataValueB.getValue() );
 
-        dataValueC = dataValueStore.getDataValue( sourceA, dataElementC, periodC );
+        dataValueC = dataValueStore.getDataValue( sourceA, dataElementC, periodC, optionCombo );
         assertNotNull( dataValueC );
         assertEquals( sourceA.getId(), dataValueC.getSource().getId() );
         assertEquals( dataElementC, dataValueC.getDataElement() );
@@ -216,17 +216,17 @@
         dataValueStore.addDataValue( dataValueA );
         dataValueStore.addDataValue( dataValueB );
 
-        assertNotNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNotNull( dataValueStore.getDataValue( sourceB, dataElementB, periodA ) );
+        assertNotNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNotNull( dataValueStore.getDataValue( sourceB, dataElementB, periodA, optionCombo ) );
 
         dataValueA.setValue( "5" );
         dataValueStore.updateDataValue( dataValueA );
 
-        dataValueA = dataValueStore.getDataValue( sourceA, dataElementA, periodA );
+        dataValueA = dataValueStore.getDataValue( sourceA, dataElementA, periodA, optionCombo );
         assertNotNull( dataValueA );
         assertEquals( "5", dataValueA.getValue() );
 
-        dataValueB = dataValueStore.getDataValue( sourceB, dataElementB, periodA );
+        dataValueB = dataValueStore.getDataValue( sourceB, dataElementB, periodA, optionCombo );
         assertNotNull( dataValueB );
         assertEquals( "2", dataValueB.getValue() );
     }
@@ -249,34 +249,34 @@
         dataValueStore.addDataValue( dataValueC );
         dataValueStore.addDataValue( dataValueD );
 
-        assertNotNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNotNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNotNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNotNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNotNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNotNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNotNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNotNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
 
         dataValueStore.deleteDataValue( dataValueA );
-        assertNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNotNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNotNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNotNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNotNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNotNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNotNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
 
         dataValueStore.deleteDataValue( dataValueB );
-        assertNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNotNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNotNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNotNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNotNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
 
         dataValueStore.deleteDataValue( dataValueC );
-        assertNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNotNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNotNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
 
         dataValueStore.deleteDataValue( dataValueD );
-        assertNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
     }
 
     @Test
@@ -297,34 +297,34 @@
         dataValueStore.addDataValue( dataValueC );
         dataValueStore.addDataValue( dataValueD );
 
-        assertNotNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNotNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNotNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNotNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNotNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNotNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNotNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNotNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
 
         dataValueStore.deleteDataValuesBySource( sourceA );
-        assertNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNotNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNotNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNotNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNotNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
 
         dataValueStore.deleteDataValuesBySource( sourceB );
-        assertNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNotNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNotNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
 
         dataValueStore.deleteDataValuesBySource( sourceC );
-        assertNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNotNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNotNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
 
         dataValueStore.deleteDataValuesBySource( sourceD );
-        assertNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
     }
 
     @Test
@@ -345,34 +345,34 @@
         dataValueStore.addDataValue( dataValueC );
         dataValueStore.addDataValue( dataValueD );
 
-        assertNotNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNotNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNotNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNotNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNotNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNotNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNotNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNotNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
 
         dataValueStore.deleteDataValuesByDataElement( dataElementA );
-        assertNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNotNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNotNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNotNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNotNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNotNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNotNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
 
         dataValueStore.deleteDataValuesByDataElement( dataElementB );
-        assertNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNotNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNotNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNotNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNotNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
 
         dataValueStore.deleteDataValuesByDataElement( dataElementC );
-        assertNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNotNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNotNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
 
         dataValueStore.deleteDataValuesByDataElement( dataElementD );
-        assertNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA ) );
-        assertNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA ) );
-        assertNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC ) );
-        assertNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC ) );
+        assertNull( dataValueStore.getDataValue( sourceA, dataElementA, periodA, optionCombo ) );
+        assertNull( dataValueStore.getDataValue( sourceA, dataElementB, periodA, optionCombo ) );
+        assertNull( dataValueStore.getDataValue( sourceD, dataElementC, periodC, optionCombo ) );
+        assertNull( dataValueStore.getDataValue( sourceB, dataElementD, periodC, optionCombo ) );
     }
 
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/service/DefaultImportObjectService.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/service/DefaultImportObjectService.java	2009-11-23 17:43:36 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/service/DefaultImportObjectService.java	2009-11-25 16:25:53 +0000
@@ -610,7 +610,8 @@
         {
             DataValue dataValue = (DataValue) object;
             
-            dataValue = updateDataValue( dataValue, dataValueService.getDataValue( dataValue.getSource(), dataValue.getDataElement(), dataValue.getPeriod() ) );
+            dataValue = updateDataValue( dataValue, dataValueService.getDataValue( 
+                dataValue.getSource(), dataValue.getDataElement(), dataValue.getPeriod(), dataValue.getOptionCombo() ) );
         }
 
         // ---------------------------------------------------------------------

=== modified 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/outlieranalysis/EditOutlierAction.java	2009-10-10 14:26:24 +0000
+++ 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
@@ -28,6 +28,8 @@
  */
 
 import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
+import org.hisp.dhis.dataelement.DataElementCategoryService;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.datavalue.DataValue;
 import org.hisp.dhis.datavalue.DataValueService;
@@ -81,6 +83,13 @@
     {
         this.periodService = periodService;
     }
+    
+    private DataElementCategoryService categoryService;
+
+    public void setCategoryService( DataElementCategoryService categoryService )
+    {
+        this.categoryService = categoryService;
+    }
 
     private CurrentUserService currentUserService;
 
@@ -100,27 +109,34 @@
         this.value = value;
     }
 
-    private String organisationUnitId;
-
-    public void setOrganisationUnitId( String organisationUnitId )
-    {
-        this.organisationUnitId = organisationUnitId;
-    }
-
-    private String dataElementId;
-
-    public void setDataElementId( String dataElementId )
+    private Integer dataElementId;
+
+    public void setDataElementId( Integer dataElementId )
     {
         this.dataElementId = dataElementId;
     }
 
-    private String periodId;
+    private Integer periodId;
 
-    public void setPeriodId( String periodId )
+    public void setPeriodId( Integer periodId )
     {
         this.periodId = periodId;
     }
 
+    private Integer organisationUnitId;
+
+    public void setOrganisationUnitId( Integer organisationUnitId )
+    {
+        this.organisationUnitId = organisationUnitId;
+    }
+    
+    private Integer categoryOptionComboId;
+
+    public void setCategoryOptionComboId( Integer categoryOptionComboId )
+    {
+        this.categoryOptionComboId = categoryOptionComboId;
+    }
+
     private String message;
 
     public String getMessage()
@@ -141,52 +157,6 @@
 
     public String execute()
     {
-        Period period = null;
-        DataElement dataElement = null;
-        OrganisationUnit organisationUnit = null;
-
-        try
-        {
-            int i = Integer.parseInt( periodId );
-
-            period = periodService.getPeriod( i );
-        }
-        catch ( Exception e )
-        {
-            e.printStackTrace();
-            statusCode = 1;
-            message = "invalid data value";
-            return ERROR;
-        }
-
-        try
-        {
-            int i = Integer.parseInt( dataElementId );
-
-            dataElement = dataElementService.getDataElement( i );
-        }
-        catch ( Exception e )
-        {
-            e.printStackTrace();
-            statusCode = 2;
-            message = "invalid data value";
-            return ERROR;
-        }
-
-        try
-        {
-            int i = Integer.parseInt( organisationUnitId );
-
-            organisationUnit = organisationUnitService.getOrganisationUnit( i );
-        }
-        catch ( Exception e )
-        {
-            e.printStackTrace();
-            statusCode = 3;
-            message = "invalid data value";
-            return ERROR;
-        }
-
         if ( value != null && value.trim().length() == 0 )
         {
             value = null;
@@ -197,7 +167,12 @@
             value = value.trim();
         }
 
-        DataValue dataValue = dataValueService.getDataValue( organisationUnit, dataElement, period );
+        DataElement dataElement = dataElementService.getDataElement( dataElementId );
+        Period period = periodService.getPeriod( periodId );
+        OrganisationUnit unit = organisationUnitService.getOrganisationUnit( organisationUnitId );
+        DataElementCategoryOptionCombo categoryOptionCombo = categoryService.getDataElementCategoryOptionCombo( categoryOptionComboId );
+        
+        DataValue dataValue = dataValueService.getDataValue( unit, dataElement, period, categoryOptionCombo );
 
         if ( dataValue == null )
         {
@@ -207,9 +182,6 @@
         }
         if ( !dataValue.getDataElement().getType().equals( "int" ) )
         {
-            // can only find outlier values for data elements of where
-            // type="int", and therefore, only update such values
-            
             statusCode = 5;
             message = "invalid data value";
             return ERROR;
@@ -229,7 +201,7 @@
         dataValueService.updateDataValue( dataValue );
 
         statusCode = 0;
-        message = ""; // "success" - no message set
+        message = "";
 
         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-10-18 22:44:41 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/META-INF/dhis/beans.xml	2009-11-25 16:25:53 +0000
@@ -282,6 +282,8 @@
       ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
     <property name="periodService" 
       ref="org.hisp.dhis.period.PeriodService" />
+	<property name="categoryService"
+	  ref="org.hisp.dhis.dataelement.DataElementCategoryService"/>
     <property name="currentUserService"
       ref="org.hisp.dhis.user.CurrentUserService" />
   </bean>

=== modified 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/outlierAnalysisEditValue.js	2009-10-10 14:26:24 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/outlierAnalysisEditValue.js	2009-11-25 16:25:53 +0000
@@ -13,6 +13,7 @@
 	var field = document.getElementById( 'outlier[' + outlierId + '].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;
 	
@@ -38,7 +39,7 @@
 			
 			if ( value < min )
 			{
-				var valueSaver = new ValueSaver( dataElementId, periodId, sourceId, field.value, outlierId, '#ffcccc' );
+				var valueSaver = new ValueSaver( dataElementId, periodId, sourceId, categoryOptionComboId, field.value, outlierId, '#ffcccc' );
 				valueSaver.save();
 				
 				alert( "Value is still lower than the lower boundary." );
@@ -47,7 +48,7 @@
 			
 			if ( value > max )
 			{
-				var valueSaver = new ValueSaver( dataElementId, periodId, sourceId, field.value, outlierId, '#ffcccc' );
+				var valueSaver = new ValueSaver( dataElementId, periodId, sourceId, categoryOptionComboId, field.value, outlierId, '#ffcccc' );
 				valueSaver.save();
 				
 				alert( "Value is still higher than the upper boundary." );
@@ -56,7 +57,7 @@
 		}
 	}
 	
-    var valueSaver = new ValueSaver( dataElementId, periodId, sourceId, field.value, outlierId, '#ccffcc', '');
+    var valueSaver = new ValueSaver( dataElementId, periodId, sourceId, categoryOptionComboId, field.value, outlierId, '#ccffcc', '');
     valueSaver.save();
 
 }
@@ -78,7 +79,7 @@
 // Saver object (modified version of dataentry/javascript/general.js)
 //-----------------------------------------------------------------------------
 
-function ValueSaver( dataElementId_, periodId_, sourceId_, value_, outlierId_, resultColor_, selectedOption_ )
+function ValueSaver( dataElementId_, periodId_, sourceId_, categoryOptionComboId_, value_, outlierId_, resultColor_, selectedOption_ )
 {
     var SUCCESS = '#ccffcc';
     var ERROR = '#ccccff';
@@ -86,6 +87,7 @@
     var dataElementId = dataElementId_;
     var periodId = periodId_;
     var sourceId = sourceId_;
+    var categoryOptionComboId = categoryOptionComboId_;
     var value = value_;
     var outlierId = outlierId_;
     var resultColor = resultColor_;
@@ -101,6 +103,7 @@
         		+ 'dataElementId=' + dataElementId
         		+ '&periodId=' + periodId
         		+ '&organisationUnitId=' + sourceId
+        		+ '&categoryOptionComboId=' + categoryOptionComboId
         		+ '&value=' + value );
     };
     

=== modified 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/outlierSearchResult.vm	2009-11-25 15:56:24 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/outlierSearchResult.vm	2009-11-25 16:25:53 +0000
@@ -61,12 +61,13 @@
 		## value
 		<td style="width:100px">
 			<input name="outliervalue" id="outlier[$count].value" value="$outlierValue.getValue()"
-				style="width: 95%; text-align: center;" tabindex="$count" type="text" onchange="editOutlierValue( $count )" />
-			<input type="hidden" id="outlier[$count].source" value="$outlierValue.organisationUnit.id" />
-			<input type="hidden" id="outlier[$count].period" value="$outlierValue.period.id" />
-			<input type="hidden" id="outlier[$count].max" value="$outlierValue.upperBound" />
-			<input type="hidden" id="outlier[$count].min" value="$outlierValue.lowerBound" />
-			<input type="hidden" id="outlier[$count].dataElement" value="$outlierValue.dataElement.id" />
+				style="width: 95%; text-align: center;" tabindex="$count" type="text" onchange="editOutlierValue( $count )">			
+            <input type="hidden" id="outlier[$count].dataElement" value="$outlierValue.dataElement.id">
+            <input type="hidden" id="outlier[$count].period" value="$outlierValue.period.id">
+			<input type="hidden" id="outlier[$count].source" value="$outlierValue.organisationUnit.id">
+			<input type="hidden" id="outlier[$count].categoryOptionCombo" value="$outlierValue.categoryOptionCombo.id">
+			<input type="hidden" id="outlier[$count].max" value="$outlierValue.upperBound">
+			<input type="hidden" id="outlier[$count].min" value="$outlierValue.lowerBound">
 		</td>
 		
 		## upper bound (max)