← Back to team overview

dhis-mobile-devs team mailing list archive

[Branch ~dhis-mobile-devs/dhis-mobile/lwuit-tracking] Rev 150: hide/show current relationship on dashboard, clean code

 

------------------------------------------------------------
revno: 150
committer: Lai <lai.hispvietnam@xxxxxxxxx>
branch nick: lwuit-tracking
timestamp: Wed 2013-09-18 16:05:12 +0700
message:
  hide/show current relationship on dashboard, clean code
modified:
  src/org/hisp/dhis/mobile/model/Patient.java
  src/org/hisp/dhis/mobile/view/PersonDashboardView.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/Patient.java'
--- src/org/hisp/dhis/mobile/model/Patient.java	2013-09-11 15:25:01 +0000
+++ src/org/hisp/dhis/mobile/model/Patient.java	2013-09-18 09:05:12 +0000
@@ -47,8 +47,6 @@
 
     private String birthDate;
 
-    private String bloodGroup;
-
     private Date registrationDate;
 
     private Character dobType;
@@ -91,16 +89,6 @@
         this.birthDate = birthDate;
     }
 
-    public String getBloodGroup()
-    {
-        return bloodGroup;
-    }
-
-    public void setBloodGroup( String bloodGroup )
-    {
-        this.bloodGroup = bloodGroup;
-    }
-
     public Date getRegistrationDate()
     {
         return registrationDate;
@@ -342,15 +330,6 @@
 
         if ( din.readBoolean() )
         {
-            this.setBloodGroup( din.readUTF() );
-        }
-        else
-        {
-            this.setBloodGroup( null );
-        }
-
-        if ( din.readBoolean() )
-        {
             this.setRegistrationDate( new Date( din.readLong() ) );
         }
         else
@@ -548,8 +527,6 @@
         {
             dout.writeBoolean( false );
         }
-        // doesn't transfer blood group to client
-        dout.writeBoolean( false );
 
         if ( registrationDate != null )
         {

=== modified file 'src/org/hisp/dhis/mobile/view/PersonDashboardView.java'
--- src/org/hisp/dhis/mobile/view/PersonDashboardView.java	2013-09-11 15:25:01 +0000
+++ src/org/hisp/dhis/mobile/view/PersonDashboardView.java	2013-09-18 09:05:12 +0000
@@ -45,7 +45,6 @@
 import org.hisp.dhis.mobile.model.Relationship;
 import org.hisp.dhis.mobile.recordstore.PatientRecordStore;
 import org.hisp.dhis.mobile.ui.Text;
-import org.hisp.dhis.mobile.util.PeriodUtil;
 
 import com.sun.lwuit.Command;
 import com.sun.lwuit.Form;
@@ -70,52 +69,12 @@
 
     private Patient patient;
 
-    Vector orgUnitVector;
-
     public PersonDashboardView( DHISMIDlet dhisMIDlet )
     {
         super( dhisMIDlet );
         this.namebasedMidlet = (NameBasedMIDlet) dhisMIDlet;
     }
 
-    class Node
-    {
-        Object[] children;
-
-        String value;
-
-        public Node( String value, Object[] children )
-        {
-            this.children = children;
-            this.value = value;
-        }
-
-        public String toString()
-        {
-            return value;
-        }
-
-        public Object[] getChildren()
-        {
-            return children;
-        }
-
-        public void setChildren( Object[] children )
-        {
-            this.children = children;
-        }
-
-        public String getValue()
-        {
-            return value;
-        }
-
-        public void setValue( String value )
-        {
-            this.value = value;
-        }
-    }
-
     public void prepareView()
     {
         System.gc();
@@ -163,7 +122,6 @@
         gender.setEnabled( false );
 
         TextArea dob = new TextArea();
-        int y = 0, m = 0, d = 0;
         if ( patient.getBirthDate() == null )
         {
             dob.setText( "Date of Birth: empty" );
@@ -211,11 +169,14 @@
         this.prepareEnrollmentPrograms();
 
         // show relationship
-        Label relationshiplbl = new Label( "Relationships" );
-        relationshiplbl.setUnselectedStyle( labelStyle );
-        relationshiplbl.setSelectedStyle( labelStyle );
-        mainForm.addComponent( relationshiplbl );
-        this.prepareRelationships();
+        if ( patient.getRelationships() != null )
+        {
+            Label relationshiplbl = new Label( "Relationships" );
+            relationshiplbl.setUnselectedStyle( labelStyle );
+            relationshiplbl.setSelectedStyle( labelStyle );
+            mainForm.addComponent( relationshiplbl );
+            this.prepareRelationships();
+        }
 
         // show enrollment relationship
         Label lblEnrollmentRelationship = new Label( "Add Relationships" );