← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13290: Add new patient-attribute type called phoneNumber; Remove phoneNumber property of Patient object.

 

------------------------------------------------------------
revno: 13290
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-12-18 13:05:41 +0700
message:
  Add new patient-attribute type called phoneNumber; Remove phoneNumber property of Patient object.
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/PatientAttribute.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientReminderService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientStore.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/AbstractPersonService.java
  dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/caseaggregation/hibernate/HibernateCaseAggregationConditionStore.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/patient/DefaultPatientReminderService.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-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java
  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/HibernateProgramStageInstanceStore.java
  dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/Patient.hbm.xml
  dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/patient/PatientReminderServiceTest.java
  dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/patient/PatientServiceTest.java
  dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/patient/PatientStoreTest.java
  dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/program/ProgramInstanceServiceTest.java
  dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/program/ProgramStageInstanceServiceTest.java
  dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/AddPatientAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/UpdatePatientAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanRecords.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanSelect.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addRelationshipForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addSingleEventRegistration.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataRecordingSelect.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataentryRecords.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/defaultPatientForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/detailsPartner.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/underage.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/listPatient.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/multiDataEntrySelect.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientLocation.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientRegistrationList.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingSelect.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/records.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/relationshipList.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/relationshipPatients.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/reportDataEntryForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePatient.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePatientDetails.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePatients.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/underAgeForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitSchedule.vm
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/SaveBeneficiaryAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/caseaggregation.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttribute.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttribute.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewPatientRegistationForm.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	2013-12-16 04:27:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java	2013-12-18 06:05:41 +0000
@@ -80,8 +80,6 @@
 
     private OrganisationUnit organisationUnit;
 
-    private String phoneNumber;
-
     private Patient representative;
 
     private User associate;
@@ -198,18 +196,4 @@
         attributeValue.setPatient( null );
     }
 
-    // -------------------------------------------------------------------------
-    // Getter && Setter
-    // -------------------------------------------------------------------------
-
-    public String getPhoneNumber()
-    {
-        return phoneNumber;
-    }
-
-    public void setPhoneNumber( String phoneNumber )
-    {
-        this.phoneNumber = phoneNumber;
-    }
-
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttribute.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttribute.java	2013-12-16 04:27:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttribute.java	2013-12-18 06:05:41 +0000
@@ -65,6 +65,8 @@
     public static final String TYPE_TRUE_ONLY = "trueOnly";
 
     public static final String TYPE_COMBO = "combo";
+    
+    public static final String TYPE_PHONE_NUMBER = "phoneNumber";
 
     private String description;
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientReminderService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientReminderService.java	2013-10-29 05:04:36 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientReminderService.java	2013-12-18 06:05:41 +0000
@@ -73,7 +73,7 @@
      * @param patientReminder PatientReminder
      * @param patient Patient
      * 
-     * @return The list of the phone numbers ( patient phone numbers, orgunit
+     * @return The list of the phone numbers ( patient attribute phone numbers, orgunit
      *         phone numbers, phone numbers of DHIS users at the orgunit OR
      *         phone numbers of DHIS users in a user group.
      */

=== 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	2013-12-16 04:27:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientStore.java	2013-12-18 06:05:41 +0000
@@ -29,7 +29,6 @@
  */
 
 import java.util.Collection;
-import java.util.Date;
 import java.util.List;
 
 import org.hisp.dhis.common.GenericIdentifiableObjectStore;

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/AbstractPersonService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/AbstractPersonService.java	2013-12-16 04:27:26 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/AbstractPersonService.java	2013-12-18 06:05:41 +0000
@@ -205,7 +205,6 @@
         person.setName( patient.getName() );
 
         Contact contact = new Contact();
-        contact.setPhoneNumber( nullIfEmpty( patient.getPhoneNumber() ) );
 
         if ( contact.getPhoneNumber() != null )
         {
@@ -264,11 +263,6 @@
 
         patient.setOrganisationUnit( organisationUnit );
 
-        if ( person.getContact() != null && person.getContact().getPhoneNumber() != null )
-        {
-            patient.setPhoneNumber( person.getContact().getPhoneNumber() );
-        }
-
         updateIdentifiers( person, patient );
 
         return patient;
@@ -354,7 +348,6 @@
 
         patient.setName( person.getName() );
         String phoneNumber = person.getContact() != null ? person.getContact().getPhoneNumber() : null;
-        patient.setPhoneNumber( phoneNumber );
 
         updateSystemIdentifier( person );
         removeRelationships( patient );

=== modified file 'dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/caseaggregation/hibernate/HibernateCaseAggregationConditionStore.java'
--- dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/caseaggregation/hibernate/HibernateCaseAggregationConditionStore.java	2013-12-16 04:27:26 +0000
+++ dhis-2/dhis-services/dhis-service-eventreporting/src/main/java/org/hisp/dhis/caseaggregation/hibernate/HibernateCaseAggregationConditionStore.java	2013-12-18 06:05:41 +0000
@@ -918,7 +918,7 @@
         {
             if ( hasPatients || operator.equals( CaseAggregationCondition.AGGRERATION_COUNT ) )
             {
-                sql += "p.name, p.gender, p.birthDate, p.phoneNumber,";
+                sql += "p.name,";
             }
 
             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-12-16 15:15:54 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java	2013-12-18 06:05:41 +0000
@@ -911,10 +911,6 @@
         {
             patientModel.setOrganisationUnitName( patient.getOrganisationUnit().getName() );
         }
-        if ( patient.getPhoneNumber() != null )
-        {
-            patientModel.setPhoneNumber( patient.getPhoneNumber() );
-        }
 
         this.setSetting( getSettings() );
 
@@ -1735,7 +1731,6 @@
         org.hisp.dhis.patient.Patient patientWeb = new org.hisp.dhis.patient.Patient();
 
         patientWeb.setName( patient.getName() );
-        patientWeb.setPhoneNumber( patient.getPhoneNumber() );
         patientWeb.setOrganisationUnit( organisationUnitService.getOrganisationUnit( orgUnitId ) );
 
         Set<org.hisp.dhis.patient.PatientIdentifier> patientIdentifierSet = new HashSet<org.hisp.dhis.patient.PatientIdentifier>();
@@ -2021,14 +2016,21 @@
             programStageInstanceService.updateProgramStageInstance( programStageInstance );
 
             // send SMS
-            if ( programStageInstance.getProgramInstance().getPatient().getPhoneNumber() != null
+            if ( programStageInstance.getProgramInstance().getPatient().getAttributeValues() != null
                 && lostEvent.getSMS() != null )
             {
-                User user = new User();
-                user.setPhoneNumber( programStageInstance.getProgramInstance().getPatient().getPhoneNumber() );
                 List<User> recipientsList = new ArrayList<User>();
-                recipientsList.add( user );
+                for ( PatientAttributeValue attrValue : programStageInstance.getProgramInstance().getPatient()
+                    .getAttributeValues() )
+                {
+                    if ( attrValue.getPatientAttribute().getValueType().equals( "phoneNumber" ) )
+                    {
+                        User user = new User();
+                        user.setPhoneNumber( attrValue.getValue() );
+                        recipientsList.add( user );
+                    }
 
+                }
                 smsSender.sendMessage( lostEvent.getName(), lostEvent.getSMS(), currentUserService.getCurrentUser(),
                     recipientsList, false );
             }

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientReminderService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientReminderService.java	2013-11-25 07:31:02 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientReminderService.java	2013-12-18 06:05:41 +0000
@@ -34,6 +34,7 @@
 import java.util.Set;
 
 import org.hisp.dhis.i18n.I18nFormat;
+import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
 import org.hisp.dhis.program.ProgramInstance;
 import org.hisp.dhis.program.ProgramStageInstance;
 import org.hisp.dhis.system.util.DateUtils;
@@ -150,20 +151,16 @@
             }
             break;
         default:
-            if ( patient.getPhoneNumber() != null && !patient.getPhoneNumber().isEmpty() )
+            if ( patient.getAttributeValues() != null )
             {
-                if ( patient.getPhoneNumber().contains( ";" ) )
+                for ( PatientAttributeValue attributeValue : patient.getAttributeValues() )
                 {
-                    String token[] = patient.getPhoneNumber().split( ";" );
-                    for ( String phoneNumber : token )
+                    if ( attributeValue.getPatientAttribute().getValueType()
+                        .equals( PatientAttribute.TYPE_PHONE_NUMBER ) )
                     {
-                        phoneNumbers.add( phoneNumber );
+                        phoneNumbers.add( attributeValue.getValue() );
                     }
                 }
-                else
-                {
-                    phoneNumbers.add( patient.getPhoneNumber() );
-                }
             }
             break;
         }

=== 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	2013-12-16 04:27:26 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java	2013-12-18 06:05:41 +0000
@@ -267,35 +267,30 @@
     }
 
     @Override
-    @SuppressWarnings( "unchecked" )
     public Collection<Patient> getPatients( OrganisationUnit organisationUnit, Integer min, Integer max )
     {
         return patientStore.getByOrgUnit( organisationUnit, min, max );
     }
 
     @Override
-    @SuppressWarnings( "unchecked" )
     public Collection<Patient> getPatients( Program program )
     {
         return patientStore.getByProgram( program, 0, Integer.MAX_VALUE );
     }
 
     @Override
-    @SuppressWarnings( "unchecked" )
     public Collection<Patient> getPatients( OrganisationUnit organisationUnit, Program program )
     {
         return patientStore.getByOrgUnitProgram( organisationUnit, program, 0, Integer.MAX_VALUE );
     }
 
     @Override
-    @SuppressWarnings( "unchecked" )
     public Collection<Patient> getPatientsLikeName( OrganisationUnit organisationUnit, String name, Integer min,
         Integer max )
     {
         return patientStore.getByOrgUnitAndNameLike( organisationUnit, name, min, max );
     }
 
-    @SuppressWarnings( "unchecked" )
     @Override
     public Collection<Patient> getPatient( Integer identifierTypeId, Integer attributeId, String value )
     {
@@ -325,7 +320,7 @@
         }
 
         return patientStore.getByNames( value, null, null );
-        
+
     }
 
     @Override
@@ -364,7 +359,6 @@
     }
 
     @Override
-    @SuppressWarnings( "unchecked" )
     public Collection<Patient> getPatientsByNames( String name, Integer min, Integer max )
     {
         return patientStore.getByNames( name.toLowerCase(), min, max );
@@ -447,7 +441,6 @@
     }
 
     @Override
-    @SuppressWarnings( "unchecked" )
     public Collection<Patient> getPatients( OrganisationUnit organisationUnit, Program program, Integer min, Integer max )
     {
         return patientStore.getByOrgUnitProgram( organisationUnit, program, min, max );
@@ -494,14 +487,12 @@
     }
 
     @Override
-    @SuppressWarnings( "unchecked" )
     public Collection<Patient> getRepresentatives( Patient patient )
     {
         return patientStore.getRepresentatives( patient );
     }
 
     @Override
-    @SuppressWarnings( "unchecked" )
     public Collection<Patient> searchPatients( List<String> searchKeys, Collection<OrganisationUnit> orgunits,
         Boolean followup, Collection<PatientAttribute> patientAttributes,
         Collection<PatientIdentifierType> identifierTypes, Integer statusEnrollment, Integer min, Integer max )
@@ -518,20 +509,26 @@
     }
 
     @Override
-    @SuppressWarnings( "unchecked" )
     public Collection<String> getPatientPhoneNumbers( List<String> searchKeys, Collection<OrganisationUnit> orgunits,
         Boolean followup, Integer statusEnrollment, Integer min, Integer max )
     {
         Collection<Patient> patients = patientStore.search( searchKeys, orgunits, followup, null, null,
             statusEnrollment, min, max );
-
         Set<String> phoneNumbers = new HashSet<String>();
-
+		
         for ( Patient patient : patients )
         {
-            if ( patient.getPhoneNumber() != null )
+            Collection<PatientAttributeValue> attributeValues = patient.getAttributeValues();
+            if ( attributeValues != null )
             {
-                phoneNumbers.add( patient.getPhoneNumber() );
+                for ( PatientAttributeValue attributeValue : attributeValues )
+                {
+                    if ( attributeValue.getPatientAttribute().getValueType()
+                        .equals( PatientAttribute.TYPE_PHONE_NUMBER ) )
+                    {
+                        phoneNumbers.add( attributeValue.getValue() );
+                    }
+                }
             }
         }
 
@@ -539,7 +536,6 @@
     }
 
     @Override
-    @SuppressWarnings( "unchecked" )
     public List<Integer> getProgramStageInstances( List<String> searchKeys, Collection<OrganisationUnit> orgunits,
         Boolean followup, Integer statusEnrollment, Integer min, Integer max )
     {
@@ -548,7 +544,6 @@
     }
 
     @Override
-    @SuppressWarnings( "unchecked" )
     public Collection<Patient> getPatientsByPhone( String phoneNumber, Integer min, Integer max )
     {
         return patientStore.getByPhoneNumber( phoneNumber, min, max );
@@ -644,7 +639,6 @@
     }
 
     @Override
-    @SuppressWarnings( "unchecked" )
     public Collection<Patient> getPatientByFullname( String fullName, OrganisationUnit organisationUnit )
     {
         return patientStore.getByFullName( fullName, organisationUnit );

=== 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	2013-12-16 04:27:26 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java	2013-12-18 06:05:41 +0000
@@ -323,15 +323,19 @@
     @SuppressWarnings( "unchecked" )
     public Collection<Patient> getByPhoneNumber( String phoneNumber, Integer min, Integer max )
     {
-        String hql = "select p from Patient p where p.phoneNumber like '%" + phoneNumber + "%'";
-        Query query = getQuery( hql );
-
+        Criteria criteria = getCriteria();
+        criteria.createAlias( "attributeValues", "attributeValue" );
+        criteria.createAlias( "attributeValue.patientAttribute", "patientAttribute" );
+        criteria.add( Restrictions.eq( "patientAttribute.valueType", PatientAttribute.TYPE_PHONE_NUMBER ) );
+        criteria.add( Restrictions.like( "attributeValue.value", phoneNumber ) );
+        
         if ( min != null && max != null )
         {
-            query.setFirstResult( min ).setMaxResults( max );
+            criteria.setFirstResult( min );
+            criteria.setMaxResults( max );
         }
 
-        return query.list();
+        return criteria.list();
     }
 
     @Override
@@ -420,15 +424,15 @@
             }
         }
 
-//        if ( program != null )
-//        {
-//            ValidationCriteria validationCriteria = program.isValid( patient );
-//
-//            if ( validationCriteria != null )
-//            {
-//                return PatientService.ERROR_ENROLLMENT;
-//            }
-//        }
+        // if ( program != null )
+        // {
+        // ValidationCriteria validationCriteria = program.isValid( patient );
+        //
+        // if ( validationCriteria != null )
+        // {
+        // return PatientService.ERROR_ENROLLMENT;
+        // }
+        // }
 
         return PatientService.ERROR_NONE;
     }
@@ -442,7 +446,7 @@
         Collection<PatientIdentifierType> identifierTypes, Integer statusEnrollment, Integer min, Integer max )
     {
         String selector = count ? "count(*) " : "* ";
-        String sql = "select " + selector + " from ( select distinct p.patientid, p.name, p.phonenumber,";
+        String sql = "select " + selector + " from ( select distinct p.patientid, p.name,";
 
         if ( identifierTypes != null )
         {
@@ -465,7 +469,7 @@
 
         String patientWhere = "";
         String patientOperator = " where ";
-        String patientGroupBy = " GROUP BY  p.patientid, p.name, p.phonenumber ";
+        String patientGroupBy = " GROUP BY  p.patientid, p.name ";
         String otherWhere = "";
         String operator = " where ";
         String orderBy = "";
@@ -577,116 +581,116 @@
                     int statusEvent = Integer.parseInt( keys[index] );
                     switch ( statusEvent )
                     {
-                        case ProgramStageInstance.COMPLETED_STATUS:
-                            patientWhere += condition + operatorStatus
-                                + "( psi.executiondate is not null and  psi.executiondate>='" + keys[2]
-                                + "' and psi.executiondate<='" + keys[3] + "' and psi.completed=true ";
-
-                            // get events by orgunit children
-                            if ( keys[4].equals( "-1" ) )
-                            {
-                                patientWhere += " and psi.organisationunitid in( "
-                                    + TextUtils.getCommaDelimitedString( orgunitChilrenIds ) + " )";
-                            }
-
-                            // get events by selected orgunit
-                            else if ( !keys[4].equals( "0" ) )
-                            {
-                                patientWhere += " and psi.organisationunitid=" + getOrgUnitId( keys );
-                            }
-
-                            patientWhere += ")";
-                            operatorStatus = " OR ";
-                            condition = "";
-                            continue;
-                        case ProgramStageInstance.VISITED_STATUS:
-                            patientWhere += condition + operatorStatus
-                                + "( psi.executiondate is not null and psi.executiondate>='" + keys[2]
-                                + "' and psi.executiondate<='" + keys[3] + "' and psi.completed=false ";
-
-                            // get events by orgunit children
-                            if ( keys[4].equals( "-1" ) )
-                            {
-                                patientWhere += " and psi.organisationunitid in( "
-                                    + TextUtils.getCommaDelimitedString( orgunitChilrenIds ) + " )";
-                            }
-
-                            // get events by selected orgunit
-                            else if ( !keys[4].equals( "0" ) )
-                            {
-                                patientWhere += " and psi.organisationunitid=" + getOrgUnitId( keys );
-                            }
-
-                            patientWhere += ")";
-                            operatorStatus = " OR ";
-                            condition = "";
-                            continue;
-                        case ProgramStageInstance.FUTURE_VISIT_STATUS:
-                            patientWhere += condition + operatorStatus + "( psi.executiondate is null and psi.duedate>='"
-                                + keys[2] + "' and psi.duedate<='" + keys[3]
-                                + "' and psi.status is not null and (DATE(now()) - DATE(psi.duedate) <= 0) ";
-
-                            // get events by orgunit children
-                            if ( keys[4].equals( "-1" ) )
-                            {
-                                patientWhere += " and p.organisationunitid in( "
-                                    + TextUtils.getCommaDelimitedString( orgunitChilrenIds ) + " )";
-                            }
-
-                            // get events by selected orgunit
-                            else if ( !keys[4].equals( "0" ) )
-                            {
-                                patientWhere += " and p.organisationunitid=" + getOrgUnitId( keys );
-                            }
-
-                            patientWhere += ")";
-                            operatorStatus = " OR ";
-                            condition = "";
-                            continue;
-                        case ProgramStageInstance.LATE_VISIT_STATUS:
-                            patientWhere += condition + operatorStatus + "( psi.executiondate is null and  psi.duedate>='"
-                                + keys[2] + "' and psi.duedate<='" + keys[3]
-                                + "' and psi.status is not null and (DATE(now()) - DATE(psi.duedate) > 0) ";
-
-                            // get events by orgunit children
-                            if ( keys[4].equals( "-1" ) )
-                            {
-                                patientWhere += " and p.organisationunitid in( "
-                                    + TextUtils.getCommaDelimitedString( orgunitChilrenIds ) + " )";
-                            }
-
-                            // get events by selected orgunit
-                            else if ( !keys[4].equals( "0" ) )
-                            {
-                                patientWhere += " and p.organisationunitid=" + getOrgUnitId( keys );
-                            }
-
-                            patientWhere += ")";
-                            operatorStatus = " OR ";
-                            condition = "";
-                            continue;
-                        case ProgramStageInstance.SKIPPED_STATUS:
-                            patientWhere += condition + operatorStatus + "( psi.status=5 and  psi.duedate>='" + keys[2]
-                                + "' and psi.duedate<='" + keys[3] + "' ";
-
-                            // get events by orgunit children
-                            if ( keys[4].equals( "-1" ) )
-                            {
-                                patientWhere += " and psi.organisationunitid in( "
-                                    + TextUtils.getCommaDelimitedString( orgunitChilrenIds ) + " )";
-                            }
-
-                            // get events by selected orgunit
-                            else if ( !keys[4].equals( "0" ) )
-                            {
-                                patientWhere += " and p.organisationunitid=" + getOrgUnitId( keys );
-                            }
-                            patientWhere += ")";
-                            operatorStatus = " OR ";
-                            condition = "";
-                            continue;
-                        default:
-                            continue;
+                    case ProgramStageInstance.COMPLETED_STATUS:
+                        patientWhere += condition + operatorStatus
+                            + "( psi.executiondate is not null and  psi.executiondate>='" + keys[2]
+                            + "' and psi.executiondate<='" + keys[3] + "' and psi.completed=true ";
+
+                        // get events by orgunit children
+                        if ( keys[4].equals( "-1" ) )
+                        {
+                            patientWhere += " and psi.organisationunitid in( "
+                                + TextUtils.getCommaDelimitedString( orgunitChilrenIds ) + " )";
+                        }
+
+                        // get events by selected orgunit
+                        else if ( !keys[4].equals( "0" ) )
+                        {
+                            patientWhere += " and psi.organisationunitid=" + getOrgUnitId( keys );
+                        }
+
+                        patientWhere += ")";
+                        operatorStatus = " OR ";
+                        condition = "";
+                        continue;
+                    case ProgramStageInstance.VISITED_STATUS:
+                        patientWhere += condition + operatorStatus
+                            + "( psi.executiondate is not null and psi.executiondate>='" + keys[2]
+                            + "' and psi.executiondate<='" + keys[3] + "' and psi.completed=false ";
+
+                        // get events by orgunit children
+                        if ( keys[4].equals( "-1" ) )
+                        {
+                            patientWhere += " and psi.organisationunitid in( "
+                                + TextUtils.getCommaDelimitedString( orgunitChilrenIds ) + " )";
+                        }
+
+                        // get events by selected orgunit
+                        else if ( !keys[4].equals( "0" ) )
+                        {
+                            patientWhere += " and psi.organisationunitid=" + getOrgUnitId( keys );
+                        }
+
+                        patientWhere += ")";
+                        operatorStatus = " OR ";
+                        condition = "";
+                        continue;
+                    case ProgramStageInstance.FUTURE_VISIT_STATUS:
+                        patientWhere += condition + operatorStatus + "( psi.executiondate is null and psi.duedate>='"
+                            + keys[2] + "' and psi.duedate<='" + keys[3]
+                            + "' and psi.status is not null and (DATE(now()) - DATE(psi.duedate) <= 0) ";
+
+                        // get events by orgunit children
+                        if ( keys[4].equals( "-1" ) )
+                        {
+                            patientWhere += " and p.organisationunitid in( "
+                                + TextUtils.getCommaDelimitedString( orgunitChilrenIds ) + " )";
+                        }
+
+                        // get events by selected orgunit
+                        else if ( !keys[4].equals( "0" ) )
+                        {
+                            patientWhere += " and p.organisationunitid=" + getOrgUnitId( keys );
+                        }
+
+                        patientWhere += ")";
+                        operatorStatus = " OR ";
+                        condition = "";
+                        continue;
+                    case ProgramStageInstance.LATE_VISIT_STATUS:
+                        patientWhere += condition + operatorStatus + "( psi.executiondate is null and  psi.duedate>='"
+                            + keys[2] + "' and psi.duedate<='" + keys[3]
+                            + "' and psi.status is not null and (DATE(now()) - DATE(psi.duedate) > 0) ";
+
+                        // get events by orgunit children
+                        if ( keys[4].equals( "-1" ) )
+                        {
+                            patientWhere += " and p.organisationunitid in( "
+                                + TextUtils.getCommaDelimitedString( orgunitChilrenIds ) + " )";
+                        }
+
+                        // get events by selected orgunit
+                        else if ( !keys[4].equals( "0" ) )
+                        {
+                            patientWhere += " and p.organisationunitid=" + getOrgUnitId( keys );
+                        }
+
+                        patientWhere += ")";
+                        operatorStatus = " OR ";
+                        condition = "";
+                        continue;
+                    case ProgramStageInstance.SKIPPED_STATUS:
+                        patientWhere += condition + operatorStatus + "( psi.status=5 and  psi.duedate>='" + keys[2]
+                            + "' and psi.duedate<='" + keys[3] + "' ";
+
+                        // get events by orgunit children
+                        if ( keys[4].equals( "-1" ) )
+                        {
+                            patientWhere += " and psi.organisationunitid in( "
+                                + TextUtils.getCommaDelimitedString( orgunitChilrenIds ) + " )";
+                        }
+
+                        // get events by selected orgunit
+                        else if ( !keys[4].equals( "0" ) )
+                        {
+                            patientWhere += " and p.organisationunitid=" + getOrgUnitId( keys );
+                        }
+                        patientWhere += ")";
+                        operatorStatus = " OR ";
+                        condition = "";
+                        continue;
+                    default:
+                        continue;
                     }
                 }
                 if ( condition.isEmpty() )
@@ -707,20 +711,20 @@
                 int statusEvent = Integer.parseInt( keys[2] );
                 switch ( statusEvent )
                 {
-                    case ProgramStageInstance.COMPLETED_STATUS:
-                        patientWhere += "psi.completed=true";
-                        break;
-                    case ProgramStageInstance.VISITED_STATUS:
-                        patientWhere += "psi.executiondate is not null and psi.completed=false";
-                        break;
-                    case ProgramStageInstance.FUTURE_VISIT_STATUS:
-                        patientWhere += "psi.executiondate is null and psi.duedate >= now()";
-                        break;
-                    case ProgramStageInstance.LATE_VISIT_STATUS:
-                        patientWhere += "psi.executiondate is null and psi.duedate < now()";
-                        break;
-                    default:
-                        break;
+                case ProgramStageInstance.COMPLETED_STATUS:
+                    patientWhere += "psi.completed=true";
+                    break;
+                case ProgramStageInstance.VISITED_STATUS:
+                    patientWhere += "psi.executiondate is not null and psi.completed=false";
+                    break;
+                case ProgramStageInstance.FUTURE_VISIT_STATUS:
+                    patientWhere += "psi.executiondate is null and psi.duedate >= now()";
+                    break;
+                case ProgramStageInstance.LATE_VISIT_STATUS:
+                    patientWhere += "psi.executiondate is null and psi.duedate < now()";
+                    break;
+                default:
+                    break;
                 }
 
                 patientWhere += " and pgi.status=" + ProgramInstance.STATUS_ACTIVE + " ";

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java	2013-12-17 03:31:30 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java	2013-12-18 06:05:41 +0000
@@ -463,8 +463,7 @@
             ResultSet resultSet = statement.executeQuery( "SELECT gender1 FROM patient" );
 
             if ( resultSet.next() )
-            {System.out.println("\n\n 1");
-
+            {
                 int max = jdbcTemplate.queryForInt( "select max(patientattributeid) from patientattribute" );
 
                 // ---------------------------------------------------------------------
@@ -606,9 +605,9 @@
                     + CaseAggregationCondition.SEPARATOR_OBJECT + max + "]";
                 updateFixedAttributeInCaseAggregate( source, target );
 
-                // ---------------------------------------------------------------------
+                // -------------------------------------------------------------
                 // Birthdate
-                // ---------------------------------------------------------------------
+                // -------------------------------------------------------------
 
                 max++;
                 executeSql( "INSERT INTO patientattribute (patientattributeid, uid, lastUpdated, name, description, valueType, mandatory, inherit, displayOnVisitSchedule ) VALUES ("
@@ -621,18 +620,40 @@
                 executeSql( "INSERT INTO patientattributevalue (patientid, patientattributeid, value ) SELECT patientid,"
                     + max + ",birthdate from patient where birthdate is not null" );
 
+                // -------------------------------------------------------------
+                // Phone number
+                // -------------------------------------------------------------
+
+                max++;
+                executeSql( "INSERT INTO patientattribute (patientattributeid, uid, lastUpdated, name, description, valueType, mandatory, inherit, displayOnVisitSchedule ) VALUES ("
+                    + max
+                    + ",'"
+                    + CodeGenerator.generateCode()
+                    + "','"
+                    + DateUtils.getMediumDateString()
+                    + "','Phone number', 'Phone number','"
+                    + PatientAttribute.TYPE_PHONE_NUMBER
+                    + "', false, false, false)" );
+                executeSql( "INSERT INTO patientattributevalue (patientid, patientattributeid, value ) SELECT patientid,"
+                    + max + ",phoneNumber from patient where phoneNumber is not null" );
+
+                // -------------------------------------------------------------
                 // Update Case Aggregate Query Builder
+                // -------------------------------------------------------------
+
                 source = "[CP" + CaseAggregationCondition.SEPARATOR_OBJECT + "age]";
                 target = "[" + CaseAggregationCondition.OBJECT_PATIENT_ATTRIBUTE
                     + CaseAggregationCondition.SEPARATOR_OBJECT + max + ".age]";
                 updateFixedAttributeInCaseAggregate( source, target );
 
-                executeSql( "ALTER TABLE patient DROP COLUMN deathDate" );
-                executeSql( "ALTER TABLE patient DROP COLUMN registrationDate" );
-                executeSql( "ALTER TABLE patient DROP COLUMN isDead" );
-                executeSql( "ALTER TABLE patient DROP COLUMN underAge" );
-                executeSql( "ALTER TABLE patient DROP COLUMN dobType" );
-                executeSql( "ALTER TABLE patient DROP COLUMN birthdate" );
+                // executeSql( "ALTER TABLE patient DROP COLUMN deathDate" );
+                // executeSql(
+                // "ALTER TABLE patient DROP COLUMN registrationDate" );
+                // executeSql( "ALTER TABLE patient DROP COLUMN isDead" );
+                // executeSql( "ALTER TABLE patient DROP COLUMN underAge" );
+                // executeSql( "ALTER TABLE patient DROP COLUMN dobType" );
+                // executeSql( "ALTER TABLE patient DROP COLUMN birthdate" );
+                // executeSql( "ALTER TABLE patient DROP COLUMN phoneNumber" );
             }
         }
         catch ( Exception ex )

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java	2013-12-16 04:27:26 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java	2013-12-18 06:05:41 +0000
@@ -277,17 +277,7 @@
         attrGrid.addHeader( new GridHeader( i18n.getString( "name" ), false, true ) );
         attrGrid.addHeader( new GridHeader( i18n.getString( "value" ), false, true ) );
         attrGrid.addHeader( new GridHeader( "", true, false ) );
-
-        // ---------------------------------------------------------------------
-        // Add fixed attribues
-        // ---------------------------------------------------------------------
-
-        attrGrid.addRow();
-        attrGrid.addValue( i18n.getString( "phoneNumber" ) );
-        attrGrid
-            .addValue( (patient.getPhoneNumber() == null || patient.getPhoneNumber().isEmpty()) ? PatientAttributeValue.UNKNOWN
-                : patient.getPhoneNumber() );
-
+      
         // ---------------------------------------------------------------------
         // Add dynamic attribues
         // ---------------------------------------------------------------------

=== 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-12-02 03:34:33 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramInstanceStore.java	2013-12-18 06:05:41 +0000
@@ -292,7 +292,7 @@
 
     private String sendToPatientSql( String dateToCompare )
     {
-        return "SELECT pi.programinstanceid, p.phonenumber, prm.templatemessage, "
+        return "SELECT pi.programinstanceid, pav.value as 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 "
@@ -300,8 +300,10 @@
             + "              ON p.patientid=pi.patientid INNER JOIN program pg "
             + "              ON pg.programid=pi.programid INNER JOIN organisationunit org "
             + "              ON org.organisationunitid = p.organisationunitid INNER JOIN patientreminder prm "
-            + "              ON prm.programid = pi.programid " + "       WHERE pi.status= "
-            + ProgramInstance.STATUS_ACTIVE + "         and p.phonenumber is not NULL and p.phonenumber != ''   "
+            + "              ON prm.programid = pi.programid INNER JOIN patientattributevalue pav "
+            + "              ON pav.patientid=p.patientid INNER JOIN patientattribute pa "
+            + "              ON pa.patientattributeid=pav.patientattributeid " + "       WHERE pi.status= "
+            + ProgramInstance.STATUS_ACTIVE
             + "         and prm.templatemessage is not NULL and prm.templatemessage != ''   "
             + "         and pg.type=1 and prm.daysallowedsendmessage is not null    "
             + "         and ( DATE(now()) - DATE(pi." + dateToCompare + ") ) = prm.daysallowedsendmessage "

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java	2013-12-02 15:02:29 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java	2013-12-18 06:05:41 +0000
@@ -569,7 +569,7 @@
 
     private String sendMessageToPatientSql()
     {
-        return "select psi.programstageinstanceid, p.phonenumber, prm.templatemessage, p.name, org.name as orgunitName "
+        return "select psi.programstageinstanceid, pav.value as phonenumber, prm.templatemessage, p.name, org.name as orgunitName "
             + ",pg.name as programName, ps.name as programStageName, psi.duedate,(DATE(now()) - DATE(psi.duedate) ) as days_since_due_date "
             + "from patient p INNER JOIN programinstance pi "
             + "     ON p.patientid=pi.patientid "
@@ -583,9 +583,12 @@
             + "     ON org.organisationunitid = p.organisationunitid "
             + " INNER JOIN patientreminder prm  "
             + "     ON prm.programstageid = ps.programstageid "
+            + " INNER JOIN patientattributevalue pav "
+            + "     ON pav.patientid=p.patientid "
+            + " INNER JOIN patientattribute pa "
+            + "     ON pa.patientattributeid=pav.patientattributeid "
             + "WHERE pi.status="
             + ProgramInstance.STATUS_ACTIVE
-            + "     and p.phonenumber is not NULL and p.phonenumber != '' "
             + "     and prm.templatemessage is not NULL and prm.templatemessage != '' "
             + "     and pg.type=1 and prm.daysallowedsendmessage is not null  "
             + "     and psi.executiondate is null "

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/Patient.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/Patient.hbm.xml	2013-12-16 04:27:26 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/Patient.hbm.xml	2013-12-18 06:05:41 +0000
@@ -13,8 +13,6 @@
     &identifiableProperties;
 
     <property name="name" column="name" length="230" />
-   
-    <property name="phoneNumber" length="25" />
     
     <set name="identifiers" inverse="true">
       <key column="patientid" />

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/patient/PatientReminderServiceTest.java'
--- dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/patient/PatientReminderServiceTest.java	2013-11-19 03:45:56 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/patient/PatientReminderServiceTest.java	2013-12-18 06:05:41 +0000
@@ -38,6 +38,8 @@
 import org.hisp.dhis.mock.MockI18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
+import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.program.ProgramInstance;
 import org.hisp.dhis.program.ProgramInstanceService;
@@ -83,6 +85,12 @@
     @Autowired
     private UserService userService;
 
+    @Autowired
+    private PatientAttributeService patientAttributeService;
+
+    @Autowired
+    private PatientAttributeValueService patientAttributeValueService;
+
     private MockI18nFormat mockFormat;
 
     private ProgramInstance programInstance;
@@ -106,7 +114,7 @@
 
         OrganisationUnit organisationUnit = createOrganisationUnit( 'A' );
         organisationUnitService.addOrganisationUnit( organisationUnit );
-        
+
         Set<OrganisationUnit> orgUnits = new HashSet<OrganisationUnit>();
         orgUnits.add( organisationUnit );
 
@@ -181,6 +189,17 @@
     @Test
     public void testGetPhonenumbers()
     {
+        PatientAttribute attribute = createPatientAttribute( 'A' );
+        attribute.setValueType( PatientAttribute.TYPE_PHONE_NUMBER );
+        patientAttributeService.savePatientAttribute( attribute );
+
+        PatientAttributeValue attributeValue = createPatientAttributeValue( 'A', patient, attribute );
+        attributeValue.setValue( "123456789" );
+        patientAttributeValueService.savePatientAttributeValue( attributeValue );
+        
+        patient.getAttributeValues().add( attributeValue );
+        patientService.updatePatient( patient );
+
         Set<String> phoneNumbers = patientReminderService.getPhonenumbers( patientReminderA, patient );
         assertEquals( 1, phoneNumbers.size() );
         assertTrue( phoneNumbers.contains( "123456789" ) );

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/patient/PatientServiceTest.java'
--- dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/patient/PatientServiceTest.java	2013-12-16 04:27:26 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/patient/PatientServiceTest.java	2013-12-18 06:05:41 +0000
@@ -535,24 +535,31 @@
         int idA = programService.addProgram( programA );
         programService.addProgram( programB );
 
-        patientA3.setPhoneNumber( "123456789" );
         patientService.savePatient( patientA1 );
         patientService.savePatient( patientA2 );
         patientService.savePatient( patientA3 );
         patientService.savePatient( patientB1 );
         patientService.savePatient( patientB2 );
 
-        PatientAttributeValue attributeValue = createPatientAttributeValue( 'A', patientA3, patientAttribute );
+        PatientAttribute phoneAttribute = createPatientAttribute( 'B' );
+        phoneAttribute.setValueType( PatientAttribute.TYPE_PHONE_NUMBER );
+        patientAttributeService.savePatientAttribute( phoneAttribute );
+
+        Set<PatientAttributeValue> attributeValues = new HashSet<PatientAttributeValue>();
+        PatientAttributeValue attributeValue = createPatientAttributeValue( 'A', patientA3, phoneAttribute );
+        attributeValue.setValue( "123456789" );
         patientAttributeValueService.savePatientAttributeValue( attributeValue );
 
+        attributeValues.add( attributeValue );
+        patientA3.addAttributeValue( attributeValue );
+        patientService.updatePatient( patientA3 );
+
         programInstanceService.enrollPatient( patientA3, programA, date, date, organisationUnit, null );
         programInstanceService.enrollPatient( patientB1, programA, date, date, organisationUnit, null );
 
         List<String> searchKeys = new ArrayList<String>();
         searchKeys.add( Patient.PREFIX_IDENTIFIER_TYPE + Patient.SEARCH_SAPERATE + "a" + Patient.SEARCH_SAPERATE
             + organisationUnit.getId() );
-        searchKeys.add( Patient.PREFIX_PATIENT_ATTRIBUTE + Patient.SEARCH_SAPERATE + attributeId
-            + Patient.SEARCH_SAPERATE + "a" );
         searchKeys.add( Patient.PREFIX_PROGRAM + Patient.SEARCH_SAPERATE + idA );
 
         Collection<OrganisationUnit> orgunits = new HashSet<OrganisationUnit>();
@@ -571,6 +578,23 @@
         patientService.savePatient( patientA2 );
         patientService.savePatient( patientA3 );
 
+        PatientAttribute patientAttribute = createPatientAttribute( 'B' );
+        patientAttribute.setValueType( PatientAttribute.TYPE_PHONE_NUMBER );
+        patientAttributeService.savePatientAttribute( patientAttribute );
+
+        PatientAttributeValue attributeValue = createPatientAttributeValue( 'A', patientA1, patientAttribute );
+        attributeValue.setValue( "123456789" );
+        patientAttributeValueService.savePatientAttributeValue( attributeValue );
+
+        patientA1.addAttributeValue( attributeValue );
+        patientService.updatePatient( patientA1 );
+
+        attributeValue = createPatientAttributeValue( 'A', patientA2, patientAttribute );
+        attributeValue.setValue( "123456789" );
+        patientAttributeValueService.savePatientAttributeValue( attributeValue );
+        patientA2.addAttributeValue( attributeValue );
+        patientService.updatePatient( patientA2 );
+        
         Collection<Patient> patients = patientService.getPatientsByPhone( "123456789", null, null );
         assertEquals( 2, patients.size() );
         assertTrue( patients.contains( patientA1 ) );

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/patient/PatientStoreTest.java'
--- dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/patient/PatientStoreTest.java	2013-12-16 04:27:26 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/patient/PatientStoreTest.java	2013-12-18 06:05:41 +0000
@@ -82,6 +82,9 @@
 
     @Autowired
     private ValidationCriteriaService validationCriteriaService;
+    
+    @Autowired
+    private PatientService patientService;
 
     private Patient patientA1;
 
@@ -301,6 +304,24 @@
         patientStore.save( patientA1 );
         patientStore.save( patientB1 );
 
+        PatientAttribute attribute = createPatientAttribute( 'B' );
+        attribute.setValueType( PatientAttribute.TYPE_PHONE_NUMBER );
+        patientAttributeService.savePatientAttribute( attribute );
+
+        PatientAttributeValue attributeValue = createPatientAttributeValue( 'A', patientA1, attribute );
+        attributeValue.setValue( "123456789" );
+        patientAttributeValueService.savePatientAttributeValue( attributeValue );
+
+        patientA1.addAttributeValue( attributeValue );
+        patientService.updatePatient( patientA1 );
+
+        attributeValue = createPatientAttributeValue( 'A', patientB1, attribute );
+        attributeValue.setValue( "123456789" );
+        patientAttributeValueService.savePatientAttributeValue( attributeValue );
+
+        patientB1.addAttributeValue( attributeValue );
+        patientService.updatePatient( patientB1 );
+
         assertEquals( 2, patientStore.getByPhoneNumber( "123456789", null, null ).size() );
     }
 

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/program/ProgramInstanceServiceTest.java'
--- dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/program/ProgramInstanceServiceTest.java	2013-11-19 03:45:56 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/program/ProgramInstanceServiceTest.java	2013-12-18 06:05:41 +0000
@@ -44,8 +44,12 @@
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.patient.Patient;
+import org.hisp.dhis.patient.PatientAttribute;
+import org.hisp.dhis.patient.PatientAttributeService;
 import org.hisp.dhis.patient.PatientReminder;
 import org.hisp.dhis.patient.PatientService;
+import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
+import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
 import org.hisp.dhis.period.PeriodType;
 import org.hisp.dhis.sms.config.BulkSmsGatewayConfig;
 import org.hisp.dhis.sms.config.SmsConfiguration;
@@ -81,6 +85,12 @@
     @Autowired
     private SmsConfigurationManager smsConfigurationManager;
 
+    @Autowired
+    private PatientAttributeService patientAttributeService;
+
+    @Autowired
+    private PatientAttributeValueService patientAttributeValueService;
+
     private Date incidenDate;
 
     private Date enrollmentDate;
@@ -553,6 +563,18 @@
     @Test
     public void testSendMessages()
     {
+        PatientAttribute attribute = createPatientAttribute( 'A' );
+        attribute.setValueType( PatientAttribute.TYPE_PHONE_NUMBER );
+        patientAttributeService.savePatientAttribute( attribute );
+
+        PatientAttributeValue attributeValue = createPatientAttributeValue( 'A', patientA,
+            attribute );
+        attributeValue.setValue( "123456789" );
+        patientAttributeValueService.savePatientAttributeValue( attributeValue );
+
+        patientA.getAttributeValues().add( attributeValue );
+        patientService.updatePatient( patientA );
+
         programInstanceService.addProgramInstance( programInstanceA );
         Collection<OutboundSms> outboundSmsList = programInstanceService.sendMessages( programInstanceA,
             PatientReminder.SEND_WHEN_TO_C0MPLETED_EVENT, mockFormat );
@@ -572,7 +594,8 @@
         Collection<MessageConversation> messages = programInstanceService.sendMessageConversations( programInstanceA,
             PatientReminder.SEND_WHEN_TO_C0MPLETED_EVENT, mockFormat );
         assertEquals( 1, messages.size() );
-        assertEquals( "Test program message template NameA", messages.iterator().next().getMessages().get( 0 ).getText() );
+        assertEquals( "Test program message template NameA", messages.iterator().next().getMessages().get( 0 )
+            .getText() );
     }
 
     @Test

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/program/ProgramStageInstanceServiceTest.java'
--- dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/program/ProgramStageInstanceServiceTest.java	2013-11-19 06:51:39 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/program/ProgramStageInstanceServiceTest.java	2013-12-18 06:05:41 +0000
@@ -49,8 +49,12 @@
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.patient.Patient;
+import org.hisp.dhis.patient.PatientAttribute;
+import org.hisp.dhis.patient.PatientAttributeService;
 import org.hisp.dhis.patient.PatientReminder;
 import org.hisp.dhis.patient.PatientService;
+import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
+import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
 import org.hisp.dhis.period.PeriodType;
 import org.hisp.dhis.sms.config.BulkSmsGatewayConfig;
 import org.hisp.dhis.sms.config.SmsConfiguration;
@@ -94,6 +98,12 @@
     @Autowired
     private SmsConfigurationManager smsConfigurationManager;
 
+    @Autowired
+    private PatientAttributeService patientAttributeService;
+
+    @Autowired
+    private PatientAttributeValueService patientAttributeValueService;
+
     private OrganisationUnit organisationUnitA;
 
     private OrganisationUnit organisationUnitB;
@@ -165,6 +175,17 @@
         patientB = createPatient( 'B', organisationUnitB );
         patientService.savePatient( patientB );
 
+        PatientAttribute attribute = createPatientAttribute( 'A' );
+        attribute.setValueType( PatientAttribute.TYPE_PHONE_NUMBER );
+        patientAttributeService.savePatientAttribute( attribute );
+
+        PatientAttributeValue attributeValue = createPatientAttributeValue( 'A', patientA, attribute );
+        attributeValue.setValue( "123456789" );
+        patientAttributeValueService.savePatientAttributeValue( attributeValue );
+
+        patientA.getAttributeValues().add( attributeValue );
+        patientService.updatePatient( patientA );
+
         /**
          * Program A
          */

=== modified file 'dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java'
--- dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java	2013-12-16 04:27:26 +0000
+++ dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java	2013-12-18 06:05:41 +0000
@@ -1005,7 +1005,6 @@
         patient.setAutoFields();
 
         patient.setName( "Name" + uniqueChar );
-        patient.setPhoneNumber( "123456789" );
         patient.setOrganisationUnit( organisationUnit );
 
         return patient;

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/AddPatientAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/AddPatientAction.java	2013-12-16 04:27:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/AddPatientAction.java	2013-12-18 06:05:41 +0000
@@ -54,7 +54,6 @@
 import org.hisp.dhis.relationship.RelationshipService;
 import org.hisp.dhis.relationship.RelationshipType;
 import org.hisp.dhis.relationship.RelationshipTypeService;
-import org.hisp.dhis.setting.SystemSettingManager;
 import org.hisp.dhis.user.UserService;
 
 import com.opensymphony.xwork2.Action;
@@ -86,8 +85,6 @@
 
     private UserService userService;
 
-    private SystemSettingManager systemSettingManager;
-
     private RelationshipTypeService relationshipTypeService;
 
     private RelationshipService relationshipService;
@@ -98,8 +95,6 @@
 
     private String fullName;
 
-    private String[] phoneNumber;
-
     private boolean underAge;
 
     private Integer representativeId;
@@ -132,25 +127,6 @@
         // Set Other information for patient
         // ---------------------------------------------------------------------
 
-        String phone = "";
-
-        if ( phoneNumber != null )
-        {
-            for ( String _phoneNumber : phoneNumber )
-            {
-                _phoneNumber = (_phoneNumber != null && _phoneNumber.isEmpty() && _phoneNumber.trim().equals(
-                    systemSettingManager.getSystemSetting( SystemSettingManager.KEY_PHONE_NUMBER_AREA_CODE ) )) ? null
-                    : _phoneNumber;
-                if ( _phoneNumber != null )
-                {
-                    phone += _phoneNumber + ";";
-                }
-            }
-
-            phone = (phone.isEmpty()) ? null : phone.substring( 0, phone.length() - 1 );
-            patient.setPhoneNumber( phone );
-        }
-
         if ( healthWorker != null )
         {
             patient.setAssociate( userService.getUser( healthWorker ) );
@@ -328,11 +304,6 @@
         this.relationshipService = relationshipService;
     }
 
-    public void setSystemSettingManager( SystemSettingManager systemSettingManager )
-    {
-        this.systemSettingManager = systemSettingManager;
-    }
-
     public String getMessage()
     {
         return message;
@@ -368,11 +339,6 @@
         this.fullName = fullName;
     }
 
-    public void setPhoneNumber( String[] phoneNumber )
-    {
-        this.phoneNumber = phoneNumber;
-    }
-
     public void setPatientAttributeOptionService( PatientAttributeOptionService patientAttributeOptionService )
     {
         this.patientAttributeOptionService = patientAttributeOptionService;

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/UpdatePatientAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/UpdatePatientAction.java	2013-12-16 04:27:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/UpdatePatientAction.java	2013-12-18 06:05:41 +0000
@@ -79,13 +79,6 @@
 
     private UserService userService;
 
-    private SystemSettingManager systemSettingManager;
-
-    public void setSystemSettingManager( SystemSettingManager systemSettingManager )
-    {
-        this.systemSettingManager = systemSettingManager;
-    }
-
     // -------------------------------------------------------------------------
     // Input
     // -------------------------------------------------------------------------
@@ -94,8 +87,6 @@
 
     private String fullName;
 
-    private String[] phoneNumber;
-
     private Integer representativeId;
 
     private Integer relationshipTypeId;
@@ -128,24 +119,6 @@
         // Set Other information for patient
         // ---------------------------------------------------------------------
 
-        String phone = "";
-        if ( phoneNumber != null )
-        {
-            for ( String _phoneNumber : phoneNumber )
-            {
-                _phoneNumber = (_phoneNumber != null && _phoneNumber.isEmpty() && _phoneNumber.trim().equals(
-                    systemSettingManager.getSystemSetting( SystemSettingManager.KEY_PHONE_NUMBER_AREA_CODE ) )) ? null
-                    : _phoneNumber;
-                if ( _phoneNumber != null )
-                {
-                    phone += _phoneNumber + ";";
-                }
-            }
-
-            phone = (phone.isEmpty()) ? null : phone.substring( 0, phone.length() - 1 );
-            patient.setPhoneNumber( phone );
-        }
-
         if ( healthWorker != null )
         {
             patient.setAssociate( userService.getUser( healthWorker ) );
@@ -323,11 +296,6 @@
         this.fullName = fullName;
     }
 
-    public void setPhoneNumber( String[] phoneNumber )
-    {
-        this.phoneNumber = phoneNumber;
-    }
-
     public Patient getPatient()
     {
         return patient;

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2013-12-16 04:27:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2013-12-18 06:05:41 +0000
@@ -465,7 +465,6 @@
 		<property name="patientAttributeOptionService"
 			ref="org.hisp.dhis.patient.PatientAttributeOptionService" />
 		<property name="userService" ref="org.hisp.dhis.user.UserService" />
-		<property name="systemSettingManager" ref="org.hisp.dhis.setting.SystemSettingManager" />
 		<property name="relationshipService"
 			ref="org.hisp.dhis.relationship.RelationshipService" />
 		<property name="relationshipTypeService"
@@ -495,7 +494,6 @@
 		<property name="patientAttributeOptionService"
 			ref="org.hisp.dhis.patient.PatientAttributeOptionService" />
 		<property name="userService" ref="org.hisp.dhis.user.UserService" />
-		<property name="systemSettingManager" ref="org.hisp.dhis.setting.SystemSettingManager" />
 	</bean>
 
 	<bean id="org.hisp.dhis.caseentry.action.patient.ShowAddPatientFormAction"

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanRecords.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanRecords.vm	2013-11-25 08:18:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanRecords.vm	2013-12-18 06:05:41 +0000
@@ -19,7 +19,6 @@
 			
 			#if( $auth.hasAccess( "dhis-web-caseentry", "accessPatientAttributes" ) )
 				<th>$i18n.getString('full_name')</th>
-				<th>$i18n.getString('phone_number')</th>
 				#foreach( $patientAttribute in $patientAttributes)
 				<th>$patientAttribute.displayName</th>
 				#end
@@ -74,8 +73,6 @@
 				$value
 			</a></td>
 			
-			<td>$!patient.phoneNumber</td>
-			
 			#set( $attributeValues = $patientAttributeValueMap.get($programStageInstance.programInstance.patient.id))
 			#foreach( $attributeValue in $attributeValues)
 				<td>$attributeValue</td>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanSelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanSelect.vm	2013-09-20 15:13:05 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanSelect.vm	2013-12-18 06:05:41 +0000
@@ -175,9 +175,6 @@
 	var i18n_confirm_remove_empty_events = '$encoder.jsEscape( $i18n.getString( "confirm_remove_empty_events" ) , "'")';
 	var i18n_report_date = '$encoder.jsEscape( $i18n.getString( "report_date" ) , "'")';
 	
-	var i18n_male = '$encoder.jsEscape( $i18n.getString( "male" ) , "'")';
-	var i18n_female = '$encoder.jsEscape( $i18n.getString( "female" ) , "'")';
-	var i18n_transgender = '$encoder.jsEscape( $i18n.getString( "transgender" ) , "'")';
 	var i18n_yes = '$encoder.jsEscape( $i18n.getString( "yes" ) , "'")';
 	var i18n_no = '$encoder.jsEscape( $i18n.getString( "no" ) , "'")';
 	var i18n_specify_search_criteria = '$encoder.jsEscape( $i18n.getString( "specify_search_criteria" ) , "'")';

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm	2013-11-25 08:18:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm	2013-12-18 06:05:41 +0000
@@ -1,10 +1,7 @@
 <script>
-	
 	jQuery(document).ready(	function(){
-
 		currentDiv = 'patientForm';
 		checkedDuplicate = false;
-		
 		jQuery("#patientForm").validate({
 				 meta:"validate"
 				,errorElement:"span"
@@ -18,29 +15,8 @@
 							addPatient(programId, false, isContinue);
 						#end
 					}
-				,beforeValidateHandler: function(form)
-					{
-						var dobType = $('#patientForm [id=dobType]').val();
-						
-						if( dobType=='V' || dobType=='D' ) 
-						{
-							var birthDate = $('#patientForm [id=birthDate]').val();
-							if( birthDate != '' ){
-								$("#patientForm [id=memberValidator]").val(birthDate);
-							}
-						}else{
-							var age = $('#patientForm [id=age]').val();
-							$("#patientForm [id=memberValidator]").val(age);
-						}
-					}
 			});
 		
-		#if($!customRegistrationForm)
-		#else
-			datePickerValid( 'patientForm [id=registrationDate]', true );
-			datePickerValid( 'patientForm [id=birthDate]' );
-			datePickerValid( 'patientForm [id=deathDate]', false );
-		#end
 		addEventForPatientForm( 'patientForm' );
 	});	
 	

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addRelationshipForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addRelationshipForm.vm	2013-11-25 08:18:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addRelationshipForm.vm	2013-12-18 06:05:41 +0000
@@ -27,27 +27,6 @@
 
 <table>
 	<tr>
-		<td class='information'>
-			<table>
-				<tr align='justify'>
-					<td colspan='2'>$!patient.name
-						#if($patient.gender=='F')
-							<img src='images/female_small.png'>
-						#else
-							<img src='images/male_small.png'>
-						#end
-					</td>
-				</tr>
-				<tr>
-					<td>$i18n.getString('date_of_birth'):</td>
-					<td>$!format.formatDate($!patient.birthDate)</td>
-				</tr>
-				<tr>
-					<td>$i18n.getString('age'):</td>
-					<td>$!patient.getAge()</td>
-				</tr>
-			</table>
-		</td>
 		
     <td class='information'>
         <table>  

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addSingleEventRegistration.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addSingleEventRegistration.vm	2013-04-04 06:01:50 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addSingleEventRegistration.vm	2013-12-18 06:05:41 +0000
@@ -1,7 +1,5 @@
 <script>
-	
 	jQuery("#singleEventForm").ready(	function(){
-
 		currentDiv = 'patientForm';
 		checkedDuplicate = false;
 		
@@ -12,27 +10,8 @@
 					{
 						validateAddPatient();
 					}
-				,beforeValidateHandler: function(form)
-					{
-						var dobType = $('#patientForm [id=dobType]').val();
-						
-						if( dobType=='V' || dobType=='D' ) 
-						{
-							var birthDate = $('#patientForm [id=birthDate]').val();
-							if( birthDate != '' ){
-								$("#patientForm [id=memberValidator]").val(birthDate);
-							}
-						}else{
-							var age = $('#patientForm [id=age]').val();
-							$("#patientForm [id=memberValidator]").val(age);
-						}
-					}
 			});
-		#if($!customRegistrationForm)
-		#else
-			datePickerValid( 'patientForm [id=registrationDate]', true );
-			datePickerValid( 'patientForm [id=birthDate]' );
-		#end
+		
 		addEventForPatientForm( 'patientForm' );
 	});	
 	

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm	2013-10-16 12:48:29 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm	2013-12-18 06:05:41 +0000
@@ -209,9 +209,6 @@
 	var i18n_confirm_remove_empty_events = '$encoder.jsEscape( $i18n.getString( "confirm_remove_empty_events" ) , "'")';
 	var i18n_report_date = '$encoder.jsEscape( $i18n.getString( "report_date" ) , "'")';
 
-	var i18n_male = '$encoder.jsEscape( $i18n.getString( "male" ) , "'")';
-	var i18n_female = '$encoder.jsEscape( $i18n.getString( "female" ) , "'")';
-	var i18n_transgender = '$encoder.jsEscape( $i18n.getString( "transgender" ) , "'")';
 	var i18n_yes = '$encoder.jsEscape( $i18n.getString( "yes" ) , "'")';
 	var i18n_no = '$encoder.jsEscape( $i18n.getString( "no" ) , "'")';
 	var i18n_specify_search_criteria = '$encoder.jsEscape( $i18n.getString( "specify_search_criteria" ) , "'")';

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataRecordingSelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataRecordingSelect.vm	2013-09-23 03:15:40 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataRecordingSelect.vm	2013-12-18 06:05:41 +0000
@@ -9,19 +9,6 @@
 				<td class="bold">$i18n.getString( "full_name" ):</td>
 				<td>$!encoder.htmlEncode( $patient.name )<td>
 			</tr>
-			<tr>
-				<td class="bold">$i18n.getString( "gender" ):</td>
-				<td>#if($patient.gender=='F')
-						<img src='images/female_small.png'>
-					#else
-						<img src='images/male_small.png'>
-					#end
-				</td>
-			</tr>
-			<tr>
-				<td class="bold">$i18n.getString( "date_of_birth" ):</td>
-				<td>$format.formatDate( $patient.birthDate ) ($patient.getAge())<td>
-			</tr>
 		#else
 			#set($value="")
 			#foreach( $identifier in $patient.identifiers)

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataentryRecords.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataentryRecords.vm	2013-11-25 08:18:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataentryRecords.vm	2013-12-18 06:05:41 +0000
@@ -31,7 +31,6 @@
 			
 			#if( $auth.hasAccess( "dhis-web-caseentry", "accessPatientAttributes" ) )
 			<th>$i18n.getString('full_name')</th>
-			<th>$i18n.getString('phone_number')</th>
 			#else
 			<th>$i18n.getString('system_identifier')</th>
 			#end
@@ -75,8 +74,6 @@
 				$value
 			</a></td>
 			
-			<td>$!patient.phoneNumber</td>
-			
 			#else
 				#set($value="")
 				#foreach( $identifier in $patient.identifiers)

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/defaultPatientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/defaultPatientForm.vm	2013-11-25 07:31:02 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/defaultPatientForm.vm	2013-12-18 06:05:41 +0000
@@ -19,52 +19,6 @@
 	</tr>
 #end
 
-#if($patientRegistrationForm.fixedAttributes.contains( 'gender' ))
-	<tr>
-		<td class='text-column'><label for="gender">$i18n.getString( "gender" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
-		<td class="input-column">
-			<select id="gender" name="gender">
-				<option value="M" #if( $!patient.gender == 'M' ) selected="selected" #end>$i18n.getString( "male" )</option>
-				<option value="F" #if( $!patient.gender == 'F' ) selected="selected" #end>$i18n.getString( "female" )</option>
-				<option value="T" #if( $!patient.gender == 'T' ) selected="selected" #end>$i18n.getString( "transgender" )</option>
-			</select>
-		</td>					
-	</tr>
-#end
-
-<tr>
-	<td class='text-column' ><label for="birthDate">$i18n.getString( "date_of_birth" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
-	<td class="input-column">
-		<select id='dobType' name="dobType" style='width:120px' onchange='dobTypeOnChange("patientForm")' >
-			<option value="V" #if($patient.dobType=='V') selected #end >$i18n.getString( "verified" )</option>
-			<option value="D" #if($patient.dobType=='D') selected #end >$i18n.getString( "declared" )</option>
-			<option value="A" #if($patient.dobType=='A') selected #end >$i18n.getString( "approximated" )</option>
-		</select>
-		#if($patientRegistrationForm.fixedAttributes.contains( 'birthDate' ))
-			<input type="text" id="birthDate" name="birthDate" value='$!format.formatDate($!patient.birthDate)' style='width:136px;' />
-		#else
-			<input type="text" id="age" name="age" placeholder="$i18n.getString('enter_age_in_years')" value='$!patient.getIntegerValueOfAge()' class="{validate:{number:true}}" style='width:136px;' />
-		#end
-	</td>
-</tr>
-
-<tr>
-	<td></td>
-	<td class="input-column">
-		<input id="memberValidator" class="hidden {validate:{required:true}}"/>
-	</td>
-</tr>
-	
-#if($patientRegistrationForm.fixedAttributes.contains( 'phoneNumber' ))
-	<tr>
-		<td class='text-column'><label for="phoneNumber">$i18n.getString( "phone_number" )</label></td>
-		<td class="input-column">
-			<input type="text" id="phoneNumber" name="phoneNumber" class="{validate:{phone:true}}"/>
-			<input type="button" value='+' style='width:20px;' onclick='addPhoneNumberField("$!phoneNumberAreaCode");' />
-		</td>
-	</tr>
-#end
-
 #if($patientRegistrationForm.fixedAttributes.contains( 'healthWorker' ))
 	<tr>
 		<td class='text-column'><label for="healthWorker">$i18n.getString( "health_worker" )</label></td>
@@ -79,44 +33,6 @@
 	</tr>
 #end
 
-<!-- UNDERAGE -->
-
-#if($!patient.underAge)
-	#set( $representative = $!patient.representative ) 
-	<tr id="representativeFormDiv" name="representativeFormDiv">
-		<td class='text-column'>$i18n.getString("guardian")</td>
-		<td> 
-			$!patient.representative.name <img src="../images/information.png" alt="$i18n.getString( 'show_details' )" onclick='showRepresentativeInfo()' class='img-button'>
-		</td>
-	</tr>
-#else
-	<tr id="underAgeDiv" name="underAgeDiv">
-		<td class='text-column'>$i18n.getString("has_guardian")</td>
-		<td>
-			<input type="checkbox" name="underAge" id="underAge" onclick="toggleUnderAge(this);" value="true" #if($!patient.underAge == "true") checked="checked" #end/>
-		</td>
-	</tr>
-#end
-
-<!-- DEAD -->
-#if($patientRegistrationForm.fixedAttributes.contains( 'isDead' ))
-	<tr id="deathCheckboxTR">
-		<td class='text-column'>$i18n.getString("is_dead")</td>
-		<td>
-			<input type="checkbox" name="isDead" id="isDead" value="true" #if($!patient.isDead) checked="checked" #end onchange='isDeathOnChange();'/>
-		</td>
-	</tr>
-#end
-
-#if($patientRegistrationForm.fixedAttributes.contains( 'deathDate' ))
-	<tr id='deathDateTR' #if($!patient.isDead) #else class="hidden" #end>
-		<td class='text-column'><label for="deathDate">$i18n.getString("death_date")</label></td>
-		<td class="input-column">
-			<input type="text" name="deathDate" id="deathDate" #if($!patient.deathDate) value="$format.formatDate( $!patient.deathDate )" #end>
-		</td>
-	</tr>
-#end
-
 <tr>
 	<td></td>
 	<td><input type="button" class='button' id='checkDuplicateBtn' name='checkDuplicateBtn' value="$i18n.getString('check_duplicate')" /></td>
@@ -210,24 +126,3 @@
 		<script>datePickerValid( 'enrollmentDate', true );</script>
 	#end
 #end
-
-<script>
-	#if($!patient.dobType && $!patient.dobType=='A') 
-		showById('age');
-		hideById('birthDate');
-	#else
-		hideById('age');
-		showById('birthDate');
-	#end
-	
-	#if( $!patient.phoneNumber && $patient.phoneNumber!="")
-		var phoneNumbers = "$!patient.phoneNumber".split(';');
-		setFieldValue('phoneNumber',phoneNumbers[0]);
-		for( var i = 1;i<phoneNumbers.length;i++ )
-		{
-			addPhoneNumberField(phoneNumbers[i]);
-		}
-	#else 
-		setFieldValue('phoneNumber',"$!phoneNumberAreaCode")
-	#end
-</script>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/detailsPartner.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/detailsPartner.vm	2013-09-23 03:15:40 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/detailsPartner.vm	2013-12-18 06:05:41 +0000
@@ -10,30 +10,6 @@
 	</tr>
 	#end
 	
-	#if($partner.gender)
-	<tr>
-		<td>$i18n.getString( "gender" )</td>
-		<td>: $i18n.getString($partner.gender)</td>
-	</tr>
-	#end
-	
-	#if($partner.birthDate)
-	<tr>
-		<td>$i18n.getString( "date_of_birth" )</td>
-		<td>: $format.formatDate( $partner.birthDate )</td>
-	</tr>
-	
-	<tr>
-		<td>$i18n.getString( "age" )</td>
-		<td>: $partner.getAge()</td>
-	</tr>
-	#end
-	
-	<tr>
-		<td>$i18n.getString( "phone_number" )</td>
-		<td>: $!patient.phoneNumber</td>
-	</tr>
-	
 	<tr><td>&nbsp;</td></tr>
 	<tr>
 		<td><label class="bold">$i18n.getString( "identifiers" )</td>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2013-10-25 05:00:41 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2013-12-18 06:05:41 +0000
@@ -91,30 +91,9 @@
     $('#dateOperator_' + container).remove();
     $('#searchText_' + container).val("");
 
-	if( attributeId == 'fixedAttr_birthDate' || valueType=='date')
-	{
-		element.replaceWith( getDateField( container ) );
-		datePickerValid( 'searchText_' + container );
-		return;
-	}
-	
 	$( '#searchText_' + container ).datepicker("destroy");
 	$('#' + container + ' [id=dateOperator]').replaceWith("");
-	if ( attributeId=='fixedAttr_gender' )
-	{
-		element.replaceWith( getGenderSelector() );
-	}
-	else if ( attributeId=='fixedAttr_age' )
-	{
-		element.replaceWith( getAgeTextBox() );
-	}
-	else if ( attributeId=='fixedAttr_registrationDate' ||
-		attributeId=='pi_enrollmentDate' )
-	{
-		element.replaceWith( getRegistrationDate(container) );
-		datePickerValid( 'searchText_' + container );
-	}
-	else if ( valueType=='bool' )
+	if ( valueType=='bool' )
 	{
 		element.replaceWith( getTrueFalseBox() );
 	}
@@ -132,37 +111,6 @@
 	trueFalseBox += '</select>';
 	return trueFalseBox;
 }
-	
-function getGenderSelector()
-{
-	var genderSelector = '<select id="searchText" name="searchText" style="width:200px;">';
-		genderSelector += '<option value="M">' + i18n_male + '</option>';
-		genderSelector += '<option value="F">' + i18n_female + '</option>';
-		genderSelector += '<option value="T">' + i18n_transgender + '</option>';
-		genderSelector += '</select>';
-	return genderSelector;
-}
-
-function getAgeTextBox( container )
-{
-	var ageField = '<select id="dateOperator" name="dateOperator" style="width:40px"><option value=">"> > </option><option value=">="> >= </option><option value="="> = </option><option value="<"> < </option><option value="<="> <= </option></select>';
-	ageField += '<input type="text" id="searchText_' + container + '" name="searchText" style="width:160px;">';
-	return ageField;
-}
-
-function getRegistrationDate( container )
-{
-	var registrationDateField = '<select id="dateOperator" name="dateOperator" style="width:40px"><option value=">"> > </option><option value=">="> >= </option><option value="="> = </option><option value="<"> < </option><option value="<="> <= </option></select>';
-	registrationDateField += '<input type="text" id="searchText_' + container + '" name="searchText" style="width:160px;">';
-	return registrationDateField;
-}
-
-function getDateField( container )
-{
-	var dateField = '<select id="dateOperator_' + container + '" name="dateOperator" style="width:40px"><option value=">"> > </option><option value=">="> >= </option><option value="="> = </option><option value="<"> < </option><option value="<="> <= </option></select>';
-	dateField += '<input type="text" id="searchText_' + container + '" name="searchText" style="width:160px;" onkeyup="searchPatientsOnKeyUp( event );">';
-	return dateField;
-}
 
 //-----------------------------------------------------------------------------
 // Search Patient
@@ -439,11 +387,7 @@
 {
 	$.postUTF8( 'validatePatient.action', {
         id: $( '#' + divname + ' [id=id]' ).val(),
-        fullName: $( '#' + divname + ' [id=fullName]' ).val(),
-        dobType: $( '#' + divname + ' [id=dobType]' ).val(),
-        gender: $( '#' + divname + ' [id=gender]' ).val(),
-        birthDate: $( '#' + divname + ' [id=birthDate]' ).val(),
-        age: $( '#' + divname + ' [id=age]' ).val()
+        fullName: $( '#' + divname + ' [id=fullName]' ).val()
     }, function( xmlObject, divname ) {
         checkDuplicateCompleted( xmlObject, divname );
     });
@@ -1098,10 +1042,6 @@
 			sPatient += "<hr style='margin:5px 0px;'><table>";
 			sPatient += "<tr><td class='bold'>" + i18n_patient_system_id + "</td><td>" + $(patient).find('systemIdentifier').text() + "</td></tr>" ;
 			sPatient += "<tr><td class='bold'>" + i18n_patient_full_name + "</td><td>" + $(patient).find('fullName').text() + "</td></tr>" ;
-			sPatient += "<tr><td class='bold'>" + i18n_patient_gender + "</td><td>" + $(patient).find('gender').text() + "</td></tr>" ;
-			sPatient += "<tr><td class='bold'>" + i18n_patient_date_of_birth + "</td><td>" + $(patient).find('dateOfBirth').text() + "</td></tr>" ;
-			sPatient += "<tr><td class='bold'>" + i18n_patient_age + "</td><td>" + $(patient).find('age').text() + "</td></tr>" ;
-			sPatient += "<tr><td class='bold'>" + i18n_patient_phone_number + "</td><td>" + $(patient).find('phoneNumber').text() + "</td></tr>";
         	
 			var identifiers = $(patient).find('identifier');
 
@@ -2187,40 +2127,6 @@
     });
 }
 
-function addPhoneNumberField(phoneNumberAreaCode)
-{	
-	$('.phoneNumberTR').last().after(
-		'<tr class="phoneNumberTR">'
-		+ '	<td></td>'
-		+ '	<td class="input-column">'
-		+ '		<input type="text" id="phoneNumber" name="phoneNumber" class="{validate:{phone:true}}" value="'+phoneNumberAreaCode+'"/>'
-		+ '		<input type="button" value="-" onclick="removePhoneNumberField(this)" style="width:20px;" />'
-		+ '	</td>'
-		+ '</tr>' );
-}
-
-function removePhoneNumberField(_this)
-{
-	$(_this).parent().parent().remove();
-}
-
-function addCustomPhoneNumberField( phoneNumber )
-{
-	if(phoneNumber=='')
-	{
-		phoneNumber = phoneNumberAreaCode;
-	}
-	var idx = $('.phoneNumberTR').length + 1;
-	$('.phoneNumberTR').last().after(
-		'<br/><input type="text" id="phoneNumber" name="phoneNumber" class="idxPhoneNumber' + idx + ' {validate:{phone:true}}" value=\"' + phoneNumber + '\" />'
-		+ '    <input type="button" value="-" class="phoneNumberTR idxPhoneNumber' + idx + '" onclick="removeCustomPhoneNumberField(' + idx + ')" style="width:20px;" />');
-}
-
-function removeCustomPhoneNumberField(idx)
-{
-	$('.idxPhoneNumber' + idx).remove();
-}
-
 // --------------------------------------------------------------------------
 // Advanced-search person
 // --------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js	2013-10-23 12:24:18 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js	2013-12-18 06:05:41 +0000
@@ -205,10 +205,6 @@
 			sPatient += "<hr style='margin:5px 0px;'><table>";
 			sPatient += "<tr><td class='bold'>" + i18n_patient_system_id + "</td><td>" + jQuery(patient).find('systemIdentifier').text() + "</td></tr>" ;
 			sPatient += "<tr><td class='bold'>" + i18n_patient_full_name + "</td><td>" + jQuery(patient).find('fullName').text() + "</td></tr>" ;
-			sPatient += "<tr><td class='bold'>" + i18n_patient_gender + "</td><td>" + jQuery(patient).find('gender').text() + "</td></tr>" ;
-			sPatient += "<tr><td class='bold'>" + i18n_patient_date_of_birth + "</td><td>" + jQuery(patient).find('dateOfBirth').text() + "</td></tr>" ;
-			sPatient += "<tr><td class='bold'>" + i18n_patient_age + "</td><td>" + jQuery(patient).find('age').text() + "</td></tr>" ;
-			sPatient += "<tr><td class='bold'>" + i18n_patient_phone_number + "</td><td>" + jQuery(patient).find('phoneNumber').text() + "</td></tr>";
         	
 			var identifiers = jQuery(patient).find('identifier');
         	if( identifiers.length > 0 )

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/underage.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/underage.js	2013-10-23 12:24:18 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/underage.js	2013-12-18 06:05:41 +0000
@@ -6,12 +6,7 @@
 {	
 	$.postUTF8("validatePatient.action?" + getIdentifierTypeIdParams(),
 		{
-			fullName: jQuery( '#addRepresentativeForm [id=fullName]' ).val(),
-			gender: jQuery( '#addRepresentativeForm [id=gender]' ).val(),
-			birthDate: jQuery( '#addRepresentativeForm [id=birthDate]' ).val(), 	        
-			age: jQuery( '#addRepresentativeForm [id=age]' ).val(),
-			dobType: jQuery( '#addRepresentativeForm [id=dobType]' ).val(),
-			ageType: jQuery( '#addRepresentativeForm [id=ageType]' ).val()
+			fullName: jQuery( '#addRepresentativeForm [id=fullName]' ).val()
 		}, addValidationRepresentativeCompleted, "xml" );
 }
 
@@ -109,10 +104,6 @@
 		sPatient += "<hr style='margin:5px 0px;'><table>";
 		sPatient += "<tr><td class='bold'>" + i18n_patient_system_id + "</td><td>" + $( patient ).find('systemIdentifier').text() + "</td></tr>" ;
 		sPatient += "<tr><td class='bold'>" + i18n_patient_full_name + "</td><td>" + $( patient ).find('fullName').text() + "</td></tr>" ;
-		sPatient += "<tr><td class='bold'>" + i18n_patient_gender + "</td><td>" + $( patient ).find('gender').text() + "</td></tr>" ;
-		sPatient += "<tr><td class='bold'>" + i18n_patient_date_of_birth + "</td><td>" + $( patient ).find('dateOfBirth').text() + "</td></tr>" ;
-		sPatient += "<tr><td class='bold'>" + i18n_patient_age + "</td><td>" + $( patient ).find('age').text() + "</td></tr>" ;
-		sPatient += "<tr><td class='bold'>" + i18n_patient_phone_number + "</td><td>" + $( patient ).find('phoneNumber').text() + "</td></tr>";
 		
 		var identifiers =  $( patient ).find('identifier');
 		$( identifiers ).each( function( i, identifier )

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/listPatient.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/listPatient.vm	2013-09-23 03:15:40 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/listPatient.vm	2013-12-18 06:05:41 +0000
@@ -50,10 +50,6 @@
 			#if( $identifierTypes.size()==0 )
 				<th>$i18n.getString( "full_name" )</th>          
 			#end       
-			<th>$i18n.getString( "gender" )</th>
-			<th>$i18n.getString( "date_of_birth" )</th>
-			<th>$i18n.getString( "age" )</th> 
-			<th class="{sorter: false}">$i18n.getString( "phone_number" )</th>  
 		#else
 			<th>$i18n.getString('system_identifier')</th>
 		#end
@@ -88,16 +84,6 @@
 				<td style="cursor:pointer;" onclick="javascript:showUpdatePatientForm('$patient.id');">
 					<a>$encoder.htmlEncode($value)</a>
 				</td>
-				<td>			
-					$i18n.getString( $patient.gender )
-				</td>
-				<td>			
-					$format.formatDate( $patient.birthDate )
-				</td>
-				<td>            
-					$encoder.htmlEncode( $patient.getAge() )
-				</td>
-				<td>$!patient.phoneNumber</td>
 			#else
 				#set($value="")
 				#foreach( $identifier in $patient.identifiers)

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/multiDataEntrySelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/multiDataEntrySelect.vm	2013-10-15 17:20:40 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/multiDataEntrySelect.vm	2013-12-18 06:05:41 +0000
@@ -75,9 +75,6 @@
 	
 	var i18n_id = '$encoder.jsEscape( $i18n.getString( "id" ), "'")';
 	var i18n_full_name = '$encoder.jsEscape( $i18n.getString( "full_name" ), "'")';
-	var i18n_gender = '$encoder.jsEscape( $i18n.getString( "gender" ), "'")';
-	var i18n_dob_type = '$encoder.jsEscape( $i18n.getString( "dob_type" ), "'")';
-	var i18n_date_of_birth = '$encoder.jsEscape( $i18n.getString( "date_of_birth" ), "'")';
 	var i18n_none = '$encoder.jsEscape( $i18n.getString( "none" ), "'")';
 	var i18n_show_all_items = '$encoder.jsEscape( $i18n.getString( "show_all_items" ) , "'")';
 	var i18n_program_stage = '$encoder.jsEscape( $i18n.getString( "program_stage" ) , "'")';

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm	2013-11-25 08:18:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm	2013-12-18 06:05:41 +0000
@@ -30,33 +30,6 @@
 					<td>$i18n.getString("location")</td>
 					<td>$encoder.htmlEncode($!patient.organisationUnit.name)</td>
 				</tr>
-				#if( $!patient.gender )
-				<tr>
-					<td>$i18n.getString("gender")</td>
-					<td>#if($patient.gender=='F')
-							<img src='images/female_small.png'>
-						#else
-							<img src='images/male_small.png'>
-						#end
-					</td>
-				</tr>
-				#end
-				#if( $!patient.birthDate )
-				<tr>
-					<td>$i18n.getString("date_of_birth")</td>
-					<td>$format.formatDate( $!patient.birthDate) ($!patient.getAge())</td>
-				</tr>
-				#end
-				<tr>
-					<td>$i18n.getString("phone_number")</td>
-					<td>
-						#if($!patient.phoneNumber && $!patient.phoneNumber!='')
-							$!patient.phoneNumber
-						#else
-							[$i18n.getString('none')]
-						#end
-					</td>
-				</tr>
 				
 				<tr>
 					<td>$i18n.getString("health_worker")</td>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm	2013-11-28 09:42:33 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm	2013-12-18 06:05:41 +0000
@@ -1,6 +1,3 @@
-<script>
-	var phoneNumberAreaCode =  '$!encoder.jsEscape( $phoneNumberAreaCode , "'" )';
-</script>
 
 #if($!customRegistrationForm)
 	$customRegistrationForm
@@ -33,45 +30,6 @@
 	</tr>
 
 	<tr name='propertiesField'>
-		<td class='text-column'><label for="gender">$i18n.getString( "gender" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
-		<td class="input-column">
-			<select id="gender" name="gender">
-				<option value="M" #if( $!patient.gender == 'M' ) selected="selected" #end>$i18n.getString( "male" )</option>
-				<option value="F" #if( $!patient.gender == 'F' ) selected="selected" #end>$i18n.getString( "female" )</option>
-				<option value="T" #if( $!patient.gender == 'T' ) selected="selected" #end>$i18n.getString( "transgender" )</option>
-			</select>
-		</td>					
-	</tr>
-
-	<tr name='propertiesField'>
-		<td class='text-column' ><label for="birthDate">$i18n.getString( "date_of_birth" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
-		<td class="input-column">
-			<select id='dobType' name="dobType" style='width:120px' onchange='dobTypeOnChange("patientForm")' >
-				<option value="V" #if($patient.dobType=='V') selected #end >$i18n.getString( "verified" )</option>
-				<option value="D" #if($patient.dobType=='D') selected #end >$i18n.getString( "declared" )</option>
-				<option value="A" #if($patient.dobType=='A') selected #end >$i18n.getString( "approximated" )</option>
-			</select>
-			<input type="text" id="birthDate" name="birthDate" value='$!format.formatDate($!patient.birthDate)' style='width:136px;' />
-			<input type="text" id="age" name="age" placeholder="$i18n.getString('enter_age_in_years')" value='$!patient.getIntegerValueOfAge()' class="{validate:{number:true}}" style='width:136px;' />
-		</td>
-	</tr>
-
-	<tr>
-		<td></td>
-		<td class="input-column">
-			<input id="memberValidator" class="hidden {validate:{required:true}}"/>
-		</td>
-	</tr>
-
-	<tr class='phoneNumberTR' name='propertiesField'>
-		<td class='text-column'><label for="phoneNumber">$i18n.getString( "phone_number" )</label></td>
-		<td class="input-column">
-			<input type="text" id="phoneNumber" name="phoneNumber" class="{validate:{phone:true}}"/>
-			<input type="button" value='+' style='width:20px;' onclick='addPhoneNumberField(phoneNumberAreaCode);' />
-		</td>
-	</tr>
-
-	<tr name='propertiesField'>
 		<td class='text-column'><label for="healthWorker">$i18n.getString( "health_worker" )</label></td>
 		<td class="input-column">
 			<select id="healthWorker" name="healthWorker">
@@ -82,42 +40,7 @@
 			</select>
 		</td>
 	</tr>
-
-	<!-- UNDERAGE -->
-
-	#if($!patient.underAge)
-		#set( $representative = $!patient.representative ) 
-		<tr id="representativeFormDiv" name='propertiesField'>
-			<td class='text-column'>$i18n.getString("guardian")</td>
-			<td> 
-				$!patient.representative.name <img src="../images/information.png" alt="$i18n.getString( 'show_details' )" onclick='showRepresentativeInfo()' class='img-button'>
-			</td>
-		</tr>
-	#else
-		<tr id="underAgeDiv" name="underAgeDiv">
-			<td class='text-column'>$i18n.getString("has_guardian")</td>
-			<td>
-				<input type="checkbox" name="underAge" id="underAge" onclick="toggleUnderAge(this);" value="true" #if($!patient.underAge == "true") checked="checked" #end/>
-			</td>
-		</tr>
-	#end
-
-	<!-- DEAD -->
-
-	<tr id="deathCheckboxTR" name='propertiesField'>
-		<td class='text-column'>$i18n.getString("is_dead")</td>
-		<td>
-			<input type="checkbox" name="isDead" id="isDead" value="true" #if($!patient.isDead) checked="checked" #end onchange='isDeathOnChange();'/>
-		</td>
-	</tr>
-
-	<tr id='deathDateTR' #if($!patient.isDead) #else class="hidden" #end name='propertiesField'>
-		<td class='text-column'><label for="deathDate">$i18n.getString("death_date")</label></td>
-		<td class="input-column">
-			<input type="text" name="deathDate" id="deathDate" #if($!patient.deathDate) value="$format.formatDate( $!patient.deathDate )" #end>
-		</td>
-	</tr>
-
+	
 	<tr>
 		<td></td>
 		<td><input type="button" class='button' id='checkDuplicateBtn' name='checkDuplicateBtn' value="$i18n.getString('check_duplicate')" /></td>
@@ -296,35 +219,4 @@
 	if(disableButtons){
 		jQuery('#patientForm .button').attr('disabled',true);
 	}
-
-	if(getFieldValue('dobType')=='A'){
-		showById('age');
-		hideById('birthDate');
-		setFieldValue('birthDate',"");
-	}
-	else{
-		hideById('age');
-		showById('birthDate');
-	}
-	
-	#if( $!patient.phoneNumber )
-		if(!addRelationship){
-			var phoneNumbers = '$!encoder.jsEscape( $patient.phoneNumber , "'" )'.split(";");
-			setFieldValue('phoneNumber',phoneNumbers[0]);
-			#if($!customRegistrationForm)
-				for( var i = 1;i<phoneNumbers.length;i++ )
-				{
-					addCustomPhoneNumberField(phoneNumbers[i]);
-				}
-			#elseif( $!patient.phoneNumber && $patient.phoneNumber!="")
-				for( var i = 1;i<phoneNumbers.length;i++ )
-				{
-					addPhoneNumberField(phoneNumbers[i]);
-				}
-			#end
-		}
-	#else
-		setFieldValue('phoneNumber',phoneNumberAreaCode)
-	#end
-	
 </script>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientLocation.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientLocation.vm	2013-11-25 08:18:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientLocation.vm	2013-12-18 06:05:41 +0000
@@ -40,24 +40,6 @@
 		<td>$value</td>
 	</tr>
 	#end
-	<tr>
-		<td>$i18n.getString('gender'):</td>
-		<td>
-			#if($patient.gender=='F')
-				<img src='images/female_small.png'>
-			#else
-				<img src='images/male_small.png'>
-			#end
-		</td>
-	</tr>
-	<tr>
-		<td>$i18n.getString('date_of_birth'):</td>
-		<td>$!format.formatDate($!patient.birthDate)</td>
-	</tr>
-	<tr>
-		<td>$i18n.getString('age'):</td>
-		<td>$!patient.getAge()</td>
-	</tr>
 </table>
 
 <form method='post'>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientRegistrationList.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientRegistrationList.vm	2013-11-25 08:18:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientRegistrationList.vm	2013-12-18 06:05:41 +0000
@@ -80,10 +80,6 @@
 					#if( $personDisplayName=='false' )
 						<th>$i18n.getString( "full_name" )</th>          
 					#end
-					<th>$i18n.getString( "gender" )</th>
-					<th>$i18n.getString( "date_of_birth" )</th> 
-					<th>$i18n.getString( "age" )</th>
-					<th>$i18n.getString( "phone_number" )</th>
 				#else
 					<th>$i18n.getString("system_identifier")</th>
 				#end
@@ -146,14 +142,6 @@
 					</td>
 				#end
 				
-				<td>#if($!patient.gender) $i18n.getString($!patient.gender) #end</td>
-				
-				<td>#if($!patient.birthDate) $format.formatDate( $!patient.birthDate) #end</td>
-				
-				<td>#if($!patient.birthDate) $!patient.getAge() #end</td>
-				
-				<td>$!patient.phoneNumber</td>
-				
 				#if($mapPatientOrgunit.size()!=0)
 					<td>$!mapPatientOrgunit.get($patient.id)</td>
 				#end
@@ -196,9 +184,6 @@
 	var i18n_patient_details_and_history = '$encoder.jsEscape( $i18n.getString( "patient_details_and_history" ) , "'" )';	
 	var i18n_id = '$encoder.jsEscape( $i18n.getString( "id" ), "'")';
 	var i18n_full_name = '$encoder.jsEscape( $i18n.getString( "full_name" ), "'")';
-	var i18n_gender = '$encoder.jsEscape( $i18n.getString( "gender" ), "'")';
-	var i18n_dob_type = '$encoder.jsEscape( $i18n.getString( "dob_type" ), "'")';
-	var i18n_date_of_birth = '$encoder.jsEscape( $i18n.getString( "date_of_birth" ), "'")';
 	var i18n_none = '$encoder.jsEscape( $i18n.getString( "none" ), "'")';
 	var i18n_select = '[' + '$encoder.jsEscape( $i18n.getString( "select" ), "'")' + ']';
 	var i18n_program_stages_history_plan = '$encoder.jsEscape( $i18n.getString( "program_stages_history_plan" ) , "'")';	

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm	2013-11-25 08:18:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm	2013-12-18 06:05:41 +0000
@@ -37,29 +37,6 @@
 				<td>$value</td>
 			</tr>
 			<tr>
-				<td>$i18n.getString("gender"):</td>
-				<td>#if($patient.gender=='F')
-						<img src='images/female_small.png'>
-					#else
-						<img src='images/male_small.png'>
-					#end
-				</td>
-			</tr>
-			<tr>
-				<td>$i18n.getString( "date_of_birth" ):</td>
-				<td>$format.formatDate( $programStageInstance.programInstance.patient.birthDate ) ( $programStageInstance.programInstance.patient.getAge() )</td>
-			</tr>
-			<tr>
-				<td>$i18n.getString("phone_number"):</td>
-				<td>
-					#if($!programStageInstance.programInstance.patient.phoneNumber && $!programStageInstance.programInstance.patient.phoneNumber!='')
-						$!programStageInstance.programInstance.patient.phoneNumber
-					#else
-						[$i18n.getString('none')]
-					#end
-				</td>
-			</tr>
-			<tr>
 				<td>$i18n.getString("health_worker"):</td>
 				<td>
 					#if($!programStageInstance.programInstance.patient.associate )
@@ -143,8 +120,14 @@
 					#set($patient=$!programInstance.patient)
 					
 					<select id='sendTo' name='sendTo' style='width:260px;'>
-					#if($!patient.phoneNumber)
-					<option value='1'>$i18n.getString('patient')</option>
+					#set($valueType='')
+					#foreach($attrValue in $!patient.attributeValues)
+						#if($attrValue.patientAttribute.valueType=='phoneNumber')
+							#set($valueType = $attrValue.patientAttribute.valueType )
+						#end
+					#end
+					#if($valueType!='')
+						<option value='1'>$i18n.getString('patient')</option>
 					#end
 					
 					#if($!patient.associate.phoneNumber)

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm	2013-11-25 08:18:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm	2013-12-18 06:05:41 +0000
@@ -22,7 +22,6 @@
 		<tr>
 			<th>$i18n.getString('risk')</th>
 			<th>$i18n.getString('full_name')</th>
-			<th>$i18n.getString('phone_number')</th>
 			<th>$i18n.getString( "events" )</th>
 			<th>$i18n.getString( "operations" )</th>
 		</tr>
@@ -62,22 +61,6 @@
 				$value
 			</a></td>
 			
-			<td name='infor_$patient.id' class='$class'>$!patient.phoneNumber</td>
-				#set($rowspan=1)
-				#if($class=='listRow')
-					#set($class='listAlternateRow')
-					#set($alterclass='listRow')
-				#else
-					#set($class='listRow')
-					#set($alterclass='listAlternateRow')
-				#end
-			#else
-				#set($rowspan=$rowspan+1)
-				<script>
-					jQuery("[name=infor_" + "$patient.id]").attr('rowspan',$rowspan)
-				</script>
-			#end
-			
 			<td class='$alterclass'>
 				<a href="javascript:programTrackingList( $programStageInstance.id, false );">
 					$programStageInstance.programStage.displayName

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingSelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingSelect.vm	2013-10-21 07:40:21 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingSelect.vm	2013-12-18 06:05:41 +0000
@@ -120,11 +120,6 @@
 	var i18n_patient_id = '$encoder.jsEscape( $i18n.getString( "id" ) , "'")';
 	var i18n_patient_full_name = '$encoder.jsEscape( $i18n.getString( "full_name" ) , "'")';
 	var i18n_patient_demographics = '$encoder.jsEscape( $i18n.getString( "demographics" ) , "'")';
-	var i18n_patient_gender = '$encoder.jsEscape( $i18n.getString( "gender" ) , "'")';
-	var i18n_patient_date_of_birth = '$encoder.jsEscape( $i18n.getString( "date_of_birth" ) , "'")';
-	var i18n_patient_dob_type = '$encoder.jsEscape( $i18n.getString( "dob_type" ), "'")';
-	var i18n_patient_age = '$encoder.jsEscape( $i18n.getString( "age" ) , "'")';
-	var i18n_patient_phone_number = '$encoder.jsEscape( $i18n.getString( "phone_number" ) , "'")';
 	var i18n_edit_this_patient = '$encoder.jsEscape( $i18n.getString( "edit_this_patient" ) , "'")';
 	var i18n_no_duplicate_found = '$encoder.jsEscape( $i18n.getString( "no_duplicate_found" ) , "'")';
 	var i18n_patient_system_id = '$encoder.jsEscape( $i18n.getString( "patient_system_id" ) , "'")';

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/records.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/records.vm	2013-09-23 03:15:40 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/records.vm	2013-12-18 06:05:41 +0000
@@ -2,24 +2,7 @@
 	<tr>
 	    <td class="bold">$i18n.getString( "full_name" ):</td>
 	    <td>$encoder.htmlEncode( $patient.name )</td>
-	</tr>
-	<tr>
-	    <td class="bold">$i18n.getString( "gender" ):</td>
-	    <td>#if($patient.gender=='F')
-				<img src='images/female_small.png'>
-			#else
-				<img src='images/male_small.png'>
-			#end
-		</td>
-	</tr>    
-	<tr>
-	    <td class="bold">$i18n.getString( "date_of_birth" ):</td>
-	    <td>$format.formatDate( $patient.birthDate )</td>
-	</tr>
-	<tr>
-	    <td class="bold">$i18n.getString( "age" ):</td>
-	    <td>$encoder.htmlEncode( $patient.getAge() )</td>
-	</tr>    
+	</tr>   
 </table>
 
 <h4>$i18n.getString( "records_for" ) $encoder.htmlEncode( $programStageInstance.programStage.displayName ) </h4>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/relationshipList.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/relationshipList.vm	2013-11-25 08:18:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/relationshipList.vm	2013-12-18 06:05:41 +0000
@@ -17,23 +17,6 @@
 					<td class="bold text-column">$i18n.getString( "full_name" ): </td>
 					<td>$!encoder.htmlEncode( $patient.name )<td>
 				</tr>
-				<tr>
-					<td class="bold text-column">$i18n.getString( "gender" ): </td>
-					<td>#if($patient.gender=='F')
-							<img src='images/female_small.png'>
-						#else
-							<img src='images/male_small.png'>
-						#end
-					<td>
-				</tr>
-				<tr>
-					<td class="bold text-column">$i18n.getString( "date_of_birth" ): </td>
-					<td>$format.formatDate( $patient.birthDate )<td>
-				</tr>
-				<tr>
-					<td class="bold text-column" style='vertical-align:top'>$i18n.getString( "age" ): </td>
-					<td>$encoder.htmlEncode( $patient.getAge() )</td>
-				</tr>
 			</table>
 		</td>
 	
@@ -113,9 +96,6 @@
 			</td>
 			<td>
                 <span class="bold">$i18n.getString( "full_name" ):</span><span id="fullNameField"></span><br>
-                <span class="bold">$i18n.getString( "gender" ):</span><span id="genderField"></span><br>
-                <span class="bold">$i18n.getString( "date_of_birth" ):</span><span id="dateOfBirthField"></span><br>
-                <span class="bold">$i18n.getString( "age" ):</span><span id="ageField"></span>
             </td>   
             <td style="vertical-align:top">
                 <div style="float:right">                              

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/relationshipPatients.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/relationshipPatients.vm	2013-11-25 08:18:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/relationshipPatients.vm	2013-12-18 06:05:41 +0000
@@ -23,11 +23,7 @@
 	  <thead>
 		<tr>
 			<th>#</th>
-			<th>$i18n.getString( "full_name" )</th>          
-			<th>$i18n.getString( "gender" )</th>
-			<th>$i18n.getString( "date_of_birth" )</th> 
-			<th>$i18n.getString( "age" )</th>
-			<th>$i18n.getString( "phone_number" )</th>
+			<th>$i18n.getString( "full_name" )</th>   
 			<th style="text-align:center">$i18n.getString( "operations" )</th>
 		</tr>
 	  </thead>
@@ -42,14 +38,6 @@
 				<a>$!encoder.htmlEncode($patient.name)</a>
 			</td>
 			
-			<td>#if($!patient.gender) $i18n.getString($!patient.gender) #end</td>
-			
-			<td>#if($!patient.birthDate) $format.formatDate( $!patient.birthDate) #end</td>
-			
-			<td>#if($!patient.birthDate) $!patient.getAge() #end</td>
-			
-			<td>$!patient.phoneNumber</td>
-			
 			<td>
 			  <a href="javascript:isDashboard=true;showPatientDashboardForm( '$patient.uid' )" title='$i18n.getString( "patient_dashboard" )'><img src="../images/enroll.png"></a>
 			  <a href="javascript:validateAddRelationship($patient.id);" title="$i18n.getString( 'assign_relationship' )" ><img src="../images/relationship.png" ></a>
@@ -71,9 +59,6 @@
 	var i18n_patient_details_and_history = '$encoder.jsEscape( $i18n.getString( "patient_details_and_history" ) , "'" )';	
 	var i18n_id = '$encoder.jsEscape( $i18n.getString( "id" ), "'")';
 	var i18n_full_name = '$encoder.jsEscape( $i18n.getString( "full_name" ), "'")';
-	var i18n_gender = '$encoder.jsEscape( $i18n.getString( "gender" ), "'")';
-	var i18n_dob_type = '$encoder.jsEscape( $i18n.getString( "dob_type" ), "'")';
-	var i18n_date_of_birth = '$encoder.jsEscape( $i18n.getString( "date_of_birth" ), "'")';
 	var i18n_none = '$encoder.jsEscape( $i18n.getString( "none" ), "'")';
 	var i18n_select = '[' + '$encoder.jsEscape( $i18n.getString( "select" ), "'")' + ']';
 	var i18n_program_stages_history_plan = '$encoder.jsEscape( $i18n.getString( "program_stages_history_plan" ) , "'")';	

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/reportDataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/reportDataEntryForm.vm	2013-09-30 13:53:17 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/reportDataEntryForm.vm	2013-12-18 06:05:41 +0000
@@ -10,14 +10,6 @@
 				<td class='coordinates1'>
 					<span class='bold' id="patientName">$i18n.getString( "full_name" ):</span>
 				</td>
-				<td class='coordinates2'>
-					$!encoder.htmlEncode( $patient.name ) 
-					#if($patient.gender=='F')
-						<img src='images/female_small.png'>
-					#else
-						<img src='images/male_small.png'>
-					#end
-				</td>
 				<td class='bold coordinates1'>$i18n.getString('program'):</td>
 				<td class='coordinates2'>$program.displayName</td>
 				<td rowspan='2'>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePatient.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePatient.vm	2013-09-23 03:15:40 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePatient.vm	2013-12-18 06:05:41 +0000
@@ -2,11 +2,6 @@
 <patient>
   <id>$patient.id</id>  
   <fullName>$!encoder.xmlEncode( $patient.name )</fullName>
-  <gender>$!encoder.xmlEncode( $i18n.getString($patient.gender ))</gender>
-  <dobType>#if($!patient.dobType)$!patient.dobType#else $i18n.getString('none') #end</dobType>
-  <dateOfBirth>$!format.formatDate( $!patient.birthDate )</dateOfBirth>
-  <age>$!encoder.xmlEncode( $patient.getAge() )</age>
-  <phoneNumber>#if($!patient.phoneNumber) $patient.phoneNumber #else $i18n.getString('none') #end</phoneNumber>
   #foreach( $patientIdentifier in $patient.identifiers )
     <identifier>        
         <identifierText>$!encoder.xmlEncode( $patientIdentifier.identifier )</identifierText>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePatientDetails.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePatientDetails.vm	2013-09-23 03:15:40 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePatientDetails.vm	2013-12-18 06:05:41 +0000
@@ -2,10 +2,6 @@
 <patient>
   <id>$patient.id</id>  
   <fullName>$!encoder.xmlEncode( $patient.name )</fullName>
-  <gender>$!encoder.xmlEncode( $i18n.getString($patient.gender ))</gender>
-  <dateOfBirth>$!format.formatDate( $patient.birthDate )</dateOfBirth>
-  <age>$!encoder.xmlEncode( $patient.getAge() )</age>
-  <phoneNumber>$!encoder.xmlEncode( $patient.phoneNumber )</phoneNumber>
   #foreach( $patientIdentifier in $!patient.identifiers )
     <identifier>        
         <identifierText>$!encoder.xmlEncode( $!patientIdentifier.identifier )</identifierText>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePatients.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePatients.vm	2013-09-23 03:15:40 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePatients.vm	2013-12-18 06:05:41 +0000
@@ -4,10 +4,6 @@
 <patient>
   <id>$patient.id</id>  
   <fullName>$!encoder.xmlEncode( $patient.name )</fullName>
-  <gender>$!encoder.xmlEncode( $i18n.getString( $patient.gender ))</gender>
-  <dateOfBirth>$format.formatDate( $patient.birthDate )</dateOfBirth>
-  <age>$!encoder.xmlEncode( $patient.getAge() )</age>
-  <phoneNumber>#if( $patient.phoneNumber ) $!encoder.xmlEncode( $patient.phoneNumber ) #else N/A #end</phoneNumber>
   #foreach( $identifier in $patient.identifiers )
   	#if( $identifier.identifierType )
 	    <identifier>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm	2013-10-25 05:00:41 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm	2013-12-18 06:05:41 +0000
@@ -127,11 +127,6 @@
 			  <select class='search-field' id="searchObjectId" name="searchObjectId" #if( $patientAttributes.size() == 0 ) disabled="disabled" #end onchange="searchObjectOnChange(this)">
 				#if( $auth.hasAccess( "dhis-web-caseentry", "accessPatientAttributes" ) )
 					<option value="iden">$i18n.getString( "search_by_name_identifier" )</option>
-					<option value="fixedAttr_registrationDate">$i18n.getString( "registration_date" )</option>
-					<option value="fixedAttr_birthDate">$i18n.getString( "date_of_birth" )</option>
-					<option value="fixedAttr_age">$i18n.getString( "age_year" )</option>
-					<option value="fixedAttr_gender">$i18n.getString( "gender" )</option>
-					<option value="fixedAttr_phoneNumber">$i18n.getString( "phone_number" )</option>
 					<option value="pi_enrollmentDate">$i18n.getString( "enrollment_date" )</option>
 					#foreach( $attribute in $patientAttributes )
 						<option value="attr_$attribute.id" valueType='$attribute.valueType'>$encoder.htmlEncode( $attribute.displayName )</option>
@@ -147,11 +142,6 @@
 				  <select class='search-field' id="searchObjectId" name="searchObjectId" #if( $patientAttributes.size() == 0 ) disabled="disabled" #end onchange="searchObjectOnChange(this)">
 					#if( $auth.hasAccess( "dhis-web-caseentry", "accessPatientAttributes" ) )
 						<option value="iden">$i18n.getString( "search_by_name_identifier" )</option>
-						<option value="fixedAttr_registrationDate">$i18n.getString( "registration_date" )</option>
-						<option value="fixedAttr_birthDate">$i18n.getString( "date_of_birth" )</option>
-						<option value="fixedAttr_age">$i18n.getString( "age_year" )</option>
-						<option value="fixedAttr_gender">$i18n.getString( "gender" )</option>
-						<option value="fixedAttr_phoneNumber">$i18n.getString( "phone_number" )</option>
 						<option value="pi_enrollmentDate">$i18n.getString( "enrollment_date" )</option>
 						#foreach( $attribute in $patientAttributes )
 							<option value="attr_$attribute.id" valueType='$attribute.valueType'>$encoder.htmlEncode( $attribute.displayName )</option>
@@ -175,9 +165,6 @@
 </div>
 
 <script>
-	var i18n_male = '$encoder.jsEscape( $i18n.getString( "male" ) , "'")';
-	var i18n_female = '$encoder.jsEscape( $i18n.getString( "female" ) , "'")';
-	var i18n_transgender = '$encoder.jsEscape( $i18n.getString( "transgender" ) , "'")';
 	var i18n_yes = '$encoder.jsEscape( $i18n.getString( "yes" ) , "'")';
 	var i18n_no = '$encoder.jsEscape( $i18n.getString( "no" ) , "'")';
 	var i18n_specify_search_criteria = '$encoder.jsEscape( $i18n.getString( "specify_search_criteria" ) , "'")';

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.vm	2013-10-24 08:31:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.vm	2013-12-18 06:05:41 +0000
@@ -55,11 +55,6 @@
 	var i18n_patient_id = '$encoder.jsEscape( $i18n.getString( "id" ) , "'")';
 	var i18n_patient_full_name = '$encoder.jsEscape( $i18n.getString( "full_name" ) , "'")';
 	var i18n_patient_demographics = '$encoder.jsEscape( $i18n.getString( "demographics" ) , "'")';
-	var i18n_patient_gender = '$encoder.jsEscape( $i18n.getString( "gender" ) , "'")';
-	var i18n_patient_date_of_birth = '$encoder.jsEscape( $i18n.getString( "date_of_birth" ) , "'")';
-	var i18n_patient_dob_type = '$encoder.jsEscape( $i18n.getString( "dob_type" ), "'")';
-	var i18n_patient_age = '$encoder.jsEscape( $i18n.getString( "age" ) , "'")';
-	var i18n_patient_phone_number = '$encoder.jsEscape( $i18n.getString( "phone_number" ) , "'")';
 	var i18n_edit_this_patient = '$encoder.jsEscape( $i18n.getString( "edit_this_patient" ) , "'")';
 	var i18n_no_duplicate_found = '$encoder.jsEscape( $i18n.getString( "no_duplicate_found" ) , "'")';
 	var i18n_patient_system_id = '$encoder.jsEscape( $i18n.getString( "patient_system_id" ) , "'")';

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.vm	2013-10-16 11:03:45 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.vm	2013-12-18 06:05:41 +0000
@@ -87,11 +87,6 @@
 	var i18n_patient_id = '$encoder.jsEscape( $i18n.getString( "id" ) , "'")';
 	var i18n_patient_full_name = '$encoder.jsEscape( $i18n.getString( "full_name" ) , "'")';
 	var i18n_patient_demographics = '$encoder.jsEscape( $i18n.getString( "demographics" ) , "'")';
-	var i18n_patient_gender = '$encoder.jsEscape( $i18n.getString( "gender" ) , "'")';
-	var i18n_patient_date_of_birth = '$encoder.jsEscape( $i18n.getString( "date_of_birth" ) , "'")';
-	var i18n_patient_dob_type = '$encoder.jsEscape( $i18n.getString( "dob_type" ), "'")';
-	var i18n_patient_age = '$encoder.jsEscape( $i18n.getString( "age" ) , "'")';
-	var i18n_patient_phone_number = '$encoder.jsEscape( $i18n.getString( "phone_number" ) , "'")';
 	var i18n_edit_this_patient = '$encoder.jsEscape( $i18n.getString( "edit_this_patient" ) , "'")';
 	var i18n_no_duplicate_found = '$encoder.jsEscape( $i18n.getString( "no_duplicate_found" ) , "'")';
 	var i18n_patient_system_id = '$encoder.jsEscape( $i18n.getString( "patient_system_id" ) , "'")';
@@ -119,9 +114,6 @@
     var i18n_complete_confirm_message = '$encoder.jsEscape( $i18n.getString( "complete_confirm_message" ) , "'")';
     var i18n_quit_confirm_message = '$encoder.jsEscape( $i18n.getString( "quit_confirm_message" ) , "'")';
     var i18n_date_is_greater_then_or_equals_due_date = '$encoder.jsEscape( $i18n.getString( "date_is_greater_then_or_equals_due_date" ) , "'")';
-	var i18n_male = '$encoder.jsEscape( $i18n.getString( "male" ) , "'")';
-	var i18n_female = '$encoder.jsEscape( $i18n.getString( "female" ) , "'")';
-	var i18n_transgender = '$encoder.jsEscape( $i18n.getString( "transgender" ) , "'")';
 	
 	var i18n_violate_validation = '$encoder.jsEscape( $i18n.getString( "violate_validation" ) , "'")';
 	var i18n_show_all_items = '$encoder.jsEscape( $i18n.getString( "show_all_items" ) , "'")';

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/underAgeForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/underAgeForm.vm	2013-02-13 15:58:32 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/underAgeForm.vm	2013-12-18 06:05:41 +0000
@@ -1,9 +1,6 @@
 <script type="text/javascript">
 	jQuery("#representativeDiv").ready(function() {
-		hideById('addRepresentativeForm [id=age]');
 		addEventForPatientForm('addRepresentativeForm');
-		$('#addRepresentativeForm [id=dobType]').removeAttr('onchange');
-		$('#addRepresentativeForm [id=dobType]').attr('onchange', 'dobTypeOnChange( "addRepresentativeForm" );');
 				
 		jQuery("#searchForm").validate({
 			meta:"validate"
@@ -23,26 +20,7 @@
 				{
 					validateAddRepresentative('addRepresentativeForm');
 				}
-			,beforeValidateHandler: function(form)
-				{
-					var dobType = $('#addRepresentativeForm [id=dobType]').val();
-					
-					if( dobType=='V' || dobType=='D' ) 
-					{
-						var birthDate = $('#addRepresentativeForm [id=birthDate]').val();
-						if( birthDate != '' ){
-							$("#addRepresentativeForm [id=memberValidator]").val(birthDate);
-						}
-					}else{
-						var age = $('#addRepresentativeForm [id=age]').val();
-						$("#addRepresentativeForm [id=memberValidator]").val(age);
-					}
-				}
 		});
-		datePickerValid( 'addRepresentativeForm [id=birthDate]' );
-		hideById('addRepresentativeForm [id=deathCheckboxTR]');
-		hideById('addRepresentativeForm [id=representativeFormDiv]');
-		hideById('addRepresentativeForm [id=underAgeDiv]');
 	}); 
 	
 	jQuery("#addRepresentativeTabs").tabs();

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm	2013-11-25 08:38:25 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm	2013-12-18 06:05:41 +0000
@@ -111,18 +111,6 @@
 			<td class="bold text-column">$i18n.getString("relationship"): </td>
 			<td>$encoder.htmlEncode($!relationship.relationshipType.aIsToB)</td>
 		</tr>
-		<tr>
-			<td class="bold text-column">$i18n.getString("gender"): </td>
-			<td>$!representative.gender</td>
-		</tr>
-		<tr>
-			<td class="bold text-column">$i18n.getString("date_of_birth"): </td>
-			<td>$!format.formatDate( $!representative.birthDate )</td>
-		</tr>
-		<tr>
-			<td class="bold text-column">$i18n.getString("age"): </td>
-			<td> $!representative.getAge() </td>
-		</tr>
 		#foreach( $patientIdentifier in $representative.identifiers )
 		  <tr>  
 			<td class="bold text-column">#if( $patientIdentifier.identifierType )$patientIdentifier.identifierType.displayName: #else $i18n.getString("system_identifier"): #end</td>      

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitSchedule.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitSchedule.vm	2013-11-25 07:31:02 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitSchedule.vm	2013-12-18 06:05:41 +0000
@@ -13,7 +13,6 @@
 	   <col style="width: 10%;">
        <col style="width: 10%;">
        <col style="width: 10%;">
-	   <col style="width: 10%;">
        <col style="width: 10%;">
    </colgroup>
    
@@ -182,18 +181,6 @@
 			<td>
 				<input type='button' class='normal-button' onclick="addComment(byId('message_$programStageInstance.id'),'$programStageInstance.id')" value="$i18n.getString('save')" >
 			</td>
-			<td>
-				#if(($auth.hasAccess( "dhis-web-caseentry", "sendSMS" ) ) 
-					&& ($!programInstance.patient.phoneNumber 
-					|| $!programInstance.patient.associate.phoneNumber 
-					|| $!programInstance.patient.associate.organisationUnit.phoneNumber 
-					|| $hasUsers ))
-				<img src="images/send_sms.png" class='img-button' title="$i18n.getString( 'send_message' )" onclick="setFieldValue('sendFromEvent','true');setFieldValue( 'programStageInstanceId',$programStageInstance.id);sendSmsOnePatientForm();"/>
-				#end
-				#if( $auth.hasAccess( "dhis-web-caseentry", "removeCurrentEncounter" ) )
-					<a href="javascript:removeEvent($programStageInstance.id, false)" link="javascript:removeEvent($programStageInstance.id, false)" title='$i18n.getString( "remove" )'><img src="../images/delete.png" id='del_$programStageInstance.id' name='del_$programStageInstance.id' alt='$i18n.getString( "remove" )' #if( $status==1 ) class='hidden' #end></a>
-				#end
-			</td>
 		</tr>
 		#set( $mark = !$mark  )
 	#end
@@ -207,8 +194,14 @@
 				<td>$i18n.getString("send_to")</td>
 				<td>
 					<select id='sendTo' name='sendTo' style='width:260px;'>
-						#if($!programInstance.patient.phoneNumber)
-						<option value='1'>$i18n.getString('patient')</option>
+						#set($valueType='')
+						#foreach($attrValue in $!programInstance.patient.attributeValues)
+							#if($attrValue.patientAttribute.valueType=='phoneNumber')
+								#set($valueType = $attrValue.patientAttribute.valueType )
+							#end
+						#end
+						#if($valueType!='')
+							<option value='1'>$i18n.getString('patient')</option>
 						#end
 						
 						#if($!programInstance.patient.associate.phoneNumber)

=== 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	2013-12-16 17:25:44 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/SaveBeneficiaryAction.java	2013-12-18 06:05:41 +0000
@@ -354,15 +354,6 @@
             patient.setName( patientFullName.trim() );
         }
 
-        if ( phoneNumber.matches( "^(\\+)?\\d+$" ) )
-        {
-            patient.setPhoneNumber( phoneNumber );
-        }
-        else
-        {
-            validationMap.put( "phoneNumber", "invalid_phone_number" );
-        }
-
         HttpServletRequest request = (HttpServletRequest) ActionContext.getContext().get(
             StrutsStatics.HTTP_REQUEST );
         Map<String, String> parameterMap = ContextUtils.getParameterMap( request );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeForm.vm	2013-12-17 03:31:30 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeForm.vm	2013-12-18 06:05:41 +0000
@@ -46,6 +46,7 @@
                 <option value="bool">$i18n.getString( "yes_no" )</option>
 				<option value="trueOnly">$i18n.getString( "yes_only" )</option>
                 <option value="date">$i18n.getString( "date" )</option>
+                <option value="phoneNumber">$i18n.getString( "phone_number" )</option>
                 <option value="combo">$i18n.getString( "attribute_combo_type" )</option>
             </select>
         </td>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/caseaggregation.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/caseaggregation.js	2013-12-17 03:31:30 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/caseaggregation.js	2013-12-18 06:05:41 +0000
@@ -144,13 +144,6 @@
       var type = jQuery('#programId option:selected').attr('programType');
       if( type != '3' ) {
         var caseProperty = jQuery('#caseProperty');
-        for( i in json.fixedAttributes ) {
-          var id = json.fixedAttributes[i].id;
-          var name = json.fixedAttributes[i].name;
-
-          caseProperty.append("<option value='" + id + "' title='" + name + "' suggested='" + json.fixedAttributes[i].suggested + "'>" + name + "</option>");
-        }
-
         for( i in json.patientAttributes ) {
           var id = json.patientAttributes[i].id;
           var name = json.patientAttributes[i].name;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttribute.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttribute.js	2013-12-17 03:31:30 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttribute.js	2013-12-18 06:05:41 +0000
@@ -40,6 +40,7 @@
 	typeMap['bool'] = i18n_yes_no;
 	typeMap['trueOnly'] = i18n_yes_only;
 	typeMap['date'] = i18n_date;
+	typeMap['phoneNumber'] = i18n_phone_number;
 	typeMap['combo'] = i18n_attribute_combo_type;
 	return typeMap;
 }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttribute.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttribute.vm	2013-12-17 01:29:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttribute.vm	2013-12-18 06:05:41 +0000
@@ -73,4 +73,5 @@
 	var i18n_all = '$encoder.jsEscape( $i18n.getString( "all" ) , "'")';
 	var i18n_yes_only = '$encoder.jsEscape( $i18n.getString( "yes_only" ) , "'")';
 	var i18n_attribute_combo_type = '$encoder.jsEscape( $i18n.getString( "attribute_combo_type" ) , "'")';
+	var i18n_phone_number = '$encoder.jsEscape( $i18n.getString( "phone_number" ) , "'") ';
 </script>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm	2013-12-17 03:31:30 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm	2013-12-18 06:05:41 +0000
@@ -49,7 +49,8 @@
                 <option value="bool" #if( $patientAttribute.valueType == 'bool' ) selected="selected" #end>$i18n.getString( "yes_no" )</option>
                 <option value="trueOnly" #if( $patientAttribute.valueType == 'trueOnly' ) selected="selected" #end >$i18n.getString( "yes_only" )</option>
 				<option value="date" #if( $patientAttribute.valueType == 'date' ) selected="selected" #end>$i18n.getString( "date" )</option>
-                <option value="combo" #if( $patientAttribute.valueType == 'combo' ) selected="selected" #end>$i18n.getString( "attribute_combo_type" )</option>
+                <option value="phoneNumber" #if( $patientAttribute.valueType == 'phoneNumber' ) selected="selected" #end>$i18n.getString( "phone_number" )</option>
+				<option value="combo" #if( $patientAttribute.valueType == 'combo' ) selected="selected" #end>$i18n.getString( "attribute_combo_type" )</option>
             </select>
         </td>
     </tr>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewPatientRegistationForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewPatientRegistationForm.vm	2013-12-17 03:31:30 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/viewPatientRegistationForm.vm	2013-12-18 06:05:41 +0000
@@ -119,7 +119,7 @@
 		</tr>
 		<tr>
 			<td>
-				<select id="fixedAttrSelector" multiple="multiple" style="width:450px;height:270px" onclick='suggestionSelectorToggle()' ondblclick="insertElement( 'fixedAttr' )">
+				<select id="fixedAttrSelector" multiple="multiple" style="width:450px;height:270px" ondblclick="insertElement( 'fixedAttr' )">
 					<option value="fullName">$i18n.getString('full_name')</option>
 					<option value="phoneNumber">$i18n.getString('phone_number')</option>
 					<option value="associate">$i18n.getString('health_worker')</option>