dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #24460
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11987: fix bugs for Mujhu project
------------------------------------------------------------
revno: 11987
committer: Lai <lai.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-09-09 19:57:33 +0700
message:
fix bugs for Mujhu project
modified:
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java
--
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-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java 2013-09-08 11:40:48 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java 2013-09-09 12:57:33 +0000
@@ -849,9 +849,29 @@
List<org.hisp.dhis.patient.PatientAttribute> atts;
patientModel.setId( patient.getId() );
- patientModel.setFirstName( patient.getFirstName() );
- patientModel.setLastName( patient.getLastName() );
- patientModel.setMiddleName( patient.getMiddleName() );
+
+ String firstName = "";
+ String lastName = "";
+ String middleName = "";
+
+ if ( patient.getFirstName() != null )
+ {
+ firstName = patient.getFirstName();
+ }
+
+ if ( patient.getLastName() != null )
+ {
+ lastName = patient.getLastName();
+ }
+
+ if ( patient.getMiddleName() != null )
+ {
+ middleName = patient.getMiddleName();
+ }
+
+ patientModel.setFirstName( firstName );
+ patientModel.setLastName( lastName );
+ patientModel.setMiddleName( middleName );
Period period = new Period( new DateTime( patient.getBirthDate() ), new DateTime() );
patientModel.setAge( period.getYears() );
@@ -1914,8 +1934,15 @@
{
break;
}
- patientsInfo += each.getId() + "/" + each.getFullName() + "/" + dateFormat.format( each.getBirthDate() )
+ if ( each.getBirthDate() != null )
+ {
+ patientsInfo += each.getId() + "/" + each.getFullName() + "/" + dateFormat.format( each.getBirthDate() )
+ "$";
+ }
+ else
+ {
+ patientsInfo += each.getId() + "/" + each.getFullName() + "/DOB$";
+ }
i++;
}