dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #24548
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12055: remove first, middle, last name from Patient (wip)
------------------------------------------------------------
revno: 12055
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-09-12 09:29:29 +0200
message:
remove first, middle, last name from Patient (wip)
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientService.java
dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/caseaggregation/jdbc/JdbcCaseAggregationConditionManager.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramInstanceStore.java
dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/H2StatementBuilder.java
dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/HsqlStatementBuilder.java
dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/MySQLStatementBuilder.java
dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/PostgreSQLStatementBuilder.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-api/src/main/java/org/hisp/dhis/patient/PatientService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientService.java 2013-09-12 07:26:17 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientService.java 2013-09-12 07:29:29 +0000
@@ -61,7 +61,7 @@
Collection<Patient> getAllPatients();
/**
- * Search Patient base on firstname/middlename/lastname/birthDate/gender
+ * Search Patient base on name/birthDate/gender
*
* @param name
* @param birthdate
@@ -242,7 +242,7 @@
int countGetPatients( String searchText );
/**
- * Search Patient base on firstname/middlename/lastname and get number of
+ * Search Patient base on name and get number of
* result
*
* @param name
=== modified file 'dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/caseaggregation/jdbc/JdbcCaseAggregationConditionManager.java'
--- dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/caseaggregation/jdbc/JdbcCaseAggregationConditionManager.java 2013-08-30 10:00:42 +0000
+++ dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/caseaggregation/jdbc/JdbcCaseAggregationConditionManager.java 2013-09-12 07:29:29 +0000
@@ -414,7 +414,7 @@
{
if ( hasPatients || operator.equals( CaseAggregationCondition.AGGRERATION_COUNT ) )
{
- sql += "p.firstName, p.middleName, p.lastName, p.gender, p.birthDate, p.phoneNumber, ";
+ sql += "p.name, p.gender, p.birthDate, p.phoneNumber, ";
}
if ( hasDataelement )
=== 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-12 07:19:15 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java 2013-09-12 07:29:29 +0000
@@ -427,31 +427,7 @@
{
if ( isNumber( keyword ) == false )
{
-
- int startIndex = keyword.indexOf( ' ' );
- int endIndex = keyword.lastIndexOf( ' ' );
-
- String firstName = keyword.toString();
- String middleName = " ";
- String lastName = " ";
-
- if ( keyword.indexOf( ' ' ) != -1 )
- {
- firstName = keyword.substring( 0, startIndex );
- if ( startIndex == endIndex )
- {
- middleName = " ";
- lastName = keyword.substring( startIndex + 1, keyword.length() );
- }
- else
- {
- middleName = " " + keyword.substring( startIndex + 1, endIndex ) + " ";
- lastName = keyword.substring( endIndex + 1, keyword.length() );
- }
- }
-
- List<Patient> patients = (List<Patient>) this.patientService.getPatientByFullname( firstName + middleName
- + lastName, orgUnitId );
+ List<Patient> patients = (List<Patient>) this.patientService.getPatientByFullname( keyword, orgUnitId );
if ( patients.size() > 1 )
{
@@ -1301,29 +1277,7 @@
else
{
String fullName = enrollmentRelationship.getPersonBName();
- int startIndex = fullName.indexOf( ' ' );
- int endIndex = fullName.lastIndexOf( ' ' );
-
- String firstName = fullName.toString();
- String middleName = " ";
- String lastName = " ";
-
- if ( fullName.indexOf( ' ' ) != -1 )
- {
- firstName = fullName.substring( 0, startIndex );
- if ( startIndex == endIndex )
- {
- middleName = " ";
- lastName = fullName.substring( startIndex + 1, fullName.length() );
- }
- else
- {
- middleName = " " + fullName.substring( startIndex + 1, endIndex ) + " ";
- lastName = fullName.substring( endIndex + 1, fullName.length() );
- }
- }
- List<Patient> patients = (List<Patient>) this.patientService.getPatientByFullname( firstName + middleName
- + lastName, orgUnitId );
+ List<Patient> patients = (List<Patient>) this.patientService.getPatientByFullname( fullName, orgUnitId );
// remove the own searcher
patients = removeIfDuplicated( patients, enrollmentRelationship.getPersonAId() );
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramInstanceStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramInstanceStore.java 2013-09-06 08:35:43 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramInstanceStore.java 2013-09-12 07:29:29 +0000
@@ -234,7 +234,7 @@
for ( int i = 1; i <= cols; i++ )
{
message = rs.getString( "templatemessage" );
- String patientName = rs.getString( "firstName" );
+ String patientName = rs.getString( "name" );
String organisationunitName = rs.getString( "orgunitName" );
String programName = rs.getString( "programName" );
String incidentDate = rs.getString( "dateofincident" ).split( " " )[0];// just
@@ -276,7 +276,7 @@
private String sendToPatientSql( String dateToCompare )
{
return "SELECT pi.programinstanceid, p.phonenumber, prm.templatemessage, "
- + " p.firstname, p.middlename, p.lastname, org.name as orgunitName, "
+ + " p.name, org.name as orgunitName, "
+ " pg.name as programName, pi.dateofincident , "
+ " pi.enrollmentdate,(DATE(now()) - DATE(pi.enrollmentdate) ) as days_since_erollment_date, "
+ " (DATE(now()) - DATE(pi.dateofincident) ) as days_since_incident_date "
@@ -295,7 +295,7 @@
private String sendToHealthWorkerSql( String dateToCompare )
{
- return "SELECT pi.programinstanceid, uif.phonenumber, prm.templatemessage, p.firstname, p.middlename, p.lastname, org.name as orgunitName, "
+ return "SELECT pi.programinstanceid, uif.phonenumber, prm.templatemessage, p.name, org.name as orgunitName, "
+ " pg.name as programName, pi.dateofincident, pi.enrollmentdate,(DATE(now()) - DATE(pi.enrollmentdate) ) as days_since_erollment_date, "
+ " (DATE(now()) - DATE(pi.dateofincident) ) as days_since_incident_date "
+ " FROM patient p INNER JOIN programinstance pi "
@@ -320,7 +320,7 @@
private String sendMessageToOrgunitRegisteredSql( String dateToCompare )
{
- return "SELECT pi.programinstanceid, org.phonenumber, prm.templatemessage, p.firstname, p.middlename, p.lastname, org.name as orgunitName, "
+ return "SELECT pi.programinstanceid, org.phonenumber, prm.templatemessage, p.name, org.name as orgunitName, "
+ " pg.name as programName, pi.dateofincident, pi.enrollmentdate,(DATE(now()) - DATE(pi.enrollmentdate) ) as days_since_erollment_date, "
+ " (DATE(now()) - DATE(pi.dateofincident) ) as days_since_incident_date "
+ " FROM patient p INNER JOIN programinstance pi "
@@ -343,7 +343,7 @@
private String sendMessageToUsersSql( String dateToCompare )
{
- return "SELECT pi.programinstanceid, uif.phonenumber, prm.templatemessage, p.firstname, p.middlename, p.lastname, org.name as orgunitName, pg.name as programName, pi.dateofincident ,"
+ return "SELECT pi.programinstanceid, uif.phonenumber, prm.templatemessage, p.name, org.name as orgunitName, pg.name as programName, pi.dateofincident ,"
+ "pi.enrollmentdate,(DATE(now()) - DATE(pi.enrollmentdate) ) as days_since_erollment_date, "
+ "(DATE(now()) - DATE(pi.dateofincident) ) as days_since_incident_date "
+ "FROM patient p INNER JOIN programinstance pi "
@@ -368,7 +368,7 @@
private String sendMessageToUserGroupsSql( String dateToCompare )
{
- return "select pi.programinstanceid, uif.phonenumber,prm.templatemessage, p.firstname, p.middlename, p.lastname, org.name as orgunitName ,"
+ return "select pi.programinstanceid, uif.phonenumber,prm.templatemessage, p.name, org.name as orgunitName ,"
+ " pg.name as programName, pi.dateofincident, pi.enrollmentdate, (DATE(now()) - DATE(pi.enrollmentdate) ) as days_since_erollment_date, "
+ "(DATE(now()) - DATE(pi.dateofincident) ) as days_since_incident_date "
+ " from patient p INNER JOIN programinstance pi "
=== modified file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/H2StatementBuilder.java'
--- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/H2StatementBuilder.java 2013-09-01 18:30:05 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/H2StatementBuilder.java 2013-09-12 07:29:29 +0000
@@ -170,7 +170,7 @@
@Override
public String getPatientFullName()
{
- return "concat( firstname, \" \",middleName , \" \" , lastname)";
+ return "name";
}
@Override
=== modified file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/HsqlStatementBuilder.java'
--- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/HsqlStatementBuilder.java 2013-09-11 16:26:42 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/HsqlStatementBuilder.java 2013-09-12 07:29:29 +0000
@@ -170,7 +170,7 @@
@Override
public String getPatientFullName()
{
- return "concat( firstname, \" \",middleName , \" \" , lastname)";
+ return "name";
}
@Override
=== modified file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/MySQLStatementBuilder.java'
--- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/MySQLStatementBuilder.java 2013-09-01 18:30:05 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/MySQLStatementBuilder.java 2013-09-12 07:29:29 +0000
@@ -173,7 +173,7 @@
@Override
public String getPatientFullName()
{
- return "concat( firstname, \" \",middleName , \" \" , lastname)";
+ return "name";
}
@Override
=== modified file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/PostgreSQLStatementBuilder.java'
--- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/PostgreSQLStatementBuilder.java 2013-09-01 18:30:05 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/PostgreSQLStatementBuilder.java 2013-09-12 07:29:29 +0000
@@ -173,7 +173,7 @@
@Override
public String getPatientFullName()
{
- return "firstname || ' ' || middleName || ' ' || lastname";
+ return "name";
}
@Override