← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15189: Removed now unused methods in tracked entity instance store/service

 

------------------------------------------------------------
revno: 15189
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-05-07 11:33:33 +0200
message:
  Removed now unused methods in tracked entity instance store/service
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStore.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceServiceTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStoreTest.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/AddOrganisationUnitAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/UpdateOrganisationUnitAction.java
  dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/SearchPatientAction.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java	2014-05-07 09:03:42 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java	2014-05-07 09:33:33 +0000
@@ -154,7 +154,7 @@
      * @return a collection of all TrackedEntityInstance, or an empty collection
      *         if there are no TrackedEntityInstances.
      */
-    Collection<TrackedEntityInstance> getAllTrackedEntityInstances();
+    //Collection<TrackedEntityInstance> getAllTrackedEntityInstances();
 
     /**
      * Retrieve entityInstances for mobile base on identifier value
@@ -184,7 +184,7 @@
      * @param program Program
      * @return TrackedEntityInstance list
      */
-    Collection<TrackedEntityInstance> getTrackedEntityInstances( Program program );
+    //Collection<TrackedEntityInstance> getTrackedEntityInstances( Program program );
 
     /**
      * Retrieve entityInstances registered in a orgunit and enrolled into a
@@ -194,7 +194,7 @@
      * @param program
      * @return
      */
-    Collection<TrackedEntityInstance> getTrackedEntityInstances( OrganisationUnit organisationUnit, Program program );
+    //Collection<TrackedEntityInstance> getTrackedEntityInstances( OrganisationUnit organisationUnit, Program program );
 
     /**
      * Retrieve entityInstances base on Attribute
@@ -225,8 +225,7 @@
      * @param attribute
      * @return TrackedEntityInstance List
      */
-    Collection<TrackedEntityInstance> sortTrackedEntityInstancesByAttribute(
-        Collection<TrackedEntityInstance> entityInstances, TrackedEntityAttribute attribute );
+    //Collection<TrackedEntityInstance> sortTrackedEntityInstancesByAttribute( Collection<TrackedEntityInstance> entityInstances, TrackedEntityAttribute attribute );
 
     /**
      * Get entityInstances who has the same representative
@@ -273,7 +272,7 @@
      * 
      * @return The number of entityInstances
      */
-    int countGetTrackedEntityInstancesByOrgUnit( OrganisationUnit organisationUnit );
+    //int countGetTrackedEntityInstancesByOrgUnit( OrganisationUnit organisationUnit );
 
     /**
      * Get the number of entityInstances who registered into an organisation
@@ -284,7 +283,7 @@
      * 
      * @return The number of entityInstances
      */
-    int countGetTrackedEntityInstancesByOrgUnitProgram( OrganisationUnit organisationUnit, Program program );
+    //int countGetTrackedEntityInstancesByOrgUnitProgram( OrganisationUnit organisationUnit, Program program );
 
     /**
      * Cache value from String to the value type based on property
@@ -306,7 +305,7 @@
      * 
      * @return List of entityInstance
      */
-    Collection<TrackedEntityInstance> getTrackedEntityInstancesByPhone( String phoneNumber, Integer min, Integer max );
+    //Collection<TrackedEntityInstance> getTrackedEntityInstancesByPhone( String phoneNumber, Integer min, Integer max );
 
     /**
      * Validate entityInstance attributes and validation criteria by program
@@ -344,8 +343,7 @@
      * @return TrackedEntityInstance List
      */
 
-    Collection<TrackedEntityInstance> searchTrackedEntityInstancesForMobile( String searchText, int orgUnitId,
-        int attributeId );
+    Collection<TrackedEntityInstance> searchTrackedEntityInstancesForMobile( String searchText, int orgUnitId, int attributeId );
 
     /**
      * Search entityInstances by entityInstance attribute value (performs
@@ -358,8 +356,7 @@
      * 
      * @return List of TrackedEntityInstance
      */
-    Collection<TrackedEntityInstance> getTrackedEntityInstancesByAttributeValue( String searchText, int attributeId,
-        Integer min, Integer max );
+    //Collection<TrackedEntityInstance> getTrackedEntityInstancesByAttributeValue( String searchText, int attributeId, Integer min, Integer max );
 
     /**
      * Get entityInstances by {@link TrackedEntity}

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStore.java	2014-05-07 09:03:42 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStore.java	2014-05-07 09:33:33 +0000
@@ -79,8 +79,7 @@
      * 
      * @return List of entityInstances
      */
-    Collection<TrackedEntityInstance> getByOrgUnitProgram( OrganisationUnit organisationUnit, Program program,
-        Integer min, Integer max );
+    Collection<TrackedEntityInstance> getByOrgUnitProgram( OrganisationUnit organisationUnit, Program program, Integer min, Integer max );
 
     /**
      * Search instances who has the same representative
@@ -99,7 +98,7 @@
      * 
      * @return The number of entityInstances
      */
-    int countListTrackedEntityInstanceByOrgunit( OrganisationUnit organisationUnit );
+    //int countListTrackedEntityInstanceByOrgunit( OrganisationUnit organisationUnit );
 
     /**
      * Get the number of entityInstances who registered into a certain
@@ -113,7 +112,7 @@
      * 
      * @return The number of entityInstances
      */
-    int countGetTrackedEntityInstancesByOrgUnitProgram( OrganisationUnit organisationUnit, Program program );
+    //int countGetTrackedEntityInstancesByOrgUnitProgram( OrganisationUnit organisationUnit, Program program );
 
     /**
      * Search entityInstances by phone number (performs partial search)
@@ -135,7 +134,7 @@
      * 
      *        return List of entityInstances
      */
-    Collection<TrackedEntityInstance> getByProgram( Program program, Integer min, Integer max );
+    //Collection<TrackedEntityInstance> getByProgram( Program program, Integer min, Integer max );
 
     /**
      * Validate entity-instances attribute values and validation criteria by

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java	2014-05-07 09:03:42 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java	2014-05-07 09:33:33 +0000
@@ -37,7 +37,6 @@
 import static org.hisp.dhis.trackedentity.TrackedEntityInstanceQueryParams.TRACKED_ENTITY_INSTANCE_ID;
 
 import java.lang.reflect.Type;
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
 import java.util.HashMap;
@@ -526,16 +525,10 @@
     }
 
     @Override
-    public Collection<TrackedEntityInstance> getAllTrackedEntityInstances()
-    {
-        return trackedEntityInstanceStore.getAll();
-    }
-
-    @Override
     public Collection<TrackedEntityInstance> getTrackedEntityInstancesForMobile( String searchText, int orgUnitId )
     {
         Set<TrackedEntityInstance> entityInstances = new HashSet<TrackedEntityInstance>();
-        entityInstances.addAll( getTrackedEntityInstancesByPhone( searchText, 0, Integer.MAX_VALUE ) );
+        entityInstances.addAll( trackedEntityInstanceStore.getByPhoneNumber( searchText, 0, Integer.MAX_VALUE ) );
 
         if ( orgUnitId != 0 )
         {
@@ -563,19 +556,6 @@
     }
 
     @Override
-    public Collection<TrackedEntityInstance> getTrackedEntityInstances( Program program )
-    {
-        return trackedEntityInstanceStore.getByProgram( program, 0, Integer.MAX_VALUE );
-    }
-
-    @Override
-    public Collection<TrackedEntityInstance> getTrackedEntityInstances( OrganisationUnit organisationUnit,
-        Program program )
-    {
-        return trackedEntityInstanceStore.getByOrgUnitProgram( organisationUnit, program, 0, Integer.MAX_VALUE );
-    }
-
-    @Override
     public Collection<TrackedEntityInstance> getTrackedEntityInstance( Integer attributeId, String value )
     {
         TrackedEntityAttribute attribute = attributeService.getTrackedEntityAttribute( attributeId );
@@ -588,48 +568,6 @@
     }
 
     @Override
-    public Collection<TrackedEntityInstance> sortTrackedEntityInstancesByAttribute(
-        Collection<TrackedEntityInstance> entityInstances, TrackedEntityAttribute attribute )
-    {
-        Collection<TrackedEntityInstance> sortedTrackedEntityInstances = new ArrayList<TrackedEntityInstance>();
-
-        // ---------------------------------------------------------------------
-        // Better to fetch all attribute values at once than fetching the
-        // required attribute value of each instance using loop
-        // ---------------------------------------------------------------------
-
-        Collection<TrackedEntityAttributeValue> attributeValues = attributeValueService
-            .getTrackedEntityAttributeValues( entityInstances );
-
-        if ( attributeValues != null )
-        {
-            for ( TrackedEntityAttributeValue attributeValue : attributeValues )
-            {
-                if ( attribute == attributeValue.getAttribute() )
-                {
-                    sortedTrackedEntityInstances.add( attributeValue.getEntityInstance() );
-                    entityInstances.remove( attributeValue.getEntityInstance() );
-                }
-            }
-        }
-
-        // ---------------------------------------------------------------------
-        // Make sure all entityInstances are in the sorted list - because all
-        // entityInstances might not have the sorting attribute/value
-        // ---------------------------------------------------------------------
-
-        sortedTrackedEntityInstances.addAll( entityInstances );
-
-        return sortedTrackedEntityInstances;
-    }
-
-    @Override
-    public int countGetTrackedEntityInstancesByOrgUnit( OrganisationUnit organisationUnit )
-    {
-        return trackedEntityInstanceStore.countListTrackedEntityInstanceByOrgunit( organisationUnit );
-    }
-
-    @Override
     public void updateTrackedEntityInstance( TrackedEntityInstance instance, Integer representativeId,
         Integer relationshipTypeId, List<TrackedEntityAttributeValue> valuesForSave,
         List<TrackedEntityAttributeValue> valuesForUpdate, Collection<TrackedEntityAttributeValue> valuesForDelete )
@@ -694,12 +632,6 @@
     }
 
     @Override
-    public int countGetTrackedEntityInstancesByOrgUnitProgram( OrganisationUnit organisationUnit, Program program )
-    {
-        return trackedEntityInstanceStore.countGetTrackedEntityInstancesByOrgUnitProgram( organisationUnit, program );
-    }
-
-    @Override
     public Object getObjectValue( String property, String value, I18nFormat format )
     {
         try
@@ -741,13 +673,6 @@
     }
 
     @Override
-    public Collection<TrackedEntityInstance> getTrackedEntityInstancesByPhone( String phoneNumber, Integer min,
-        Integer max )
-    {
-        return trackedEntityInstanceStore.getByPhoneNumber( phoneNumber, min, max );
-    }
-
-    @Override
     public String validateTrackedEntityInstance( TrackedEntityInstance instance, Program program, I18nFormat format )
     {
         return trackedEntityInstanceStore.validate( instance, program, format );
@@ -765,7 +690,7 @@
     {
         Set<TrackedEntityInstance> entityInstances = new HashSet<TrackedEntityInstance>();
 
-        entityInstances.addAll( getTrackedEntityInstancesByAttributeValue( searchText, attributeId, 0,
+        entityInstances.addAll( trackedEntityInstanceStore.getByAttributeValue( searchText, attributeId, 0,
             Integer.MAX_VALUE ) );
 
         if ( orgUnitId != 0 )
@@ -785,13 +710,6 @@
 
         return entityInstances;
     }
-
-    @Override
-    public Collection<TrackedEntityInstance> getTrackedEntityInstancesByAttributeValue( String searchText,
-        int attributeId, Integer min, Integer max )
-    {
-        return trackedEntityInstanceStore.getByAttributeValue( searchText, attributeId, min, max );
-    }
     
     @Override
     public Collection<TrackedEntityInstance> getTrackedEntityInstances( TrackedEntity trackedEntity )

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java	2014-05-07 09:03:42 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java	2014-05-07 09:33:33 +0000
@@ -432,45 +432,6 @@
 
     @Override
     @SuppressWarnings( "unchecked" )
-    public Collection<TrackedEntityInstance> getByProgram( Program program, Integer min, Integer max )
-    {
-        String hql = "select pt from TrackedEntityInstance pt inner join pt.programInstances pi "
-            + "where pi.program = :program and pi.status = :status";
-
-        Query query = getQuery( hql );
-        query.setEntity( "program", program );
-        query.setInteger( "status", ProgramInstance.STATUS_ACTIVE );
-
-        return query.list();
-    }
-
-    @Override
-    public int countListTrackedEntityInstanceByOrgunit( OrganisationUnit organisationUnit )
-    {
-        Query query = getQuery( "select count(p.id) from TrackedEntityInstance p where p.organisationUnit.id=:orgUnitId " );
-
-        query.setParameter( "orgUnitId", organisationUnit.getId() );
-
-        Number rs = (Number) query.uniqueResult();
-
-        return rs != null ? rs.intValue() : 0;
-    }
-
-    @Override
-    public int countGetTrackedEntityInstancesByOrgUnitProgram( OrganisationUnit organisationUnit, Program program )
-    {
-        String sql = "select count(p.trackedentityinstanceid) from trackedentityinstance p join programinstance pi on p.trackedentityinstanceid=pi.trackedentityinstanceid "
-            + "where p.organisationunitid="
-            + organisationUnit.getId()
-            + " and pi.programid="
-            + program.getId()
-            + " and pi.status=" + ProgramInstance.STATUS_ACTIVE;
-
-        return jdbcTemplate.queryForObject( sql, Integer.class );
-    }
-
-    @Override
-    @SuppressWarnings( "unchecked" )
     public Collection<TrackedEntityInstance> getRepresentatives( TrackedEntityInstance instance )
     {
         String hql = "select distinct p from TrackedEntityInstance p where p.representative = :representative order by p.id DESC";

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceServiceTest.java	2014-04-22 00:17:55 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceServiceTest.java	2014-05-07 09:33:33 +0000
@@ -198,15 +198,6 @@
     }
 
     @Test
-    public void testGetAllTrackedEntityInstances()
-    {
-        entityInstanceService.addTrackedEntityInstance( entityInstanceA1 );
-        entityInstanceService.addTrackedEntityInstance( entityInstanceB1 );
-
-        assertTrue( equals( entityInstanceService.getAllTrackedEntityInstances(), entityInstanceA1, entityInstanceB1 ) );
-    }
-
-    @Test
     public void testGetTrackedEntityInstancesByOu()
     {
         entityInstanceService.addTrackedEntityInstance( entityInstanceA1 );
@@ -220,43 +211,6 @@
     }
 
     @Test
-    public void testGetTrackedEntityInstancesByProgram()
-    {
-        programService.addProgram( programA );
-
-        entityInstanceService.addTrackedEntityInstance( entityInstanceA1 );
-        entityInstanceService.addTrackedEntityInstance( entityInstanceA2 );
-        entityInstanceService.addTrackedEntityInstance( entityInstanceA3 );
-
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA1, programA, date, date, organisationUnit );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA3, programA, date, date, organisationUnit );
-
-        Collection<TrackedEntityInstance> entityInstances = entityInstanceService.getTrackedEntityInstances( programA );
-        assertEquals( 2, entityInstances.size() );
-        assertTrue( entityInstances.contains( entityInstanceA1 ) );
-        assertTrue( entityInstances.contains( entityInstanceA3 ) );
-    }
-
-    @Test
-    public void testGetTrackedEntityInstancesbyOuProgram()
-    {
-        programService.addProgram( programA );
-
-        entityInstanceService.addTrackedEntityInstance( entityInstanceA1 );
-        entityInstanceService.addTrackedEntityInstance( entityInstanceA2 );
-        entityInstanceService.addTrackedEntityInstance( entityInstanceA3 );
-
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA1, programA, date, date, organisationUnit );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA2, programA, date, date, organisationUnit );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA3, programA, date, date, organisationUnit );
-
-        Collection<TrackedEntityInstance> entityInstances = entityInstanceService.getTrackedEntityInstances( organisationUnit, programA );
-        assertEquals( 2, entityInstances.size() );
-        assertTrue( entityInstances.contains( entityInstanceA1 ) );
-        assertTrue( entityInstances.contains( entityInstanceA3 ) );
-    }
-
-    @Test
     public void testGetTrackedEntityInstancesByAttribute()
     {
         entityInstanceService.addTrackedEntityInstance( entityInstanceA2 );
@@ -365,67 +319,4 @@
             new ArrayList<TrackedEntityAttributeValue>(), new ArrayList<TrackedEntityAttributeValue>() );
         assertEquals( "B", entityInstanceService.getTrackedEntityInstance( idA ).getName() );
     }
-
-    @Test
-    public void testCountGetTrackedEntityInstancesByOrgUnit()
-    {
-        entityInstanceService.addTrackedEntityInstance( entityInstanceA1 );
-        entityInstanceService.addTrackedEntityInstance( entityInstanceA2 );
-        entityInstanceService.addTrackedEntityInstance( entityInstanceA3 );
-
-        assertEquals( 2, entityInstanceService.countGetTrackedEntityInstancesByOrgUnit( organisationUnit ) );
-    }
-
-    @Test
-    public void testCountGetTrackedEntityInstancesByOrgUnitProgram()
-    {
-        programService.addProgram( programA );
-        programService.addProgram( programB );
-
-        entityInstanceService.addTrackedEntityInstance( entityInstanceA1 );
-        entityInstanceService.addTrackedEntityInstance( entityInstanceB1 );
-        entityInstanceService.addTrackedEntityInstance( entityInstanceA2 );
-        entityInstanceService.addTrackedEntityInstance( entityInstanceB2 );
-
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA1, programA, date, date, organisationUnit );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceB1, programA, date, date, organisationUnit );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA2, programA, date, date, organisationUnit );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceB2, programB, date, date, organisationUnit );
-
-        assertEquals( 2, entityInstanceService.countGetTrackedEntityInstancesByOrgUnitProgram( organisationUnit, programA ) );
-        assertEquals( 1, entityInstanceService.countGetTrackedEntityInstancesByOrgUnitProgram( organisationUnit, programB ) );
-    }
-
-    @Test
-    public void testGetTrackedEntityInstancesByPhone()
-    {
-        entityInstanceService.addTrackedEntityInstance( entityInstanceA1 );
-        entityInstanceService.addTrackedEntityInstance( entityInstanceA2 );
-        entityInstanceService.addTrackedEntityInstance( entityInstanceA3 );
-
-        TrackedEntityAttribute entityInstanceAttribute = createTrackedEntityAttribute( 'B' );
-        entityInstanceAttribute.setValueType( TrackedEntityAttribute.TYPE_PHONE_NUMBER );
-        attributeService.addTrackedEntityAttribute( entityInstanceAttribute );
-
-        TrackedEntityAttributeValue attributeValue = createTrackedEntityAttributeValue( 'A', entityInstanceA1,
-            entityInstanceAttribute );
-        attributeValue.setValue( "123456789" );
-        attributeValueService.addTrackedEntityAttributeValue( attributeValue );
-
-        entityInstanceA1.addAttributeValue( attributeValue );
-        entityInstanceService.updateTrackedEntityInstance( entityInstanceA1 );
-
-        attributeValue = createTrackedEntityAttributeValue( 'A', entityInstanceA2, entityInstanceAttribute );
-        attributeValue.setValue( "123456789" );
-        attributeValueService.addTrackedEntityAttributeValue( attributeValue );
-        entityInstanceA2.addAttributeValue( attributeValue );
-        entityInstanceService.updateTrackedEntityInstance( entityInstanceA2 );
-
-        Collection<TrackedEntityInstance> entityInstances = entityInstanceService.getTrackedEntityInstancesByPhone(
-            "123456789", null, null );
-        assertEquals( 2, entityInstances.size() );
-        assertTrue( entityInstances.contains( entityInstanceA1 ) );
-        assertTrue( entityInstances.contains( entityInstanceA2 ) );
-    }
-
 }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStoreTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStoreTest.java	2014-04-22 00:17:55 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStoreTest.java	2014-05-07 09:33:33 +0000
@@ -194,35 +194,6 @@
     }
 
     @Test
-    public void testGetByProgram()
-    {
-        programService.addProgram( programA );
-        programService.addProgram( programB );
-
-        entityInstanceStore.save( entityInstanceA1 );
-        entityInstanceStore.save( entityInstanceB1 );
-        entityInstanceStore.save( entityInstanceA2 );
-        entityInstanceStore.save( entityInstanceB2 );
-
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA1, programA, date, date, organisationUnit );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA2, programA, date, date, organisationUnit );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceB1, programA, date, date, organisationUnit );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceB2, programB, date, date, organisationUnit );
-
-        Collection<TrackedEntityInstance> entityInstances = entityInstanceStore.getByProgram( programA, 0, 100 );
-
-        assertEquals( 3, entityInstances.size() );
-        assertTrue( entityInstances.contains( entityInstanceA1 ) );
-        assertTrue( entityInstances.contains( entityInstanceA2 ) );
-        assertTrue( entityInstances.contains( entityInstanceB1 ) );
-
-        entityInstances = entityInstanceStore.getByOrgUnitProgram( organisationUnit, programB, 0, 100 );
-
-        assertEquals( 1, entityInstances.size() );
-        assertTrue( entityInstances.contains( entityInstanceB2 ) );
-    }
-
-    @Test
     public void testGetRepresentatives()
     {
         entityInstanceStore.save( entityInstanceB1 );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/AddOrganisationUnitAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/AddOrganisationUnitAction.java	2014-05-05 08:08:38 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/AddOrganisationUnitAction.java	2014-05-07 09:33:33 +0000
@@ -28,13 +28,17 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import com.opensymphony.xwork2.Action;
+import static org.hisp.dhis.system.util.TextUtils.nullIfEmpty;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+
 import org.hisp.dhis.attribute.AttributeService;
 import org.hisp.dhis.calendar.CalendarService;
 import org.hisp.dhis.calendar.DateUnit;
 import org.hisp.dhis.common.IdentifiableObjectManager;
 import org.hisp.dhis.dataset.DataSetService;
-import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
@@ -44,11 +48,7 @@
 import org.hisp.dhis.system.util.ValidationUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-
-import static org.hisp.dhis.system.util.TextUtils.nullIfEmpty;
+import com.opensymphony.xwork2.Action;
 
 /**
  * @author Torgeir Lorange Ostby
@@ -60,13 +60,6 @@
     // Dependencies
     // -------------------------------------------------------------------------
 
-    private I18nFormat format;
-
-    public void setFormat( I18nFormat format )
-    {
-        this.format = format;
-    }
-
     private OrganisationUnitService organisationUnitService;
 
     public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/UpdateOrganisationUnitAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/UpdateOrganisationUnitAction.java	2014-05-05 08:08:38 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/UpdateOrganisationUnitAction.java	2014-05-07 09:33:33 +0000
@@ -28,14 +28,22 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import com.opensymphony.xwork2.Action;
+import static org.hisp.dhis.system.util.TextUtils.nullIfEmpty;
+import static org.hisp.dhis.system.util.ValidationUtils.coordinateIsValid;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
 import org.hisp.dhis.attribute.AttributeService;
 import org.hisp.dhis.calendar.CalendarService;
 import org.hisp.dhis.calendar.DateUnit;
 import org.hisp.dhis.common.IdentifiableObjectManager;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
-import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
@@ -45,15 +53,7 @@
 import org.hisp.dhis.system.util.ValidationUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import static org.hisp.dhis.system.util.TextUtils.nullIfEmpty;
-import static org.hisp.dhis.system.util.ValidationUtils.coordinateIsValid;
+import com.opensymphony.xwork2.Action;
 
 /**
  * @author Torgeir Lorange Ostby
@@ -65,13 +65,6 @@
     // Dependencies
     // -------------------------------------------------------------------------
 
-    private I18nFormat format;
-
-    public void setFormat( I18nFormat format )
-    {
-        this.format = format;
-    }
-
     private OrganisationUnitService organisationUnitService;
 
     public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )

=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/SearchPatientAction.java'
--- dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/SearchPatientAction.java	2014-05-07 09:03:42 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/SearchPatientAction.java	2014-05-07 09:33:33 +0000
@@ -38,10 +38,8 @@
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
 import org.hisp.dhis.paging.ActionPagingSupport;
-import org.hisp.dhis.program.ProgramInstance;
 import org.hisp.dhis.program.ProgramService;
 import org.hisp.dhis.trackedentity.TrackedEntityInstance;
-import org.hisp.dhis.trackedentity.TrackedEntityInstanceQueryParams;
 import org.hisp.dhis.trackedentity.TrackedEntityInstanceService;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -124,11 +122,12 @@
         // List all patients
         if ( listAll )
         {
-            total = patientService.countGetTrackedEntityInstancesByOrgUnit( organisationUnit );
+            //TODO re-implement using TrackedEntityInstanceService.getTrackedEntityInstances( TrackedEntityInstanceQueryParams )
+            
+            //total = patientService.countGetTrackedEntityInstancesByOrgUnit( organisationUnit );
             this.paging = createPaging( total );
 
-            patients = new ArrayList<TrackedEntityInstance>( patientService.getTrackedEntityInstances( organisationUnit, paging.getStartPos(),
-                paging.getPageSize() ) );
+            //patients = new ArrayList<TrackedEntityInstance>( patientService.getTrackedEntityInstances( organisationUnit, paging.getStartPos(), paging.getPageSize() ) );
 
         }
         // search patients