← Back to team overview

dhis-mobile-devs team mailing list archive

[Branch ~dhis-mobile-devs/dhis-mobile/lwuit-tracking] Rev 216: https://blueprints.launchpad.net/dhis-mobile/+spec/enhance-tracker-client

 

------------------------------------------------------------
revno: 216
committer: sherylyn.marie
branch nick: lwuit-tracking
timestamp: Mon 2014-05-12 14:46:39 +0800
message:
  https://blueprints.launchpad.net/dhis-mobile/+spec/enhance-tracker-client
  #1 ALL TRACKED ENTITY SUPPORT
  Pending Registration Screen
modified:
  src/org/hisp/dhis/mobile/model/OrgUnit.java
  src/org/hisp/dhis/mobile/recordstore/OfflinePatientRecordStore.java
  src/org/hisp/dhis/mobile/view/OfflineView.java
  src/org/hisp/dhis/mobile/view/PersonRegistrationView.java


--
lp:~dhis-mobile-devs/dhis-mobile/lwuit-tracking
https://code.launchpad.net/~dhis-mobile-devs/dhis-mobile/lwuit-tracking

Your team DHIS mobile developers is subscribed to branch lp:~dhis-mobile-devs/dhis-mobile/lwuit-tracking.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis-mobile-devs/dhis-mobile/lwuit-tracking/+edit-subscription
=== modified file 'src/org/hisp/dhis/mobile/model/OrgUnit.java'
--- src/org/hisp/dhis/mobile/model/OrgUnit.java	2014-05-09 10:20:37 +0000
+++ src/org/hisp/dhis/mobile/model/OrgUnit.java	2014-05-12 06:46:39 +0000
@@ -26,341 +26,354 @@
 import org.hisp.dhis.mobile.log.LogMan;
 import org.hisp.dhis.mobile.recordstore.SettingRecordStore;
 
-public class OrgUnit implements DataStreamSerializable {
-	private static final String CLASS_TAG = "OrgUnit";
-
-	private int id;
-
-	private String name;
-
-	private String downloadAllUrl;
-
-	private String updateActivityPlanUrl;
-
-	private String uploadFacilityReportUrl;
-
-	private String downloadFacilityReportUrl;
-
-	private String uploadActivityReportUrl;
-
-	private String updateDataSetsUrl;
-
-	private String changeDataSetLangUrl;
-
-	private String searchUrl;
-
-	private String updateNewVersionUrl;
-
-	private String sendFeedbackUrl;
-
-	private String findUserUrl;
-
-	private String updateContactUrl;
-
-	private String findPatientUrl;
-
-	private String uploadProgramStageUrl;
-
-	private String registerPersonUrl;
-
-	private String enrollProgramUrl;
-
-	private String getVariesInfoUrl;
-
-	private String addRelationshipUrl;
-
-	private String downloadAnonymousProgramUrl;
-
-	private String findProgramUrl;
-
-	private String findPatientInAdvancedUrl;
-
-	private String findLostToFollowUpUrl;
-
-	private String handleLostToFollowUpUrl;
-
-	private String generateRepeatableEventUrl;
-
-	private String uploadSingleEventWithoutRegistration;
-
-	public static double serverVersion;
-
-	public int getId() {
-		return id;
-	}
-
-	public void setId(int id) {
-		this.id = id;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public String getDownloadAllUrl() {
-		return downloadAllUrl;
-	}
-
-	public String getUploadFacilityReportUrl() {
-		return uploadFacilityReportUrl;
-	}
-
-	public String getDownloadFacilityReportUrl() {
-		return downloadFacilityReportUrl;
-	}
-
-	public String getUploadActivityReportUrl() {
-		return uploadActivityReportUrl;
-	}
-
-	public String getUpdateDataSetsUrl() {
-		return updateDataSetsUrl;
-	}
-
-	public String getUpdateActivityPlanUrl() {
-		return updateActivityPlanUrl;
-	}
-
-	public String getChangeDataSetLangUrl() {
-		return changeDataSetLangUrl;
-	}
-
-	public String getSearchUrl() {
-		return searchUrl;
-	}
-
-	public String getUpdateNewVersionUrl() {
-		return updateNewVersionUrl;
-	}
-
-	public String getSendFeedbackUrl() {
-		return sendFeedbackUrl;
-	}
-
-	public String getFindUserUrl() {
-		return findUserUrl;
-	}
-
-	public String getUpdateContactUrl() {
-		return updateContactUrl;
-	}
-
-	public String getFindPatientUrl() {
-		return findPatientUrl;
-	}
-
-	public String getUploadProgramStageUrl() {
-		return uploadProgramStageUrl;
-	}
-
-	public String getRegisterPersonUrl() {
-		return registerPersonUrl;
-	}
-
-	public String getEnrollProgramUrl() {
-		return enrollProgramUrl;
-	}
-
-	public String getGetVariesInfoUrl() {
-		return getVariesInfoUrl;
-	}
-
-	public String getAddRelationshipUrl() {
-		return addRelationshipUrl;
-	}
-
-	public String getDownloadAnonymousProgramUrl() {
-		return downloadAnonymousProgramUrl;
-	}
-
-	public String getFindProgramUrl() {
-		return findProgramUrl;
-	}
-
-	public String getFindPatientInAdvancedUrl() {
-		return findPatientInAdvancedUrl;
-	}
-
-	public String getFindLostToFollowUpUrl() {
-		return findLostToFollowUpUrl;
-	}
-
-	public String getHandleLostToFollowUpUrl() {
-		return handleLostToFollowUpUrl;
-	}
-
-	public String getGenerateRepeatableEventUrl() {
-		return generateRepeatableEventUrl;
-	}
-
-	public String getUploadSingleEventWithoutRegistration() {
-		return uploadSingleEventWithoutRegistration;
-	}
-
-	public void setUploadSingleEventWithoutRegistration(
-			String uploadSingleEventWithoutRegistration) {
-		this.uploadSingleEventWithoutRegistration = uploadSingleEventWithoutRegistration;
-	}
-
-	public void serialize(DataOutputStream dataOutputStream) throws IOException {
-		dataOutputStream.writeInt(id);
-		dataOutputStream.writeUTF(name);
-		dataOutputStream.writeUTF(downloadAllUrl);
-		dataOutputStream.writeUTF(updateActivityPlanUrl);
-		dataOutputStream.writeUTF(uploadFacilityReportUrl);
-		dataOutputStream.writeUTF(downloadFacilityReportUrl);
-		dataOutputStream.writeUTF(uploadActivityReportUrl);
-		dataOutputStream.writeUTF(updateDataSetsUrl);
-		dataOutputStream.writeUTF(changeDataSetLangUrl);
-		dataOutputStream.writeUTF(searchUrl);
-		dataOutputStream.writeUTF(updateNewVersionUrl);
-		dataOutputStream.writeUTF(sendFeedbackUrl);
-		dataOutputStream.writeUTF(findUserUrl);
-		dataOutputStream.writeUTF(updateContactUrl);
-		dataOutputStream.writeUTF(findPatientUrl);
-		dataOutputStream.writeUTF(registerPersonUrl);
-		dataOutputStream.writeUTF(uploadProgramStageUrl);
-		dataOutputStream.writeUTF(enrollProgramUrl);
-		dataOutputStream.writeUTF(getVariesInfoUrl);
-		dataOutputStream.writeUTF(addRelationshipUrl);
-		dataOutputStream.writeUTF(downloadAnonymousProgramUrl);
-		dataOutputStream.writeUTF(findProgramUrl);
-		dataOutputStream.writeUTF(findPatientInAdvancedUrl);
-		dataOutputStream.writeUTF(findLostToFollowUpUrl);
-		dataOutputStream.writeUTF(handleLostToFollowUpUrl);
-		dataOutputStream.writeUTF(generateRepeatableEventUrl);
-		dataOutputStream.writeUTF(uploadSingleEventWithoutRegistration);
-	}
-
-	public void deSerialize(DataInputStream dataInputStream) throws IOException {
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG,
-				"Deserializing Organization Unit...");
-
-		id = dataInputStream.readInt();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "id=" + id);
-
-		name = dataInputStream.readUTF();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "name=" + name);
-
-		downloadAllUrl = dataInputStream.readUTF();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "downloadAllUrl="
-				+ downloadAllUrl);
-
-		updateActivityPlanUrl = dataInputStream.readUTF();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG,
-				"updateActivityPlanUrl=" + updateActivityPlanUrl);
-
-		uploadFacilityReportUrl = dataInputStream.readUTF();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG,
-				"uploadFacilityReportUrl=" + uploadFacilityReportUrl);
-
-		downloadFacilityReportUrl = dataInputStream.readUTF();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG,
-				"downloadFacilityReportUrl=" + downloadFacilityReportUrl);
-
-		uploadActivityReportUrl = dataInputStream.readUTF();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG,
-				"uploadActivityReportUrl=" + uploadActivityReportUrl);
-
-		updateDataSetsUrl = dataInputStream.readUTF();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "updateDataSetsUrl="
-				+ updateDataSetsUrl);
-
-		changeDataSetLangUrl = dataInputStream.readUTF();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG,
-				"changeDataSetLangUrl=" + changeDataSetLangUrl);
-
-		searchUrl = dataInputStream.readUTF();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "searchUrl="
-				+ searchUrl);
-
-		updateNewVersionUrl = dataInputStream.readUTF();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "updateNewVersionUrl="
-				+ updateNewVersionUrl);
-
-		sendFeedbackUrl = dataInputStream.readUTF();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "sendFeedbackUrl="
-				+ sendFeedbackUrl);
-		
-		findUserUrl = dataInputStream.readUTF();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "findUserUrl="
-				+ findUserUrl);
-
-		updateContactUrl = dataInputStream.readUTF();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "updateContactUrl="
-				+ updateContactUrl);
-
-		findPatientUrl = dataInputStream.readUTF();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "findPatientUrl="
-				+ findPatientUrl);
-
-		registerPersonUrl = dataInputStream.readUTF();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "registerPersonUrl="
-				+ registerPersonUrl);
-
-		uploadProgramStageUrl = dataInputStream.readUTF();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG,
-				"uploadProgramStageUrl=" + uploadProgramStageUrl);
-
-		enrollProgramUrl = dataInputStream.readUTF();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "enrollProgramUrl="
-				+ enrollProgramUrl);
-
-		getVariesInfoUrl = dataInputStream.readUTF();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "getVariesInfoUrl="
-				+ getVariesInfoUrl);
-
-		addRelationshipUrl = dataInputStream.readUTF();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "addRelationshipUrl="
-				+ addRelationshipUrl);
-
-		downloadAnonymousProgramUrl = dataInputStream.readUTF();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG,
-				"downloadAnonymousProgramUrl=" + downloadAnonymousProgramUrl);
-
-		findProgramUrl = dataInputStream.readUTF();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "findProgramUrl="
-				+ findProgramUrl);
-
-		findPatientInAdvancedUrl = dataInputStream.readUTF();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG,
-				"findPatientInAdvancedUrl=" + findPatientInAdvancedUrl);
-
-		findLostToFollowUpUrl = dataInputStream.readUTF();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG,
-				"findLostToFollowUpUrl=" + findLostToFollowUpUrl);
-
-		handleLostToFollowUpUrl = dataInputStream.readUTF();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG,
-				"handleLostToFollowUpUrl=" + handleLostToFollowUpUrl);
-
-		generateRepeatableEventUrl = dataInputStream.readUTF();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG,
-				"generateRepeatableEventUrl=" + generateRepeatableEventUrl);
-
-		uploadSingleEventWithoutRegistration = dataInputStream.readUTF();
-		LogMan.log(LogMan.DEBUG, "OrgUnit," + CLASS_TAG,
-				"uploadSingleEventWithoutRegistration="
-						+ uploadSingleEventWithoutRegistration);
-	}
-
-	public boolean checkNewVersion(double serverVersion) {
-		double clientVersion;
-		boolean result = false;
-		try {
-			SettingRecordStore settingRecordStore = new SettingRecordStore();
-			clientVersion = Double.parseDouble(settingRecordStore
-					.get(SettingRecordStore.CLIENT_VERSION));
-			if (serverVersion > clientVersion) {
-				result = true;
-			}
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-		return result;
-	}
+public class OrgUnit
+    implements DataStreamSerializable
+{
+    private static final String CLASS_TAG = "OrgUnit";
+
+    private int id;
+
+    private String name;
+
+    private String downloadAllUrl;
+
+    private String updateActivityPlanUrl;
+
+    private String uploadFacilityReportUrl;
+
+    private String downloadFacilityReportUrl;
+
+    private String uploadActivityReportUrl;
+
+    private String updateDataSetsUrl;
+
+    private String changeDataSetLangUrl;
+
+    private String searchUrl;
+
+    private String updateNewVersionUrl;
+
+    private String sendFeedbackUrl;
+
+    private String findUserUrl;
+
+    private String updateContactUrl;
+
+    private String findPatientUrl;
+
+    private String uploadProgramStageUrl;
+
+    private String registerPersonUrl;
+
+    private String enrollProgramUrl;
+
+    private String getVariesInfoUrl;
+
+    private String addRelationshipUrl;
+
+    private String downloadAnonymousProgramUrl;
+
+    private String findProgramUrl;
+
+    private String findPatientInAdvancedUrl;
+
+    private String findLostToFollowUpUrl;
+
+    private String handleLostToFollowUpUrl;
+
+    private String generateRepeatableEventUrl;
+
+    private String uploadSingleEventWithoutRegistration;
+
+    public static double serverVersion;
+
+    public int getId()
+    {
+        return id;
+    }
+
+    public void setId( int id )
+    {
+        this.id = id;
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+
+    public void setName( String name )
+    {
+        this.name = name;
+    }
+
+    public String getDownloadAllUrl()
+    {
+        return downloadAllUrl;
+    }
+
+    public String getUploadFacilityReportUrl()
+    {
+        return uploadFacilityReportUrl;
+    }
+
+    public String getDownloadFacilityReportUrl()
+    {
+        return downloadFacilityReportUrl;
+    }
+
+    public String getUploadActivityReportUrl()
+    {
+        return uploadActivityReportUrl;
+    }
+
+    public String getUpdateDataSetsUrl()
+    {
+        return updateDataSetsUrl;
+    }
+
+    public String getUpdateActivityPlanUrl()
+    {
+        return updateActivityPlanUrl;
+    }
+
+    public String getChangeDataSetLangUrl()
+    {
+        return changeDataSetLangUrl;
+    }
+
+    public String getSearchUrl()
+    {
+        return searchUrl;
+    }
+
+    public String getUpdateNewVersionUrl()
+    {
+        return updateNewVersionUrl;
+    }
+
+    public String getSendFeedbackUrl()
+    {
+        return sendFeedbackUrl;
+    }
+
+    public String getFindUserUrl()
+    {
+        return findUserUrl;
+    }
+
+    public String getUpdateContactUrl()
+    {
+        return updateContactUrl;
+    }
+
+    public String getFindPatientUrl()
+    {
+        return findPatientUrl;
+    }
+
+    public String getUploadProgramStageUrl()
+    {
+        return uploadProgramStageUrl;
+    }
+
+    public String getRegisterPersonUrl()
+    {
+        return registerPersonUrl;
+    }
+
+    public String getEnrollProgramUrl()
+    {
+        return enrollProgramUrl;
+    }
+
+    public String getGetVariesInfoUrl()
+    {
+        return getVariesInfoUrl;
+    }
+
+    public String getAddRelationshipUrl()
+    {
+        return addRelationshipUrl;
+    }
+
+    public String getDownloadAnonymousProgramUrl()
+    {
+        return downloadAnonymousProgramUrl;
+    }
+
+    public String getFindProgramUrl()
+    {
+        return findProgramUrl;
+    }
+
+    public String getFindPatientInAdvancedUrl()
+    {
+        return findPatientInAdvancedUrl;
+    }
+
+    public String getFindLostToFollowUpUrl()
+    {
+        return findLostToFollowUpUrl;
+    }
+
+    public String getHandleLostToFollowUpUrl()
+    {
+        return handleLostToFollowUpUrl;
+    }
+
+    public String getGenerateRepeatableEventUrl()
+    {
+        return generateRepeatableEventUrl;
+    }
+
+    public String getUploadSingleEventWithoutRegistration()
+    {
+        return uploadSingleEventWithoutRegistration;
+    }
+
+    public void setUploadSingleEventWithoutRegistration( String uploadSingleEventWithoutRegistration )
+    {
+        this.uploadSingleEventWithoutRegistration = uploadSingleEventWithoutRegistration;
+    }
+
+    public void serialize( DataOutputStream dataOutputStream )
+        throws IOException
+    {
+        dataOutputStream.writeInt( id );
+        dataOutputStream.writeUTF( name );
+        dataOutputStream.writeUTF( downloadAllUrl );
+        dataOutputStream.writeUTF( updateActivityPlanUrl );
+        dataOutputStream.writeUTF( uploadFacilityReportUrl );
+        dataOutputStream.writeUTF( downloadFacilityReportUrl );
+        dataOutputStream.writeUTF( uploadActivityReportUrl );
+        dataOutputStream.writeUTF( updateDataSetsUrl );
+        dataOutputStream.writeUTF( changeDataSetLangUrl );
+        dataOutputStream.writeUTF( searchUrl );
+        dataOutputStream.writeUTF( updateNewVersionUrl );
+        dataOutputStream.writeUTF( sendFeedbackUrl );
+        dataOutputStream.writeUTF( findUserUrl );
+        dataOutputStream.writeUTF( updateContactUrl );
+        dataOutputStream.writeUTF( findPatientUrl );
+        dataOutputStream.writeUTF( registerPersonUrl );
+        dataOutputStream.writeUTF( uploadProgramStageUrl );
+        dataOutputStream.writeUTF( enrollProgramUrl );
+        dataOutputStream.writeUTF( getVariesInfoUrl );
+        dataOutputStream.writeUTF( addRelationshipUrl );
+        dataOutputStream.writeUTF( downloadAnonymousProgramUrl );
+        dataOutputStream.writeUTF( findProgramUrl );
+        dataOutputStream.writeUTF( findPatientInAdvancedUrl );
+        dataOutputStream.writeUTF( findLostToFollowUpUrl );
+        dataOutputStream.writeUTF( handleLostToFollowUpUrl );
+        dataOutputStream.writeUTF( generateRepeatableEventUrl );
+        dataOutputStream.writeUTF( uploadSingleEventWithoutRegistration );
+    }
+
+    public void deSerialize( DataInputStream dataInputStream )
+        throws IOException
+    {
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "Deserializing Organization Unit..." );
+
+        id = dataInputStream.readInt();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "id=" + id );
+
+        name = dataInputStream.readUTF();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "name=" + name );
+
+        downloadAllUrl = dataInputStream.readUTF();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "downloadAllUrl=" + downloadAllUrl );
+
+        updateActivityPlanUrl = dataInputStream.readUTF();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "updateActivityPlanUrl=" + updateActivityPlanUrl );
+
+        uploadFacilityReportUrl = dataInputStream.readUTF();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "uploadFacilityReportUrl=" + uploadFacilityReportUrl );
+
+        downloadFacilityReportUrl = dataInputStream.readUTF();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "downloadFacilityReportUrl=" + downloadFacilityReportUrl );
+
+        uploadActivityReportUrl = dataInputStream.readUTF();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "uploadActivityReportUrl=" + uploadActivityReportUrl );
+
+        updateDataSetsUrl = dataInputStream.readUTF();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "updateDataSetsUrl=" + updateDataSetsUrl );
+
+        changeDataSetLangUrl = dataInputStream.readUTF();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "changeDataSetLangUrl=" + changeDataSetLangUrl );
+
+        searchUrl = dataInputStream.readUTF();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "searchUrl=" + searchUrl );
+
+        updateNewVersionUrl = dataInputStream.readUTF();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "updateNewVersionUrl=" + updateNewVersionUrl );
+
+        sendFeedbackUrl = dataInputStream.readUTF();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "sendFeedbackUrl=" + sendFeedbackUrl );
+
+        findUserUrl = dataInputStream.readUTF();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "findUserUrl=" + findUserUrl );
+
+        updateContactUrl = dataInputStream.readUTF();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "updateContactUrl=" + updateContactUrl );
+
+        findPatientUrl = dataInputStream.readUTF();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "findPatientUrl=" + findPatientUrl );
+
+        registerPersonUrl = dataInputStream.readUTF();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "registerPersonUrl=" + registerPersonUrl );
+
+        uploadProgramStageUrl = dataInputStream.readUTF();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "uploadProgramStageUrl=" + uploadProgramStageUrl );
+
+        enrollProgramUrl = dataInputStream.readUTF();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "enrollProgramUrl=" + enrollProgramUrl );
+
+        getVariesInfoUrl = dataInputStream.readUTF();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "getVariesInfoUrl=" + getVariesInfoUrl );
+
+        addRelationshipUrl = dataInputStream.readUTF();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "addRelationshipUrl=" + addRelationshipUrl );
+
+        downloadAnonymousProgramUrl = dataInputStream.readUTF();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "downloadAnonymousProgramUrl=" + downloadAnonymousProgramUrl );
+
+        findProgramUrl = dataInputStream.readUTF();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "findProgramUrl=" + findProgramUrl );
+
+        findPatientInAdvancedUrl = dataInputStream.readUTF();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "findPatientInAdvancedUrl=" + findPatientInAdvancedUrl );
+
+        findLostToFollowUpUrl = dataInputStream.readUTF();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "findLostToFollowUpUrl=" + findLostToFollowUpUrl );
+
+        handleLostToFollowUpUrl = dataInputStream.readUTF();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "handleLostToFollowUpUrl=" + handleLostToFollowUpUrl );
+
+        generateRepeatableEventUrl = dataInputStream.readUTF();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "generateRepeatableEventUrl=" + generateRepeatableEventUrl );
+
+        uploadSingleEventWithoutRegistration = dataInputStream.readUTF();
+        LogMan.log( LogMan.DEBUG, "OrgUnit," + CLASS_TAG, "uploadSingleEventWithoutRegistration="
+            + uploadSingleEventWithoutRegistration );
+    }
+
+    public boolean checkNewVersion( double serverVersion )
+    {
+        double clientVersion;
+        boolean result = false;
+        try
+        {
+            SettingRecordStore settingRecordStore = new SettingRecordStore();
+            clientVersion = Double.parseDouble( settingRecordStore.get( SettingRecordStore.CLIENT_VERSION ) );
+            if ( serverVersion > clientVersion )
+            {
+                result = true;
+            }
+        }
+        catch ( Exception e )
+        {
+            e.printStackTrace();
+        }
+        return result;
+    }
 }
\ No newline at end of file

=== modified file 'src/org/hisp/dhis/mobile/recordstore/OfflinePatientRecordStore.java'
--- src/org/hisp/dhis/mobile/recordstore/OfflinePatientRecordStore.java	2014-04-03 01:58:41 +0000
+++ src/org/hisp/dhis/mobile/recordstore/OfflinePatientRecordStore.java	2014-05-12 06:46:39 +0000
@@ -12,6 +12,7 @@
 import javax.microedition.rms.RecordStoreNotOpenException;
 
 import org.hisp.dhis.mobile.log.LogMan;
+import org.hisp.dhis.mobile.model.Model;
 import org.hisp.dhis.mobile.model.Patient;
 import org.hisp.dhis.mobile.recordstore.filter.OfflinePatientFilter;
 import org.hisp.dhis.mobile.util.SerializationUtil;
@@ -93,6 +94,49 @@
         return offlinePatientVector;
 
     }
+    
+    public static Vector loadAllOfflinePatientsByTrackedEntity()
+        throws RecordStoreFullException, RecordStoreNotFoundException, RecordStoreException, IOException
+    {
+        Vector offlinePatientVector = null;
+        try
+        {
+            RecordStore recordStore = RecordStore.openRecordStore( OFFLINEPATIENT_DB, true );
+            RecordEnumeration recordEnum = recordStore.enumerateRecords( null, null, false );
+            offlinePatientVector = new Vector();
+            while ( recordEnum.hasNextElement() )
+            {
+                Patient patient = new Patient();
+                SerializationUtil.deSerialize( patient, recordEnum.nextRecord() );
+                
+                int index;
+                for ( index = offlinePatientVector.size(); index > 0; index-- )
+                {
+                    if ( ((Patient)offlinePatientVector.elementAt( index - 1 )).getTrackedEntityName().equals( patient.getTrackedEntityName() ) )
+                    {
+                        break;
+                    }
+                }
+
+                if ( index > 0 )
+                {
+                    offlinePatientVector.insertElementAt( patient, index - 1 );
+                }
+                else
+                {
+                    offlinePatientVector.addElement( patient );
+                }
+            }
+            recordEnum.destroy();
+            recordStore.closeRecordStore();
+        }
+        finally
+        {
+            System.gc();
+        }
+        return offlinePatientVector;
+
+    }
 
     public static void deleteAllOfflinePatient()
         throws RecordStoreFullException, RecordStoreNotFoundException, RecordStoreException

=== modified file 'src/org/hisp/dhis/mobile/view/OfflineView.java'
--- src/org/hisp/dhis/mobile/view/OfflineView.java	2014-04-04 03:54:55 +0000
+++ src/org/hisp/dhis/mobile/view/OfflineView.java	2014-05-12 06:46:39 +0000
@@ -19,6 +19,7 @@
 import com.sun.lwuit.events.ActionEvent;
 import com.sun.lwuit.events.ActionListener;
 import com.sun.lwuit.layouts.BoxLayout;
+import com.sun.lwuit.plaf.Style;
 
 public class OfflineView
     extends AbstractView
@@ -47,12 +48,28 @@
         offlineForm.removeAll();
         try
         {
-            this.offlinePatientVector = OfflinePatientRecordStore.loadAllOfflinePatients();
+            String trackedEntityName = "";
+            this.offlinePatientVector = OfflinePatientRecordStore.loadAllOfflinePatientsByTrackedEntity();
             for ( int i = 0; i < offlinePatientVector.size(); i++ )
             {
                 String displayText = "";
                 Patient patient = (Patient) offlinePatientVector.elementAt( i );
 
+                if ( !patient.getTrackedEntityName().equals( trackedEntityName ) )
+                {
+                    trackedEntityName = patient.getTrackedEntityName();
+
+                    Style labelStyle = new Style();
+                    labelStyle.setBgColor( 0xcccccc );
+
+                    Label trackedEntitylbl = new Label( trackedEntityName );
+                    trackedEntitylbl.setUnselectedStyle( labelStyle );
+                    trackedEntitylbl.setSelectedStyle( labelStyle );
+                    trackedEntitylbl.setFocusable( false );
+                    offlineForm.addComponent( trackedEntitylbl );
+
+                }
+                
                 for ( int j = 0; j < patient.getPatientAttValues().size(); j++ )
                 {
                     PatientAttribute patientAttribute = (PatientAttribute) patient.getPatientAttValues().elementAt( j );
@@ -62,8 +79,13 @@
                     }
                 }
                 
+                Style labelStyle = new Style();
+                labelStyle.setBgColor( 0xffffff );
+                
                 displayText = displayText.trim();
                 this.patientLabel = new Label( displayText );
+                this.patientLabel.setUnselectedStyle( labelStyle );
+                this.patientLabel.setSelectedStyle( labelStyle );
                 offlineForm.addComponent( patientLabel );
 
             }

=== modified file 'src/org/hisp/dhis/mobile/view/PersonRegistrationView.java'
--- src/org/hisp/dhis/mobile/view/PersonRegistrationView.java	2014-05-06 06:54:53 +0000
+++ src/org/hisp/dhis/mobile/view/PersonRegistrationView.java	2014-05-12 06:46:39 +0000
@@ -364,6 +364,7 @@
 
         patient.setPatientAttValues( attributeVector );
         patient.setOrganisationUnitName( dhisMIDlet.getCurrentOrgUnit().getName() );
+        patient.setTrackedEntityName( program.getTrackedEntityName() );
 
         ProgramInstance programInstance = new ProgramInstance();
         programInstance.setId( 0 );