dhis-mobile-devs team mailing list archive
-
dhis-mobile-devs team
-
Mailing list archive
-
Message #00330
[Branch ~dhis-mobile-devs/dhis-mobile/lwuit-tracking] Rev 187: put more options for lost to follow up
------------------------------------------------------------
revno: 187
committer: Lai <lai.hispvietnam@xxxxxxxxx>
branch nick: lwuit-tracking
timestamp: Tue 2013-11-12 15:06:45 +0700
message:
put more options for lost to follow up
modified:
src/org/hisp/dhis/mobile/connection/ConnectionManager.java
src/org/hisp/dhis/mobile/connection/task/FindLostToFollowUpTask.java
src/org/hisp/dhis/mobile/view/ProgramSelectView.java
src/org/hisp/dhis/mobile/view/TrackingMainMenuView.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/connection/ConnectionManager.java'
--- src/org/hisp/dhis/mobile/connection/ConnectionManager.java 2013-11-05 08:47:26 +0000
+++ src/org/hisp/dhis/mobile/connection/ConnectionManager.java 2013-11-12 08:06:45 +0000
@@ -226,9 +226,9 @@
runTask( registerAllOfflinePatientTask );
}
- public static void findLostToFollowUp( String programId )
+ public static void findLostToFollowUp( String searchEventInfos )
{
- FindLostToFollowUpTask findLostToFollowUpTask = new FindLostToFollowUpTask( programId );
+ FindLostToFollowUpTask findLostToFollowUpTask = new FindLostToFollowUpTask( searchEventInfos );
runTask( findLostToFollowUpTask );
}
=== modified file 'src/org/hisp/dhis/mobile/connection/task/FindLostToFollowUpTask.java'
--- src/org/hisp/dhis/mobile/connection/task/FindLostToFollowUpTask.java 2013-10-07 08:13:22 +0000
+++ src/org/hisp/dhis/mobile/connection/task/FindLostToFollowUpTask.java 2013-11-12 08:06:45 +0000
@@ -40,13 +40,13 @@
*/
public class FindLostToFollowUpTask extends AbstractTask
{
- private String programId;
+ private String searchEventInfos;
NameBasedMIDlet nameBasedMIDlet;
- public FindLostToFollowUpTask( String programId )
+ public FindLostToFollowUpTask( String searchEventInfos )
{
- this.programId = programId;
+ this.searchEventInfos = searchEventInfos;
this.nameBasedMIDlet = (NameBasedMIDlet) ConnectionManager.getDhisMIDlet();
}
@@ -55,7 +55,7 @@
DataInputStream inputStream = null;
try
{
- inputStream = this.download( programId, "programId" );
+ inputStream = this.download( searchEventInfos, "searchEventInfos" );
}
catch ( Exception e )
{
=== modified file 'src/org/hisp/dhis/mobile/view/ProgramSelectView.java'
--- src/org/hisp/dhis/mobile/view/ProgramSelectView.java 2013-10-10 08:12:04 +0000
+++ src/org/hisp/dhis/mobile/view/ProgramSelectView.java 2013-11-12 08:06:45 +0000
@@ -10,12 +10,16 @@
import org.hisp.dhis.mobile.recordstore.PatientIdentifierRecordStore;
import org.hisp.dhis.mobile.ui.Text;
+import com.sun.lwuit.CheckBox;
+import com.sun.lwuit.ComboBox;
import com.sun.lwuit.Command;
import com.sun.lwuit.Form;
+import com.sun.lwuit.Label;
import com.sun.lwuit.animations.CommonTransitions;
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 ProgramSelectView
extends AbstractView
@@ -32,6 +36,10 @@
private String programType;
private boolean isLostToFollowUp;
+
+ private ComboBox cbbStatus;
+
+ private CheckBox chbRisk;
public ProgramSelectView( DHISMIDlet dhisMIDlet )
{
@@ -55,6 +63,23 @@
getMainForm();
mainForm.removeAll();
+ Style labelStyle = new Style();
+ labelStyle.setBgColor( 0xcccccc );
+
+ // Status section
+ Label lblStatus = new Label( "Status" );
+ lblStatus.setUnselectedStyle( labelStyle );
+ lblStatus.setSelectedStyle( labelStyle );
+ mainForm.addComponent( lblStatus );
+ mainForm.addComponent( getCbbStatus() );
+ mainForm.addComponent( getChbRisk() );
+
+ // Program section
+ Label lblProgram = new Label( "Programs" );
+ lblProgram.setUnselectedStyle( labelStyle );
+ lblProgram.setSelectedStyle( labelStyle );
+ mainForm.addComponent( lblProgram );
+
for ( int i = 0; i < programInfos.size(); i++ )
{
String programInfo = (String) programInfos.elementAt( i );
@@ -88,8 +113,10 @@
}
else
{
+ String status = (String) cbbStatus.getSelectedItem();
+ boolean isRiskCase = chbRisk.isSelected();
ConnectionManager.setUrl( nameBasedMIDlet.getCurrentOrgUnit().getFindLostToFollowUpUrl() );
- ConnectionManager.findLostToFollowUp( programId );
+ ConnectionManager.findLostToFollowUp( programId+"-"+status+"-"+isRiskCase );
}
}
catch ( Exception e )
@@ -127,15 +154,11 @@
CommonTransitions.SLIDE_HORIZONTAL, true, 200 ) );
mainForm.addCommandListener( this );
mainForm.addCommand( new Command( "Back" ) );
+
}
return mainForm;
}
- public void setMainForm( Form mainForm )
- {
- this.mainForm = mainForm;
- }
-
public void setProgramInfos( Vector programInfos )
{
this.programInfos = programInfos;
@@ -151,4 +174,25 @@
this.isLostToFollowUp = isLostToFollowUp;
}
+ public ComboBox getCbbStatus()
+ {
+ if ( cbbStatus == null )
+ {
+ cbbStatus = new ComboBox();
+ cbbStatus.addItem( "Overdue" );
+ cbbStatus.addItem( "Scheduled in future" );
+ cbbStatus.setSmoothScrolling( true );
+ }
+ return cbbStatus;
+ }
+
+ public CheckBox getChbRisk()
+ {
+ if ( chbRisk == null )
+ {
+ chbRisk = new CheckBox( "Only Risk Case" );
+ }
+ return chbRisk;
+ }
+
}
=== modified file 'src/org/hisp/dhis/mobile/view/TrackingMainMenuView.java'
--- src/org/hisp/dhis/mobile/view/TrackingMainMenuView.java 2013-11-05 08:47:26 +0000
+++ src/org/hisp/dhis/mobile/view/TrackingMainMenuView.java 2013-11-12 08:06:45 +0000
@@ -19,8 +19,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import java.util.Date;
-
import org.hisp.dhis.mobile.connection.ConnectionManager;
import org.hisp.dhis.mobile.midlet.DHISMIDlet;
import org.hisp.dhis.mobile.midlet.NameBasedMIDlet;
@@ -29,7 +27,6 @@
import org.hisp.dhis.mobile.recordstore.OrgUnitRecordStore;
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.Dialog;