dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #19202
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8276: apply search by phone number function in Mobile (Light)
------------------------------------------------------------
revno: 8276
committer: Homg Em <em.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-09-27 12:47:35 +0700
message:
apply search by phone number function in Mobile (Light)
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientIdentifierService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientStore.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java
dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/smslib/GateWayFactory.java
dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/StatementBuilder.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/MySQLStatementBuilder.java
dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/PostgreSQLStatementBuilder.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ValidateAddRelationshipPatientAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ValidatePatientAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/SearchBeneficiaryAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/SaveBeneficiaryAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/FindBeneficiarytAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetBeneficiaryDetailAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetPatientProgramListAction.java
dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties
dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/menu.vm
dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryList.vm
dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/findBeneficiaryForm.vm
dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/registration/beneficiaryRegistrationForm.vm
--
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/Patient.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java 2012-09-25 02:38:27 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java 2012-09-27 05:47:35 +0000
@@ -50,23 +50,35 @@
private static final long serialVersionUID = 884114994005945275L;
public static final String MALE = "M";
+
public static final String FEMALE = "F";
public static final char DOB_TYPE_VERIFIED = 'V';
+
public static final char DOB_TYPE_DECLARED = 'D';
+
public static final char DOB_TYPE_APPROXIATED = 'A';
public static final char AGE_TYPE_YEAR = 'Y';
+
public static final char AGE_TYPE_MONTH = 'M';
+
public static final char AGE_TYPE_DAY = 'D';
-
+
public static String PREFIX_IDENTIFIER_TYPE = "iden";
- public static String PREFIX_FIXED_ATTRIBUTE = "fixedAttr";
+
+ public static String PREFIX_FIXED_ATTRIBUTE = "fixedAttr";
+
public static String PREFIX_PATIENT_ATTRIBUTE = "attr";
+
public static String PREFIX_PROGRAM = "prg";
+
public static String PREFIX_PROGRAM_EVENT_BY_STATUS = "stat";
+
public static String PREFIX_PROGRAM_STAGE = "prgst";
+
public static String FIXED_ATTR_BIRTH_DATE = "birthDate";
+
public static String FIXED_ATTR_AGE = "age";
private Integer id;
@@ -102,7 +114,7 @@
private boolean underAge;
private Character dobType;
-
+
private User healthWorker;
// -------------------------------------------------------------------------
@@ -149,6 +161,7 @@
result = prime * result + ((gender == null) ? 0 : gender.hashCode());
result = prime * result + ((lastName == null) ? 0 : lastName.hashCode());
result = prime * result + ((middleName == null) ? 0 : middleName.hashCode());
+ result = prime * result + ((phoneNumber == null) ? 0 : phoneNumber.hashCode());
return result;
}
@@ -230,6 +243,13 @@
{
return false;
}
+ if ( phoneNumber == null )
+ {
+ if ( other.phoneNumber != null )
+ {
+ return false;
+ }
+ }
return true;
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientIdentifierService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientIdentifierService.java 2012-03-26 06:36:24 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientIdentifierService.java 2012-09-27 05:47:35 +0000
@@ -64,6 +64,7 @@
Patient getPatient( PatientIdentifierType idenType, String value);
Collection<Patient> getPatientsByIdentifier( String identifier, int min, int max );
+
int countGetPatientsByIdentifier( String identifier );
=== 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 2012-09-06 09:44:43 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientService.java 2012-09-27 05:47:35 +0000
@@ -64,7 +64,7 @@
* @param gender
* @return Patient List
*/
- Collection<Patient> getPatients( String firstName, String middleName, String lastName, Date birthdate, String gender );
+ Collection<Patient> getPatients( String firstName, String middleName, String lastName, Date birthdate, String gender, String phoneNumber );
/**
* Search Patient base on gender
@@ -76,10 +76,12 @@
/**
* Search Patient base on birthDate
+ * @param maxValue
*
* @param birthdate
* @return Patient List
*/
+
Collection<Patient> getPatientsByBirthDate( Date birthDate );
/**
@@ -105,7 +107,7 @@
* @param orgUnitId
* @return Patient List
*/
- Collection<Patient> getPatientsForMobile( String searchText, int orgUnitId );
+ Collection<Patient> getPatientsForMobile( String searchText, int orgUnitId);
/**
* Search Patient base on organization unit with result limited
@@ -113,6 +115,7 @@
* @param organisationUnit organisationUnit
* @return Patient List
*/
+
Collection<Patient> getPatients( OrganisationUnit organisationUnit, Integer min, Integer max );
/**
@@ -211,4 +214,12 @@
Collection<Integer> getProgramStageInstances( List<String> searchKeys, OrganisationUnit orgunit, Integer min, Integer max );
+ Collection<Patient> getPatientsByPhone( String phoneNumber, Integer min, Integer max);
+
+
+
+
+
+
+
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientStore.java 2012-08-16 13:46:23 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientStore.java 2012-09-27 05:47:35 +0000
@@ -46,32 +46,38 @@
Collection<Patient> getByGender( String gender );
+ Collection<Patient> getByPhoneNumber( String phoneNumber, Integer min, Integer max);
+
Collection<Patient> getByBirthDate( Date birthDate );
Collection<Patient> getByNames( String name, Integer min, Integer max );
-
- Collection<Patient> get( String firstName, String middleName, String lastName, Date birthdate, String gender );
-
+
+ Collection<Patient> get( String firstName, String middleName, String lastName, Date birthdate, String gender, String phoneNumber);
+
Collection<Patient> getByOrgUnit( OrganisationUnit organisationUnit, Integer min, Integer max );
-
- Collection<Patient> getByOrgUnitProgram( OrganisationUnit organisationUnit, Program program, Integer min, Integer max );
-
+
+ Collection<Patient> getByOrgUnitProgram( OrganisationUnit organisationUnit, Program program, Integer min,
+ Integer max );
+
Collection<Patient> getRepresentatives( Patient patient );
-
- int countListPatientByOrgunit(OrganisationUnit organisationUnit);
-
+
+ int countListPatientByOrgunit( OrganisationUnit organisationUnit );
+
int countGetPatientsByName( String name );
-
+
int countGetPatientsByOrgUnitProgram( OrganisationUnit organisationUnit, Program program );
void removeErollmentPrograms( Program program );
-
+
Collection<Patient> search( List<String> searchKeys, OrganisationUnit orgunit, Integer min, Integer max );
-
+
int countSearch( List<String> searchKeys, OrganisationUnit orgunit );
-
- Collection<String> getPatientPhoneNumbers( List<String> searchKeys, OrganisationUnit orgunit, Integer min, Integer max );
+
+ Collection<String> getPatientPhoneNumbers( List<String> searchKeys, OrganisationUnit orgunit, Integer min,
+ Integer max );
Collection<Integer> getProgramStageInstances( List<String> searchKeys, OrganisationUnit orgunit, Integer min,
Integer max );
+
+
}
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java 2012-08-16 13:46:23 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java 2012-09-27 05:47:35 +0000
@@ -115,7 +115,7 @@
@Override
public int createPatient( Patient patient, Integer representativeId, Integer relationshipTypeId,
- List<PatientAttributeValue> patientAttributeValues )
+ List<PatientAttributeValue> patientAttributeValues )
{
int patientid = savePatient( patient );
@@ -183,9 +183,9 @@
@Override
public Collection<Patient> getPatients( String firstName, String middleName, String lastName, Date birthdate,
- String gender )
+ String gender, String phoneNumber )
{
- return patientStore.get( firstName, middleName, lastName, birthdate, gender );
+ return patientStore.get( firstName, middleName, lastName, birthdate, gender, phoneNumber);
}
@Override
@@ -242,13 +242,17 @@
}
@Override
- public Collection<Patient> getPatientsForMobile( String searchText, int orgUnitId )
+ public Collection<Patient> getPatientsForMobile( String searchText, int orgUnitId)
{
Set<Patient> patients = new HashSet<Patient>();
patients.addAll( patientIdentifierService.getPatientsByIdentifier( searchText, 0, Integer.MAX_VALUE ) );
patients.addAll( getPatientsByNames( searchText, 0, Integer.MAX_VALUE ) );
+ patients.addAll( getPatientsByPhone( searchText, 0, Integer.MAX_VALUE ) );
+
+
- // if an orgunit has been selected, filter out every patient that has a different ou
+ // if an orgunit has been selected, filter out every patient that has a
+ // different ou
if ( orgUnitId != 0 )
{
Set<Patient> toRemoveList = new HashSet<Patient>();
@@ -275,7 +279,7 @@
@Override
public Collection<Patient> getPatients( OrganisationUnit organisationUnit, PatientAttribute patientAttribute,
- Integer min, Integer max )
+ Integer min, Integer max )
{
List<Patient> patientList = new ArrayList<Patient>( patientStore.getByOrgUnit( organisationUnit, min, max ) );
@@ -291,7 +295,7 @@
@Override
public Collection<Patient> getPatients( OrganisationUnit organisationUnit, String searchText, Integer min,
- Integer max )
+ Integer max )
{
Collection<Patient> patients = new ArrayList<Patient>();
@@ -402,8 +406,8 @@
@Override
public void updatePatient( Patient patient, Integer representativeId, Integer relationshipTypeId,
- List<PatientAttributeValue> valuesForSave, List<PatientAttributeValue> valuesForUpdate,
- Collection<PatientAttributeValue> valuesForDelete )
+ List<PatientAttributeValue> valuesForSave, List<PatientAttributeValue> valuesForUpdate,
+ Collection<PatientAttributeValue> valuesForDelete )
{
patientStore.update( patient );
@@ -496,7 +500,8 @@
}
return value;
- } catch ( Exception ex )
+ }
+ catch ( Exception ex )
{
ex.printStackTrace();
}
@@ -514,7 +519,8 @@
patientStore.removeErollmentPrograms( program );
}
- public Collection<Patient> searchPatients( List<String> searchKeys, OrganisationUnit orgunit, Integer min, Integer max )
+ public Collection<Patient> searchPatients( List<String> searchKeys, OrganisationUnit orgunit, Integer min,
+ Integer max )
{
return patientStore.search( searchKeys, orgunit, min, max );
}
@@ -523,16 +529,34 @@
{
return patientStore.countSearch( searchKeys, orgunit );
}
-
- public Collection<String> getPatientPhoneNumbers( List<String> searchKeys, OrganisationUnit orgunit, Integer min, Integer max )
+
+ public Collection<String> getPatientPhoneNumbers( List<String> searchKeys, OrganisationUnit orgunit, Integer min,
+ Integer max )
{
return patientStore.getPatientPhoneNumbers( searchKeys, orgunit, min, max );
}
-
- public Collection<Integer> getProgramStageInstances( List<String> searchKeys, OrganisationUnit orgunit, Integer min, Integer max )
+
+ public Collection<Integer> getProgramStageInstances( List<String> searchKeys, OrganisationUnit orgunit,
+ Integer min, Integer max )
{
return patientStore.getProgramStageInstances( searchKeys, orgunit, min, max );
}
-
+
+
+ @Override
+ public Collection<Patient> getPatientsByPhone( String phoneNumber, Integer min, Integer max)
+ {
+
+ return patientStore.getByPhoneNumber( phoneNumber, min, max );
+
+ }
+
+
+
+
+
+
+
+
}
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java 2012-09-23 07:34:49 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java 2012-09-27 05:47:35 +0000
@@ -38,6 +38,7 @@
import org.apache.commons.lang.StringUtils;
import org.hibernate.Criteria;
import org.hibernate.Query;
+import org.hibernate.SQLQuery;
import org.hibernate.criterion.Conjunction;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Projections;
@@ -133,7 +134,8 @@
@SuppressWarnings( "unchecked" )
@Override
- public Collection<Patient> get( String firstName, String middleName, String lastName, Date birthdate, String gender )
+ public Collection<Patient> get( String firstName, String middleName, String lastName, Date birthdate,
+ String gender, String phoneNumber )
{
Criteria crit = getCriteria();
Conjunction con = Restrictions.conjunction();
@@ -149,6 +151,7 @@
con.add( Restrictions.eq( "gender", gender ) );
con.add( Restrictions.eq( "birthDate", birthdate ) );
+ con.add( Restrictions.eq( "phoneNumber", phoneNumber ) );
crit.add( con );
@@ -433,16 +436,20 @@
condition = "";
continue;
case ProgramStageInstance.FUTURE_VISIT_STATUS:
- patientWhere += condition + operatorStatus + "("
- + " psi.status is null and psi.executiondate is null and psi.duedate >= now() and p.organisationunitid=" + keys[4]
- + ")";
+ patientWhere += condition
+ + operatorStatus
+ + "("
+ + " psi.status is null and psi.executiondate is null and psi.duedate >= now() and p.organisationunitid="
+ + keys[4] + ")";
operatorStatus = " OR ";
condition = "";
continue;
case ProgramStageInstance.LATE_VISIT_STATUS:
- patientWhere += condition + operatorStatus + "("
- + " psi.status is null and psi.executiondate is null and psi.duedate < now() and p.organisationunitid=" + keys[4]
- + ")";
+ patientWhere += condition
+ + operatorStatus
+ + "("
+ + " psi.status is null and psi.executiondate is null and psi.duedate < now() and p.organisationunitid="
+ + keys[4] + ")";
operatorStatus = " OR ";
condition = "";
continue;
@@ -527,8 +534,45 @@
{
sql += statementBuilder.limitRecord( min, max );
}
-
+
return sql;
}
+ @SuppressWarnings( "unchecked" )
+ @Override
+ public Collection<Patient> getByPhoneNumber( String phoneNumber, Integer min, Integer max )
+ {
+
+ List<Patient> patients = new ArrayList<Patient>();
+
+ String sql = "select patientid from patient " + "where lower( " + statementBuilder.getPatientsByPhone() + ") "
+ + "like '%" + phoneNumber + "%'";
+
+ if ( min != null && max != null )
+ {
+ sql += statementBuilder.limitRecord( min, max );
+ }
+ try
+ {
+ patients = jdbcTemplate.query( sql, new RowMapper<Patient>()
+ {
+
+ @Override
+ public Patient mapRow( ResultSet rs, int rowNum )
+ throws SQLException
+ {
+
+ return get( rs.getInt( 1 ) );
+ }
+
+ } );
+ }
+ catch ( Exception ex )
+ {
+ ex.printStackTrace();
+ }
+ return patients;
+
+ }
+
}
=== modified file 'dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/smslib/GateWayFactory.java'
--- dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/smslib/GateWayFactory.java 2012-08-30 12:47:05 +0000
+++ dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/smslib/GateWayFactory.java 2012-09-27 05:47:35 +0000
@@ -40,10 +40,14 @@
import org.smslib.http.BulkSmsHTTPGateway.Regions;
import org.smslib.http.ClickatellHTTPGateway;
import org.smslib.modem.SerialModemGateway;
+
+//import org.smslib.smsserver.gateways.SMPPGateway;
+
import org.smslib.smpp.BindAttributes;
import org.smslib.smpp.BindAttributes.BindType;
import org.smslib.smpp.jsmpp.JSMPPGateway;
+
public class GateWayFactory
{
public AGateway create( SmsGatewayConfig config )
@@ -160,4 +164,9 @@
gateway.setInbound( false );
return gateway;
}
+
+// public AGateway createSMPPGateway( SMPPGateway c )
+// {
+// SMPPGateway gateway = new SMPPGateway( myGatewayId, myProps, myServer );
+// }
}
=== modified file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/StatementBuilder.java'
--- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/StatementBuilder.java 2012-07-26 16:50:38 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/StatementBuilder.java 2012-09-27 05:47:35 +0000
@@ -163,4 +163,7 @@
String getAddDate( String dateField, int days );
String getPatientFullName();
+ String getPatientsByPhone();
+
+
}
=== 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 2012-07-23 12:56:20 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/H2StatementBuilder.java 2012-09-27 05:47:35 +0000
@@ -326,4 +326,10 @@
{
return "concat( firstname, \" \",middleName , \" \" , lastname)";
}
+
+ @Override
+ public String getPatientsByPhone()
+ {
+ return "phoneNumber";
+ }
}
=== 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 2012-07-25 13:18:48 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/MySQLStatementBuilder.java 2012-09-27 05:47:35 +0000
@@ -322,4 +322,10 @@
{
return "concat( firstname, \" \",middleName , \" \" , lastname)";
}
+
+ @Override
+ public String getPatientsByPhone()
+ {
+ return "phoneNumber";
+ }
}
=== 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 2012-07-23 12:56:20 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/PostgreSQLStatementBuilder.java 2012-09-27 05:47:35 +0000
@@ -321,4 +321,8 @@
{
return "firstname || ' ' || middleName || ' ' || lastname";
}
+
+ public String getPatientsByPhone(){
+ return "phoneNumber";
+ }
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ValidateAddRelationshipPatientAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ValidateAddRelationshipPatientAction.java 2012-06-12 07:46:25 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ValidateAddRelationshipPatientAction.java 2012-09-27 05:47:35 +0000
@@ -86,6 +86,8 @@
private Integer age;
private String gender;
+
+ private String phoneNumber;
private Integer id;
@@ -182,7 +184,7 @@
// Check duplication name, birthdate, gender
patients = patientService.getPatients( firstName, middleName, lastName, format.parseDate( birthDate ),
- gender );
+ gender, phoneNumber );
if ( patients != null && patients.size() > 0 )
{
@@ -360,6 +362,13 @@
{
this.gender = gender;
}
+
+
+
+ public void setPhoneNumber( String phoneNumber )
+ {
+ this.phoneNumber = phoneNumber;
+ }
public void setUnderAge( boolean underAge )
{
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ValidatePatientAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ValidatePatientAction.java 2012-06-12 07:46:25 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ValidatePatientAction.java 2012-09-27 05:47:35 +0000
@@ -91,6 +91,8 @@
private String gender;
+ private String phoneNumber;
+
private Integer id;
private boolean checkedDuplicate;
@@ -136,14 +138,14 @@
{
Patient patient = new Patient();
patient.setBirthDateFromAge( age.intValue(), ageType );
-
- if( patient.getIntegerValueOfAge() > 100 )
+
+ if ( patient.getIntegerValueOfAge() > 100 )
{
message = i18n.getString( "age_of_patient_must_be_less_or_equals_to_100" );
return INPUT;
}
}
-
+
if ( dobType != null && (dobType == Patient.DOB_TYPE_VERIFIED || dobType == Patient.DOB_TYPE_DECLARED) )
{
birthDate = birthDate.trim();
@@ -189,8 +191,8 @@
if ( !checkedDuplicate )
{
patients = patientService.getPatients( firstName, middleName, lastName, format.parseDate( birthDate ),
- gender );
-
+ gender, phoneNumber );
+
if ( patients != null && patients.size() > 0 )
{
message = i18n.getString( "patient_duplicate" );
@@ -212,7 +214,7 @@
}
}
}
-
+
if ( flagDuplicate )
{
return PATIENT_DUPLICATE;
@@ -265,11 +267,11 @@
if ( !underAge || (underAge && !idType.isRelated()) )
{
value = request.getParameter( AddPatientAction.PREFIX_IDENTIFIER + idType.getId() );
-
+
if ( StringUtils.isNotBlank( value ) )
{
PatientIdentifier identifier = patientIdentifierService.get( idType, value );
-
+
if ( identifier != null
&& (id == null || identifier.getPatient().getId().intValue() != id.intValue()) )
{
@@ -325,6 +327,11 @@
this.format = format;
}
+ public void setPhoneNumber( String phoneNumber )
+ {
+ this.phoneNumber = phoneNumber;
+ }
+
public void setPatientService( PatientService patientService )
{
this.patientService = patientService;
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/SearchBeneficiaryAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/SearchBeneficiaryAction.java 2012-06-27 10:03:43 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/SearchBeneficiaryAction.java 2012-09-27 05:47:35 +0000
@@ -69,6 +69,19 @@
{
this.keyword = keyword;
}
+ private String phoneNumber;
+
+
+
+ public String getPhoneNumber()
+ {
+ return phoneNumber;
+ }
+
+ public void setPhoneNumber( String phoneNumber )
+ {
+ this.phoneNumber = phoneNumber;
+ }
public List<Patient> patientList;
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/SaveBeneficiaryAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/SaveBeneficiaryAction.java 2012-09-22 05:51:25 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/SaveBeneficiaryAction.java 2012-09-27 05:47:35 +0000
@@ -534,4 +534,4 @@
}
return SUCCESS;
}
-}
+}
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/FindBeneficiarytAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/FindBeneficiarytAction.java 2012-07-30 08:32:34 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/FindBeneficiarytAction.java 2012-09-27 05:47:35 +0000
@@ -131,6 +131,30 @@
this.relationshipTypeId = relationshipTypeId;
}
+ private String phoneNumber;
+
+ public String getPhoneNumber()
+ {
+ return phoneNumber;
+ }
+
+ public void setPhoneNumber( String phoneNumber )
+ {
+ this.phoneNumber = phoneNumber;
+ }
+
+ private String keyPhone;
+
+ public String getKeyPhone()
+ {
+ return keyPhone;
+ }
+
+ public void setKeyPhone( String keyPhone )
+ {
+ this.keyPhone = keyPhone;
+ }
+
@Override
public String execute()
throws Exception
@@ -152,9 +176,36 @@
{
Patient patient = patients.iterator().next();
patientId = patient.getId();
+ phoneNumber = patient.getPhoneNumber();
return REDIRECT;
}
+
return SUCCESS;
+
+ // if ( keyPhone != null )
+ // {
+ // int index = keyPhone.indexOf( ' ' );
+ //
+ // if ( index != -1 && index == keyPhone.lastIndexOf( ' ' ) )
+ // {
+ // String[] keys = keyPhone.split( " " );
+ // keyPhone = keys[0] + " " + keys[1];
+ // }
+ // }
+ //
+ // patients = patientService.getPatientsByPhone( keyPhone,
+ // organisationUnitId );
+ //
+ //
+ // if ( patients.size() == 1 )
+ // {
+ // Patient patient = patients.iterator().next();
+ //
+ // phoneNumber = patient.getPhoneNumber();
+ // return REDIRECT;
+ // }
+ //
+ // return SUCCESS;
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetBeneficiaryDetailAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetBeneficiaryDetailAction.java 2012-05-24 14:51:18 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetBeneficiaryDetailAction.java 2012-09-27 05:47:35 +0000
@@ -85,7 +85,7 @@
public String execute()
throws Exception
{
- this.patient = patientService.getPatient( patientId );
+ this.patient = patientService.getPatient( patientId );
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetPatientProgramListAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetPatientProgramListAction.java 2012-09-24 07:42:21 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetPatientProgramListAction.java 2012-09-27 05:47:35 +0000
@@ -156,6 +156,19 @@
{
this.patientId = patientId;
}
+
+ private String phoneNumber;
+
+
+ public String getPhoneNumber()
+ {
+ return phoneNumber;
+ }
+
+ public void setPhoneNumber( String phoneNumber )
+ {
+ this.phoneNumber = phoneNumber;
+ }
private Set<ProgramInstance> programInstances = new HashSet<ProgramInstance>();
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties 2012-09-24 07:42:21 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties 2012-09-27 05:47:35 +0000
@@ -83,7 +83,7 @@
tracking=Tracking
find_beneficiary=Find Person
activity_plan=Activity Plan
-search_by_name_or_id=Search By Name or ID
+search_by_name_or_id=Search By Name or ID or Phone Number
select_orgunit=Select Organisation Unit
all_orgunit=All Organisation Unit
tracking_menu=Tracking Menu
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/menu.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/menu.vm 2012-09-24 03:28:31 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/menu.vm 2012-09-27 05:47:35 +0000
@@ -28,8 +28,10 @@
#set ($trackingAuthority = true)
#set ($aggregateAuthority = true)
#else
+
#if ( $each == 'M_dhis-web-maintenance-patient' )
#set ($trackingAuthority = true)
+
#end
#if ( $each == 'M_dhis-web-dataentry' )
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryList.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryList.vm 2012-06-11 10:11:21 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryList.vm 2012-09-27 05:47:35 +0000
@@ -4,8 +4,11 @@
<ul>
#foreach( $patient in $patients )
<li><a href="showPatientProgramList.action?patientId=$patient.getId()">$!encoder.htmlEncode( ${patient.getFullName()} )</a></li>
+
#end
</ul>
+
+
</p>
<p><strong>Total found: $patients.size()</strong></p>
<div id="footer">
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/findBeneficiaryForm.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/findBeneficiaryForm.vm 2012-09-19 04:37:21 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/findBeneficiaryForm.vm 2012-09-27 05:47:35 +0000
@@ -16,7 +16,7 @@
#if( $validationMap.get( "keyword" ) )
<br /><span style="color: #990000;"> $i18n.getString($validationMap.get( "fullName" ))</span>
#end
- <input type="text" name="keyword" value="$!previousValues.get("fullName")" />
+ <input type="text" name="keyword" value="$!previousValues.get("fullName")" />
</p>
<p style="text-align: left;">
<label>$i18n.getString( "select_orgunit" )</label>
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/registration/beneficiaryRegistrationForm.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/registration/beneficiaryRegistrationForm.vm 2012-09-21 14:54:46 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/registration/beneficiaryRegistrationForm.vm 2012-09-27 05:47:35 +0000
@@ -53,7 +53,7 @@
>$i18n.getString( "transgender" )</option>
</select>
- <label>$i18n.getString( "date_of_birth" )</label>
+ <label>$i18n.getString( "age_or_dob" )</label>
<select name="dobType">
<option value="A"
#if($previousValues.get("dobType") == "A")