dhis-mobile-devs team mailing list archive
-
dhis-mobile-devs team
-
Mailing list archive
-
Message #00312
[Branch ~dhis-mobile-devs/dhis-mobile/lwuit-tracking] Rev 169: minor fix
------------------------------------------------------------
revno: 169
committer: Long <Long@Long-Laptop>
branch nick: lwuit-tracking
timestamp: Mon 2013-10-21 09:58:54 +0700
message:
minor fix
modified:
build.xml
src/org/hisp/dhis/mobile/connection/task/FindPatientTask.java
src/org/hisp/dhis/mobile/connection/task/GetAllAnonymousProgramTask.java
src/org/hisp/dhis/mobile/connection/task/GetVariesInfoTask.java
src/org/hisp/dhis/mobile/connection/task/LoginTask.java
src/org/hisp/dhis/mobile/recordstore/PatientRecordStore.java
src/org/hisp/dhis/mobile/view/HistoryPersonListView.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 'build.xml'
--- build.xml 2013-09-23 07:58:49 +0000
+++ build.xml 2013-10-21 02:58:54 +0000
@@ -34,11 +34,11 @@
<!-- Which logo to use -->
<property name="logo" value="dhis2_logo.png" />
<!-- Server URL -->
- <property name="server.url" value="http://localhost:9999" />
+ <property name="server.url" value="http://mujhu.dhis2.org/" />
<!-- User Name -->
- <property name="username" value="mobile" />
+ <property name="username" value="" />
<!-- Password -->
- <property name="password" value="district" />
+ <property name="password" value="" />
<!-- Server Phone Number -->
<property name="server.phonenumber" value="+8494485878" />
<!-- Default Locale -->
=== modified file 'src/org/hisp/dhis/mobile/connection/task/FindPatientTask.java'
--- src/org/hisp/dhis/mobile/connection/task/FindPatientTask.java 2013-10-07 03:35:19 +0000
+++ src/org/hisp/dhis/mobile/connection/task/FindPatientTask.java 2013-10-21 02:58:54 +0000
@@ -48,7 +48,7 @@
private String keyWord;
NameBasedMIDlet nameBasedMIDlet;
-
+
public FindPatientTask( String keyWord )
{
this.keyWord = keyWord;
@@ -65,15 +65,8 @@
if ( inputStream != null )
{
patient.deSerialize( inputStream );
-
- /*if ( patient.getId() > 0 )
- {*/
- nameBasedMIDlet.getPersonDashboardView().setPatient( patient );
- nameBasedMIDlet.getPersonDashboardView().showView();
- /*}
- else
- {
- }*/
+ nameBasedMIDlet.getPersonDashboardView().setPatient( patient );
+ nameBasedMIDlet.getPersonDashboardView().showView();
}
inputStream = null;
patient = null;
@@ -93,13 +86,17 @@
nameBasedMIDlet.getNoMatchingView().getTxtNotification().setText( message );
nameBasedMIDlet.getNoMatchingView().getMainForm().show();
}
-
+ else if ( e.getMessage().equalsIgnoreCase( Text.HTTP_ERROR() ) || e.getMessage().equalsIgnoreCase( "TCP open" ) )
+ {
+ nameBasedMIDlet.getAlertBoxView( "Internet is not available, Please try again later.", "Alert" ).showView();
+ nameBasedMIDlet.getFindBeneficiaryView().showView();
+ }
else if ( e.getMessage().equalsIgnoreCase( "NO_PROGRAM_BELONG_ORGUNIT" ) )
{
nameBasedMIDlet.getAlertBoxView( "Program not belong to Org Unit", "Warning" ).showView();
nameBasedMIDlet.getFindBeneficiaryView().showView();
}
-
+
else
{
message = e.getMessage();
=== modified file 'src/org/hisp/dhis/mobile/connection/task/GetAllAnonymousProgramTask.java'
--- src/org/hisp/dhis/mobile/connection/task/GetAllAnonymousProgramTask.java 2013-10-10 06:13:16 +0000
+++ src/org/hisp/dhis/mobile/connection/task/GetAllAnonymousProgramTask.java 2013-10-21 02:58:54 +0000
@@ -105,7 +105,7 @@
message = e.getMessage();
if ( e.getMessage().equalsIgnoreCase( Text.HTTP_ERROR() ) )
{
- nameBasedMIDlet.getAlertBoxView( "Internet is not available, Please try againt later.", "Alert" ).showView();
+ nameBasedMIDlet.getAlertBoxView( "Internet is not available, Please try again later.", "Alert" ).showView();
nameBasedMIDlet.getTrackingMainMenuView().showView();
}
else if ( message.equalsIgnoreCase( "NO_PROGRAM_FOUND" ) )
=== modified file 'src/org/hisp/dhis/mobile/connection/task/GetVariesInfoTask.java'
--- src/org/hisp/dhis/mobile/connection/task/GetVariesInfoTask.java 2013-10-10 08:12:04 +0000
+++ src/org/hisp/dhis/mobile/connection/task/GetVariesInfoTask.java 2013-10-21 02:58:54 +0000
@@ -66,6 +66,7 @@
finally
{
nameBasedMIDlet.getPersonRegistrationView().setEnrollProgramId( programId );
+ nameBasedMIDlet.getPersonRegistrationView().prepareView();
nameBasedMIDlet.getPersonRegistrationView().showView();
}
=== modified file 'src/org/hisp/dhis/mobile/connection/task/LoginTask.java'
--- src/org/hisp/dhis/mobile/connection/task/LoginTask.java 2013-04-24 04:25:42 +0000
+++ src/org/hisp/dhis/mobile/connection/task/LoginTask.java 2013-10-21 02:58:54 +0000
@@ -84,6 +84,11 @@
.showView();
ConnectionManager.getDhisMIDlet().getLoginView().showView();
}
+ else if ( e.getMessage().equalsIgnoreCase( "Invalid username or password" ) )
+ {
+ ConnectionManager.getDhisMIDlet().getAlertBoxView( "Invalid username or password", "Alert" ).showView();
+ ConnectionManager.getDhisMIDlet().getLoginView().showView();
+ }
e.printStackTrace();
DHISMIDlet.debug( e.getMessage() );
}
=== modified file 'src/org/hisp/dhis/mobile/recordstore/PatientRecordStore.java'
--- src/org/hisp/dhis/mobile/recordstore/PatientRecordStore.java 2013-10-07 03:35:19 +0000
+++ src/org/hisp/dhis/mobile/recordstore/PatientRecordStore.java 2013-10-21 02:58:54 +0000
@@ -38,6 +38,7 @@
import org.hisp.dhis.mobile.model.Model;
import org.hisp.dhis.mobile.model.ModelList;
import org.hisp.dhis.mobile.model.Patient;
+import org.hisp.dhis.mobile.model.PatientIdentifier;
import org.hisp.dhis.mobile.recordstore.filter.PatientFilter;
import org.hisp.dhis.mobile.util.SerializationUtil;
@@ -140,11 +141,17 @@
{
patient = new Patient();
Model model = new Model();
-
+ String patientInfo;
SerializationUtil.deSerialize( patient, recordEnumeration.nextRecord() );
-
model.setId( patient.getId() );
- model.setName( patient.getName()+"/"+patient.getBirthDate() );
+ if ( patient.getIdentifiers().size() > 0 )
+ {
+ PatientIdentifier identifier = (PatientIdentifier) patient.getIdentifiers().elementAt( 0 );
+ patientInfo = identifier.getIdentifier() + " , DoB: " + patient.getBirthDate();
+ } else {
+ patientInfo = "Patient" + " , DoB" + patient.getBirthDate();
+ }
+ model.setName( patientInfo );
modelList.getModels().addElement( model );
patient = null;
model = null;
=== modified file 'src/org/hisp/dhis/mobile/view/HistoryPersonListView.java'
--- src/org/hisp/dhis/mobile/view/HistoryPersonListView.java 2013-07-17 03:33:24 +0000
+++ src/org/hisp/dhis/mobile/view/HistoryPersonListView.java 2013-10-21 02:58:54 +0000
@@ -82,9 +82,9 @@
{
final Model patientModel = (Model) offlinePatients.elementAt( i );
String patientInfo = patientModel.getName();
- String name = patientInfo.substring( 0, patientInfo.indexOf( "/" ) );
- String birthday = patientInfo.substring( patientInfo.indexOf( "/" ) + 1, patientInfo.length() );
- LinkButton personLink = new LinkButton( name + ", DOB: " + birthday );
+// String name = patientInfo.substring( 0, patientInfo.indexOf( "/" ) );
+// String birthday = patientInfo.substring( patientInfo.indexOf( "/" ) + 1, patientInfo.length() );
+ LinkButton personLink = new LinkButton( patientInfo );
/*
* name = null; birthday = null; patientInfo = null;
*/
=== modified file 'src/org/hisp/dhis/mobile/view/PersonRegistrationView.java'
--- src/org/hisp/dhis/mobile/view/PersonRegistrationView.java 2013-10-09 03:09:25 +0000
+++ src/org/hisp/dhis/mobile/view/PersonRegistrationView.java 2013-10-21 02:58:54 +0000
@@ -113,6 +113,12 @@
System.gc();
getPersonRegistrationForm();
personRegistrationForm.removeAll();
+ this.setDobWrongFortmatLabel( null );
+ this.setRequiredLabel( null );
+ this.patientIdentifierVector = null;
+ this.offlinePatientIdentifierVector = null;
+ this.patientIdentifierValueVector = new Vector();
+ this.patientAttributeValueVector = new Vector();
fullNameLabel = new Label( "Fullname(*)" );
genderLabel = new Label( Text.GENDER() );
@@ -146,10 +152,11 @@
}
} );
- personRegistrationForm.addComponent( getRequiredLabel() );
- personRegistrationForm.addComponent( fullNameLabel );
- personRegistrationForm.addComponent( getFullNameTextField() );
- fullNameTextField.requestFocus();
+ // Hide full name text field for Uganda case
+ // personRegistrationForm.addComponent( getRequiredLabel() );
+ // personRegistrationForm.addComponent( fullNameLabel );
+ // personRegistrationForm.addComponent( getFullNameTextField() );
+ // fullNameTextField.requestFocus();
// add identifier
@@ -165,7 +172,7 @@
{
this.patientIdentifierVector = this.offlinePatientIdentifierVector;
}
-
+ System.out.println( "Identifier Type Size: " + patientIdentifierVector.size() );
for ( int i = 0; i < patientIdentifierVector.size(); i++ )
{
PatientIdentifier patientIdentifier = (PatientIdentifier) patientIdentifierVector.elementAt( i );
@@ -597,7 +604,9 @@
private Patient collectData()
{
- String fullName = this.getFullNameTextField().getText().trim();
+ // No fullName for Uganda case
+ // String fullName = this.getFullNameTextField().getText().trim();
+ String fullName = "";
String gender = (String) this.getGenderComboBox().getSelectedItem();
String dobType = (String) this.getDateOfBirthComboBox().getSelectedItem();
String dateOfBirth = this.getDateOfBirthTextFiled().getText();
@@ -642,9 +651,9 @@
try
{
birthYear = currentYear - Integer.parseInt( dateOfBirth );
- // dateOfBirth = birthYear + "-" + currentMonth + "-" +
- // currentDate;
- dateOfBirth = currentDate + "-" + currentMonth + "-" + birthYear;
+ dateOfBirth = birthYear + "-" + currentMonth + "-" + currentDate;
+ // dateOfBirth = currentDate + "-" + currentMonth + "-" +
+ // birthYear;
}
catch ( Exception e )
{
@@ -702,6 +711,8 @@
patientAttribute.setPredefinedValues( new Vector() );
// patientAttributeValueVector.setElementAt( patientAttribute, i
// );
+ System.out.println( "Att: " + name );
+ System.out.println( "Value: " + value );
attributeVector.addElement( patientAttribute );
}
}
@@ -732,7 +743,6 @@
patientIdentifier.setIdentifierType( typeName );
patientIdentifier.setIdentifier( field.getText() );
identiferVector.addElement( patientIdentifier );
-
}
patient.setIdentifiers( identiferVector );
patient.setPatientAttValues( attributeVector );