← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8009: Program Tracking support (WIP).

 

------------------------------------------------------------
revno: 8009
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-09-06 16:44:43 +0700
message:
  Program Tracking support (WIP).
renamed:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsMenu.vm => dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackingMenu.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsPatientRecords.vm => dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsReminderList.vm => dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsReminderSelect.vm => dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingSelect.vm
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/comment/Comment.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetOutboundSmsListAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/index.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstanceFlow.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackingMenu.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingSelect.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/patient/Patient.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java	2012-08-16 06:20:33 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java	2012-09-06 09:44:43 +0000
@@ -63,6 +63,7 @@
     public static String PREFIX_FIXED_ATTRIBUTE = "fixedAttr";    
     public static String PREFIX_PATIENT_ATTRIBUTE = "attr";
     public static String PREFIX_PROGRAM = "prg";
+    public static String PREFIX_PROGRAM_EVENT_BY_STATUS = "stat";
     public static String PREFIX_PROGRAM_STAGE = "prgst";
     public static String FIXED_ATTR_BIRTH_DATE = "birthDate";
     public static String FIXED_ATTR_AGE = "age";

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientService.java	2012-08-16 13:46:23 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientService.java	2012-09-06 09:44:43 +0000
@@ -160,7 +160,7 @@
      * @return
      */
     Collection<Patient> getPatients( OrganisationUnit organisationUnit, Program program, Integer min, Integer max );
-
+    
     /**
      * Sort the result by PatientAttribute
      * 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/comment/Comment.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/comment/Comment.java	2012-08-17 06:42:32 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/comment/Comment.java	2012-09-06 09:44:43 +0000
@@ -103,5 +103,11 @@
     {
         this.creator = creator;
     }
+    
+    @Override
+    public String toString()
+    {
+        return createdDate + " - "  + creator + "_" + commentText;
+    }
 
 }

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java	2012-08-21 13:51:07 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java	2012-09-06 09:44:43 +0000
@@ -263,13 +263,14 @@
         }
         return patients;
     }
-    
+
     @Override
-    public Collection<String> getPatientPhoneNumbers( List<String> searchKeys, OrganisationUnit orgunit, Integer min, Integer max )
+    public Collection<String> getPatientPhoneNumbers( List<String> searchKeys, OrganisationUnit orgunit, Integer min,
+        Integer max )
     {
         String sql = searchPatientSql( false, searchKeys, orgunit, min, max );
         Collection<String> phoneNumbers = new HashSet<String>();
-        
+
         try
         {
             phoneNumbers = jdbcTemplate.query( sql, new RowMapper<String>()
@@ -278,7 +279,7 @@
                     throws SQLException
                 {
                     String phoneNumber = rs.getString( "phonenumber" );
-                    return ( phoneNumber==null || phoneNumber.isEmpty()) ? "0" : phoneNumber;
+                    return (phoneNumber == null || phoneNumber.isEmpty()) ? "0" : phoneNumber;
                 }
             } );
         }
@@ -288,14 +289,15 @@
         }
         return phoneNumbers;
     }
-    
+
     @Override
-    public Collection<Integer> getProgramStageInstances( List<String> searchKeys, OrganisationUnit orgunit, Integer min, Integer max )
+    public Collection<Integer> getProgramStageInstances( List<String> searchKeys, OrganisationUnit orgunit,
+        Integer min, Integer max )
     {
         String sql = searchPatientSql( false, searchKeys, orgunit, min, max );
 
         Collection<Integer> programStageInstanceIds = new HashSet<Integer>();
-        
+
         try
         {
             programStageInstanceIds = jdbcTemplate.query( sql, new RowMapper<Integer>()
@@ -311,11 +313,10 @@
         {
             ex.printStackTrace();
         }
-        
+
         return programStageInstanceIds;
     }
 
-
     public int countSearch( List<String> searchKeys, OrganisationUnit orgunit )
     {
         String sql = searchPatientSql( true, searchKeys, orgunit, null, null );
@@ -400,13 +401,50 @@
                 otherWhere += operator + Patient.PREFIX_PROGRAM + "_" + id + "=" + id;
                 operator = " and ";
             }
+            else if ( keys[0].equals( Patient.PREFIX_PROGRAM_EVENT_BY_STATUS ) )
+            {
+                sql += "(select programid from patient_programs where patientid=p.patientid and programid=" + keys[1]
+                    + " ) as " + Patient.PREFIX_PROGRAM + "_" + id + ",";
+                otherWhere += operator + Patient.PREFIX_PROGRAM + "_" + id + "=" + id;
+                operator = " and ";
+
+                sql += " MIN( psi.programstageinstanceid ) as programstageinstanceid,";
+                isSearchEvent = true;
+                patientWhere += patientOperator + "pgi.patientid=p.patientid and ";
+                patientWhere += "psi.duedate>='" + keys[3] + "' and psi.duedate<='" + keys[4] + "' and ";
+                patientWhere += "psi.organisationunitid = " + keys[5] + " and ";
+
+                int statusEvent = Integer.parseInt( keys[2] );
+                switch ( statusEvent )
+                {
+                case ProgramStageInstance.COMPLETED_STATUS:
+                    patientWhere += "psi.completed=true";
+                    break;
+                case ProgramStageInstance.VISITED_STATUS:
+                    patientWhere += "psi.executiondate is not null and psi.completed=false";
+                    break;
+                case ProgramStageInstance.FUTURE_VISIT_STATUS:
+                    patientWhere += "psi.executiondate is null and psi.duedate >= now()";
+                    break;
+                case ProgramStageInstance.LATE_VISIT_STATUS:
+                    patientWhere += "psi.executiondate is null and psi.duedate < now()";
+                    break;
+                default:
+                    break;
+                }
+
+                patientWhere += " and pgi.completed=false ";
+                patientOperator = " and ";
+
+            }
             else if ( keys[0].equals( Patient.PREFIX_PROGRAM_STAGE ) )
             {
                 sql += " MIN( psi.programstageinstanceid ) as programstageinstanceid,";
                 isSearchEvent = true;
                 patientWhere += patientOperator + "pgi.patientid=p.patientid and psi.programstageid=" + id + " and ";
                 patientWhere += "psi.duedate>='" + keys[3] + "' and psi.duedate<='" + keys[4] + "' and ";
-                    
+                patientWhere += "psi.organisationunitid = " + keys[5] + " and ";
+
                 int statusEvent = Integer.parseInt( keys[2] );
                 switch ( statusEvent )
                 {
@@ -425,7 +463,7 @@
                 default:
                     break;
                 }
-                
+
                 patientWhere += " and pgi.completed=false ";
                 patientOperator = " and ";
 
@@ -446,20 +484,18 @@
         {
             sql += " left join patientidentifier pi on p.patientid=pi.patientid ";
         }
-        if(isSearchEvent)
+        if ( isSearchEvent )
         {
-            sql += " left join programinstance pgi on " +
-                        " (pgi.patientid=p.patientid) " +
-                   " left join programstageinstance psi on " +
-            		" (psi.programinstanceid=pgi.programinstanceid) ";
+            sql += " left join programinstance pgi on " + " (pgi.patientid=p.patientid) "
+                + " left join programstageinstance psi on " + " (psi.programinstanceid=pgi.programinstanceid) ";
         }
 
         sql += patientWhere;
-        if( isSearchEvent )
+        if ( isSearchEvent )
         {
             sql += patientGroupBy;
         }
-        
+
         sql += " ) as searchresult";
         sql += otherWhere;
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetOutboundSmsListAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetOutboundSmsListAction.java	2012-08-17 09:17:56 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetOutboundSmsListAction.java	2012-09-06 09:44:43 +0000
@@ -28,10 +28,13 @@
 package org.hisp.dhis.caseentry.action.reminder;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 
 import org.hisp.dhis.patient.comment.Comment;
+import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
+import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
 import org.hisp.dhis.program.ProgramStageInstance;
 import org.hisp.dhis.program.ProgramStageInstanceService;
 import org.hisp.dhis.sms.outbound.OutboundSms;
@@ -54,14 +57,16 @@
     // -------------------------------------------------------------------------
 
     private ProgramStageInstanceService programStageInstanceService;
-    
+
     private CurrentUserService currentUserService;
 
     public void setCurrentUserService( CurrentUserService currentUserService )
     {
         this.currentUserService = currentUserService;
     }
-    
+
+    private PatientAttributeValueService patientAttributeValueService;
+
     @Autowired
     private OutboundSmsTransportService transportService;
 
@@ -74,11 +79,13 @@
     private ProgramStageInstance programStageInstance;
 
     private List<OutboundSms> outboundSms;
-    
+
     private List<Comment> comments;
-    
+
     private String currentUsername;
-    
+
+    private Collection<PatientAttributeValue> attributeValues;
+
     // -------------------------------------------------------------------------
     // Getter/Setter
     // -------------------------------------------------------------------------
@@ -88,11 +95,21 @@
         this.programStageInstanceService = programStageInstanceService;
     }
 
+    public void setPatientAttributeValueService( PatientAttributeValueService patientAttributeValueService )
+    {
+        this.patientAttributeValueService = patientAttributeValueService;
+    }
+
     public ProgramStageInstance getProgramStageInstance()
     {
         return programStageInstance;
     }
 
+    public Collection<PatientAttributeValue> getAttributeValues()
+    {
+        return attributeValues;
+    }
+
     public String getCurrentUsername()
     {
         return currentUsername;
@@ -129,10 +146,12 @@
         programStageInstance = programStageInstanceService.getProgramStageInstance( programStageInstanceId );
 
         outboundSms = new ArrayList<OutboundSms>( programStageInstance.getOutboundSms() );
-        
+
         comments = new ArrayList<Comment>( programStageInstance.getComments() );
-        
+
         currentUsername = currentUserService.getCurrentUsername();
+
+        attributeValues = patientAttributeValueService.getPatientAttributeValues( programStageInstance.getProgramInstance().getPatient() );
         
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2012-09-06 03:50:03 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2012-09-06 09:44:43 +0000
@@ -980,6 +980,8 @@
 			ref="org.hisp.dhis.program.ProgramStageInstanceService" />
 		<property name="currentUserService"
 			ref="org.hisp.dhis.user.CurrentUserService" />
+		<property name="patientAttributeValueService"
+			ref="org.hisp.dhis.patientattributevalue.PatientAttributeValueService" />
 	</bean>
 	
 	<bean id="org.hisp.dhis.caseentry.action.reminder.SendSmsAction"

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2012-09-06 03:50:03 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2012-09-06 09:44:43 +0000
@@ -389,11 +389,11 @@
 report_date_from_to=Report date (from-to)
 enter_age_in_years = Enter age in years
 add_and_continue = Add and continue
-sms = SMS
-sms_reminder = SMS Reminder
+tracking = Tracking
+program_tracking = Program Tracking
+intro_program_tracking = Support the work practices around tracking persons within a health program that have not shown up for a scheduled visit (stage), e.g. that are lost to follow-up.
 sms_reminder_list = SMS reminder list
 patient_did_not_register_a_phone_number = The person did not register a phone number
-sms_message_management = SMS message management
 date = Date
 sms_message_details = SMS message details
 message = Message
@@ -430,7 +430,10 @@
 completed_date = Completed date
 find_and_add_person = Find/Add Person
 add_person = Add Person
-identifiers_and_attributes = Identifiers / attributes
+identifiers_and_attributes = Identifiers/Attributes
 at = at
 on_date = on
-no_records = No records
\ No newline at end of file
+no_records = No records
+show_hide_event_flow = Show/Hide event flow
+tracking_history = Tracking history
+show_hide_more = Show/Hide more ...
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2012-09-05 14:30:23 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2012-09-06 09:44:43 +0000
@@ -21,11 +21,14 @@
 		<action name="validateSearch"
 			class="org.hisp.dhis.caseentry.action.caseentry.ValidateSearchAction">
 			<result name="success" type="velocity-xml">
-				/dhis-web-caseentry/responseSuccess.vm</result>
+				/dhis-web-caseentry/responseSuccess.vm
+			</result>
 			<result name="error" type="velocity-xml">
-				/dhis-web-caseentry/responseError.vm</result>
+				/dhis-web-caseentry/responseError.vm
+			</result>
 			<result name="input" type="velocity-xml">
-				/dhis-web-caseentry/responseInput.vm</result>
+				/dhis-web-caseentry/responseInput.vm
+			</result>
 			<param name="onExceptionReturn">plainTextError</param>
 		</action>
 
@@ -52,7 +55,8 @@
 		<action name="loadProgramStageInstances"
 			class="org.hisp.dhis.caseentry.action.caseentry.LoadProgramStageInstancesAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-caseentry/jsonProgramStageInstances.vm</result>
+				/dhis-web-caseentry/jsonProgramStageInstances.vm
+			</result>
 		</action>
 
 		<action name="dataentryform"
@@ -65,23 +69,27 @@
 		<action name="completeDataEntry"
 			class="org.hisp.dhis.caseentry.action.caseentry.CompleteDataEntryAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+				/dhis-web-commons/ajax/jsonResponseSuccess.vm
+			</result>
 			<param name="requiredAuthorities">F_PATIENT_DATAVALUE_ADD,F_PATIENT_DATAVALUE_UPDATE,F_PATIENT_DATAVALUE_DELETE</param>
 		</action>
 
 		<action name="uncompleteDataEntry"
 			class="org.hisp.dhis.caseentry.action.caseentry.UncompleteDataEntryAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+				/dhis-web-commons/ajax/jsonResponseSuccess.vm
+			</result>
 			<param name="requiredAuthorities">F_PATIENT_DATAVALUE_ADD,F_PATIENT_DATAVALUE_UPDATE,F_PATIENT_DATAVALUE_DELETE</param>
 		</action>
 
 		<action name="saveExecutionDate"
 			class="org.hisp.dhis.caseentry.action.caseentry.SaveExecutionDateAction">
 			<result name="success" type="velocity-xml">
-				/dhis-web-commons/ajax/xmlResponseSuccess.vm</result>
+				/dhis-web-commons/ajax/xmlResponseSuccess.vm
+			</result>
 			<result name="input" type="velocity-xml">
-				/dhis-web-commons/ajax/xmlResponseInput.vm</result>
+				/dhis-web-commons/ajax/xmlResponseInput.vm
+			</result>
 			<param name="onExceptionReturn">plainTextError</param>
 			<param name="requiredAuthorities">F_PATIENT_DATAVALUE_ADD,F_PATIENT_DATAVALUE_UPDATE,F_PATIENT_DATAVALUE_DELETE</param>
 		</action>
@@ -89,7 +97,8 @@
 		<action name="registerIrregularEncounter"
 			class="org.hisp.dhis.caseentry.action.caseentry.RegisterIrregularEncounterAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+				/dhis-web-commons/ajax/jsonResponseSuccess.vm
+			</result>
 			<param name="requiredAuthorities">F_PATIENT_DATAVALUE_ADD,F_PATIENT_DATAVALUE_UPDATE,F_PATIENT_DATAVALUE_DELETE</param>
 		</action>
 
@@ -110,31 +119,37 @@
 
 		<action name="anonymousPrograms"
 			class="org.hisp.dhis.caseentry.action.caseentry.LoadAnonymousProgramsAction">
-			<result name="success" type="velocity-json">/dhis-web-caseentry/jsonSingleEventPrograms.vm</result>
+			<result name="success" type="velocity-json">/dhis-web-caseentry/jsonSingleEventPrograms.vm
+			</result>
 			<param name="requiredAuthorities">F_NAME_BASED_DATA_ENTRY</param>
 		</action>
 
 		<action name="createAnonymousEncounter"
 			class="org.hisp.dhis.caseentry.action.caseentry.CreateAnonymousEncounterAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+				/dhis-web-commons/ajax/jsonResponseSuccess.vm
+			</result>
 			<result name="input" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseInput.vm</result>
+				/dhis-web-commons/ajax/jsonResponseInput.vm
+			</result>
 			<param name="requiredAuthorities">F_PATIENT_DATAVALUE_ADD,F_PATIENT_DATAVALUE_UPDATE,F_PATIENT_DATAVALUE_DELETE</param>
 		</action>
 
 		<action name="loadAnonymousPrograms"
 			class="org.hisp.dhis.caseentry.action.caseentry.LoadAnonymousProgramsAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-caseentry/jsonProgramInstances.vm</result>
+				/dhis-web-caseentry/jsonProgramInstances.vm
+			</result>
 		</action>
 
 		<action name="removeCurrentEncounter"
 			class="org.hisp.dhis.caseentry.action.caseentry.RemoveCurrentEncounterAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+				/dhis-web-commons/ajax/jsonResponseSuccess.vm
+			</result>
 			<result name="error" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseError.vm</result>
+				/dhis-web-commons/ajax/jsonResponseError.vm
+			</result>
 			<param name="requiredAuthorities">F_PATIENT_DATAVALUE_ADD,F_PATIENT_DATAVALUE_UPDATE,F_PATIENT_DATAVALUE_DELETE</param>
 		</action>
 
@@ -146,12 +161,14 @@
 
 		<action name="getOptions"
 			class="org.hisp.dhis.caseentry.action.caseentry.GetOptionsByDataElementAction">
-			<result name="success" type="velocity-json">/dhis-web-caseentry/jsonOptions.vm</result>
+			<result name="success" type="velocity-json">/dhis-web-caseentry/jsonOptions.vm
+			</result>
 		</action>
 
 		<action name="getProgramStageDataElementList"
 			class="org.hisp.dhis.caseentry.action.caseentry.GetProgramStageDataElementsAction">
-			<result name="success" type="velocity-json">/dhis-web-caseentry/jsonProgramStageDataElements.vm</result>
+			<result name="success" type="velocity-json">/dhis-web-caseentry/jsonProgramStageDataElements.vm
+			</result>
 		</action>
 
 		<action name="searchProgramStageInstances"
@@ -164,7 +181,8 @@
 		<action name="removeEmptyEvents"
 			class="org.hisp.dhis.caseentry.action.caseentry.RemoveEmptyEventsAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+				/dhis-web-commons/ajax/jsonResponseSuccess.vm
+			</result>
 			<param name="requiredAuthorities">F_PATIENT_REMOVE_EMPTY_EVENTS</param>
 		</action>
 
@@ -174,7 +192,8 @@
 			class="org.hisp.dhis.caseentry.action.caseentry.SaveValueAction">
 			<result name="success" type="velocity-xml">status.vm</result>
 			<result name="input" type="velocity-xml">
-				/dhis-web-caseentry/responseInput.vm</result>
+				/dhis-web-caseentry/responseInput.vm
+			</result>
 			<param name="onExceptionReturn">plainTextError</param>
 			<param name="requiredAuthorities">F_PATIENT_DATAVALUE_ADD,F_PATIENT_DATAVALUE_UPDATE,F_PATIENT_DATAVALUE_DELETE</param>
 		</action>
@@ -204,7 +223,8 @@
 
 		<action name="getPrograms"
 			class="org.hisp.dhis.caseentry.action.caseentry.GetProgramsByOrgunitAction">
-			<result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonPrograms.vm</result>
+			<result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonPrograms.vm
+			</result>
 		</action>
 
 		<action name="getDataRecords"
@@ -232,7 +252,8 @@
 		<action name="completeProgramStageDataEntry"
 			class="org.hisp.dhis.caseentry.action.caseentry.CompleteDataEntryAction">
 			<result name="success" type="redirect">
-				getDataRecords.action?programId=${programId}</result>
+				getDataRecords.action?programId=${programId}
+			</result>
 			<param name="requiredAuthorities">F_PATIENT_DATAVALUE_ADD,F_PATIENT_DATAVALUE_UPDATE,F_PATIENT_DATAVALUE_DELETE</param>
 		</action>
 
@@ -257,7 +278,8 @@
 
 		<action name="singleEventPrograms"
 			class="org.hisp.dhis.caseentry.action.caseentry.GetSingleEventProgramListAction">
-			<result name="success" type="velocity-json">/dhis-web-caseentry/jsonSingleEventPrograms.vm</result>
+			<result name="success" type="velocity-json">/dhis-web-caseentry/jsonSingleEventPrograms.vm
+			</result>
 			<param name="requiredAuthorities">F_NAME_BASED_DATA_ENTRY</param>
 		</action>
 
@@ -324,12 +346,14 @@
 		<action name="getReportPrograms"
 			class="org.hisp.dhis.caseentry.action.caseentry.GetProgramsByOrgunitAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-caseentry/responsePrograms.vm</result>
+				/dhis-web-caseentry/responsePrograms.vm
+			</result>
 		</action>
 		<!-- i18n -->
 
 		<action name="i18n" class="org.hisp.dhis.caseentry.action.NoAction">
-			<result name="success" type="velocity-javascript">/dhis-web-caseentry/i18n.vm</result>
+			<result name="success" type="velocity-javascript">/dhis-web-caseentry/i18n.vm
+			</result>
 		</action>
 
 		<!-- Case Aggregation -->
@@ -347,17 +371,21 @@
 		<action name="loadPeriods"
 			class="org.hisp.dhis.caseentry.action.caseaggregation.LoadPeriodsAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-caseentry/responsePeriods.vm</result>
+				/dhis-web-caseentry/responsePeriods.vm
+			</result>
 		</action>
 
 		<action name="validateCaseAggregation"
 			class="org.hisp.dhis.caseentry.action.caseaggregation.ValidationCaseAggregationAction">
 			<result name="success" type="velocity-xml">
-				/dhis-web-caseentry/responseSuccess.vm</result>
+				/dhis-web-caseentry/responseSuccess.vm
+			</result>
 			<result name="error" type="velocity-xml">
-				/dhis-web-caseentry/responseError.vm</result>
+				/dhis-web-caseentry/responseError.vm
+			</result>
 			<result name="input" type="velocity-xml">
-				/dhis-web-caseentry/responseInput.vm</result>
+				/dhis-web-caseentry/responseInput.vm
+			</result>
 		</action>
 
 		<action name="caseAggregationResult"
@@ -372,7 +400,8 @@
 		<action name="saveAggregateDataValue"
 			class="org.hisp.dhis.caseentry.action.caseaggregation.SaveAggregateDataValueAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+				/dhis-web-commons/ajax/jsonResponseSuccess.vm
+			</result>
 			<param name="requiredAuthorities">F_DATAVALUE_ADD,F_DATAVALUE_DELETE,F_DATAVALUE_UPDATE</param>
 		</action>
 
@@ -384,13 +413,15 @@
 
 		<action name="nextPeriods" class="org.hisp.dhis.caseentry.state.NextPeriodsAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-commons/ajax/jsonPeriods.vm</result>
+				/dhis-web-commons/ajax/jsonPeriods.vm
+			</result>
 		</action>
 
 		<action name="previousPeriods"
 			class="org.hisp.dhis.caseentry.state.PreviousPeriodsAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-commons/ajax/jsonPeriods.vm</result>
+				/dhis-web-commons/ajax/jsonPeriods.vm
+			</result>
 		</action>
 
 		<!-- Patient -->
@@ -440,9 +471,11 @@
 		<action name="removePatient"
 			class="org.hisp.dhis.caseentry.action.patient.RemovePatientAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+				/dhis-web-commons/ajax/jsonResponseSuccess.vm
+			</result>
 			<result name="error" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseError.vm</result>
+				/dhis-web-commons/ajax/jsonResponseError.vm
+			</result>
 			<param name="onExceptionReturn">plainTextError</param>
 			<param name="requiredAuthorities">F_PATIENT_DELETE</param>
 		</action>
@@ -450,7 +483,8 @@
 		<action name="addPatient"
 			class="org.hisp.dhis.caseentry.action.patient.AddPatientAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+				/dhis-web-commons/ajax/jsonResponseSuccess.vm
+			</result>
 			<param name="requiredAuthorities">F_PATIENT_ADD</param>
 		</action>
 
@@ -472,20 +506,25 @@
 		<action name="updatePatient"
 			class="org.hisp.dhis.caseentry.action.patient.UpdatePatientAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+				/dhis-web-commons/ajax/jsonResponseSuccess.vm
+			</result>
 			<param name="requiredAuthorities">F_PATIENT_UPDATE</param>
 		</action>
 
 		<action name="validatePatient"
 			class="org.hisp.dhis.caseentry.action.patient.ValidatePatientAction">
 			<result name="success" type="velocity-xml">
-				/dhis-web-commons/ajax/xmlResponseSuccess.vm</result>
+				/dhis-web-commons/ajax/xmlResponseSuccess.vm
+			</result>
 			<result name="error" type="velocity-xml">
-				/dhis-web-commons/ajax/xmlResponseError.vm</result>
+				/dhis-web-commons/ajax/xmlResponseError.vm
+			</result>
 			<result name="input" type="velocity-xml">
-				/dhis-web-commons/ajax/xmlResponseInput.vm</result>
+				/dhis-web-commons/ajax/xmlResponseInput.vm
+			</result>
 			<result name="duplicate" type="velocity-xml">
-				/dhis-web-caseentry/responseDuplicate.vm</result>
+				/dhis-web-caseentry/responseDuplicate.vm
+			</result>
 			<param name="onExceptionReturn">plainTextError</param>
 		</action>
 
@@ -536,7 +575,8 @@
 		<action name="registerPatientLocation"
 			class="org.hisp.dhis.caseentry.action.patient.RegisterPatientLocationAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+				/dhis-web-commons/ajax/jsonResponseSuccess.vm
+			</result>
 			<param name="requiredAuthorities">F_PATIENT_UPDATE</param>
 		</action>
 
@@ -559,24 +599,29 @@
 		<action name="validatePatientProgramEnrollment"
 			class="org.hisp.dhis.caseentry.action.patient.ValidatePatientProgramEnrollmentAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+				/dhis-web-commons/ajax/jsonResponseSuccess.vm
+			</result>
 			<result name="error" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseError.vm</result>
+				/dhis-web-commons/ajax/jsonResponseError.vm
+			</result>
 			<result name="input" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseInput.vm</result>
+				/dhis-web-commons/ajax/jsonResponseInput.vm
+			</result>
 		</action>
 
 		<action name="saveProgramEnrollment"
 			class="org.hisp.dhis.caseentry.action.patient.SaveProgramEnrollmentAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-caseentry/jsonProgramEnrollment.vm</result>
+				/dhis-web-caseentry/jsonProgramEnrollment.vm
+			</result>
 			<param name="requiredAuthorities">F_PROGRAM_ENROLLMENT</param>
 		</action>
 
 		<action name="getProgramInstance"
 			class="org.hisp.dhis.caseentry.action.patient.GetProgramInstanceAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-caseentry/responseProgramInstance.vm</result>
+				/dhis-web-caseentry/responseProgramInstance.vm
+			</result>
 		</action>
 
 		<action name="getEventMessages"
@@ -589,7 +634,8 @@
 		<action name="removeEnrollment"
 			class="org.hisp.dhis.caseentry.action.patient.RemoveEnrollmentAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+				/dhis-web-commons/ajax/jsonResponseSuccess.vm
+			</result>
 			<param name="requiredAuthorities">F_PROGRAM_UNENROLLMENT</param>
 		</action>
 
@@ -637,11 +683,14 @@
 		<action name="validateSearchRelationship"
 			class="org.hisp.dhis.caseentry.action.patient.ValidateSearchRelationshipAction">
 			<result name="success" type="velocity-xml">
-				/dhis-web-commons/ajax/xmlResponseSuccess.vm</result>
+				/dhis-web-commons/ajax/xmlResponseSuccess.vm
+			</result>
 			<result name="error" type="velocity-xml">
-				/dhis-web-commons/ajax/xmlResponseError.vm</result>
+				/dhis-web-commons/ajax/xmlResponseError.vm
+			</result>
 			<result name="input" type="velocity-xml">
-				/dhis-web-commons/ajax/xmlResponseInput.vm</result>
+				/dhis-web-commons/ajax/xmlResponseInput.vm
+			</result>
 			<param name="onExceptionReturn">plainTextError</param>
 		</action>
 
@@ -656,11 +705,14 @@
 		<action name="saveRelationship"
 			class="org.hisp.dhis.caseentry.action.patient.SaveRelationshipAction">
 			<result name="success" type="velocity-xml">
-				/dhis-web-commons/ajax/xmlResponseSuccess.vm</result>
+				/dhis-web-commons/ajax/xmlResponseSuccess.vm
+			</result>
 			<result name="error" type="velocity-xml">
-				/dhis-web-commons/ajax/xmlResponseError.vm</result>
+				/dhis-web-commons/ajax/xmlResponseError.vm
+			</result>
 			<result name="input" type="velocity-xml">
-				/dhis-web-commons/ajax/xmlResponseInput.vm</result>
+				/dhis-web-commons/ajax/xmlResponseInput.vm
+			</result>
 			<param name="onExceptionReturn">plainTextError</param>
 			<param name="requiredAuthorities">F_RELATIONSHIP_ADD</param>
 		</action>
@@ -668,29 +720,36 @@
 		<action name="removeRelationship"
 			class="org.hisp.dhis.caseentry.action.patient.RemoveRelationshipAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+				/dhis-web-commons/ajax/jsonResponseSuccess.vm
+			</result>
 			<param name="requiredAuthorities">F_RELATIONSHIP_DELETE</param>
 		</action>
 
 		<action name="saveRepresentative"
 			class="org.hisp.dhis.caseentry.action.patient.SaveRepresentativeAction">
 			<result name="success" type="velocity-xml">
-				/dhis-web-commons/ajax/xmlResponseSuccess.vm</result>
+				/dhis-web-commons/ajax/xmlResponseSuccess.vm
+			</result>
 			<result name="error" type="velocity-xml">
-				/dhis-web-commons/ajax/xmlResponseError.vm</result>
+				/dhis-web-commons/ajax/xmlResponseError.vm
+			</result>
 			<result name="input" type="velocity-xml">
-				/dhis-web-commons/ajax/xmlResponseInput.vm</result>
+				/dhis-web-commons/ajax/xmlResponseInput.vm
+			</result>
 			<param name="onExceptionReturn">plainTextError</param>
 		</action>
 
 		<action name="removeRepresentative"
 			class="org.hisp.dhis.caseentry.action.patient.RemoveRepresentativeAction">
 			<result name="success" type="velocity-xml">
-				/dhis-web-commons/ajax/xmlResponseSuccess.vm</result>
+				/dhis-web-commons/ajax/xmlResponseSuccess.vm
+			</result>
 			<result name="error" type="velocity-xml">
-				/dhis-web-commons/ajax/xmlResponseError.vm</result>
+				/dhis-web-commons/ajax/xmlResponseError.vm
+			</result>
 			<result name="input" type="velocity-xml">
-				/dhis-web-commons/ajax/xmlResponseInput.vm</result>
+				/dhis-web-commons/ajax/xmlResponseInput.vm
+			</result>
 			<param name="onExceptionReturn">plainTextError</param>
 			<param name="requiredAuthorities">F_RELATIONSHIP_DELETE</param>
 		</action>
@@ -705,20 +764,25 @@
 		<action name="validateAddRelationshipPatient"
 			class="org.hisp.dhis.caseentry.action.patient.ValidateAddRelationshipPatientAction">
 			<result name="success" type="velocity-xml">
-				/dhis-web-commons/ajax/xmlResponseSuccess.vm</result>
+				/dhis-web-commons/ajax/xmlResponseSuccess.vm
+			</result>
 			<result name="error" type="velocity-xml">
-				/dhis-web-commons/ajax/xmlResponseError.vm</result>
+				/dhis-web-commons/ajax/xmlResponseError.vm
+			</result>
 			<result name="input" type="velocity-xml">
-				/dhis-web-commons/ajax/xmlResponseInput.vm</result>
+				/dhis-web-commons/ajax/xmlResponseInput.vm
+			</result>
 			<result name="duplicate" type="velocity-xml">
-				/dhis-web-caseentry/responseDuplicate.vm</result>
+				/dhis-web-caseentry/responseDuplicate.vm
+			</result>
 			<param name="onExceptionReturn">plainTextError</param>
 		</action>
 
 		<action name="addRelationshipPatient"
 			class="org.hisp.dhis.caseentry.action.patient.AddRelationshipPatientAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+				/dhis-web-commons/ajax/jsonResponseSuccess.vm
+			</result>
 			<param name="requiredAuthorities">F_RELATIONSHIP_ADD</param>
 		</action>
 
@@ -738,47 +802,56 @@
 		<action name="getOrganisationUnitChildren"
 			class="org.hisp.dhis.caseentry.action.report.GetOrganisationUnitChildrenAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-caseentry/jsonminOrganisationUnitChildren.vm</result>
+				/dhis-web-caseentry/jsonminOrganisationUnitChildren.vm
+			</result>
 		</action>
 
 		<action name="tabularInitialize"
 			class="org.hisp.dhis.caseentry.action.report.TabularInitializeAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-caseentry/jsonTabularInitialize.vm</result>
+				/dhis-web-caseentry/jsonTabularInitialize.vm
+			</result>
 		</action>
 
 		<action name="loadPatientProperties"
 			class="org.hisp.dhis.caseentry.action.report.LoadPatientPropertiesAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-caseentry/jsonPatientProperties.vm</result>
+				/dhis-web-caseentry/jsonPatientProperties.vm
+			</result>
 		</action>
 
 		<action name="loadReportProgramStages"
 			class="org.hisp.dhis.caseentry.action.report.LoadProgramStagesAction">
-			<result name="success" type="velocity-json">/dhis-web-caseentry/jsonProgramStages.vm</result>
+			<result name="success" type="velocity-json">/dhis-web-caseentry/jsonProgramStages.vm
+			</result>
 		</action>
 
 		<action name="loadDataElements"
 			class="org.hisp.dhis.caseentry.action.report.LoadDataElementsAction">
-			<result name="success" type="velocity-json">/dhis-web-caseentry/responseDataElements.vm</result>
+			<result name="success" type="velocity-json">/dhis-web-caseentry/responseDataElements.vm
+			</result>
 		</action>
 
 		<action name="getTabularParams"
 			class="org.hisp.dhis.caseentry.action.report.GetTabularParamsAction">
-			<result name="success" type="velocity-json">/dhis-web-caseentry/responseTabularParams.vm</result>
+			<result name="success" type="velocity-json">/dhis-web-caseentry/responseTabularParams.vm
+			</result>
 		</action>
 
 		<action name="validateTabularReport"
 			class="org.hisp.dhis.caseentry.action.report.ValidateTabularReportAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+				/dhis-web-commons/ajax/jsonResponseSuccess.vm
+			</result>
 			<result name="input" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseInput.vm</result>
+				/dhis-web-commons/ajax/jsonResponseInput.vm
+			</result>
 		</action>
 
 		<action name="generateTabularReport"
 			class="org.hisp.dhis.caseentry.action.report.GenerateTabularReportAction">
-			<result name="success" type="velocity-json">/dhis-web-caseentry/jsonTabularReportResult.vm</result>
+			<result name="success" type="velocity-json">/dhis-web-caseentry/jsonTabularReportResult.vm
+			</result>
 			<result name="xls" type="gridXlsResult" />
 			<result name="pdf" type="gridPdfResult" />
 			<param name="requiredAuthorities">F_GENERATE_BENEFICIARY_TABULAR_REPORT</param>
@@ -787,31 +860,36 @@
 		<action name="saveTabularReport"
 			class="org.hisp.dhis.caseentry.action.report.SaveTabularReportAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+				/dhis-web-commons/ajax/jsonResponseSuccess.vm
+			</result>
 		</action>
 
 		<action name="getTabularReports"
 			class="org.hisp.dhis.caseentry.action.report.GetTabularReportsAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-caseentry/jsonTabularReportList.vm</result>
+				/dhis-web-caseentry/jsonTabularReportList.vm
+			</result>
 		</action>
 
 		<action name="getTabularReport"
 			class="org.hisp.dhis.caseentry.action.report.GetTabularReportAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-caseentry/jsonTabularReport.vm</result>
+				/dhis-web-caseentry/jsonTabularReport.vm
+			</result>
 		</action>
 
 		<action name="updateTabularReportName"
 			class="org.hisp.dhis.caseentry.action.report.UpdateTabularReportNameAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+				/dhis-web-commons/ajax/jsonResponseSuccess.vm
+			</result>
 		</action>
 
 		<action name="deleteTabularReport"
 			class="org.hisp.dhis.caseentry.action.report.DeleteTabularReportAction">
 			<result name="success" type="velocity-json">
-				/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+				/dhis-web-commons/ajax/jsonResponseSuccess.vm
+			</result>
 		</action>
 
 		<action name="viewRecord"
@@ -826,8 +904,8 @@
 			class="org.hisp.dhis.caseentry.action.caseentry.MultiDataEntrySelectAction">
 			<interceptor-ref name="organisationUnitTreeStack" />
 			<result name="success" type="velocity">/main.vm</result>
-			<param name="page">/dhis-web-caseentry/smsReminderSelect.vm</param>
-			<param name="menu">/dhis-web-caseentry/smsMenu.vm</param>
+			<param name="page">/dhis-web-caseentry/programTrackingSelect.vm</param>
+			<param name="menu">/dhis-web-caseentry/trackingMenu.vm</param>
 			<param name="stylesheets">style/style.css</param>
 			<param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,javascript/commons.js,javascript/smsReminder.js</param>
 			<param name="requiredAuthorities">F_SMS_REMINDER</param>
@@ -836,14 +914,14 @@
 		<action name="getSMSPatientRecords"
 			class="org.hisp.dhis.caseentry.action.caseentry.GetDataRecordsAction">
 			<result name="success" type="velocity">/content.vm</result>
-			<param name="page">/dhis-web-caseentry/smsPatientRecords.vm</param>
+			<param name="page">/dhis-web-caseentry/programTrackingRecords.vm</param>
 			<param name="stylesheets">style/style.css</param>
 		</action>
 
 		<action name="getOutboundSmsList"
 			class="org.hisp.dhis.caseentry.action.reminder.GetOutboundSmsListAction">
 			<result name="success" type="velocity">/content.vm</result>
-			<param name="page">/dhis-web-caseentry/smsReminderList.vm</param>
+			<param name="page">/dhis-web-caseentry/programTrackingList.vm</param>
 			<param name="stylesheets">style/style.css</param>
 		</action>
 
@@ -856,15 +934,19 @@
 
 		<action name="sendSMS"
 			class="org.hisp.dhis.caseentry.action.reminder.SendSmsAction">
-			<result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
-			<result name="error" type="velocity-json">/dhis-web-commons/ajax/jsonResponseError.vm</result>
+			<result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm
+			</result>
+			<result name="error" type="velocity-json">/dhis-web-commons/ajax/jsonResponseError.vm
+			</result>
 			<param name="onExceptionReturn">plainTextError</param>
 		</action>
 
 		<action name="sendSMSTotList"
 			class="org.hisp.dhis.caseentry.action.reminder.SendSmsToListAction">
-			<result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
-			<result name="error" type="velocity-json">/dhis-web-commons/ajax/jsonResponseError.vm</result>
+			<result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm
+			</result>
+			<result name="error" type="velocity-json">/dhis-web-commons/ajax/jsonResponseError.vm
+			</result>
 			<param name="onExceptionReturn">plainTextError</param>
 		</action>
 
@@ -881,12 +963,14 @@
 
 		<action name="addComment"
 			class="org.hisp.dhis.caseentry.action.reminder.AddCommentAction">
-			<result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+			<result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm
+			</result>
 		</action>
 
 		<action name="removeComment"
 			class="org.hisp.dhis.caseentry.action.reminder.RemoveCommentAction">
-			<result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+			<result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm
+			</result>
 		</action>
 
 	</package>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/index.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/index.vm	2012-09-05 01:41:15 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/index.vm	2012-09-06 09:44:43 +0000
@@ -11,4 +11,5 @@
 	#introListImgItem( "app/index.html" "tabular_report" "summaryreport" )
 	<!-- #introListImgItem( "visitplan.action" "visit_plan" "visitplan" ) -->
     #introListImgItem( "caseAggregationForm.action" "case_aggregation" "caseaggregation" )
+	#introListImgItem( "smsReminderSelect.action" "program_tracking" "attribute" )
 </ul>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2012-09-05 14:30:23 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2012-09-06 09:44:43 +0000
@@ -224,7 +224,9 @@
 		var statusEvent = jQuery('#programStageAddPatientTR [id=statusEvent]').val();
 		var startDueDate = getFieldValue('startDueDate');
 		var endDueDate = getFieldValue('endDueDate');
-		params += '&searchTexts=prgst_' + programStageId + '_' + statusEvent + '_' + startDueDate + '_' + endDueDate;
+		params += '&searchTexts=prgst_' + programStageId + '_' + statusEvent 
+				+ '_' + startDueDate + '_' + endDueDate + "_" 
+				+ getFieldValue('orgunitId');
 	}
 	
 	var flag = false;
@@ -598,7 +600,7 @@
 						+ 'programType="' + programType + '" '
 						+ 'psname="' + programStageName + '" '
 						+ 'dueDate="' + dueDate + '" '
-						+ 'value="'+ programStageName + ' ' + dueDate + '" '
+						+ 'value="'+ programStageName + '&#13;&#10;' + dueDate + '" '
 						+ 'onclick="javascript:loadDataEntry(' + programStageInstanceId + ')" '
 						+ 'type="button" class="stage-object" '
 						+ '></td>'
@@ -618,7 +620,7 @@
 					+ 'programType="' + programType + '" '
 					+ 'psname="' + programStageName + '" '
 					+ 'dueDate="' + dueDate + '" '
-					+ 'value="'+ programStageName + ' ' + dueDate + '" '
+					+ 'value="'+ programStageName + '&#13;&#10;' + dueDate + '" '
 					+ 'onclick="javascript:loadDataEntry(' + programStageInstanceId + ')" '
 					+ 'type="button" class="stage-object" '
 					+ '></td>');
@@ -643,3 +645,16 @@
 		disable('uncompleteAndAddNewBtn');
 	}
 }
+
+// load program instance history
+function programReports( programInstanceId )
+{
+	$('#programReportDiv').load("getProgramReportHistory.action", {programInstanceId:programInstanceId});
+}
+
+// load SMS message and comments
+function getEventMessages( programInstanceId )
+{
+	$('#eventMessagesDiv').load("getEventMessages.action", {programInstanceId:programInstanceId});
+}
+

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js	2012-09-05 01:41:15 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js	2012-09-06 09:44:43 +0000
@@ -993,16 +993,6 @@
 		});
 }
 
-function programReports( programInstanceId )
-{
-	$('#programReportDiv').load("getProgramReportHistory.action", {programInstanceId:programInstanceId});
-}
-
-function getEventMessages( programInstanceId )
-{
-	$('#eventMessagesDiv').load("getEventMessages.action", {programInstanceId:programInstanceId});
-}
-
 function updateEnrollment( patientId, programId, programInstanceId, programName )
 {
 	var dateOfIncident = jQuery('#tab-3 [id=dateOfIncident]').val();

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js	2012-08-21 06:18:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js	2012-09-06 09:44:43 +0000
@@ -5,6 +5,7 @@
 	clearListById('programIdAddPatient');
 	$('#contentDataRecord').html('');
 	setFieldValue('orgunitName', orgUnitNames[0]);
+	setFieldValue('orgunitId', orgUnits[0]);
 	jQuery.get("getPrograms.action",{}, 
 		function(json)
 		{
@@ -26,11 +27,19 @@
 	hideById('listPatientDiv');
 	contentDiv = 'listPatientDiv';
 	$('#contentDataRecord').html('');
+	
+	var programId = getFieldValue('programIdAddPatient');
+	var searchTexts = "stat_" + programId + "_4_" 
+					+ getFieldValue('startDueDate') + "_" + getFieldValue('endDueDate') 
+					+ "_" + getFieldValue('orgunitId');
+	
 	showLoader();
 	jQuery('#listPatientDiv').load('getSMSPatientRecords.action',
 		{
-			programId:getFieldValue('programIdAddPatient'),
-			listAll:true
+			programId:programId,
+			listAll:false,
+			searchBySelectedOrgunit: false,
+			searchTexts: searchTexts
 		}, 
 		function()
 		{
@@ -42,7 +51,6 @@
 
 function advancedSearch( params )
 {
-	
 	setFieldValue('listAll', "false");
 	$('#contentDataRecord').html('');
 	params += "&searchTexts=prg_" + getFieldValue('programIdAddPatient');
@@ -68,21 +76,9 @@
 			programStageInstanceId: programStageInstanceId
 		}
 		, function(){
-			if(isSendSMS){
-				$('#tabs').tabs({ selected: 0 }); 
-			}
-			else{
-				$('#tabs').tabs({ selected: 1 });
-			}
-		}).dialog(
-		{
-			title:i18n_sms_message_management,
-			maximize:true, 
-			closable:true,
-			modal:false,
-			overlay:{background:'#000000', opacity:0.1},
-			width:800,
-			height:500
+			hideById('searchDiv');
+			hideById('listPatientDiv');
+			showById('smsManagementDiv');
 		});
 }
 
@@ -213,14 +209,16 @@
 				commentText: commentText 
 			}, function ( json )
 			{
-				jQuery('#commentTB').prepend("<tr><td>" + getFieldValue("currentDate") + " - " + getFieldValue('currentUsername') + " - " + commentText + "</td></tr>");
+				var programStageName = jQuery("#ps_" + programStageInstanceId).attr('programStageName');
+				jQuery('#commentTB').prepend("<tr><td>" + getFieldValue("currentDate") + "</td>"
+						+ "<td>" + programStageName + "</td>"
+						+ "<td>" + getFieldValue('currentUsername') + " - " + commentText + "</td></tr>");
 				setFieldValue( 'commentText','' );
 				showSuccessMessage( i18n_comment_added );
 			} );
 	}
 }
 
-
 function removeComment( programStageInstanceId, commentId )
 {
 	jQuery.postUTF8( 'removeComment.action',
@@ -233,3 +231,29 @@
 			hideById( 'comment_' + commentId );
 		} );
 }
+
+function eventFlowToggle( programInstanceId )
+{
+	jQuery("#tb_" + programInstanceId + " .stage-object").each( function(){
+			var programStageInstance = this.id.split('_')[1];
+			jQuery('#arrow_' + programStageInstance ).toggle();
+			jQuery('#td_' + programStageInstance ).toggle();
+			jQuery(this).removeClass("stage-object-selected");
+		});
+	
+	jQuery("#tb_" + programInstanceId + " .arrow-left").toggle();
+	jQuery("#tb_" + programInstanceId + " .arrow-right").toggle();
+	if( jQuery("#tb_" + programInstanceId + " .searched").length==0)
+	{	
+		var id = jQuery("#tb_" + programInstanceId + " .searched").attr('id').split('_')[1];
+		showById("arrow_" + id);
+		showById("td_" + id );
+	}
+}
+
+function backToSelect()
+{
+	showById('searchDiv');
+	showById('listPatientDiv');
+	hideById('smsManagementDiv');
+}
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm	2012-09-05 01:41:15 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm	2012-09-06 09:44:43 +0000
@@ -29,7 +29,7 @@
 </ul>
 
 
-<h2>$i18n.getString( "sms" )&nbsp;</h2>
+<h2>$i18n.getString( "tracking" )&nbsp;</h2>
 <ul>
-    <li><a href="smsReminderSelect.action">$i18n.getString( "sms_reminder" )</a></li>     
+    <li><a href="smsReminderSelect.action">$i18n.getString( "program_tracking" )</a></li>     
 </ul>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstanceFlow.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstanceFlow.vm	2012-09-06 03:50:03 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstanceFlow.vm	2012-09-06 09:44:43 +0000
@@ -8,7 +8,7 @@
 				<table class="stage-flow">											
 					<tr id='programStageIdTR_$!programInstance.id'>
 						#foreach( $programStageInstance in $programInstance.programStageInstances )
-						<td width="5px" style='font-size:25px;'>&rarr;</td>
+						<td width="5px" style='font-size:25px;' title='$i18n.getString("show_hide_event_flow")'>&rarr;</td>
 						<td>
 							<input type="button" name="programStageBtn"
 								id="ps_$!programStageInstance.id"

=== renamed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsReminderList.vm' => 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsReminderList.vm	2012-08-29 07:30:55 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm	2012-09-06 09:44:43 +0000
@@ -7,47 +7,71 @@
 	});
 </script>
 
-<h4>$i18n.getString( "sms_message_management" )</h4>
 <input type='hidden' id='currentUsername' name='currentUsername' value='$currentUsername'>
-<table class="mainPageTable">
+<input type='hidden' id='programInstanceId' name='programInstanceId' value='$programStageInstance.programInstance.id'>
+
+<table>
 	<tr>            
 		<td class="bold">$i18n.getString( "full_name" ):</td>
-		<td>$encoder.htmlEncode( $programStageInstance.programInstance.patient.getFullName() )( $programStageInstance.programInstance.patient.gender )<td>
+		<td>$programStageInstance.programInstance.patient.getFullName()<td>
+	</tr>
+	<tr>            
+		<td class="bold">$i18n.getString( "gender" ):</td>
+		<td>$programStageInstance.programInstance.patient.gender<td>
 	</tr>
 	<tr>
 		<td class="bold">$i18n.getString( "date_of_birth" ):</td>
-		<td>$format.formatDate( $programStageInstance.programInstance.patient.birthDate ) $programStageInstance.programInstance.patient.getAge()<td>
-	</tr>
-	<tr>
-		<td class="bold" valign='top'>$i18n.getString('comments'):</td>
-		<td colspan='2'>
-			<div class="comment-table" style='max-height:150px;'>
-				<table id='commentTB'>
-					#foreach( $comment in $comments )
-						<tr id="comment_$comment.id">
-							<td>$format.formatDate($comment.createdDate) - $comment.creator - $comment.commentText</td>
-						</tr>
-					#end
-				</table>
-			</div>
-		</td>
-	</tr>
-	<tr>
-		<td class="bold">$i18n.getString('post_comment'):</td>
+		<td>$format.formatDate( $programStageInstance.programInstance.patient.birthDate )<td>
+	</tr>
+	<tr>
+		<td class="bold">$i18n.getString( "age" ):</td>
+		<td>$programStageInstance.programInstance.patient.getAge()<td>
+	</tr>
+	<tr>
+		<td class="bold">$i18n.getString("phone_number")</td>
 		<td>
-			<input type='textbox' id='commentText' name='commentText' style="width:320px;" onkeypress="keypress(event,'$programStageInstance.id')">
-			<input type='button' value="+" class='tiny-button' onclick="addComment('$programStageInstance.id')">
+			#if($!programStageInstance.programInstance.patient.phoneNumber && $!programStageInstance.programInstance.patient.phoneNumber!='')
+				$!programStageInstance.programInstance.patient.phoneNumber
+			#else
+				[$i18n.getString('none')]
+			#end
 		</td>
 	</tr>
+	<tr>
+		<td><input type='button' value='$i18n.getString("back")' onclick='backToSelect();'></td>
+	</tr>
 </table>
 
 <div id="smsManagementForm">
 	<ul>
-		<li><a href="#tab-1">$i18n.getString("send_sms")</a></li>
-		<li><a href="#tab-2">$i18n.getString("sms_reminder_list")</a></li>
+		<li><a href="#tab-1">$i18n.getString("demographics")</a></li>
+		<li><a href="#tab-2">$i18n.getString("tracking_history")</a></li>
+		<li><a href="#tab-3">$i18n.getString("send_sms")</a></li>
+		<li><a href="#tab-4">$i18n.getString("program_reports")</a></li>
 	</ul>
-	<div id="tab-1">
-		#parse( "/dhis-web-caseentry/sendSmsForm.vm" )
+		
+	<div id='tab-1'>
+		<table width='100%'>
+			#set($mark = true)
+			#foreach( $identifier in $programStageInstance.programInstance.patient.identifiers )
+				<tr #alternate($mark)>
+					#if($!identifier.identifierType)
+						<td>$identifier.identifierType.name</td>
+					#else
+						<td>$i18n.getString("system_identifier")</td>
+					#end
+					<td>$identifier.identifier</td>
+				</tr>
+				#set($mark = !$mark)
+			#end
+			#foreach( $attributeValue in $attributeValues )
+				<tr #alternate($mark)>
+					<td>$attributeValue.patientAttribute.name</td>
+					<td>$attributeValue.value</td>
+				</tr>
+				#set($mark = !$mark)
+			#end
+		</table>
 	</div>
 	
 	<div id="tab-2">
@@ -55,21 +79,82 @@
 			<col width="160px"/>
 			<col/>
 			<tr>
+				<td class="bold">$i18n.getString('post_comment'):</td>
+				<td>
+					<input type='textbox' id='commentText' name='commentText' style="width:320px;" onkeypress="keypress(event,'$programStageInstance.id')">
+					<input type='button' value="+" class='tiny-button' onclick="addComment('$programStageInstance.id')">
+				</td>
+			</tr>
+			<tr><td>&nbsp;</td></tr>
+			<tr>
 				<th>$i18n.getString( "date" )</th>
+				<th>$i18n.getString( "program_stage" )</th>
 				<th>$i18n.getString( "message" )</th>
 			</tr>
-			<tbody id='smsManagementList'>	
+			
+			<tbody id='commentTB'>
+				#set($index = 0)
+				#set( $mark = false )
+				#foreach( $comment in $comments )
+					#if( $index < 1 )
+						<tr id="comment_$comment.id" #alternate($mark)>
+							<td>$format.formatDate($comment.createdDate)</td>
+							<td> $programStageInstance.programStage.name</td>
+							<td>$comment.creator - $comment.commentText</td>
+							#set($index = $index + 1)
+							#set( $mark = !$mark)
+						</tr>
+					#end
+				#end
+			</tbody>	
+			
+			<tbody id='smsManagementList'>
 				  #set( $mark = false )
 				  #foreach( $sms in $outboundSms )
-					<tr id="tr${sms.id}" #alternate($mark) >
-						<td>$format.formatDate($!sms.date)</td>
-						<td>$sms.message</td>
-					</tr>
-					#set( $mark = !$mark)
+					#if( $index < 1 )
+						<tr id="tr${sms.id}" #alternate($mark) >
+							<td>$format.formatDate($!sms.date)</td>
+							<td> $programStageInstance.programStage.name</td>
+							<td>$sms.message</td>
+							#set( $mark = !$mark)
+						</tr>
+					#end
+				#end
+			</tbody>
+			
+			<tbody id='moreComments' class='hidden'>
+				#foreach( $comment in $comments )
+					#if( $index >= 1 )
+						<tr id="comment_$comment.id" #alternate($mark)>
+							<td>$format.formatDate($comment.createdDate)</td>
+							<td> $programStageInstance.programStage.name</td>
+							<td>$comment.creator - $comment.commentText</td>
+							#set( $mark = !$mark)
+						</tr>
+					#end
+				#end	
+				
+				#foreach( $sms in $outboundSms )
+					#if( $index >= 1 )
+						<tr id="tr${sms.id}" #alternate($mark) >
+							<td>$format.formatDate($!sms.date)</td>
+							<td>$programStageInstance.programStage.name</td>
+							<td>$sms.message</td>
+							#set( $mark = !$mark)
+						</tr>
+					#end
 				#end
 			</tbody>
 		</table>
-	</div>
+		<br>
+		<input type='button' value='$i18n.getString("show_hide_more")' onclick='jQuery("#moreComments").toggle();'>
+	</div>
+	
+	<div id="tab-3">
+		#parse( "/dhis-web-caseentry/sendSmsForm.vm" )
+	</div>
+	
+	<div id='tab-4'><div id='programReportDiv'></div></div>
 </div>
 
 <script type="text/javascript">
@@ -77,5 +162,12 @@
 		var i18n_color_quick_help = '$encoder.jsEscape( $i18n.getString( "color_quick_help" ) , "'")';
 		var i18n_comment_added = '$encoder.jsEscape( $i18n.getString( "comment_added" ) , "'")';
 		setFieldValue( "programStageInstanceId", "$!programStageInstance.id" );
+		
+		$( "#smsManagementForm" ).bind( "tabsselect", function(event, ui) {
+			if( ui.tab.hash == '#tab-4' ){
+				programReports(getFieldValue('programInstanceId'));
+			}
+		});
 	});
+	
 </script>

=== renamed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsPatientRecords.vm' => 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsPatientRecords.vm	2012-08-21 06:18:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm	2012-09-06 09:44:43 +0000
@@ -33,10 +33,13 @@
 					<td>
 						<input type='button' class='patient-object' value='$patient.getFullName()' onclick='javascript:showPatientHistory( "$patient.id" );' title='$i18n.getString( "patient_details_and_history" )'>
 					</td>
+					<td class='bold' style='cursor:pointer;font-size:25px' onclick="eventFlowToggle($programInstance.id)">
+						<a>&raquo;</a>
+					</td>
 					#if($!programStageInstanceMap.get($programInstance))
 						#set($programStageInstances = $programStageInstanceMap.get($programInstance) )
 					<td>
-						<table class="stage-container">	
+						<table class="stage-container" id='tb_$programInstance.id'>	
 							<tr>
 								<td>
 									<div class="arrow-left" onclick="moveLeft('flow_$programInstance.id')">&nbsp;</div>
@@ -46,20 +49,34 @@
 										<tr>
 										#set( $flag = "false" )
 										#foreach( $programStageInstance in $programStageInstances )
-											<td id="img_$programStageInstance.id">
-												<img src='images/rightarrow.png'>
-											</td>
+											<td id="arrow_$programStageInstance.id" width="5px" style='font-size:25px;'>&rarr;</td>
 											<td id="td_$programStageInstance.id">
 												<table class='stage-object'>
 													<tr>
 														<td>
+															#set($title="")
+															#set($index = 0)
+															#foreach( $comment in $programStageInstance.comments)
+																#if( $index < 5)
+																	#set( $title= $title + "$format.formatDate( $comment.createdDate ) - $comment.creator - $comment.commentText &#13;&#10;" )
+																	#set( $index = $index + 1 )
+																#end
+															#end
+															#foreach( $sms in $programStageInstance.outboundSms)
+																#if( $index < 5)
+																	#set( $title= $title + "$format.formatDate( $sms.date ) - $sms.message &#13;&#10;")
+																	#set( $index = $index + 1)
+																#end
+															#end
+																	
 															<input type='button' id='ps_$programStageInstance.id' name='programStageBtn' 
 																programStageInstanceId='$programStageInstance.id' 
+																programStageName='$programStageInstance.programStage.name' 
 																programStageId='$programStageInstance.programStage.id' 
 																status="$statusMap.get( $programStageInstance.id )" 
 																class='stage-object' 
-																value='$programStageInstance.programStage.name $format.formatDate( $programStageInstance.dueDate )' 
-																onclick='javascript:getOutboundSmsList( $programStageInstance.id, false );'>
+																value='$programStageInstance.programStage.name&#13;&#10;$format.formatDate( $programStageInstance.dueDate )' 
+																title="$title" onclick='javascript:getOutboundSmsList( $programStageInstance.id, false );'>
 														</td>
 														<script>
 															var status = $statusMap.get( $programStageInstance.id ); 
@@ -67,35 +84,6 @@
 															setEventColorStatus( 'ps_' + $programStageInstance.id ,status, dueDate );
 														</script>
 													</tr>
-													<tr>
-														<td>
-															<a href="#" id="comment-$programStageInstance.id" class="tooltip">
-																<img src='images/comments.png'>
-																#set( $divid = 'comment-' + $programStageInstance.id + '-content')
-																<div id="$divid" class="tooltip-target">
-																	#if( $programStageInstance.comments.size() > 0 )
-																		#foreach( $comment in $programStageInstance.comments )
-																			<p>- $format.formatDate($comment.createdDate)- $comment.creator - $comment.commentText</p>
-																		#end
-																	#else
-																		<p>($i18n.getString('no_comment'))</p>
-																	#end
-																</div>
-															</a>
-															#if( $!programInstance.patient.phoneNumber && $!programInstance.patient.phoneNumber != '' )
-																<img src='images/sms.png' class='comment-font' onclick="getOutboundSmsList( $programStageInstance.id, true );" style='cursor:pointer;' title="$programStageInstance.outboundSms.size() $i18n.getString('messages')"/>&nbsp;
-															#end
-														</td>
-													</tr>
-													<tr class='hidden'>
-														<td>
-															#if( $!programInstance.patient.phoneNumber && $!programInstance.patient.phoneNumber != '' )
-																(<span id='noMessageDiv_$programStageInstance.id'>$programStageInstance.outboundSms.size()</span> $i18n.getString('messages'))
-															#else
-																(<span id='noMessageDiv_$programStageInstance.id'>$i18n.getString("no_phone_number")</span>)
-															#end
-														</td>
-													</tr>
 												</table>
 											</td>
 										#end
@@ -127,18 +115,19 @@
 #end
 
 <script>
-	#if( $programStageInstanceIds )
+	#if( $programStageInstanceIds && $programStageInstanceIds.size() > 0 )
 		jQuery("#patientList .stage-object").each( function(){
 			var programStageInstance = this.id.split('_')[1];
-			hideById('img_' + programStageInstance );
+			hideById('arrow_' + programStageInstance );
 			hideById('td_' + programStageInstance );
 		});
 		
 		jQuery(".arrow-left").css("display", "none");
 		jQuery(".arrow-right").css("display", "none");
 		#foreach( $id in $programStageInstanceIds )
+			showById('arrow_$id');
 			showById('td_$id');
-			jQuery("#ps_$id").addClass("stage-object-selected");
+			jQuery("#ps_$id").addClass("stage-object-selected searched");
 		#end
 	#end
 </script>
\ No newline at end of file

=== renamed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsReminderSelect.vm' => 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingSelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsReminderSelect.vm	2012-08-26 00:44:38 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingSelect.vm	2012-09-06 09:44:43 +0000
@@ -19,7 +19,7 @@
 	});	
 </script>
 
-<h3>$i18n.getString( "sms_reminder" )</h3>
+<h3>$i18n.getString( "program_tracking" )</h3>
 <form>
 	<input type='hidden' id='isRegistration' name= 'isRegistration' value='false'>
 	<input type='hidden' id='listAll' name='listAll'>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm	2012-08-26 00:44:38 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm	2012-09-06 09:44:43 +0000
@@ -1,4 +1,6 @@
 <input type='hidden' id='searchByProgramStage' name='searchByProgramStage' value="false">
+<input type='hidden' id='orgunitId' name='orgunitId' value='$organisationUnit.id' >
+
 <table style="margin-bottom:8px">    
 	<tr>
 		<td>
@@ -98,6 +100,14 @@
 	var i18n_yes = '$encoder.jsEscape( $i18n.getString( "yes" ) , "'")';
 	var i18n_no = '$encoder.jsEscape( $i18n.getString( "no" ) , "'")';
 	var searchTextBox = '<input type="text" id="searchText" name="searchText" onkeyup="searchPatientsOnKeyUp( event );">';
-	datePicker( 'startDueDate', true );
+	datePicker( 'startDueDate' );
 	datePicker( 'endDueDate', true );
+	
+	var standardInterval = -1;
+	var date = new Date();
+	var d = date.getDate() + eval(standardInterval);
+	var m = date.getMonth();
+	var y = date.getFullYear();
+	var edate= new Date(y, m, d);
+	jQuery( '#startDueDate' ).datepicker( "setDate" , edate );
 </script>
\ No newline at end of file

=== renamed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsMenu.vm' => 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackingMenu.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsMenu.vm	2012-08-09 08:57:01 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackingMenu.vm	2012-09-06 09:44:43 +0000
@@ -1,7 +1,7 @@
 
-<a href="index.action"><h2>$i18n.getString( "sms" )&nbsp;</h2></a>
+<a href="index.action"><h2>$i18n.getString( "tracking" )&nbsp;</h2></a>
 <ul>
-    <li><a href="smsReminderSelect.action">$i18n.getString( "sms_reminder" )</a></li>     
+    <li><a href="smsReminderSelect.action">$i18n.getString( "program_tracking" )</a></li>     
 </ul>
 
 #parse( "/dhis-web-commons/ouwt/orgunittreesearch.vm" )