← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14434: Removed I18nManager from interface methods in ProgramInstnanceService and loading it inside the impl

 

------------------------------------------------------------
revno: 14434
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-03-26 15:01:14 +0100
message:
  Removed I18nManager from interface methods in ProgramInstnanceService and loading it inside the impl
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstanceService.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java
  dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/EnrollmentServiceTest.java
  dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/RegistrationSingleEventServiceTest.java
  dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/TrackedEntityInstanceServiceTest.java
  dhis-2/dhis-services/dhis-service-eventreporting/src/test/java/org/hisp/dhis/caseaggregation/CaseAggregationConditionServiceTest.java
  dhis-2/dhis-services/dhis-service-eventreporting/src/test/java/org/hisp/dhis/caseaggregation/CaseAggregationConditionStoreTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java
  dhis-2/dhis-services/dhis-service-tracker/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramExpressionServiceTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramIndicatorServiceTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramInstanceServiceTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramValidationServiceTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceReminderServiceTest.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-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueServiceTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueStoreTest.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CompleteDataEntryAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetProgramInstanceHistoryAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceHistoryAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SaveProgramEnrollmentAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SetProgramInstanceStatusAction.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/program/ProgramInstanceService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstanceService.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstanceService.java	2014-03-26 14:01:14 +0000
@@ -28,18 +28,17 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+
 import org.hisp.dhis.common.Grid;
 import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.message.MessageConversation;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.sms.outbound.OutboundSms;
 import org.hisp.dhis.trackedentity.TrackedEntityInstance;
 
-import java.util.Collection;
-import java.util.Date;
-import java.util.List;
-
 /**
  * @author Abyot Asalefew
  * @version $Id$
@@ -266,23 +265,21 @@
      * 
      * @param entityInstance TrackedEntityInstance
      * @param i18n I18n object
-     * @param format I18nFormat object
      * 
      * @return Grid list in which each grid is the program information details
      *         of the TrackedEntityInstance
      */
-    List<Grid> getProgramInstanceReport( TrackedEntityInstance entityInstance, I18n i18n, I18nFormat format );
+    List<Grid> getProgramInstanceReport( TrackedEntityInstance entityInstance, I18n i18n );
 
     /**
      * Export a program information details report
      * 
      * @param programInstance ProgramInstance
      * @param i18n I18n object
-     * @param format I18nFormat object
      * 
      * @return Grid object
      */
-    Grid getProgramInstanceReport( ProgramInstance programInstance, I18n i18n, I18nFormat format );
+    Grid getProgramInstanceReport( ProgramInstance programInstance, I18n i18n );
 
     /**
      * Retrieve program instances with a certain status on a program and an
@@ -330,11 +327,10 @@
      * @param programInstance ProgramInstance
      * @param status The time to send message, send when a person enrolled an
      *        program or complete a program or send by scheduled days
-     * @param format I18nFormat object
      * 
      * @return OutboundSms list
      */
-    Collection<OutboundSms> sendMessages( ProgramInstance programInstance, int status, I18nFormat format );
+    Collection<OutboundSms> sendMessages( ProgramInstance programInstance, int status );
 
     /**
      * Send messages defined as DHIS messages for a program
@@ -342,12 +338,10 @@
      * @param programInstance ProgramInstance
      * @param status The time to send message, send when a person enrolled an
      *        program or complete a program or send by scheduled days
-     * @param format I18nFormat object
      * 
      * @return MessageConversation list
      */
-    Collection<MessageConversation> sendMessageConversations( ProgramInstance programInstance, int status,
-        I18nFormat format );
+    Collection<MessageConversation> sendMessageConversations( ProgramInstance programInstance, int status );
 
     /**
      * Enroll a TrackedEntityInstance into a program
@@ -357,12 +351,11 @@
      * @param enrollmentDate The date of enrollment
      * @param dateOfIncident The date of incident
      * @param orgunit Organisation Unit
-     * @param format I18nFormat object
      * 
      * @return ProgramInsance
      */
     ProgramInstance enrollTrackedEntityInstance( TrackedEntityInstance entityInstance, Program program, Date enrollmentDate, Date dateOfIncident,
-        OrganisationUnit orgunit, I18nFormat format );
+        OrganisationUnit orgunit );
 
     /**
      * Check a program instance if it can be completed automatically. If there
@@ -380,9 +373,8 @@
      * send if it was defined to send when to complete this program
      * 
      * @param programInstance ProgramInstance
-     * @param format I18nFormat
      */
-    void completeProgramInstanceStatus( ProgramInstance programInstance, I18nFormat format );
+    void completeProgramInstanceStatus( ProgramInstance programInstance );
 
     /**
      * Set status as skipped for overdue events; Remove scheduled events

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java	2014-03-24 16:47:20 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java	2014-03-26 14:01:14 +0000
@@ -291,8 +291,7 @@
         }
 
         ProgramInstance programInstance = programInstanceService.enrollTrackedEntityInstance( entityInstance, program,
-            enrollment.getDateOfEnrollment(), enrollment.getDateOfIncident(), entityInstance.getOrganisationUnit(),
-            i18nManager.getI18nFormat() );
+            enrollment.getDateOfEnrollment(), enrollment.getDateOfIncident(), entityInstance.getOrganisationUnit() );
 
         if ( programInstance == null )
         {
@@ -369,7 +368,7 @@
             }
             else if ( enrollment.getStatus().equals( EnrollmentStatus.COMPLETED ) )
             {
-                programInstanceService.completeProgramInstanceStatus( programInstance, i18nManager.getI18nFormat() );
+                programInstanceService.completeProgramInstanceStatus( programInstance );
             }
             else
             {
@@ -419,7 +418,7 @@
         ProgramInstance programInstance = programInstanceService.getProgramInstance( enrollment.getEnrollment() );
         Assert.notNull( programInstance );
 
-        programInstanceService.completeProgramInstanceStatus( programInstance, i18nManager.getI18nFormat() );
+        programInstanceService.completeProgramInstanceStatus( programInstance );
     }
 
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/EnrollmentServiceTest.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/EnrollmentServiceTest.java	2014-03-19 16:49:47 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/EnrollmentServiceTest.java	2014-03-26 14:01:14 +0000
@@ -30,7 +30,6 @@
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.mock;
 
 import java.util.Date;
 import java.util.HashSet;
@@ -46,7 +45,6 @@
 import org.hisp.dhis.dxf2.events.trackedentity.TrackedEntityInstanceService;
 import org.hisp.dhis.dxf2.importsummary.ImportStatus;
 import org.hisp.dhis.dxf2.importsummary.ImportSummary;
-import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.period.Cal;
 import org.hisp.dhis.program.Program;
@@ -136,8 +134,8 @@
     @Test
     public void testGetEnrollments()
     {
-        programInstanceService.enrollTrackedEntityInstance( maleA, programA, null, null, organisationUnitA, mock( I18nFormat.class ) );
-        programInstanceService.enrollTrackedEntityInstance( femaleA, programA, null, null, organisationUnitA, mock( I18nFormat.class ) );
+        programInstanceService.enrollTrackedEntityInstance( maleA, programA, null, null, organisationUnitA );
+        programInstanceService.enrollTrackedEntityInstance( femaleA, programA, null, null, organisationUnitA );
 
         assertEquals( 2, enrollmentService.getEnrollments().getEnrollments().size() );
     }
@@ -145,8 +143,8 @@
     @Test
     public void testGetEnrollmentsByPatient()
     {
-        programInstanceService.enrollTrackedEntityInstance( maleA, programA, null, null, organisationUnitA, mock( I18nFormat.class ) );
-        programInstanceService.enrollTrackedEntityInstance( femaleA, programA, null, null, organisationUnitA, mock( I18nFormat.class ) );
+        programInstanceService.enrollTrackedEntityInstance( maleA, programA, null, null, organisationUnitA );
+        programInstanceService.enrollTrackedEntityInstance( femaleA, programA, null, null, organisationUnitA );
 
         assertEquals( 1, enrollmentService.getEnrollments( maleA ).getEnrollments().size() );
         assertEquals( 1, enrollmentService.getEnrollments( femaleA ).getEnrollments().size() );
@@ -156,8 +154,8 @@
     public void testGetEnrollmentsByPerson()
     {
 
-        programInstanceService.enrollTrackedEntityInstance( maleA, programA, null, null, organisationUnitA, mock( I18nFormat.class ) );
-        programInstanceService.enrollTrackedEntityInstance( femaleA, programA, null, null, organisationUnitA, mock( I18nFormat.class ) );
+        programInstanceService.enrollTrackedEntityInstance( maleA, programA, null, null, organisationUnitA );
+        programInstanceService.enrollTrackedEntityInstance( femaleA, programA, null, null, organisationUnitA );
 
         TrackedEntityInstance male = trackedEntityInstanceService.getTrackedEntityInstance( maleA );
         TrackedEntityInstance female = trackedEntityInstanceService.getTrackedEntityInstance( femaleA );
@@ -169,8 +167,8 @@
     @Test
     public void testGetEnrollmentsByStatus()
     {
-        ProgramInstance piMale = programInstanceService.enrollTrackedEntityInstance( maleA, programA, null, null, organisationUnitA, mock( I18nFormat.class ) );
-        ProgramInstance piFemale = programInstanceService.enrollTrackedEntityInstance( femaleA, programA, null, null, organisationUnitA, mock( I18nFormat.class ) );
+        ProgramInstance piMale = programInstanceService.enrollTrackedEntityInstance( maleA, programA, null, null, organisationUnitA );
+        ProgramInstance piFemale = programInstanceService.enrollTrackedEntityInstance( femaleA, programA, null, null, organisationUnitA );
 
         assertEquals( 2, enrollmentService.getEnrollments( EnrollmentStatus.ACTIVE ).getEnrollments().size() );
         assertEquals( 0, enrollmentService.getEnrollments( EnrollmentStatus.CANCELLED ).getEnrollments().size() );
@@ -182,7 +180,7 @@
         assertEquals( 1, enrollmentService.getEnrollments( EnrollmentStatus.CANCELLED ).getEnrollments().size() );
         assertEquals( 0, enrollmentService.getEnrollments( EnrollmentStatus.COMPLETED ).getEnrollments().size() );
 
-        programInstanceService.completeProgramInstanceStatus( piFemale, mock( I18nFormat.class ) );
+        programInstanceService.completeProgramInstanceStatus( piFemale );
 
         assertEquals( 0, enrollmentService.getEnrollments( EnrollmentStatus.ACTIVE ).getEnrollments().size() );
         assertEquals( 1, enrollmentService.getEnrollments( EnrollmentStatus.CANCELLED ).getEnrollments().size() );

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/RegistrationSingleEventServiceTest.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/RegistrationSingleEventServiceTest.java	2014-03-19 16:49:47 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/RegistrationSingleEventServiceTest.java	2014-03-26 14:01:14 +0000
@@ -28,9 +28,14 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertThat;
+
+import java.util.HashSet;
+
 import org.hamcrest.CoreMatchers;
 import org.hisp.dhis.DhisSpringTest;
-import org.hisp.dhis.DhisTest;
 import org.hisp.dhis.common.IdentifiableObjectManager;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dxf2.events.enrollment.Enrollment;
@@ -54,10 +59,6 @@
 import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 
-import java.util.HashSet;
-
-import static org.junit.Assert.*;
-
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/TrackedEntityInstanceServiceTest.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/TrackedEntityInstanceServiceTest.java	2014-03-19 16:49:47 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/TrackedEntityInstanceServiceTest.java	2014-03-26 14:01:14 +0000
@@ -36,7 +36,6 @@
 import java.util.HashSet;
 
 import org.hisp.dhis.DhisSpringTest;
-import org.hisp.dhis.DhisTest;
 import org.hisp.dhis.common.IdentifiableObjectManager;
 import org.hisp.dhis.dxf2.events.trackedentity.TrackedEntityInstance;
 import org.hisp.dhis.dxf2.events.trackedentity.TrackedEntityInstanceService;
@@ -110,8 +109,8 @@
         manager.save( femaleB );
         manager.save( programA );
 
-        programInstanceService.enrollTrackedEntityInstance( maleA, programA, null, null, organisationUnitA, null );
-        programInstanceService.enrollTrackedEntityInstance( femaleA, programA, null, null, organisationUnitA, null );
+        programInstanceService.enrollTrackedEntityInstance( maleA, programA, null, null, organisationUnitA );
+        programInstanceService.enrollTrackedEntityInstance( femaleA, programA, null, null, organisationUnitA );
     }
 
     // @Override

=== modified file 'dhis-2/dhis-services/dhis-service-eventreporting/src/test/java/org/hisp/dhis/caseaggregation/CaseAggregationConditionServiceTest.java'
--- dhis-2/dhis-services/dhis-service-eventreporting/src/test/java/org/hisp/dhis/caseaggregation/CaseAggregationConditionServiceTest.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-eventreporting/src/test/java/org/hisp/dhis/caseaggregation/CaseAggregationConditionServiceTest.java	2014-03-26 14:01:14 +0000
@@ -255,7 +255,7 @@
         Calendar today = Calendar.getInstance();
         PeriodType.clearTimeOfDay( today );
         ProgramInstance programInstance = programInstanceService.enrollTrackedEntityInstance( entityInstance, program,
-            today.getTime(), today.getTime(), organisationUnit, null );
+            today.getTime(), today.getTime(), organisationUnit );
 
         ProgramStageInstance stageInstanceA = programStageInstanceService.getProgramStageInstance( programInstance,
             stageA );

=== modified file 'dhis-2/dhis-services/dhis-service-eventreporting/src/test/java/org/hisp/dhis/caseaggregation/CaseAggregationConditionStoreTest.java'
--- dhis-2/dhis-services/dhis-service-eventreporting/src/test/java/org/hisp/dhis/caseaggregation/CaseAggregationConditionStoreTest.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-eventreporting/src/test/java/org/hisp/dhis/caseaggregation/CaseAggregationConditionStoreTest.java	2014-03-26 14:01:14 +0000
@@ -252,7 +252,7 @@
         Calendar today = Calendar.getInstance();
         PeriodType.clearTimeOfDay( today );
         ProgramInstance programInstance = programInstanceService.enrollTrackedEntityInstance( entityInstance, program, today.getTime(),
-            today.getTime(), organisationUnit, null );
+            today.getTime(), organisationUnit );
 
         ProgramStageInstance stageInstanceA = programStageInstanceService.getProgramStageInstance( programInstance,
             stageA );

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java	2014-03-23 10:06:52 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java	2014-03-26 14:01:14 +0000
@@ -28,11 +28,21 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
 import org.hisp.dhis.common.Grid;
 import org.hisp.dhis.common.GridHeader;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.i18n.I18nFormat;
+import org.hisp.dhis.i18n.I18nManager;
 import org.hisp.dhis.message.MessageConversation;
 import org.hisp.dhis.message.MessageService;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -56,15 +66,6 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
 /**
  * @author Abyot Asalefew
  */
@@ -139,6 +140,13 @@
         this.programStageInstanceService = programStageInstanceService;
     }
 
+    private I18nManager i18nManager;
+    
+    public void setI18nManager( I18nManager i18nManager )
+    {
+        this.i18nManager = i18nManager;
+    }
+
     @Autowired
     private TrackedEntityInstanceService entityInstanceService;
 
@@ -258,8 +266,10 @@
         return programInstanceStore.count( program, orgunitIds, startDate, endDate );
     }
 
-    public List<Grid> getProgramInstanceReport( TrackedEntityInstance instance, I18n i18n, I18nFormat format )
+    public List<Grid> getProgramInstanceReport( TrackedEntityInstance instance, I18n i18n )
     {
+        I18nFormat format = i18nManager.getI18nFormat();
+        
         List<Grid> grids = new ArrayList<Grid>();
 
         // ---------------------------------------------------------------------
@@ -322,7 +332,7 @@
             {
                 if ( programs.contains( programInstance.getProgram() ) )
                 {
-                    Grid gridProgram = getProgramInstanceReport( programInstance, i18n, format );
+                    Grid gridProgram = getProgramInstanceReport( programInstance, i18n );
 
                     grids.add( gridProgram );
                 }
@@ -332,8 +342,10 @@
         return grids;
     }
 
-    public Grid getProgramInstanceReport( ProgramInstance programInstance, I18n i18n, I18nFormat format )
+    public Grid getProgramInstanceReport( ProgramInstance programInstance, I18n i18n )
     {
+        I18nFormat format = i18nManager.getI18nFormat();
+        
         Grid grid = new ListGrid();
 
         // ---------------------------------------------------------------------
@@ -421,7 +433,7 @@
             grid.addValue( format.formatDate( programInstance.getDateOfIncident() ) );
         }
 
-        getProgramStageInstancesReport( grid, programInstance, format, i18n );
+        getProgramStageInstancesReport( grid, programInstance, i18n );
 
         return grid;
     }
@@ -449,7 +461,7 @@
         return result;
     }
 
-    public Collection<OutboundSms> sendMessages( ProgramInstance programInstance, int status, I18nFormat format )
+    public Collection<OutboundSms> sendMessages( ProgramInstance programInstance, int status )
     {
         TrackedEntityInstance entityInstance = programInstance.getEntityInstance();
         Collection<OutboundSms> outboundSmsList = new HashSet<OutboundSms>();
@@ -463,7 +475,7 @@
                 && rm.getWhenToSend() == status
                 && (rm.getMessageType() == TrackedEntityInstanceReminder.MESSAGE_TYPE_DIRECT_SMS || rm.getMessageType() == TrackedEntityInstanceReminder.MESSAGE_TYPE_BOTH) )
             {
-                OutboundSms outboundSms = sendProgramMessage( rm, programInstance, entityInstance, format );
+                OutboundSms outboundSms = sendProgramMessage( rm, programInstance, entityInstance );
 
                 if ( outboundSms != null )
                 {
@@ -476,9 +488,10 @@
     }
 
     @Override
-    public Collection<MessageConversation> sendMessageConversations( ProgramInstance programInstance, int status,
-        I18nFormat format )
+    public Collection<MessageConversation> sendMessageConversations( ProgramInstance programInstance, int status )
     {
+        I18nFormat format = i18nManager.getI18nFormat();
+        
         Collection<MessageConversation> messageConversations = new HashSet<MessageConversation>();
 
         Collection<TrackedEntityInstanceReminder> reminders = programInstance.getProgram().getInstanceReminders();
@@ -502,7 +515,7 @@
 
     @Override
     public ProgramInstance enrollTrackedEntityInstance( TrackedEntityInstance entityInstance, Program program,
-        Date enrollmentDate, Date dateOfIncident, OrganisationUnit organisationUnit, I18nFormat format )
+        Date enrollmentDate, Date dateOfIncident, OrganisationUnit organisationUnit )
     {
         // ---------------------------------------------------------------------
         // Add program instance
@@ -562,8 +575,7 @@
             outboundSms = new ArrayList<OutboundSms>();
         }
 
-        outboundSms.addAll( sendMessages( programInstance, TrackedEntityInstanceReminder.SEND_WHEN_TO_EMROLLEMENT,
-            format ) );
+        outboundSms.addAll( sendMessages( programInstance, TrackedEntityInstanceReminder.SEND_WHEN_TO_EMROLLEMENT ) );
 
         // -----------------------------------------------------------------
         // Send message when to completed the program
@@ -576,8 +588,7 @@
             messages = new ArrayList<MessageConversation>();
         }
 
-        messages.addAll( sendMessageConversations( programInstance,
-            TrackedEntityInstanceReminder.SEND_WHEN_TO_EMROLLEMENT, format ) );
+        messages.addAll( sendMessageConversations( programInstance, TrackedEntityInstanceReminder.SEND_WHEN_TO_EMROLLEMENT ) );
 
         updateProgramInstance( programInstance );
         entityInstanceService.updateTrackedEntityInstance( entityInstance );
@@ -602,7 +613,7 @@
     }
 
     @Override
-    public void completeProgramInstanceStatus( ProgramInstance programInstance, I18nFormat format )
+    public void completeProgramInstanceStatus( ProgramInstance programInstance )
     {
         // ---------------------------------------------------------------------
         // Send sms-message when to completed the program
@@ -616,7 +627,7 @@
         }
 
         outboundSms.addAll( sendMessages( programInstance,
-            TrackedEntityInstanceReminder.SEND_WHEN_TO_C0MPLETED_PROGRAM, format ) );
+            TrackedEntityInstanceReminder.SEND_WHEN_TO_C0MPLETED_PROGRAM ) );
 
         // -----------------------------------------------------------------
         // Send DHIS message when to completed the program
@@ -630,7 +641,7 @@
         }
 
         messageConversations.addAll( sendMessageConversations( programInstance,
-            TrackedEntityInstanceReminder.SEND_WHEN_TO_C0MPLETED_PROGRAM, format ) );
+            TrackedEntityInstanceReminder.SEND_WHEN_TO_C0MPLETED_PROGRAM ) );
 
         // -----------------------------------------------------------------
         // Update program-instance
@@ -724,9 +735,10 @@
         return programStageInstance;
     }
 
-    private void getProgramStageInstancesReport( Grid grid, ProgramInstance programInstance, I18nFormat format,
-        I18n i18n )
+    private void getProgramStageInstancesReport( Grid grid, ProgramInstance programInstance, I18n i18n )
     {
+        I18nFormat format = i18nManager.getI18nFormat();
+        
         Collection<ProgramStageInstance> programStageInstances = programInstance.getProgramStageInstances();
 
         for ( ProgramStageInstance programStageInstance : programStageInstances )
@@ -793,8 +805,10 @@
     }
 
     private OutboundSms sendProgramMessage( TrackedEntityInstanceReminder reminder, ProgramInstance programInstance,
-        TrackedEntityInstance entityInstance, I18nFormat format )
+        TrackedEntityInstance entityInstance )
     {
+        I18nFormat format = i18nManager.getI18nFormat();
+        
         Set<String> phoneNumbers = reminderService.getPhonenumbers( reminder, entityInstance );
         OutboundSms outboundSms = null;
 

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/resources/META-INF/dhis/beans.xml	2014-03-21 06:39:05 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/resources/META-INF/dhis/beans.xml	2014-03-26 14:01:14 +0000
@@ -201,6 +201,7 @@
 		<property name="messageService" ref="org.hisp.dhis.message.MessageService" />
 		<property name="programStageInstanceService"
 			ref="org.hisp.dhis.program.ProgramStageInstanceService" />
+		<property name="i18nManager" ref="org.hisp.dhis.i18n.I18nManager" />
 	</bean>
 
 	<bean id="org.hisp.dhis.program.ProgramStageService" class="org.hisp.dhis.program.DefaultProgramStageService">

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramExpressionServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramExpressionServiceTest.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramExpressionServiceTest.java	2014-03-26 14:01:14 +0000
@@ -135,7 +135,7 @@
         entityInstanceService.addTrackedEntityInstance( entityInstance );
 
         ProgramInstance programInstance = programInstanceService.enrollTrackedEntityInstance( entityInstance, program, new Date(),
-            new Date(), organisationUnit, null );
+            new Date(), organisationUnit );
         stageInstance = programStageInstanceService.getProgramStageInstance( programInstance, stageA );
 
         TrackedEntityDataValue dataValueA = new TrackedEntityDataValue( stageInstance, dataElementA, "1" );

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramIndicatorServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramIndicatorServiceTest.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramIndicatorServiceTest.java	2014-03-26 14:01:14 +0000
@@ -133,7 +133,7 @@
         enrollmentDate = calEnrollment.getTime();
 
         programInstance = programInstanceService.enrollTrackedEntityInstance( entityInstance, programA, enrollmentDate, incidenDate,
-            organisationUnit, null );
+            organisationUnit );
 
         indicatorDate = new ProgramIndicator( "IndicatorA", "IndicatorDesA", ProgramIndicator.VALUE_TYPE_INT, "( "
             + ProgramIndicator.INCIDENT_DATE + " - " + ProgramIndicator.ENROLLEMENT_DATE + " )  / 7" );

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramInstanceServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramInstanceServiceTest.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramInstanceServiceTest.java	2014-03-26 14:01:14 +0000
@@ -41,7 +41,6 @@
 
 import org.hisp.dhis.DhisSpringTest;
 import org.hisp.dhis.message.MessageConversation;
-import org.hisp.dhis.mock.MockI18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.period.PeriodType;
@@ -49,9 +48,9 @@
 import org.hisp.dhis.sms.config.SmsConfiguration;
 import org.hisp.dhis.sms.config.SmsConfigurationManager;
 import org.hisp.dhis.sms.outbound.OutboundSms;
-import org.hisp.dhis.trackedentity.TrackedEntityInstance;
 import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
 import org.hisp.dhis.trackedentity.TrackedEntityAttributeService;
+import org.hisp.dhis.trackedentity.TrackedEntityInstance;
 import org.hisp.dhis.trackedentity.TrackedEntityInstanceReminder;
 import org.hisp.dhis.trackedentity.TrackedEntityInstanceService;
 import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue;
@@ -118,16 +117,12 @@
 
     private Collection<Integer> orgunitIds;
 
-    private MockI18nFormat mockFormat;
-
     @Autowired
     JdbcTemplate jdbcTemplate;
 
     @Override
     public void setUpTest()
     {
-        mockFormat = new MockI18nFormat();
-
         organisationUnitA = createOrganisationUnit( 'A' );
         int idA = organisationUnitService.addOrganisationUnit( organisationUnitA );
 
@@ -448,7 +443,7 @@
         programInstanceService.addProgramInstance( programInstanceD );
 
         ProgramInstance programInstance = programInstanceService.enrollTrackedEntityInstance( entityInstanceA, programA, enrollmentDate,
-            incidenDate, organisationUnitA, null );
+            incidenDate, organisationUnitA );
         programInstance.setStatus( ProgramInstance.STATUS_COMPLETED );
         programInstanceService.updateProgramInstance( programInstance );
 
@@ -464,12 +459,12 @@
         programInstanceService.addProgramInstance( programInstanceA );
 
         ProgramInstance programInstance1 = programInstanceService.enrollTrackedEntityInstance( entityInstanceA, programA, enrollmentDate,
-            incidenDate, organisationUnitA, null );
+            incidenDate, organisationUnitA );
         programInstance1.setStatus( ProgramInstance.STATUS_COMPLETED );
         programInstanceService.updateProgramInstance( programInstance1 );
 
         ProgramInstance programInstance2 = programInstanceService.enrollTrackedEntityInstance( entityInstanceA, programA, enrollmentDate,
-            incidenDate, organisationUnitA, null );
+            incidenDate, organisationUnitA );
         programInstance2.setStatus( ProgramInstance.STATUS_COMPLETED );
         programInstanceService.updateProgramInstance( programInstance2 );
 
@@ -577,7 +572,7 @@
 
         programInstanceService.addProgramInstance( programInstanceA );
         Collection<OutboundSms> outboundSmsList = programInstanceService.sendMessages( programInstanceA,
-            TrackedEntityInstanceReminder.SEND_WHEN_TO_C0MPLETED_EVENT, mockFormat );
+            TrackedEntityInstanceReminder.SEND_WHEN_TO_C0MPLETED_EVENT );
         assertEquals( 1, outboundSmsList.size() );
         assertEquals( "Test program message template", outboundSmsList.iterator().next().getMessage() );
     }
@@ -592,7 +587,7 @@
         programInstanceService.addProgramInstance( programInstanceB );
 
         Collection<MessageConversation> messages = programInstanceService.sendMessageConversations( programInstanceA,
-            TrackedEntityInstanceReminder.SEND_WHEN_TO_C0MPLETED_EVENT, mockFormat );
+            TrackedEntityInstanceReminder.SEND_WHEN_TO_C0MPLETED_EVENT );
         assertEquals( 1, messages.size() );
         assertEquals( "Test program message template", messages.iterator().next().getMessages().get( 0 ).getText() );
     }
@@ -601,7 +596,7 @@
     public void testEnrollTrackedEntityInstance()
     {
         ProgramInstance programInstance = programInstanceService.enrollTrackedEntityInstance( entityInstanceA, programB, enrollmentDate,
-            incidenDate, organisationUnitA, mockFormat );
+            incidenDate, organisationUnitA );
 
         assertNotNull( programInstanceService.getProgramInstance( programInstance.getId() ) );
     }
@@ -622,8 +617,8 @@
         int idA = programInstanceService.addProgramInstance( programInstanceA );
         int idD = programInstanceService.addProgramInstance( programInstanceD );
 
-        programInstanceService.completeProgramInstanceStatus( programInstanceA, mockFormat );
-        programInstanceService.completeProgramInstanceStatus( programInstanceD, mockFormat );
+        programInstanceService.completeProgramInstanceStatus( programInstanceA );
+        programInstanceService.completeProgramInstanceStatus( programInstanceD );
 
         assertEquals( ProgramInstance.STATUS_COMPLETED, programInstanceService.getProgramInstance( idA ).getStatus() );
         assertEquals( ProgramInstance.STATUS_COMPLETED, programInstanceService.getProgramInstance( idD ).getStatus() );

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramValidationServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramValidationServiceTest.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/program/ProgramValidationServiceTest.java	2014-03-26 14:01:14 +0000
@@ -148,7 +148,7 @@
         entityInstanceService.addTrackedEntityInstance( entityInstance );
 
         ProgramInstance programInstance = programInstanceService.enrollTrackedEntityInstance( entityInstance, program, new Date(),
-            new Date(), organisationUnit, null );
+            new Date(), organisationUnit );
 
         stageInstanceA = programStageInstanceService.getProgramStageInstance( programInstance, stageA );
         stageInstanceB = programStageInstanceService.getProgramStageInstance( programInstance, stageB );

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceReminderServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceReminderServiceTest.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceReminderServiceTest.java	2014-03-26 14:01:14 +0000
@@ -171,7 +171,7 @@
         programService.updateProgram( program );
 
         programInstance = programInstanceService.enrollTrackedEntityInstance( entityInstance, program, new Date(),
-            new Date(), organisationUnit, null );
+            new Date(), organisationUnit );
     }
 
     @Test

=== 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-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceServiceTest.java	2014-03-26 14:01:14 +0000
@@ -229,8 +229,8 @@
         entityInstanceService.addTrackedEntityInstance( entityInstanceA2 );
         entityInstanceService.addTrackedEntityInstance( entityInstanceA3 );
 
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA1, programA, date, date, organisationUnit, null );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA3, programA, date, date, organisationUnit, null );
+        programInstanceService.enrollTrackedEntityInstance( entityInstanceA1, programA, date, date, organisationUnit );
+        programInstanceService.enrollTrackedEntityInstance( entityInstanceA3, programA, date, date, organisationUnit );
 
         Collection<TrackedEntityInstance> entityInstances = entityInstanceService.getTrackedEntityInstances( programA );
         assertEquals( 2, entityInstances.size() );
@@ -247,9 +247,9 @@
         entityInstanceService.addTrackedEntityInstance( entityInstanceA2 );
         entityInstanceService.addTrackedEntityInstance( entityInstanceA3 );
 
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA1, programA, date, date, organisationUnit, null );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA2, programA, date, date, organisationUnit, null );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA3, programA, date, date, organisationUnit, null );
+        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() );
@@ -293,10 +293,10 @@
         entityInstanceService.addTrackedEntityInstance( entityInstanceA2 );
         entityInstanceService.addTrackedEntityInstance( entityInstanceB2 );
 
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA1, programA, date, date, organisationUnit, null );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceB1, programA, date, date, organisationUnit, null );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA2, programA, date, date, organisationUnit, null );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceB2, programB, date, date, organisationUnit, null );
+        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 );
 
         Collection<TrackedEntityInstance> entityInstances = entityInstanceService.getTrackedEntityInstances( organisationUnit, programA, 0,
             100 );
@@ -388,10 +388,10 @@
         entityInstanceService.addTrackedEntityInstance( entityInstanceA2 );
         entityInstanceService.addTrackedEntityInstance( entityInstanceB2 );
 
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA1, programA, date, date, organisationUnit, null );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceB1, programA, date, date, organisationUnit, null );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA2, programA, date, date, organisationUnit, null );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceB2, programB, date, date, organisationUnit, null );
+        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 ) );
@@ -414,8 +414,8 @@
         attributeValueService.addTrackedEntityAttributeValue( attributeValue );
         entityInstanceA3.getAttributeValues().add( attributeValue );
 
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA3, programA, date, date, organisationUnit, null );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceB1, programA, date, date, organisationUnit, null );
+        programInstanceService.enrollTrackedEntityInstance( entityInstanceA3, programA, date, date, organisationUnit );
+        programInstanceService.enrollTrackedEntityInstance( entityInstanceB1, programA, date, date, organisationUnit );
 
         List<String> searchKeys = new ArrayList<String>();
         searchKeys.add( TrackedEntityInstance.PREFIX_TRACKED_ENTITY_ATTRIBUTE + TrackedEntityInstance.SEARCH_SAPERATE
@@ -448,8 +448,8 @@
             entityInstanceAttribute );
         attributeValueService.addTrackedEntityAttributeValue( attributeValue );
 
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA3, programA, date, date, organisationUnit, null );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceB1, programA, date, date, organisationUnit, null );
+        programInstanceService.enrollTrackedEntityInstance( entityInstanceA3, programA, date, date, organisationUnit );
+        programInstanceService.enrollTrackedEntityInstance( entityInstanceB1, programA, date, date, organisationUnit );
 
         List<String> searchKeys = new ArrayList<String>();
         searchKeys.add( TrackedEntityInstance.PREFIX_TRACKED_ENTITY_ATTRIBUTE + TrackedEntityInstance.SEARCH_SAPERATE
@@ -488,8 +488,8 @@
         entityInstanceA3.addAttributeValue( attributeValue );
         entityInstanceService.updateTrackedEntityInstance( entityInstanceA3 );
 
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA3, programA, date, date, organisationUnit, null );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceB1, programA, date, date, organisationUnit, null );
+        programInstanceService.enrollTrackedEntityInstance( entityInstanceA3, programA, date, date, organisationUnit );
+        programInstanceService.enrollTrackedEntityInstance( entityInstanceB1, programA, date, date, organisationUnit );
 
         List<String> searchKeys = new ArrayList<String>();
         searchKeys.add( TrackedEntityInstance.PREFIX_PROGRAM + TrackedEntityInstance.SEARCH_SAPERATE + idA );

=== 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-03-24 14:03:51 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStoreTest.java	2014-03-26 14:01:14 +0000
@@ -188,14 +188,10 @@
         entityInstanceStore.save( entityInstanceA2 );
         entityInstanceStore.save( entityInstanceB2 );
 
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA1, programA, date, date, organisationUnit,
-            null );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceB1, programA, date, date, organisationUnit,
-            null );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA2, programA, date, date, organisationUnit,
-            null );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceB2, programB, date, date, organisationUnit,
-            null );
+        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 );
 
         Collection<TrackedEntityInstance> entityInstances = entityInstanceStore.getByOrgUnitProgram( organisationUnit,
             programA, 0, 100 );
@@ -221,14 +217,10 @@
         entityInstanceStore.save( entityInstanceA2 );
         entityInstanceStore.save( entityInstanceB2 );
 
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA1, programA, date, date, organisationUnit,
-            null );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA2, programA, date, date, organisationUnit,
-            null );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceB1, programA, date, date, organisationUnit,
-            null );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceB2, programB, date, date, organisationUnit,
-            null );
+        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 );
 
@@ -300,10 +292,8 @@
             entityInstanceAttribute );
         attributeValueService.addTrackedEntityAttributeValue( attributeValue );
 
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA3, programA, date, date, organisationUnit,
-            null );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceB1, programA, date, date, organisationUnit,
-            null );
+        programInstanceService.enrollTrackedEntityInstance( entityInstanceA3, programA, date, date, organisationUnit );
+        programInstanceService.enrollTrackedEntityInstance( entityInstanceB1, programA, date, date, organisationUnit );
 
         List<String> searchKeys = new ArrayList<String>();
         searchKeys.add( TrackedEntityInstance.PREFIX_TRACKED_ENTITY_ATTRIBUTE + TrackedEntityInstance.SEARCH_SAPERATE

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueServiceTest.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueServiceTest.java	2014-03-26 14:01:14 +0000
@@ -151,7 +151,7 @@
         tomorrow = calTomorrow.getTime();
 
         programInstance = programInstanceService.enrollTrackedEntityInstance( entityInstance, program, yesterday, yesterday,
-            organisationUnit, null );
+            organisationUnit );
 
         stageInstanceA = programStageInstanceService.getProgramStageInstance( programInstance, stageA );
         stageInstanceB = programStageInstanceService.getProgramStageInstance( programInstance, stageB );

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueStoreTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueStoreTest.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentitydatavalue/TrackedEntityDataValueStoreTest.java	2014-03-26 14:01:14 +0000
@@ -151,7 +151,7 @@
         tomorrow = calTomorrow.getTime();
 
         programInstance = programInstanceService.enrollTrackedEntityInstance( entityInstance, program, yesterday, yesterday,
-            organisationUnit, null );
+            organisationUnit );
 
         stageInstanceA = programStageInstanceService.getProgramStageInstance( programInstance, stageA );
         stageInstanceB = programStageInstanceService.getProgramStageInstance( programInstance, stageB );

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CompleteDataEntryAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CompleteDataEntryAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CompleteDataEntryAction.java	2014-03-26 14:01:14 +0000
@@ -127,7 +127,7 @@
                 return SUCCESS;
             }
 
-            programInstanceService.completeProgramInstanceStatus( programStageInstance.getProgramInstance(), format );
+            programInstanceService.completeProgramInstanceStatus( programStageInstance.getProgramInstance() );
         }
 
         return "programcompleted";

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetProgramInstanceHistoryAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetProgramInstanceHistoryAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetProgramInstanceHistoryAction.java	2014-03-26 14:01:14 +0000
@@ -30,7 +30,6 @@
 
 import org.hisp.dhis.common.Grid;
 import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.program.ProgramInstance;
 import org.hisp.dhis.program.ProgramInstanceService;
 
@@ -62,13 +61,6 @@
         this.i18n = i18n;
     }
 
-    private I18nFormat format;
-
-    public void setFormat( I18nFormat format )
-    {
-        this.format = format;
-    }
-
     // -------------------------------------------------------------------------
     // Getters && Setters
     // -------------------------------------------------------------------------
@@ -103,7 +95,7 @@
     {
         ProgramInstance programInstance = programInstanceService.getProgramInstance( programInstanceId );
 
-        grid = programInstanceService.getProgramInstanceReport( programInstance, i18n, format );
+        grid = programInstanceService.getProgramInstanceReport( programInstance, i18n );
         
         return ( type == null ) ? SUCCESS : type;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceHistoryAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceHistoryAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceHistoryAction.java	2014-03-26 14:01:14 +0000
@@ -32,7 +32,6 @@
 
 import org.hisp.dhis.common.Grid;
 import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.program.ProgramInstanceService;
 import org.hisp.dhis.trackedentity.TrackedEntityInstance;
 import org.hisp.dhis.trackedentity.TrackedEntityInstanceService;
@@ -72,13 +71,6 @@
         this.i18n = i18n;
     }
 
-    private I18nFormat format;
-
-    public void setFormat( I18nFormat format )
-    {
-        this.format = format;
-    }
-
     // -------------------------------------------------------------------------
     // Getters && Setters
     // -------------------------------------------------------------------------
@@ -120,7 +112,7 @@
     {
         entityInstance = entityInstanceService.getTrackedEntityInstance( entityInstanceId );
 
-        grids = programInstanceService.getProgramInstanceReport( entityInstance, i18n, format );
+        grids = programInstanceService.getProgramInstanceReport( entityInstance, i18n );
 
         if ( type == null )
         {

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SaveProgramEnrollmentAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SaveProgramEnrollmentAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SaveProgramEnrollmentAction.java	2014-03-26 14:01:14 +0000
@@ -177,8 +177,7 @@
 
         if ( programInstance == null )
         {
-            programInstance = programInstanceService.enrollTrackedEntityInstance( entityInstance, program, enrollment, incident, orgunit,
-                format );
+            programInstance = programInstanceService.enrollTrackedEntityInstance( entityInstance, program, enrollment, incident, orgunit );
         }
 
         // ---------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SetProgramInstanceStatusAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SetProgramInstanceStatusAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SetProgramInstanceStatusAction.java	2014-03-26 14:01:14 +0000
@@ -31,7 +31,6 @@
 import java.util.ArrayList;
 import java.util.Collection;
 
-import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.program.ProgramInstance;
 import org.hisp.dhis.program.ProgramInstanceService;
@@ -56,13 +55,6 @@
         this.programInstanceService = programInstanceService;
     }
 
-    private I18nFormat format;
-
-    public void setFormat( I18nFormat format )
-    {
-        this.format = format;
-    }
-
     // -------------------------------------------------------------------------
     // Input/Output
     // -------------------------------------------------------------------------
@@ -100,7 +92,7 @@
 
         if ( status == ProgramInstance.STATUS_COMPLETED )
         {
-            programInstanceService.completeProgramInstanceStatus( programInstance, format );
+            programInstanceService.completeProgramInstanceStatus( programInstance );
         }
 
         else if ( status == ProgramInstance.STATUS_CANCELLED )