← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4238: Ajax Request stuff don't work does not work with IE9; Remove unused files ( Patient module ).

 

------------------------------------------------------------
revno: 4238
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-08-01 09:39:52 +0700
message:
  Ajax Request stuff don't work does not work with IE9; Remove unused files ( Patient module ).
removed:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/SavePatientAttributeDateValueAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/SavePatientAttributeValueAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/ShowUpdatePatientAttributeValueAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttributeValue.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/responsePartner.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/responsePatient.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttributeValueForm.vm
added:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/detailsPartner.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/detailsPatient.vm
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addRelationshipForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addRelationshipPatientForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/commons.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/relationship.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/relationshipPatient.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/underage.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/listPatient.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programUnenrollmentSelectForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/relationshipList.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/resultSearchPatients.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/selectPatient.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientForm.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
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/SavePatientAttributeDateValueAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/SavePatientAttributeDateValueAction.java	2009-11-24 15:39:07 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/SavePatientAttributeDateValueAction.java	1970-01-01 00:00:00 +0000
@@ -1,189 +0,0 @@
-/*
- * Copyright (c) 2004-2009, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.hisp.dhis.patient.action.patientattribute;
-
-import java.util.Date;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.hisp.dhis.i18n.I18nFormat;
-import org.hisp.dhis.patient.Patient;
-import org.hisp.dhis.patient.PatientAttribute;
-import org.hisp.dhis.patient.PatientAttributeService;
-import org.hisp.dhis.patient.PatientService;
-import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
-import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Abyot Asalefew Gizaw
- * @version $Id$
- */
-public class SavePatientAttributeDateValueAction
-    implements Action
-{
-
-    private static final Log LOG = LogFactory.getLog( SavePatientAttributeDateValueAction.class );
-
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    private PatientService patientService;
-
-    public void setPatientService( PatientService patientService )
-    {
-        this.patientService = patientService;
-    }
-
-    private PatientAttributeService patientAttributeService;
-
-    public void setPatientAttributeService( PatientAttributeService patientAttributeService )
-    {
-        this.patientAttributeService = patientAttributeService;
-    }
-
-    private PatientAttributeValueService patientAttributeValueService;
-
-    public void setPatientAttributeValueService( PatientAttributeValueService patientAttributeValueService )
-    {
-        this.patientAttributeValueService = patientAttributeValueService;
-    }
-
-    private I18nFormat format;
-
-    public void setFormat( I18nFormat format )
-    {
-        this.format = format;
-    }
-
-    // -------------------------------------------------------------------------
-    // Input/Output
-    // -------------------------------------------------------------------------
-
-    private String value;
-
-    public void setValue( String value )
-    {
-        this.value = value;
-    }
-
-    private int patientId;
-
-    public void setPatientId( int patientId )
-    {
-        this.patientId = patientId;
-    }
-
-    private int patientAttributeId;
-
-    public void setPatientAttributeId( int patientAttributeId )
-    {
-        this.patientAttributeId = patientAttributeId;
-    }
-
-    private int statusCode;
-
-    public int getStatusCode()
-    {
-        return statusCode;
-    }
-
-    public void setStatusCode( int statusCode )
-    {
-        this.statusCode = statusCode;
-    }
-
-    // -------------------------------------------------------------------------
-    // Action implementation
-    // -------------------------------------------------------------------------
-
-    public String execute()
-        throws Exception
-    {
-
-        Patient patient = patientService.getPatient( patientId );
-
-        PatientAttribute patientAttribute = patientAttributeService.getPatientAttribute( patientAttributeId );
-
-        if ( !patient.getAttributes().contains( patientAttribute ) )
-        {
-            patient.getAttributes().add( patientAttribute );
-            patientService.updatePatient( patient );
-        }
-
-        if ( value != null && value.trim().length() == 0 )
-        {
-            value = null;
-        }
-
-        if ( value != null )
-        {
-            value = value.trim();
-        }
-
-        if ( value != null )
-        {
-            Date dateValue = format.parseDate( value );
-
-            if ( dateValue == null )
-            {
-                statusCode = 1;
-
-                return SUCCESS;
-            }
-        }
-
-        PatientAttributeValue patientAttributeValue = patientAttributeValueService.getPatientAttributeValue( patient,
-            patientAttribute );
-
-        if ( patientAttributeValue == null )
-        {
-            if ( value != null )
-            {
-
-                LOG.debug( "Adding PatientAttributeValue, value added" );
-
-                patientAttributeValue = new PatientAttributeValue( patientAttribute, patient, value );
-
-                patientAttributeValueService.savePatientAttributeValue( patientAttributeValue );
-            }
-        }
-        else
-        {
-            LOG.debug( "Updating PatientAttributeValue, value added/changed" );
-
-            patientAttributeValue.setValue( value );
-
-            patientAttributeValueService.updatePatientAttributeValue( patientAttributeValue );
-        }
-
-        return SUCCESS;
-
-    }
-}

=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/SavePatientAttributeValueAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/SavePatientAttributeValueAction.java	2010-03-05 13:00:37 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/SavePatientAttributeValueAction.java	1970-01-01 00:00:00 +0000
@@ -1,188 +0,0 @@
-/*
- * Copyright (c) 2004-2009, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.hisp.dhis.patient.action.patientattribute;
-
-import org.apache.commons.lang.math.NumberUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.hisp.dhis.patient.Patient;
-import org.hisp.dhis.patient.PatientAttribute;
-import org.hisp.dhis.patient.PatientAttributeOption;
-import org.hisp.dhis.patient.PatientAttributeOptionService;
-import org.hisp.dhis.patient.PatientAttributeService;
-import org.hisp.dhis.patient.PatientService;
-import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
-import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Abyot Asalefew Gizaw
- * @version $Id$
- */
-public class SavePatientAttributeValueAction
-    implements Action
-{
-
-    private static final Log LOG = LogFactory.getLog( SavePatientAttributeValueAction.class );
-
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    private PatientService patientService;
-
-    public void setPatientService( PatientService patientService )
-    {
-        this.patientService = patientService;
-    }
-
-    private PatientAttributeService patientAttributeService;
-
-    public void setPatientAttributeService( PatientAttributeService patientAttributeService )
-    {
-        this.patientAttributeService = patientAttributeService;
-    }
-
-    private PatientAttributeValueService patientAttributeValueService;
-
-    public void setPatientAttributeValueService( PatientAttributeValueService patientAttributeValueService )
-    {
-        this.patientAttributeValueService = patientAttributeValueService;
-    }
-    
-    private PatientAttributeOptionService patientAttributeOptionService;
-
-    public void setPatientAttributeOptionService( PatientAttributeOptionService patientAttributeOptionService )
-    {
-        this.patientAttributeOptionService = patientAttributeOptionService;
-    }
-    // -------------------------------------------------------------------------
-    // Input/Output
-    // -------------------------------------------------------------------------
-
-    private String value;
-
-    public void setValue( String value )
-    {
-        this.value = value;
-    }
-
-    private int patientId;
-
-    public void setPatientId( int patientId )
-    {
-        this.patientId = patientId;
-    }
-
-    private int patientAttributeId;
-
-    public void setPatientAttributeId( int patientAttributeId )
-    {
-        this.patientAttributeId = patientAttributeId;
-    }
-
-    private int statusCode;
-
-    public int getStatusCode()
-    {
-        return statusCode;
-    }
-
-    // -------------------------------------------------------------------------
-    // Action implementation
-    // -------------------------------------------------------------------------
-
-    public String execute()
-        throws Exception
-    {
-        Patient patient = patientService.getPatient( patientId );
-
-        PatientAttribute patientAttribute = patientAttributeService.getPatientAttribute( patientAttributeId );
-
-        if ( !patient.getAttributes().contains( patientAttribute ) )
-        {
-            patient.getAttributes().add( patientAttribute );
-            patientService.updatePatient( patient );
-        }
-
-        if ( value != null && value.trim().length() == 0 )
-        {
-            value = null;
-        }
-
-        PatientAttributeValue patientAttributeValue = patientAttributeValueService.getPatientAttributeValue( patient,
-            patientAttribute );
-
-        if ( patientAttributeValue == null )
-        {
-
-            if ( value != null )
-            {
-
-                LOG.debug( "Adding PatientAttributeValue, value added" );
-                
-                if( patientAttribute.getValueType().equalsIgnoreCase( PatientAttribute.TYPE_COMBO ) )
-                {
-                    PatientAttributeOption option = patientAttributeOptionService.get( NumberUtils.toInt( value,0 ) );
-                    if( option != null )
-                    {
-                        patientAttributeValue = new PatientAttributeValue( patientAttribute, patient );
-                        patientAttributeValue.setPatientAttributeOption( option );
-                        patientAttributeValue.setValue( option.getName() );
-                    }
-                }else
-                {
-                    patientAttributeValue = new PatientAttributeValue( patientAttribute, patient, value );
-                }
-                patientAttributeValueService.savePatientAttributeValue( patientAttributeValue );
-            }
-        }
-        else
-        {
-            LOG.debug( "Updating PatientAttributeValue, value added/changed" );
-
-            if( patientAttribute.getValueType().equalsIgnoreCase( PatientAttribute.TYPE_COMBO ) )
-            {
-                PatientAttributeOption option = patientAttributeOptionService.get( NumberUtils.toInt( value, 0 ) );
-                if( option != null )
-                {
-                    patientAttributeValue.setPatientAttributeOption( option );
-                    patientAttributeValue.setValue( option.getName() );
-                }
-            }else
-            {
-                patientAttributeValue.setValue( value );
-            }
-
-            patientAttributeValueService.updatePatientAttributeValue( patientAttributeValue );
-        }
-
-        return SUCCESS;
-    }
-
-}

=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/ShowUpdatePatientAttributeValueAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/ShowUpdatePatientAttributeValueAction.java	2011-03-20 17:57:30 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/ShowUpdatePatientAttributeValueAction.java	1970-01-01 00:00:00 +0000
@@ -1,165 +0,0 @@
-/*
- * Copyright (c) 2004-2009, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.hisp.dhis.patient.action.patientattribute;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.hisp.dhis.patient.Patient;
-import org.hisp.dhis.patient.PatientAttribute;
-import org.hisp.dhis.patient.PatientAttributeGroup;
-import org.hisp.dhis.patient.PatientAttributeGroupService;
-import org.hisp.dhis.patient.PatientAttributeService;
-import org.hisp.dhis.patient.PatientService;
-import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
-import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Abyot Asalefew Gizaw
- * @version $Id$
- */
-public class ShowUpdatePatientAttributeValueAction
-    implements Action
-{
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    private PatientService patientService;
-
-    public void setPatientService( PatientService patientService )
-    {
-        this.patientService = patientService;
-    }
-
-    private PatientAttributeService patientAttributeService;
-
-    public void setPatientAttributeService( PatientAttributeService patientAttributeService )
-    {
-        this.patientAttributeService = patientAttributeService;
-    }
-
-    private PatientAttributeGroupService patientAttributeGroupService;
-
-    public void setPatientAttributeGroupService( PatientAttributeGroupService patientAttributeGroupService )
-    {
-        this.patientAttributeGroupService = patientAttributeGroupService;
-    }
-
-    private PatientAttributeValueService patientAttributeValueService;
-
-    public void setPatientAttributeValueService( PatientAttributeValueService patientAttributeValueService )
-    {
-        this.patientAttributeValueService = patientAttributeValueService;
-    }
-
-    // -------------------------------------------------------------------------
-    // Input/Output
-    // -------------------------------------------------------------------------
-
-    private int id;
-
-    public void setId( int id )
-    {
-        this.id = id;
-    }
-
-    private Patient patient;
-
-    public Patient getPatient()
-    {
-        return patient;
-    }
-
-    Collection<PatientAttribute> patientNoGroupAttributes;
-
-    public Collection<PatientAttribute> getPatientNoGroupAttributes()
-    {
-        return patientNoGroupAttributes;
-    }
-
-    private Map<Integer, PatientAttributeValue> patientAttributeValueMap;
-
-    public Map<Integer, PatientAttributeValue> getPatientAttributeValueMap()
-    {
-        return patientAttributeValueMap;
-    }
-
-    private Collection<PatientAttributeGroup> patientAttributeGroups;
-
-    public Collection<PatientAttributeGroup> getPatientAttributeGroups()
-    {
-        return patientAttributeGroups;
-    }
-
-    public void setPatientAttributeGroups( Collection<PatientAttributeGroup> patientAttributeGroups )
-    {
-        this.patientAttributeGroups = patientAttributeGroups;
-    }
-
-    private int patientAttributeGroupId;
-
-    public void setPatientAttributeGroupId( int patientAttributeGroupId )
-    {
-        this.patientAttributeGroupId = patientAttributeGroupId;
-    }
-
-    public int getPatientAttributeGroupId()
-    {
-        return patientAttributeGroupId;
-    }
-
-    // -------------------------------------------------------------------------
-    // Action implementation
-    // -------------------------------------------------------------------------
-
-    public String execute()
-        throws Exception
-    {
-        patient = patientService.getPatient( id );
-
-        patientAttributeGroups = patientAttributeGroupService.getAllPatientAttributeGroups();
-
-        patientNoGroupAttributes = patientAttributeService.getPatientAttributesNotGroup();
-
-        Collection<PatientAttributeValue> patientAttributeValues = patientAttributeValueService
-            .getPatientAttributeValues( patient );
-
-        patientAttributeValueMap = new HashMap<Integer, PatientAttributeValue>( patientAttributeValues.size() );
-
-        for ( PatientAttributeValue patientAttributeValue : patientAttributeValues )
-        {
-            patientAttributeValueMap.put( patientAttributeValue.getPatientAttribute().getId(), patientAttributeValue );
-        }
-
-        return SUCCESS;
-    }
-}

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties	2011-07-29 08:58:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties	2011-08-01 02:39:52 +0000
@@ -96,7 +96,7 @@
 edit_attribute_values = Edit Attribute Values
 update_patient_attribute = Update Beneficiary Attribute
 attribute = Attribute
-attributes = Attributes
+attributes = ATTRIBUTES
 value_type = Value Type
 add_new_patient_attribute = Add New Beneficiary Attribute
 updating_patient_attribute_failed = Updating Beneficiary Attribute failed
@@ -273,7 +273,7 @@
 add_new_patient_attribute_group = Add New Beneficiary Attribute Group
 patient_duplicate = Beneficiary Duplicate
 i18n_edit_this_patient = Edit this Beneficiary
-identifier = Identifier
+identifiers = IDENTIFIERS
 patient_attributes = Beneficiary Attributes
 identifier_format = Identifier Format
 patient_identifier_type_management = Beneficiary Identifier Type Management
@@ -432,7 +432,7 @@
 not_enough_mandatory_identifier = Not enough data for the mandatory identifier(s)
 not_enough_madatory_attribute = Not enough data for the mandatory attribute(s)
 get_data_error = Get data error
-common_info = Common information
+common_info = COMMON INFORMATION
 hierachy_orgunit = Hierarchy Organisation Unit
 no_patients_found = No Patients Found
 similar_patients = Similar patients
@@ -479,4 +479,5 @@
 advanced_search = Advanced search
 add_more_option_to_search = Add more option to search
 duplicated_patient_list = Duplicated patient list
-specfiy_birth_date_or_age = Specfiy birth date or age
\ No newline at end of file
+specfiy_birth_date_or_age = Specfiy birth date or age
+update_this_patient = Update this beneficiary
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml	2011-07-29 08:58:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml	2011-08-01 02:39:52 +0000
@@ -85,9 +85,8 @@
 
 		<action name="getPartner"
 			class="org.hisp.dhis.patient.action.relationship.GetPartnerAction">
-			<result name="success" type="velocity-xml">
-				/dhis-web-maintenance-patient/responsePartner.vm</result>
-			<param name="onExceptionReturn">plainTextError</param>
+			<result name="success" type="velocity">/content.vm</result>
+			<param name="page">/dhis-web-maintenance-patient/detailsPartner.vm</param>
 		</action>
 
 		<action name="showRelationshipList"
@@ -166,8 +165,6 @@
 			class="org.hisp.dhis.patient.action.relationship.ShowAddRelationshipPatientAction">
 			<result name="success" type="velocity">/content.vm</result>
 			<param name="page">/dhis-web-maintenance-patient/addRelationshipPatientForm.vm</param>
-			<param name="stylesheets">
-				../dhis-web-commons/javascripts/jQuery/ui/css/ui.thickbox.css</param>
 			<param name="requiredAuthorities">F_PATIENT_ADD</param>
 		</action>
 
@@ -270,35 +267,7 @@
 				/dhis-web-commons/ajax/jsonResponseInput.vm</result>
 			<param name="requiredAuthorities">F_PATIENTATTRIBUTE_DELETE</param>
 		</action>
-
-		<!-- PatientAttributeValue -->
-
-		<action name="showUpdatePatientAttributeValueForm"
-			class="org.hisp.dhis.patient.action.patientattribute.ShowUpdatePatientAttributeValueAction">
-			<result name="success" type="velocity">/main.vm</result>
-			<param name="page">/dhis-web-maintenance-patient/updatePatientAttributeValueForm.vm</param>
-			<param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenuWithTree.vm</param>
-			<param name="menuTreeHeight">321</param>
-			<param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,javascript/patientAttributeValue.js</param>
-			<param name="requiredAuthorities">F_PATIENTATTRIBUTEVALUE_UPDATE</param>
-		</action>
-
-		<action name="savePatientAttributeValue"
-			class="org.hisp.dhis.patient.action.patientattribute.SavePatientAttributeValueAction">
-			<result name="success" type="velocity">status.vm</result>
-			<param name="onExceptionReturn">plainTextError</param>
-			<param name="requiredAuthorities">F_PATIENTATTRIBUTEVALUE_ADD,F_PATIENTATTRIBUTEVALUE_UPDATE,F_PATIENTATTRIBUTEVALUE_DELETE</param>
-			<result name="error" type="velocity-xml">
-				/dhis-web-commons/ajax/xmlResponseError.vm</result>
-		</action>
-
-		<action name="savePatientAttributeDateValue"
-			class="org.hisp.dhis.patient.action.patientattribute.SavePatientAttributeDateValueAction">
-			<result name="success" type="velocity">status.vm</result>
-			<param name="onExceptionReturn">plainTextError</param>
-			<param name="requiredAuthorities">F_PATIENTATTRIBUTEVALUE_ADD,F_PATIENTATTRIBUTEVALUE_UPDATE,F_PATIENTATTRIBUTEVALUE_DELETE</param>
-		</action>
-
+		
 		<!-- Patient -->
 
 		<action name="patient" class="org.hisp.dhis.patient.action.patient.SelectAction">
@@ -351,11 +320,10 @@
 
 		<action name="getPatient"
 			class="org.hisp.dhis.patient.action.patient.GetPatientAction">
-			<result name="success" type="velocity-xml">
-				/dhis-web-maintenance-patient/responsePatient.vm</result>
-			<param name="onExceptionReturn">plainTextError</param>
+			<result name="success" type="velocity">/content.vm</result>
+			<param name="page">/dhis-web-maintenance-patient/detailsPatient.vm</param>
 		</action>
-
+		
 		<action name="removePatient"
 			class="org.hisp.dhis.patient.action.patient.RemovePatientAction">
 			<result name="success" type="velocity-json">
@@ -643,7 +611,6 @@
 			<param name="requiredAuthorities">F_PROGRAM_ATTRIBUTE_UPDATE</param>
 		</action>
 
-
 		<action name="validateProgramAttribute"
 			class="org.hisp.dhis.patient.action.program.ValidateProgramAttributeAction">
 			<result name="success" type="velocity-json">
@@ -677,8 +644,7 @@
 
 		<action name="defineProgramAssociations"
 			class="org.hisp.dhis.patient.action.program.DefineProgramAssociationsAction">
-			<result name="success" type="redirect">program.action
-			</result>
+			<result name="success" type="redirect">program.action</result>
 			<param name="requiredAuthorities">F_PROGRAM_UPDATE</param>
 		</action>
 
@@ -713,8 +679,7 @@
 
 		<action name="addProgramStage"
 			class="org.hisp.dhis.patient.action.programstage.AddProgramStageAction">
-			<result name="success" type="redirect">programStage.action?id=${id}
-			</result>
+			<result name="success" type="redirect">programStage.action?id=${id}</result>
 			<param name="requiredAuthorities">F_PROGRAMSTAGE_ADD</param>
 		</action>
 
@@ -729,8 +694,7 @@
 
 		<action name="updateProgramStage"
 			class="org.hisp.dhis.patient.action.programstage.UpdateProgramStageAction">
-			<result name="success" type="redirect">programStage.action?id=${programId}
-			</result>
+			<result name="success" type="redirect">programStage.action?id=${programId}</result>
 			<param name="requiredAuthorities">F_PROGRAMSTAGE_UPDATE</param>
 		</action>
 
@@ -764,11 +728,9 @@
 
 		<action name="saveProgramStageSortOder"
 			class="org.hisp.dhis.patient.action.programstage.SaveProgramStageSortOrderAction">
-			<result name="success" type="redirect">programStage.action?id=${id}
-			</result>
+			<result name="success" type="redirect">programStage.action?id=${id}</result>
 		</action>
 
-
 		<!-- Data Entry Form -->
 
 		<action name="viewDataEntryForm"
@@ -843,8 +805,7 @@
 
 		<action name="addPatientAttributeGroup"
 			class="org.hisp.dhis.patient.action.patientattributegroup.AddPatientAttributeGroupAction">
-			<result name="success" type="redirect">patientAttributeGroup.action
-			</result>
+			<result name="success" type="redirect">patientAttributeGroup.action</result>
 			<param name="requiredAuthorities">F_PATIENTATTRIBUTE_ADD</param>
 		</action>
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientForm.vm	2011-07-29 08:58:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientForm.vm	2011-08-01 02:39:52 +0000
@@ -1,34 +1,39 @@
 <script>
+	
 	jQuery(document).ready(	function(){
 
-		datePickerValid( 'addPatientForm [id=birthDate]' );
-		addEventForPatientForm( 'addPatientForm' );
-		
+		currentDiv = 'addPatientForm';
+		checkedDuplicate = false;
+
 		jQuery("#addPatientForm").validate({
 				 meta:"validate"
 				,errorElement:"span"
 				,submitHandler: function(form)
 					{
-						validateAddPatient();
+						validateAddPatient('addPatientForm');
 					}
 				,beforeValidateHandler: function(form)
 					{
-						var dobType = $('#dobType').val();
+						var dobType = $('#addPatientForm [id=dobType]').val();
 						
 						if( dobType=='V' || dobType=='D' ) 
 						{
-							var birthDate = $('#birthDate').val();
+							var birthDate = $('#addPatientForm [id=birthDate]').val();
 							if( birthDate != '' ){
-								$("#memberValidator").val(birthDate);
+								$("#addPatientForm [id=memberValidator]").val(birthDate);
 							}
 						}else{
-							var age = $('#age').val();
-							$("#memberValidator").val(age);
+							var age = $('#addPatientForm [id=age]').val();
+							$("#addPatientForm [id=memberValidator]").val(age);
 						}
 					}
 			});
-					
-	});		
+		
+		datePickerValid( 'addPatientForm [id=registrationDate]' );
+		datePickerValid( 'addPatientForm [id=birthDate]' );
+		addEventForPatientForm( 'addPatientForm' );
+	});	
+	
 </script>
 
 <h3>$i18n.getString( "add_new_patient" )</h3>	
@@ -45,19 +50,3 @@
 </p>
 
 </form>
-
-<div id="hiddenModalContent" style="display:none">
-	<style> 
-		div#hiddenModalContent label { font-weight: bold;}  
-		div#hiddenModalContent td {padding: 2px 5px}
-	</style>
-	
-	<span>$i18n.getString( "duplicate_warning" )</span>
-	<input type="button" value="$i18n.getString( 'create_new_patient' )"  id="btnCreateNew"/>
-	
-	<div id="thickboxContainer"></div>
-</div>
-
-<script>
-	checkedDuplicate = false;
-</script>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addRelationshipForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addRelationshipForm.vm	2011-07-19 03:48:05 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addRelationshipForm.vm	2011-08-01 02:39:52 +0000
@@ -57,7 +57,7 @@
             </tr>
             <tr>  
                 <td>
-                    <select id="relationshipTypeId" name="relationshipTypeId" >
+                    <select id="relationshipTypeId" name="relationshipTypeId" class="{validate:{required:true}}" >
                         <option value="">[$i18n.getString( "select_relationship" )]</option>
                         #foreach( $relationshipType in $relationshipTypes )                        
                             <option value="$relationshipType.id:$encoder.htmlEncode( $relationshipType.aIsToB )" #if( $relationshipTypeId && "$relationshipType.id:$encoder.htmlEncode( $relationshipType.aIsToB )" == $relationshipTypeId ) selected="selected" #end>$encoder.htmlEncode( $relationshipType.aIsToB )</option>
@@ -91,7 +91,7 @@
             </tr>  
             <tr>
                 <td>
-                    <select size="15" id="availablePartnersList" name="availablePartnersList" style="min-width:20em;height:10em">                        
+                    <select size="15" id="availablePartnersList" name="availablePartnersList" style="min-width:20em;height:10em" class="{validate:{required:true}}">                        
                         #foreach ( $partner in $patients )
                             <option value="$partner.id"> $encoder.htmlEncode( $partner.getFullName() )</option>
                         #end                

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addRelationshipPatientForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addRelationshipPatientForm.vm	2011-07-29 08:58:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addRelationshipPatientForm.vm	2011-08-01 02:39:52 +0000
@@ -4,6 +4,7 @@
 		datePickerValid( 'addRelationshipPatientForm [id=birthDate]' );
 		hideById('addRelationshipPatientForm [id=underAgeDiv]');
 		addEventForPatientForm('addRelationshipPatientForm');
+		checkedDuplicate = false;
 		
 		jQuery("#addRelationshipPatientForm").validate({
 			 meta:"validate"
@@ -65,21 +66,3 @@
 
 <div id="thickboxContainer"></div>
 </div>
-
-<script type="text/javascript">
-	var i18n_patient_identifiers = '$encoder.jsEscape( $i18n.getString( "patient_identifiers" ) , "'")';
-	var i18n_patient_attributes = '$encoder.jsEscape( $i18n.getString( "patient_attributes" ) , "'")';
-	var i18n_patient_fullName = '$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_age = '$encoder.jsEscape( $i18n.getString( "age" ) , "'")';
-	var i18n_patient_blood_group = '$encoder.jsEscape( $i18n.getString( "blood_group" ) , "'")';
-	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" ) , "'")';
-	var i18n_child_representative = '$encoder.jsEscape( $i18n.getString( "child_representative" ) , "'")';
-	var i18n_no_patients_found = '$encoder.jsEscape( $i18n.getString( "no_patients_found" ) , "'")';
-	var i18n_search_result = '$encoder.jsEscape( $i18n.getString( "search_result" ) , "'")';
-	var checkedDuplicate = false;
-</script>
\ No newline at end of file

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/detailsPartner.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/detailsPartner.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/detailsPartner.vm	2011-08-01 02:39:52 +0000
@@ -0,0 +1,85 @@
+<table>
+	<tr>
+		<td><label><strong>$i18n.getString( "common_info" )</strong></label></td>
+	</tr>
+	
+	<tr>
+		<td>
+			<label><strong>$i18n.getString( "full_name" ) : </strong></label>
+				$partner.getFullName()
+		</td>
+	</tr>
+	
+	<tr>
+		<td>
+			<label><strong>$i18n.getString( "gender" ) : </strong></label>
+				$partner.gender
+		</td>
+	</tr>
+	<tr>
+		<td>
+			<label><strong>$i18n.getString( "date_of_birth" ) : </strong></label></span>
+				$format.formatDate( $partner.birthDate )
+		</td>
+	</tr>
+	<tr>
+		<td>
+			<label><strong>$i18n.getString( "age" ) : </strong></label>
+				$partner.getAge()
+		</td>
+	</tr>
+	
+	<tr><td></td></tr>
+	<tr>
+		<td><label><strong>$i18n.getString( "identifiers" )</strong></td>
+	</td> 
+	#foreach( $patientIdentifier in $partner.identifiers )
+	<tr>
+		<td>
+			<label><strong>
+				#if($!patientIdentifier.identifierType)  $!patientIdentifier.identifierType.name
+				#else $i18n.getString( "patient_system_id") #end </strong>
+			</label>
+			 : $patientIdentifier.identifier
+		</td>
+	</tr>
+	#end
+	
+	<tr><td></td></tr>
+	<tr>
+		<td><label><strong>$i18n.getString( "attributes" )</strong></label></td>
+	</tr>
+	#foreach( $attribute in $partner.attributes )
+		#if( $patientAttributeValueMap.get( $attribute.id ) != " " )
+		<tr>
+			<td><label><strong>$attribute.name : </strong></label>
+				$patientAttributeValueMap.get( $attribute.id )
+			</td>
+		</tr>
+		#end
+	#end
+	
+	<tr><td></td></tr>
+	<tr>
+		<td><label><strong>$i18n.getString( "enrolled_in_program" )</strong></label></td>
+	</tr>
+	#foreach( $program in $partner.programs )
+	<tr>
+		<td>$program.name</td>
+	</tr>
+	#end
+	
+	<tr><td></td></tr>
+	<tr>
+		#if( $partnerIsRepresentative == 'true' )
+		<td>
+			<input type="button" value="$i18n.getString('yes')" onclick="javascript:removeRepresentative( getFieldValue('id'), $partner.id );">
+		</td>
+		#else
+		<td>
+			<input type="button" value="$i18n.getString('yes')" onclick="javascript:saveRepresentative( getFieldValue('id'), $partner.id, false )">
+			<input type="button" value="$i18n.getString('yes_and_attribute')" onclick="javascript:saveRepresentative( getFieldValue('id'), $partner.id, true )">
+		</td>    
+		#end
+	</tr>                      
+</table>

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/detailsPatient.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/detailsPatient.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/detailsPatient.vm	2011-08-01 02:39:52 +0000
@@ -0,0 +1,79 @@
+<div style="float:right">
+	<a href="javascript:hideDetails()" title="$i18n.getString( 'hide_details' )"><img src="../images/close.png" alt="$i18n.getString( 'hide_details' )"></a>
+</div>
+<table>
+	<tr>
+		<td><label><strong>$i18n.getString( "common_info" )</strong></label></td>
+	</tr>
+	<tr>
+		<td><label><strong>$i18n.getString('id') : </strong></label>
+			$patient.id
+		</td>
+	</tr>
+	<tr>
+		<td><label><strong>$i18n.getString('full_name') : </strong></label>
+			$patient.getFullName()
+		</td>
+	</tr>
+	<tr>
+		<td><label><strong>$i18n.getString('gender') : </strong></label>
+			$patient.gender
+		</td>
+	</tr>
+	<tr>
+		<td><label><strong>$i18n.getString('dob_type') : </strong></label>
+			$!patient.dobType
+		</td>
+	</tr>
+	<tr>
+		<td><label><strong>$i18n.getString('date_of_birth') : </strong></label>
+			$format.formatDate( $!patient.birthDate )
+		</td>
+	</tr>
+	<tr>
+		<td><label><strong>$i18n.getString('blood_group') : </strong></label>
+			#if($!patient.bloodGroup && !$patient.bloodGroup.equals("")) $patient.bloodGroup #else $i18n.getString('none') #end
+		</td>
+	</tr>
+	
+	<tr><td></td></tr>
+	<tr>
+		<td><label><strong>$i18n.getString( "identifiers" )</strong></label></td>
+	</tr>
+	#foreach( $patientIdentifier in $patient.identifiers )
+	<tr>
+		<td>
+			<label><strong>
+				#if($!patientIdentifier.identifierType)  $!patientIdentifier.identifierType.name
+				#else $i18n.getString( "patient_system_id") #end </strong>
+			</label>
+			 : $patientIdentifier.identifier
+		</td>
+	</tr>
+	#end
+	
+	<tr><td colspan='2'></td></tr>
+	<tr>
+		<td colspan='2'><label><strong>$i18n.getString( "attributes" )</strong></label></td>
+	</tr>
+	#foreach( $attribute in $patient.attributes )
+		#if( $patientAttributeValueMap.get( $attribute.id ) != " " )
+		<tr>
+			<td><label><strong>$attribute.name : </strong></label>
+				$patientAttributeValueMap.get( $attribute.id )
+			</td>
+		</tr>
+		#end
+	#end
+	
+	<tr><td></td></tr>
+	<tr>
+		<td><label><strong>$i18n.getString( "enrolled_in_program" )</strong></label></td>
+	</tr>
+	#foreach( $program in $patient.programs )
+	<tr>
+		<td>$program.name</td>
+	</tr>
+	#end
+	
+</table>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/commons.js	2011-07-29 08:58:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/commons.js	2011-08-01 02:39:52 +0000
@@ -1,16 +1,25 @@
+
 function dobTypeOnChange( container ){
 
 	var type = jQuery('#' + container + ' [id=dobType]').val();
 	
 	if(type == 'V' || type == 'D'){
+		jQuery('#' + container + ' [id=age]').rules("remove","required");
+		jQuery('#' + container + ' [id=birthDate]').rules("add",{required:true});
+		
 		showById(container + ' [id=birthdaySpan]');
 		hideById(container + ' [id=ageSpan]');
 	}else if(type == 'A'){
+		jQuery('#' + container + ' [id=birthDate]').rules("remove","required");
+		jQuery('#' + container + ' [id=age]').rules("add",{required:true});
+		
 		hideById(container + ' [id=birthdaySpan]');
 		showById(container + ' [id=ageSpan]');
 	}else {
 		hideById(container + ' [id=birthdaySpan]');
 		hideById(container + ' [id=ageSpan]');
+		jQuery('#' + container + ' [id=age]').rules("remove","required");
+		jQuery('#' + container + ' [id=birthDate]').rules("remove","required");
 	}
 }
 
@@ -18,13 +27,13 @@
 // Search patients by name
 // ----------------------------------------------------------------------------
 
-function getPatientsByName( )
+function getPatientsByName( divname )
 {	
-	var fullName = getFieldValue('fullName').replace(/^\s+|\s+$/g,"");
+	var fullName = jQuery('#' + divname + ' [id=fullName]').val().replace(/^\s+|\s+$/g,"");
 	if( fullName.length > 0) 
 	{
-		contentDiv = 'searchPatientsByNameDiv';
-		$('#searchPatientsByNameDiv' ).load("getPatientsByName.action",
+		contentDiv = 'resultSearchDiv';
+		$('#resultSearchDiv' ).load("getPatientsByName.action",
 			{
 				fullName: fullName
 			}).dialog({
@@ -98,9 +107,15 @@
 	var params = '';
 	jQuery("#" + patientDiv + " :input").each(function()
 		{
-			if( $(this).attr('type') != 'button' )
-			{
-				var elementId = $(this).attr('id');
+			var elementId = $(this).attr('id');
+			
+			if( $(this).attr('type') == 'checkbox' )
+			{
+				var checked = jQuery(this).attr('checked') ? true : false;
+				params += elementId + "=" + checked + "&";
+			}
+			else if( $(this).attr('type') != 'button' )
+			{
 				params += elementId + "="+ jQuery(this).val() + "&";
 			}
 		});

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js	2011-07-29 08:58:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js	2011-08-01 02:39:52 +0000
@@ -79,80 +79,14 @@
 
 function showPatientDetails( patientId )
 {
-    //$.post( 'getPatient.action', { id:patientId }, patientReceived );
-	$.ajax({
-		url: 'getPatient.action?id=' + patientId,
-		cache: false,
-		dataType: "xml",
-		success: patientReceived
-	});
-}
-
-function patientReceived( patientElement )
-{   
-	// ----------------------------------------------------------------------------
-	// Get common-information
-    // ----------------------------------------------------------------------------
-	
-	var id = $(patientElement).find( "id" ).text();
-	var fullName = $(patientElement).find( "fullName" ).text();
-	var gender = $(patientElement).find( "gender" ).text();
-	var dobType = $(patientElement).find( "dobType" ).text();
-	var birthDate = $(patientElement).find( "dateOfBirth" ).text();
-	var bloodGroup= $(patientElement).find( "bloodGroup" ).text();
-    
-	var commonInfo =  '<strong>'  + i18n_id + ':</strong> ' + id + "<br>" 
-					+ '<strong>' + i18n_full_name + ':</strong> ' + fullName + "<br>" 
-					+ '<strong>' + i18n_gender + ':</strong> ' + gender+ "<br>" 
-					+ '<strong>' + i18n_dob_type + ':</strong> ' + dobType+ "<br>" 
-					+ '<strong>' + i18n_date_of_birth + ':</strong> ' + birthDate+ "<br>" 
-					+ '<strong>' + i18n_blood_group  + ':</strong> ' + bloodGroup;
-	
-	setInnerHTML( 'commonInfoField', commonInfo );
-	
-	// ----------------------------------------------------------------------------
-	// Get identifiers
-    // ----------------------------------------------------------------------------
-	
-    var identifierText = '';
-	
-	var identifiers = $(patientElement).find( "identifier" );
-	$( identifiers ).each( function( i, item )
-        {
-            identifierText += $( item ).text() + '<br>';		
-        } );
-	
-	setInnerHTML( 'identifierField', identifierText );
-	
-	// ----------------------------------------------------------------------------
-	// Get attributes
-    // ----------------------------------------------------------------------------
-	
-    var attributeValues = '';
-	
-	var attributes = $(patientElement).find( "attribute" );
-	$( attributes ).each( function( i, item )
-        {
-            attributeValues += '<strong>' + $( item ).find( 'name' ).text() + ':</strong> ' + $( item ).find( 'value' ).text() + '<br>';				
-        } );
-	
-	setInnerHTML( 'attributeField', attributeValues );
-    
-	// ----------------------------------------------------------------------------
-	// Get programs
-    // ----------------------------------------------------------------------------
-	
-    var programName = '';
-	
-	var programs = $( patientElement ).find( "program" );
-	$( programs ).each( function( i, item )
-        {
-            programName += $( item ).text() + '<br>';
-        } );
-		
-	setInnerHTML( 'programField', programName );
-   
-    showDetails();
+    $('#detailsArea').load("getPatient.action", 
+		{
+			id:patientId
+		}
+		, function( html ){
+			setInnerHTML( 'detailsArea', html );
+			showDetails();
+		});
 }
 
 // -----------------------------------------------------------------------------
@@ -339,12 +273,13 @@
 			gender: jQuery( '#' + divname + ' [id=gender]' ).val(),
 			birthDate: jQuery( '#' + divname + ' [id=birthDate]' ).val(),        
 			age: jQuery( '#' + divname + ' [id=age]' ).val()
-		}, function( xmlObject )
+		}, function( xmlObject, divname )
 		{
-			checkDuplicateCompleted( xmlObject );
+			checkDuplicateCompleted( xmlObject, divname );
 		});
 }
-function checkDuplicateCompleted( messageElement )
+
+function checkDuplicateCompleted( messageElement, divname )
 {
 	checkedDuplicate = true;    
 	var type = $(messageElement).find('message').attr('type');
@@ -364,12 +299,7 @@
     }
 }
 
-/**
- * Show list patient duplicate  by jQuery thickbox plugin
- * @param rootElement : root element of the response xml
- * @param validate  :  is TRUE if this method is called from validation method  
- */
-function showListPatientDuplicate(rootElement, validate)
+function showListPatientDuplicate( rootElement, validate )
 {
 	var message = $(rootElement).find('message').text();
 	var patients = $(rootElement).find('patient');
@@ -401,7 +331,7 @@
         	var attributes = $(patient).find('attribute');
         	if( attributes.length > 0 )
         	{
-        		sPatient += "<tr><td colspan='2'><strong>"+i18n_patient_attributes+"</strong></td></tr>"
+        		sPatient += "<tr><td colspan='2'><strong>" + i18n_patient_attributes + "</strong></td></tr>"
         		$( attributes ).each( function( i, attribute )
 				{
         			sPatient +="<tr class='attributeRow'>"
@@ -414,10 +344,17 @@
         	sPatient += "</table>";
 		});
 		
-		jQuery("#thickboxContainer","#hiddenModalContent").html("").append(sPatient);
-		if( !validate ) jQuery("#btnCreateNew","#hiddenModalContent").click(function(){window.parent.tb_remove();});
-		else jQuery("#btnCreateNew","#hiddenModalContent").click(function(){window.parent.tb_remove();window.parent.checkedDuplicate = true;window.parent.validatePatient();});
-		tb_show( message, "#TB_inline?height=500&width=500&inlineId=hiddenModalContent", null);
+		sPatient = i18n_duplicate_warning + "<br>" + sPatient;
+		$('#resultSearchDiv' ).html( sPatient );
+		$('#resultSearchDiv' ).dialog({
+			title: i18n_duplicated_patient_list,
+			maximize: true, 
+			closable: true,
+			modal:true,
+			overlay:{background:'#000000', opacity:0.1},
+			width: 800,
+			height: 400
+		});
 }
 
 // -----------------------------------------------------------------------------
@@ -506,10 +443,11 @@
 		}, function()
 		{
 			showById('updatePatientDiv');
-			jQuery('#searchPatientsByNameDiv').dialog('close');
-			window.parent.tb_remove();
+			jQuery('#searchPatientsDiv').dialog('close');
 			jQuery('#loaderDiv').hide();
 		});
+		
+	jQuery('#resultSearchDiv').dialog('close');
 }
 
 function updatePatient()
@@ -868,12 +806,8 @@
 
 function addEventForPatientForm( divname )
 {
-	jQuery("#" + divname + " [id=age]").change(function() {
-		jQuery("#" + divname + " [id=birthDate]").val("");
-	});
-	
-	jQuery("#" + divname + " [id=birthDate]").change(function() {
-		jQuery("#" + divname + " [id=age]").val("");
+	jQuery("#" + divname + " [id=searchPatientByNameBtn]").click(function() {
+		getPatientsByName( divname );
 	});
 	
 	jQuery("#" + divname + " [id=checkDuplicateBtn]").click(function() {
@@ -885,6 +819,7 @@
 	});
 }
 
+
 // -----------------------------------------------------------------------------
 // Show Details
 // -----------------------------------------------------------------------------
@@ -940,3 +875,4 @@
 		n_result = n_docel;
 	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
 }
+

=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttributeValue.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttributeValue.js	2010-03-05 13:00:37 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttributeValue.js	1970-01-01 00:00:00 +0000
@@ -1,374 +0,0 @@
-//-----------------------------------------------------------------------------
-//Save
-//-----------------------------------------------------------------------------
-
-function saveAttributeValue( patientId, patientAttributeId, patientAttributeName )
-{
-	var field = document.getElementById( 'value[' + patientAttributeId + '].value' );
-    var type = document.getElementById( 'value[' + patientAttributeId + '].valueType' ).innerHTML;
-    
-    field.style.backgroundColor = '#ffffcc';
-    
-    if( field.value != '' )
-    {
-    	if( type == 'int' )
-    	{
-    		if ( !isInt( field.value ))
-            {
-                field.style.backgroundColor = '#ffcc00';
-
-                window.alert( i18n_value_must_integer + '\n\n' + patientAttributeName );
-
-                field.select();
-                field.focus();
-
-                return;
-            }
-    	}  	
-    	
-    }
-    
-    var valueSaver = new ValueSaver( patientId, patientAttributeId, field.value, '#ccffcc', '' );
-    valueSaver.save();
-    
-}
-
-function saveDate( patientId, patientAttributeId, selectedOption )
-{
-	var field = document.getElementById( 'value[' + patientAttributeId + '].date' );
- 
-	var dateSaver = new DateSaver( patientId, patientAttributeId, field.value, '#ccffcc', '' );
-	dateSaver.save();
-}
-
-function saveBoolean( patientId, patientAttributeId, selectedOption )
-{
-	selectedOption.style.backgroundColor = '#ffffcc';
- 
-	var valueSaver = new ValueSaver( patientId, patientAttributeId, selectedOption.options[selectedOption.selectedIndex].value, '#ccffcc', selectedOption );
-	valueSaver.save();
-}
-function saveCombo( patientId, patientAttributeId, selectedOption )
-{
-	selectedOption.style.backgroundColor = '#ffffcc';
-	var valueSaver = new ValueSaver( patientId, patientAttributeId, selectedOption.options[selectedOption.selectedIndex].value, '#ccffcc', selectedOption );
-	valueSaver.save();
-}
-
-// ------------------------------------------------------------------------------
-// Saver objects
-// ------------------------------------------------------------------------------
-
-function DateSaver( patientId_, patientAttributeId_, value_, resultColor_, selectedOption_ )
-{
-	var SUCCESS = '#ccffcc';
-	var ERROR = '#ffcc00';
-	
-	var patientId = patientId_;
-	var patientAttributeId = patientAttributeId_;	
-	var value = value_;
-	var resultColor = resultColor_;
-	var selectedOption = selectedOption_;
- 
-	this.save = function()
-	{
-		var request = new Request();
-		request.setCallbackSuccess( handleResponse );
-		request.setCallbackError( handleHttpError );
-		request.setResponseTypeXML( 'status' );
-		request.send( 'savePatientAttributeDateValue.action?patientId=' + patientId + '&patientAttributeId=' + patientAttributeId + '&value=' + value );		
-	};
- 
-	function handleResponse( rootElement )
-	{
-		var codeElement = rootElement.getElementsByTagName( 'code' )[0];
-		var code = parseInt( codeElement.firstChild.nodeValue );
-     
-		if ( code == 0 )
-		{
-			markValue( resultColor );                   
-		}		
-		else
-		{
-			markValue( ERROR );
-			window.alert( i18n_invalid_date );
-		}	
-		
-	}
- 
-	function handleHttpError( errorCode )
-	{
-		markValue( ERROR );
-		window.alert( i18n_saving_value_failed_error_code + '\n\n' + errorCode );
-	}   
- 
-	function markValue( color )
-	{		       
-     
-		var element = document.getElementById( 'value[' + patientAttributeId + '].date' );	
-             
-		element.style.backgroundColor = color;
-	}
-}
-
-
-function ValueSaver( patientId_, patientAttributeId_, value_, resultColor_, selectedOption_ )
-{
-	var SUCCESS = '#ccffcc';
-	var ERROR = '#ffcc00';
-	
-	var patientId = patientId_;
-	var patientAttributeId = patientAttributeId_;	
-	var value = value_;
-	var resultColor = resultColor_;
-	var selectedOption = selectedOption_;
- 
-	this.save = function()
-	{
-		var request = new Request();
-		request.setCallbackSuccess( handleResponse );
-		request.setCallbackError( handleHttpError );
-		request.setResponseTypeXML( 'status' );
-		request.send( 'savePatientAttributeValue.action?patientId=' + patientId + '&patientAttributeId=' + patientAttributeId + '&value=' + value );		
-	};
- 
-	function handleResponse( rootElement )
-	{
-		var codeElement = rootElement.getElementsByTagName( 'code' )[0];
-		var code = parseInt( codeElement.firstChild.nodeValue );
-     
-		if ( code == 0 )
-		{
-			markValue( resultColor );                   
-		}
-		else
-		{
-			markValue( ERROR );
-			window.alert( i18n_saving_value_failed_status_code + '\n\n' + code );
-		}
-	}
- 
-	function handleHttpError( errorCode )
-	{
-		markValue( ERROR );
-		window.alert( i18n_saving_value_failed_error_code + '\n\n' + errorCode );
-	}   
- 
-	function markValue( color )
-	{
-		var type = document.getElementById( 'value[' + patientAttributeId + '].valueType' ).innerHTML;       
-     
-		var element;
-     
-		if ( type == 'YES/NO' )
-		{
-			element = document.getElementById( 'value[' + patientAttributeId + '].boolean' );
-		}	
-		else if ( type == "COMBO")
-		{           
-			element = document.getElementById( 'value[' + patientAttributeId + '].combo' );                      
-		}
-		else
-		{           
-			element = document.getElementById( 'value[' + patientAttributeId + '].value' );                      
-		}
-		
-             
-		element.style.backgroundColor = color;
-	}
-}
-
-
-function isInt( value )
-{
-	var number = new Number( value );
- 
-	if ( isNaN( number ) )
-	{
-		return false;
-	}
- 
-	return true;
-}
-
-/**
- * Display patient attribute name in selection display when a value field
- * recieves focus. XXX May want to move this to a separate function, called by
- * valueFocus.
- * 
- * @param e
- *            focus event
- * @author Hans S. Tommerholt
- */
-function valueFocus(e) 
-{
-	// Retrieve the data element id from the id of the field
-	var str = e.target.id;
-	
-	var match = /.*\[(.*)\]/.exec( str ); 
-	
-	if ( ! match )
-	{				
-		return;
-	}
-
-	var attrId = match[1];	
-	
-	// Get the data element name
-	var nameContainer = document.getElementById('value[' + attrId + '].name');	
-	
-	if ( ! nameContainer )
-	{		
-		return;
-	}
-
-	var name = '';
-	
-	
-	var as = nameContainer.getElementsByTagName('a');
-
-	if ( as.length > 0 )	// Admin rights: Name is in a link
-	{
-		name = as[0].firstChild.nodeValue;
-	} 
-	else 
-	{
-		name = nameContainer.firstChild.nodeValue;
-	}
-	
-}
-
-function keyPress( event, field )
-{
-    var key = 0;
-    if ( event.charCode )
-    {
-    	key = event.charCode; /*
-								 * Safari2 (Mac) (and probably Konqueror on
-								 * Linux, untested)
-								 */
-    }
-    else
-    {
-		if ( event.keyCode )
-		{
-			key = event.keyCode; /*
-									 * Firefox1.5 (Mac/Win), Opera9 (Mac/Win),
-									 * IE6, IE7Beta2, Netscape7.2 (Mac)
-									 */
-		}
-		else
-		{
-			if ( event.which )
-			{
-				key = event.which; /*
-									 * Older Netscape? (No browsers triggered
-									 * yet)
-									 */
-			}
-	    }
-	}
-    
-    if ( key == 13 ) /* CR */
-    {
-		nextField = getNextEntryField( field );
-        if ( nextField )
-        {
-            nextField.focus(); /*
-								 * Does not seem to actually work in Safari,
-								 * unless you also have an Alert in between
-								 */
-        }
-        return true;
-    }
-    
-    /* Illegal characters can be removed with a new if-block and return false */
-    return true;
-}
-
-function getNextEntryField( field )
-{
-    var inputs = document.getElementsByName( "entryfield" );
-    
-    // Simple bubble sort
-    for ( i = 0; i < inputs.length - 1; ++i )
-    {
-        for ( j = i + 1; j < inputs.length; ++j )
-        {
-            if ( inputs[i].tabIndex > inputs[j].tabIndex )
-            {
-                tmp = inputs[i];
-                inputs[i] = inputs[j];
-                inputs[j] = tmp;
-            }
-        }
-    }
-    
-    i = 0;
-    for ( ; i < inputs.length; ++i )
-    {
-        if ( inputs[i] == field )
-        {
-            break;
-        }
-    }
-    
-    if ( i == inputs.length - 1 )
-    {
-    	// No more fields after this:
-    	return false;
-    	// First field:
-        // return inputs[0];
-    }
-    else
-    {
-        return inputs[i + 1];
-    }
-}
-
-// Validate
-// Input datetime
-function isDate( value ) {
-	var re = /^(\d{2,4})(\/|-)(\d{1,2})(\/|-)(\d{1,2})$/;
-	return (re.test(value)) ? true : false;
-}
-
-function validateAttributeValue(  patientAttributeId, patientAttributeName, type)
-{ 
-	var field = byId( patientAttributeId );
-    
-    if( field.value != '' )
-    {
-    	if( type == 'int' )
-    	{
-    		if ( !isInt( field.value ))
-            {
-                field.style.backgroundColor = '#ffcc00';
-
-                window.alert( i18n_value_must_integer + '\n\n' + patientAttributeName );
-				field.value = '';
-                
-				field.select();
-                field.focus();
-
-                return;
-            }
-    	} else if(type == 'date'){
-			if(!isDate(field.value ))
-			{
-				field.style.backgroundColor = '#ffcc00';
-			
-				window.alert( i18n_value_must_date + '\n\n' + patientAttributeName );
-				field.value = '';
-                
-				field.select();
-                field.focus();
-
-                return;
-			}
-		}
-		field.style.backgroundColor = '';
-    }
-}
-
-

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/relationship.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/relationship.js	2011-07-21 06:26:43 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/relationship.js	2011-08-01 02:39:52 +0000
@@ -172,29 +172,8 @@
 
 function addRelationship() 
 {
-	var relationshipTypeId = getFieldValue( 'relationshipTypeId' );
-	
-	var partnerList = document.getElementById( 'availablePartnersList' );
-	var partnerId = -1;
-	
-	if( partnerList.selectedIndex >= 0 )
-	{		
-		partnerId = partnerList.options[partnerList.selectedIndex].value;		
-	}	
-	
-	if( relationshipTypeId == "null" || relationshipTypeId == "" )
-	{
-		window.alert( i18n_please_select_relationship_type );
-		
-		return;
-	}
-	
-	if( partnerId == "null" || partnerId == "" || partnerId < 0 )
-	{
-		window.alert( i18n_please_select_partner );
-		
-		return;
-	}
+	var relationshipTypeId = jQuery( '#relationshipSelectForm [id=relationshipTypeId]' ).val();
+	var partnerId = jQuery( '#relationshipSelectForm [id=availablePartnersList]' ).val();
 	
 	var relTypeId = relationshipTypeId.substr( 0, relationshipTypeId.indexOf(':') );
 	var relName = relationshipTypeId.substr( relationshipTypeId.indexOf(':') + 1, relationshipTypeId.length );
@@ -244,147 +223,3 @@
 	removeItem( relationshipId, patientA + ' is ' + aIsToB + ' to ' + patientB, i18n_confirm_delete_relationship, 'removeRelationship.action' );
 }
 
-//------------------------------------------------------------------------------
-// Relationship partner
-//------------------------------------------------------------------------------
-
-function manageRepresentative( patientId, partnerId )
-{
-    var request = new Request();
-    request.setResponseTypeXML( 'partner' );
-    request.setCallbackSuccess( representativeReceived );
-    request.send( 'getPartner.action?patientId=' + patientId + '&partnerId=' + partnerId );
-}
-
-function representativeReceived( patientElement )
-{		
-	var partnerIsRepresentative = getElementValue( patientElement, 'partnerIsRepresentative' );	
-	
-	var patientId = getFieldValue('id' );
-	var partnerId = getElementValue( patientElement, 'id' );
-	var labelField;	
-	var buttonFirstField;
-	var buttonSecondField;
-	
-	if( partnerIsRepresentative == 'true' )
-	{
-		labelField = i18n_do_you_want_to_remove_this_one_from_being_representative;
-		
-		buttonFirstField = '<input type="button" value="' + i18n_yes + '" onclick="javascript:removeRepresentative( ' + patientId + ',' + partnerId + ')">'; 
-		buttonSecondField = '&nbsp;';
-	}
-	else if( partnerIsRepresentative == 'false' )
-	{
-		labelField = i18n_do_you_want_to_make_this_one_a_representative;
-		
-		buttonFirstField = '<input type="button" value="' + i18n_yes + '" onclick="javascript:saveRepresentative( ' + patientId + ',' + partnerId + ', false )">';
-		buttonSecondField= '<input type="button" value="' + i18n_yes_and_attribute + '" onclick="javascript:saveRepresentative( ' + patientId + ',' + partnerId + ', true )">';
-	}	
-	
-	setInnerHTML( 'labelField', labelField );
-	setInnerHTML( 'buttonFirstField', buttonFirstField );
-	setInnerHTML( 'buttonSecondField', buttonSecondField );
-	setInnerHTML( 'fullNameField', getElementValue( patientElement, 'fullName' ) );
-	setInnerHTML( 'genderField', getElementValue( patientElement, 'gender' ) );	
-    setInnerHTML( 'dateOfBirthField', getElementValue( patientElement, 'dateOfBirth' ) );    
-    setInnerHTML( 'ageField', getElementValue( patientElement, 'age' ) );
-	
-	var attributes = patientElement.getElementsByTagName( "attribute" );   
-    
-    var attributeValues = '';
-	
-	for( var i = 0; i < attributes.length; i++ )
-	{		
-		attributeValues = attributeValues + '<strong>' + attributes[ i ].getElementsByTagName( "name" )[0].firstChild.nodeValue  + ':  </strong>' + attributes[ i ].getElementsByTagName( "value" )[0].firstChild.nodeValue + '<br>';		
-	}
-	
-	setInnerHTML( 'attributeField', attributeValues );   
-   
-    showPartnerDetail( true );
-}
-
-function showPartnerDetail( display )
-{   
-    var node = document.getElementById( 'relationshipPartnerContainer' );
-    
-    node.style.display = (display ? 'block' : 'none');   
-}
-
-
-function hideRelationshipPartnerContainer()
-{   
-    var node = document.getElementById( 'relationshipPartnerContainer' );
-    
-    node.style.display = 'none';   
-}
-
-function saveRepresentative( patientId, representativeId, copyAttribute )
-{
-	var url = 'saveRepresentative.action'
-	var params  = 'patientId=' + patientId
-		params += '&representativeId=' + representativeId;	
-		params += '&copyAttribute=' + copyAttribute;
-	
-	
-	var request = new Request();
-	request.setResponseTypeXML( 'message' );
-	request.setCallbackSuccess( saveRepresentativeCompleted ); 
-	request.sendAsPost( params );	
-	request.send( url );        
-
-	return false;
-}
-
-function saveRepresentativeCompleted( messageElement )
-{
-	var type = messageElement.getAttribute( 'type' );
-	var message = messageElement.firstChild.nodeValue;
-	
-	if( type == 'success' )
-	{
-		hideById('relationshipPartnerContainer');
-	}	
-	else if( type == 'error' )
-	{
-		showErrorMessage( i18n_saving_representative_failed + ':' + '\n' + message );
-	}
-	else if( type == 'input' )
-	{
-		showWarningMessage( message );
-	}
-}
-
-function removeRepresentative( patientId, representativeId )
-{	
-	var url = 'removeRepresentative.action';
-	var params = 'patientId=' + patientId;
-		params +='&representativeId=' + representativeId;	
-	
-	var request = new Request();
-	request.setResponseTypeXML( 'message' );
-	request.setCallbackSuccess( removeRepresentativeCompleted );
-	request.sendAsPost( params );
-	request.send( url );        
-
-	return false;
-	
-}
-
-function removeRepresentativeCompleted( messageElement )
-{
-	var type = messageElement.getAttribute( 'type' );
-	var message = messageElement.firstChild.nodeValue;
-	
-	if( type == 'success' )
-	{
-		showRelationshipList( getFieldValue('id') );
-	}	
-	else if( type == 'error' )
-	{
-		window.alert( i18n_removing_representative_failed + ':' + '\n' + message );
-	}
-	else if( type == 'input' )
-	{
-		setHeaderMessage( message );
-	}
-}

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/relationshipPatient.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/relationshipPatient.js	2011-07-29 08:58:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/relationshipPatient.js	2011-08-01 02:39:52 +0000
@@ -42,7 +42,7 @@
     
     if ( type == 'success' )
     {
-    	removeDisabledIdentifier();
+    	removeRelationshipDisabledIdentifier();
     	addRelationshipPatient();
     }
     else if ( type == 'error' )
@@ -91,142 +91,90 @@
 //remove value of all the disabled identifier fields
 //an identifier field is disabled when its value is inherited from another person ( underAge is true ) 
 //we don't save inherited identifiers. Only save the representative id.
-function removeDisabledIdentifier()
+function removeRelationshipDisabledIdentifier()
 {
-	jQuery("input.idfield").each(function(){
+	jQuery("#addRelationshipPatientForm :input.idfield").each(function(){
 		if( jQuery(this).is(":disabled"))
 			jQuery(this).val("");
 	});
 }
 
-//get and build a param String of all the identifierType id and its value
-//excluding inherited identifiers
-function getIdParams()
-{
-	var params = "";
-	jQuery("input.idfield").each(function(){
-		if( jQuery(this).val() && !jQuery(this).is(":disabled") )
-			params += "&" + jQuery(this).attr("name") +"="+ jQuery(this).val();
-	});
-	return params;
-}
-
-
-/**
- * Show list patient duplicate  by jQuery thickbox plugin
- * @param rootElement : root element of the response xml
- * @param validate  :  is TRUE if this method is called from validation method  
- */
-function showListPatientDuplicate(rootElement, validate)
-{
-	var message = rootElement.firstChild.nodeValue;
-	var patients = rootElement.getElementsByTagName('patient');
-	var sPatient = "";
-	if( patients && patients.length > 0 )
-	{
-		for( var i = 0; i < patients.length ; i++ )
+
+//------------------------------------------------------------------------------
+// Relationship partner
+//------------------------------------------------------------------------------
+
+function manageRepresentative( patientId, partnerId )
+{		
+	$('#relationshipDetails').dialog('destroy').remove();
+	$('<div id="relationshipDetails">' ).load( 'getPartner.action', 
 		{
-			sPatient += "<hr style='margin:5px 0px;'><table>";
-			sPatient += "<tr><td><strong>"+i18n_patient_system_id+"</strong></td><td>"+ getElementValue( patients[i], 'systemIdentifier' )+"</td></tr>" ;
-			sPatient += "<tr><td><strong>"+i18n_patient_fullName+"</strong></td><td>"+ getElementValue( patients[i], 'fullName' )+"</td></tr>" ;
-			sPatient += "<tr><td><strong>"+i18n_patient_gender+"</strong></td><td>"+ getElementValue(  patients[i], 'gender' )+"</td></tr>" ;
-			sPatient += "<tr><td><strong>"+i18n_patient_date_of_birth+"</strong></td><td>"+getElementValue(  patients[i], 'dateOfBirth' ) +"</td></tr>" ;
-			sPatient += "<tr><td><strong>"+i18n_patient_age+"</strong></td><td>"+ getElementValue(  patients[i], 'age' ) +"</td></tr>" ;
-			sPatient += "<tr><td><strong>"+i18n_patient_blood_group+"</strong></td><td>"+ getElementValue(  patients[i], 'bloodGroup' ) +"</td></tr>";
-        	var identifiers =  patients[i].getElementsByTagName('identifier');
-        	if( identifiers && identifiers.length > 0 )
-        	{
-        		sPatient += "<tr><td colspan='2'><strong>"+i18n_patient_identifiers+"</strong></td></tr>"
-        		for( var j = 0; j < identifiers.length ; j++ )
-        		{
-        			sPatient +="<tr class='identifierRow'>"
-        				+"<td><strong>"+getElementValue( identifiers[j], 'name' )+"</strong></td>"
-        				+"<td>"+getElementValue( identifiers[j], 'value' )+"</td>	"	
-        				+"</tr>";
-        		}
-        	}
-        	var attributes =  patients[i].getElementsByTagName('attribute');
-        	if( attributes && attributes.length > 0 )
-        	{
-        		sPatient += "<tr><td colspan='2'><strong>"+i18n_patient_attributes+"</strong></td></tr>"
-        		for( var k = 0; k < attributes.length ; k++ )
-        		{
-        			sPatient +="<tr class='attributeRow'>"
-        				+"<td><strong>"+getElementValue( attributes[k], 'name' )+"</strong></td>"
-        				+"<td>"+getElementValue( attributes[k], 'value' )+"</td>	"	
-        				+"</tr>";
-        		}
-        	}
-        	sPatient += "<tr><td colspan='2'><input type='button' id='"+getElementValue(  patients[i], 'id' )+"' value='"+i18n_edit_this_patient+"' onclick='showUpdatePatientForm(this.id)'/></td></tr>";
-        	sPatient += "</table>";
-		}
-		jQuery("#thickboxContainer","#hiddenModalContent").html("").append(sPatient);
-		if( !validate ) jQuery("#btnCreateNew","#hiddenModalContent").click(function(){window.parent.tb_remove();});
-		else jQuery("#btnCreateNew","#hiddenModalContent").click(function(){window.parent.tb_remove();window.parent.checkedDuplicate = true; window.parent.validatePatient();});
-		tb_show( message, "#TB_inline?height=500&width=500&inlineId=hiddenModalContent", null);
-	}
-}
-
-function validatePatient()
-{
-	if( jQuery("#id").val() )
-		validateUpdatePatient();
-	else validateAddPatient();
-}
-
-function toggleUnderage( this_ )
-{
+			patientId: patientId,
+			partnerId: partnerId
+		}).dialog({
+			title: i18n_relationship_management,
+			maximize: true, 
+			closable: true,
+			modal:true,
+			overlay:{background:'#000000', opacity:0.1},
+			width: 400,
+			height: 300
+		});
+}
+
+function saveRepresentative( patientId, representativeId, copyAttribute )
+{
+	$.post( 'saveRepresentative.action', 
+		{ 
+			patientId:patientId, 
+			representativeId: representativeId,
+			copyAttribute: copyAttribute	
+		}, saveRepresentativeCompleted );
+}
+
+function saveRepresentativeCompleted( messageElement )
+{
+	var type = $(messageElement).find('message').attr('type');
+	var message = $(messageElement).find('message').text();
+		
+	if( type == 'success' )
+	{
+		jQuery('#relationshipDetails').dialog('close');
+	}	
+	else if( type == 'error' )
+	{
+		showErrorMessage( i18n_saving_representative_failed + ':' + '\n' + message );
+	}
+	else if( type == 'input' )
+	{
+		showWarningMessage( message );
+	}
+}
+
+function removeRepresentative( patientId, representativeId )
+{	
+	$.post( 'removeRepresentative.action', 
+		{ 
+			patientId:patientId, 
+			representativeId: representativeId 
+		}, removeRepresentativeCompleted );
+}
+
+function removeRepresentativeCompleted( messageElement )
+{
+	var type = $(messageElement).find('message').attr('type');
+	var message = $(messageElement).find('message').text();
 	
-	if( !jQuery(this_).is(":checked"))
-	{
-		jQuery("input.idfield").each(function(){
-			var data = jQuery(this).metadata({type:"attr",name:"data"});
-			if( data.related )
-			{
-				jQuery(this).val("");
-				jQuery(this).attr({"disabled":""});
-			}
-		});
-		jQuery(".attrField").each(function(){
-			var data = jQuery(this).metadata({type:"attr",name:"data"});
-			if( data.inheritable )
-			{
-				jQuery(this).val("");
-//				jQuery(this).attr({"disabled":""});
-			}
-		});
-	}else {
-		jQuery("input.idfield").each(function(){
-			var data = jQuery(this).metadata({type:"attr",name:"data"});
-			if( data.related )
-			{
-				jQuery(this).val(data.id);
-				jQuery(this).attr({"disabled":"disabled"});
-			}
-		});
-		jQuery(".attrField").each(function(){
-			var data = jQuery(this).metadata({type:"attr",name:"data"});
-			if( data.inheritable )
-			{
-				jQuery(this).val(data.value);
-//				jQuery(this).attr({"disabled":"disabled"});
-			}
-		});
-	}
-}
-function ageOnchange()
-{
-	jQuery("#birthDate").val("").removeClass("error").rules("remove","required");
-	jQuery("#age").rules("add",{required:true});
-
-}
-
-function bdOnchange()
-{
-	jQuery("#age").rules("remove","required");
-	jQuery("#age").val("")
-	jQuery("#birthDate").rules("add",{required:true});
-}
-
-
-
+	if( type == 'success' )
+	{
+		$('#relationshipDetails').dialog('close');
+	}	
+	else if( type == 'error' )
+	{
+		showErrorMessage( i18n_removing_representative_failed + ':' + '\n' + message );
+	}
+	else if( type == 'input' )
+	{
+		showWarningMessage( message );
+	}
+}
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/underage.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/underage.js	2011-07-29 08:58:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/underage.js	2011-08-01 02:39:52 +0000
@@ -93,24 +93,24 @@
 	
 	if ( patients.length == 0 )
 	{
-		var message = "<p>"+i18n_no_result+"</p>";
+		var message = "<p>" + i18n_no_result + "</p>";
 		container.html(message);
 	}
 	
 	$( patients ).each( function( i, patient )
     {
 		sPatient += "<hr style='margin:5px 0px;'><table>";
-		sPatient += "<tr><td><strong>"+i18n_patient_system_id+"</strong></td><td>"+ $( patient ).find('systemIdentifier').text() +"</td></tr>" ;
-		sPatient += "<tr><td><strong>"+i18n_patient_fullName+"</strong></td><td>"+ $( patient ).find('fullName').text() +"</td></tr>" ;
-		sPatient += "<tr><td><strong>"+i18n_patient_gender+"</strong></td><td>"+ $( patient ).find('gender').text() +"</td></tr>" ;
-		sPatient += "<tr><td><strong>"+i18n_patient_date_of_birth+"</strong></td><td>"+ $( patient ).find('dateOfBirth').text() +"</td></tr>" ;
-		sPatient += "<tr><td><strong>"+i18n_patient_age+"</strong></td><td>"+ $( patient ).find('age').text() +"</td></tr>" ;
-		sPatient += "<tr><td><strong>"+i18n_patient_blood_group+"</strong></td><td>"+ $( patient ).find('bloodGroup').text() +"</td></tr>";
+		sPatient += "<tr><td><strong>" + i18n_patient_system_id + "</strong></td><td>" + $( patient ).find('systemIdentifier').text() + "</td></tr>" ;
+		sPatient += "<tr><td><strong>" + i18n_patient_full_name + "</strong></td><td>" + $( patient ).find('fullName').text() + "</td></tr>" ;
+		sPatient += "<tr><td><strong>" + i18n_patient_gender + "</strong></td><td>" + $( patient ).find('gender').text() + "</td></tr>" ;
+		sPatient += "<tr><td><strong>" + i18n_patient_date_of_birth + "</strong></td><td>" + $( patient ).find('dateOfBirth').text() + "</td></tr>" ;
+		sPatient += "<tr><td><strong>" + i18n_patient_age + "</strong></td><td>" + $( patient ).find('age').text() + "</td></tr>" ;
+		sPatient += "<tr><td><strong>" + i18n_patient_blood_group + "</strong></td><td>" + $( patient ).find('bloodGroup').text() + "</td></tr>";
 		
 		var identifiers =  $( patient ).find('identifier');
 		$( identifiers ).each( function( i, identifier )
 		{
-			sPatient +="<tr class='identifierRow"+ $(identifier).find('id').text() + "' id='iden" + $(identifier).find('id' ).text() + "'>"
+			sPatient +="<tr class='identifierRow" + $(identifier).find('id').text() + "' id='iden" + $(identifier).find('id' ).text() + "'>"
 				+"<td><strong>" + $(identifier).find('name').text() + "</strong></td>"
 				+"<td class='value'>" + $(identifier).find('value').text() + "</td>	"	
 				+"</tr>";

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/listPatient.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/listPatient.vm	2011-07-27 08:12:52 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/listPatient.vm	2011-08-01 02:39:52 +0000
@@ -1,3 +1,4 @@
+
 <table>
 	<tr>
 		<td>$i18n.getString( "search_result_matching_the_search_criteria" )</td>
@@ -20,7 +21,7 @@
 		<td>$!total</td>
 	</tr>
 </table>
-
+#if( $patients.size() > 0 )
 <table class="mainPageTable">
 	<tr>
     <td>    
@@ -127,34 +128,10 @@
 </table>
 
 <div id="detailsArea" style="display:none;overflow:auto;height:250px;width:250px">
-	<div style="float:right">
-		<a href="javascript:hideDetails()" title="$i18n.getString( 'hide_details' )"><img src="../images/close.png" alt="$i18n.getString( 'hide_details' )"></a>
-	</div>
-	<p><label><strong>$i18n.getString( "common_info" ):</strong></label><br><span id="commonInfoField"></span></p>	
-	<p><label><strong>$i18n.getString( "identifier" ):</strong></label><br><span id="identifierField"></span></p>
-	<p><label><strong>$i18n.getString( "attributes" ):</strong></label><br><span id="attributeField"></span></p>
-	<p><label><strong>$i18n.getString( "enrolled_in_program" ):</strong></label><br><span id="programField"></span></p>
 </div>
-
+#end
 <script type="text/javascript">
-	
-	var i18n_list_all_patient = '$encoder.jsEscape( $i18n.getString( "list_all_patients" ), "'" )';
-	var i18n_list_patients_by_program = '$encoder.jsEscape( $i18n.getString( "list_patients_by_program" ) , "'" )';
-	
 	jQuery(document).ready(function(){	
 		tableSorter( 'patientList' );
 	});
-	
-	var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_patient" ) , "'" )';
-	var i18n_adding_patient_failed = '$encoder.jsEscape( $i18n.getString( "adding_patient_failed" ), "'")';
-	var i18n_updating_patient_failed = '$encoder.jsEscape( $i18n.getString( "updating_patient_failed" ), "'")';	
-	var i18n_none = '$encoder.jsEscape( $i18n.getString( "none" ), "'")';
-	
-	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_blood_group = '$encoder.jsEscape( $i18n.getString( "blood_group" ), "'")';
-	
 </script>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientForm.vm	2011-07-29 08:58:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientForm.vm	2011-08-01 02:39:52 +0000
@@ -25,7 +25,7 @@
 		<td><label for="fullName">$i18n.getString( "full_name" )</label></td>
 		<td class="input-column" >
 			<input type="text" id="fullName" name="fullName" style="width:28em" class="{validate:{required:true, unicodechars:true, rangelength:[7,50]}}"/>
-			<img src='../images/search.png' onclick='getPatientsByName();' style="cursor: pointer;" width="20" height="20"/>
+			<img src='../images/search.png' id="searchPatientByNameBtn" name="searchPatientByNameBtn" style="cursor: pointer;" width="20" height="20"/>
 		</td>
 	</tr>
 		
@@ -57,7 +57,7 @@
 	<tr id='birthdaySpan' style="display:none" >
 		<td><label for="birthDate">$i18n.getString( "date_of_birth" )<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
 		<td>			
-			<input type="text" id="birthDate" name="birthDate" style="width:26.5em" onchange="bdOnchange()" />
+			<input type="text" id="birthDate" name="birthDate" style="width:26.5em" />
 		</td>
 		<td></td>
 	</tr>
@@ -70,7 +70,7 @@
 				<option value="M"> $i18n.getString('month')</option>
 				<option value="Y"> $i18n.getString('year')</option>
 			</select>
-			<input type="text" id="age" name="age" style="width:9.7em" onchange="ageOnchange()" class="{validate:{number:true, alphanumeric: true}}"/>
+			<input type="text" id="age" name="age" style="width:9.7em" class="{validate:{number:true, alphanumeric: true}}"/>
 		</td>
 		<td></td>
 	</tr>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programUnenrollmentSelectForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programUnenrollmentSelectForm.vm	2011-07-20 06:34:34 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programUnenrollmentSelectForm.vm	2011-08-01 02:39:52 +0000
@@ -111,7 +111,8 @@
 				#elseif( $attribute.valueType == "DATE" )
 					<input type="text" style="width:180px" id="attr$attribute.id" name="attr$attribute.id" class=' #validate( "default"  $attribute.mandatory )'>
 					<script type="text/javascript">
-						datePickerValid( 'attr$attribute.id' );
+						var attributeId = 'attr' + '$attribute.id'
+						datePickerValid( attributeId );
 					</script>                       
 				#elseif( $attribute.valueType == "COMBO" )
 					<select id="attr$attribute.id" name="attr$attribute.id" style="width:200px">

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/relationshipList.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/relationshipList.vm	2011-07-21 06:26:43 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/relationshipList.vm	2011-08-01 02:39:52 +0000
@@ -4,10 +4,7 @@
 
 <h3>$i18n.getString( "relationship_management" )</h3>
 
-<div>
-    <input type="hidden" id="id" name="id" value="$patient.id">    
-</div>
-
+<input type="hidden" id="id" name="id" value="$patient.id">
 <div id="selectedPatientContainer" style="border:1px solid #808080; padding:10px;">
     <table class="mainPageTable">                           
         <tr>              
@@ -85,17 +82,19 @@
                     #end
                 </tbody>
             </table>
-        </td>       
+        </td> 
     </tr>         
 </table>
 
-<div id="relationshipPartnerContainer" style="width:20em; padding-left:2em; vertical-align:top">
-
-    <div id="detailsArea" style="display:none">
+<div id="detailsArea" style="display:none; width:100%; padding-left:2em; vertical-align:top">
+	<table>
+		<tr>
+			<td>
 				<div style="float:right">
 					<a href="javascript:hideDetails()" title="$i18n.getString( 'hide_details' )"><img src="../images/close.png" alt="$i18n.getString( 'hide_details' )"></a>
 				</div>	                     
-        
+			</td>
+			<td>
                 <strong>$i18n.getString( "full_name" ):</strong><span id="fullNameField"></span><br>
                 <strong>$i18n.getString( "gender" ):</strong><span id="genderField"></span><br>
                 <strong>$i18n.getString( "date_of_birth" ):</strong><span id="dateOfBirthField"></span><br>
@@ -126,9 +125,6 @@
     var i18n_removing_representative_failed = '$encoder.jsEscape( $i18n.getString( "removing_representative_failed" ) , "'" )';
     var i18n_removing_relationship_failed = '$encoder.jsEscape( $i18n.getString( "removing_relationship_failed" ) , "'" )';        
     var i18n_adding_relationship_failed = '$encoder.jsEscape( $i18n.getString( "adding_relationship_failed" ) , "'" )';
-    var i18n_yes = '$encoder.jsEscape( $i18n.getString( "yes" ) , "'" )';                
-    var i18n_do_you_want_to_remove_this_one_from_being_representative = '$encoder.jsEscape( $i18n.getString( "do_you_want_to_remove_this_one_from_being_representative" ) , "'" )';
-    var i18n_do_you_want_to_make_this_one_a_representative = '$encoder.jsEscape( $i18n.getString( "do_you_want_to_make_this_one_a_representative" ) , "'" )';
-    var i18n_yes_and_attribute = '$encoder.jsEscape( $i18n.getString( "yes_and_attribute" ) , "'" )';                    
+	var i18n_relationship_management = '$encoder.jsEscape( $i18n.getString( "relationship_management" ) , "'" )';
 </script>
 

=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/responsePartner.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/responsePartner.vm	2011-07-19 03:48:05 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/responsePartner.vm	1970-01-01 00:00:00 +0000
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<partner> 
-  <partnerIsRepresentative>$partnerIsRepresentative</partnerIsRepresentative>
-  <id>$partner.id</id>  
-  <fullName>$encoder.xmlEncode( $partner.getFullName() )</fullName>
-  <gender>$encoder.xmlEncode( $partner.gender )</gender>
-  <dateOfBirth>$format.formatDate( $partner.birthDate )</dateOfBirth>
-  <age>$encoder.xmlEncode( $partner.getAge() )</age>
-  #foreach( $patientIdentifier in $partner.identifiers )
-    <identifier>        
-        <identifierText>$encoder.xmlEncode( $patientIdentifier.identifier )</identifierText>
-     </identifier>
-  #end
-  #foreach( $attribute in $partner.attributes )
-    #set( $attributeValue = false )
-    #set( $attributeValue = $patientAttributeValueMap.get( $attribute.id ) )             
-    <attribute>
-        <name>$encoder.xmlEncode( $attribute.name )</name>
-        <value>$encoder.xmlEncode( $attributeValue )</value>
-    </attribute> 
-  #end  
-  #foreach( $program in $partner.programs )
-    <program>
-        <name>$encoder.xmlEncode( $program.name )</name>
-    </program> 
-  #end         
-</partner>
-

=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/responsePatient.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/responsePatient.vm	2011-07-20 06:34:34 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/responsePatient.vm	1970-01-01 00:00:00 +0000
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<patient>
-  <id>$patient.id</id>  
-  <fullName>$encoder.xmlEncode( $patient.getFullName() )</fullName>
-  <gender>$encoder.xmlEncode( $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>
-  <bloodGroup>#if($!patient.bloodGroup) $patient.bloodGroup #else $i18n.getString('none') #end</bloodGroup>
-  <identifiers>    
-  #foreach( $patientIdentifier in $patient.identifiers )
-    <identifier>        
-        <identifierText>$encoder.xmlEncode( $patientIdentifier.identifier )</identifierText>
-     </identifier>
-  #end
-  </identifiers>   
-  <attributes>
-  #foreach( $attribute in $patient.attributes )
-    #set( $attributeValue = $patientAttributeValueMap.get( $attribute.id ) )             
-    <attribute>
-        <name>$encoder.xmlEncode( $attribute.name )</name>
-        <value>$encoder.xmlEncode( $attributeValue )</value>
-    </attribute> 
-  #end 
-  </attributes> 
-  <programs>  
-  #foreach( $program in $patient.programs )
-    <program>
-        <name>$encoder.xmlEncode( $program.name )</name>
-    </program> 
-  #end    
-  </programs>   
-</patient>
-

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/resultSearchPatients.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/resultSearchPatients.vm	2011-05-13 09:11:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/resultSearchPatients.vm	2011-08-01 02:39:52 +0000
@@ -20,7 +20,7 @@
 	<tbody>
 		#set($mark = false)
 		#foreach( $patient  in $patients )
-			<tr id="tr${patient.id}" #alternate($mark) onclick='showUpdatePatientForm($patient.id)' style="cursor:pointer">
+			<tr id="tr${patient.id}" #alternate($mark) onclick='showUpdatePatientForm($patient.id)' style="cursor:pointer" title="$i18n.getString('update_this_patient')">
 				<td>
 					#set( $nr = ( ( $paging.getCurrentPage() - 1  ) * $paging.pageSize ) + $velocityCount )
 					$nr

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/selectPatient.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/selectPatient.vm	2011-07-27 08:12:52 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/selectPatient.vm	2011-08-01 02:39:52 +0000
@@ -42,7 +42,6 @@
 			<td><input type="button" value='$i18n.getString( "search" )' onclick='searchPatients();'></td>
 			<td>&nbsp;</td>
 			<td><input type="button" value='$i18n.getString( "add_new" )' onclick="showAddPatientForm();"></td>
-			
 		</tr>
 		
 		<tr>
@@ -62,7 +61,7 @@
 <div id='listPatientDiv'></div> <!-- List searching patients -->
 <div id='addPatientDiv'></div> <!-- Add Patient Form -->
 <div id='updatePatientDiv'></div> <!-- Update Patient Form -->
-<div id='searchPatientsByNameDiv'></div> <!-- List searching patients by name -->
+<div id='resultSearchDiv' style='font-size:13px'></div> <!-- List searching patients -->
 <div id='enrollmentDiv'></div> <!-- Program Enrollment Form -->
 <div id='listRelationshipDiv'></div> <!-- List relationship -->
 <div id='addRelationshipDiv'></div> <!-- Add relationship -->
@@ -78,7 +77,10 @@
 	var i18n_save_success = '$encoder.jsEscape( $i18n.getString( "save_success" ) , "'")';
 	var i18n_list_all_patient = '$encoder.jsEscape( $i18n.getString( "list_all_patient" ) , "'")';
 	var i18n_enrol_success = '$encoder.jsEscape( $i18n.getString( "enrol_success" ) , "'")';
-	
+	var i18n_list_patients_by_program = '$encoder.jsEscape( $i18n.getString( "list_patients_by_program" ) , "'" )';
+	var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_patient" ) , "'" )';
+	var i18n_adding_patient_failed = '$encoder.jsEscape( $i18n.getString( "adding_patient_failed" ), "'")';
+	var i18n_updating_patient_failed = '$encoder.jsEscape( $i18n.getString( "updating_patient_failed" ), "'")';	
 	var i18n_program_enrollment_failed = '$encoder.jsEscape( $i18n.getString( "program_enrollment_failed" ) , "'")';
     var i18n_saving_value_failed_status_code = '$encoder.jsEscape( $i18n.getString( "saving_value_failed_status_code" ) , "'")';
     var i18n_saving_value_failed_error_code = '$encoder.jsEscape( $i18n.getString( "saving_value_failed_error_code" ) , "'")';
@@ -87,22 +89,25 @@
 	var i18n_date_less_incident = '$encoder.jsEscape( $i18n.getString( "date_less_incident" ) , "'")';
 	var i18n_enroll = '$encoder.jsEscape( $i18n.getString( "enroll" ) , "'")';
 	var i18n_update = '$encoder.jsEscape( $i18n.getString( "update" ) , "'")';
-
+	var i18n_oucode_must_have_9_digits = '$encoder.jsEscape( $i18n.getString( "oucode_must_be_valid" ) , "'")';
 	var i18n_patient_identifiers = '$encoder.jsEscape( $i18n.getString( "patient_identifiers" ) , "'")';
 	var i18n_patient_attributes = '$encoder.jsEscape( $i18n.getString( "patient_attributes" ) , "'")';
-	var i18n_patient_fullName = '$encoder.jsEscape( $i18n.getString( "full_name" ) , "'")';
+	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_blood_group = '$encoder.jsEscape( $i18n.getString( "blood_group" ) , "'")';
 	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" ) , "'")';
 	var i18n_child_representative = '$encoder.jsEscape( $i18n.getString( "child_representative" ) , "'")';
-    var i18n_oucode_must_have_9_digits = '$encoder.jsEscape( $i18n.getString( "oucode_must_be_valid" ) , "'")';
 	var i18n_no_patients_found = '$encoder.jsEscape( $i18n.getString( "no_patients_found" ) , "'")';
 	var i18n_search_result = '$encoder.jsEscape( $i18n.getString( "search_result" ) , "'")';
+	var i18n_duplicated_patient_list = '$encoder.jsEscape( $i18n.getString( "duplicated_patient_list" ) , "'")';
+	var i18n_duplicate_warning = '$encoder.jsEscape( $i18n.getString( "duplicate_warning" ) , "'")';
 	var checkedDuplicate = false;
 	
 	isAjax = true;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm	2011-07-29 08:58:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm	2011-08-01 02:39:52 +0000
@@ -3,6 +3,7 @@
 		
 		jQuery("#tabs").tabs();
 		hideById('addRepresentativeForm [id=underAgeDiv]');
+		hideById('addRepresentativeForm [id=searchPatientByNameBtn]');
 		addEventForPatientForm('addRepresentativeForm');
 		
 		jQuery("#searchForm").validate({
@@ -40,44 +41,7 @@
 				}
 		});
 
-		// Esc key for jQuery thickbox
-		// jQuery thickbox already has this event
-		// but somehow it's over written by jQuery tabs plugin
-		document.onkeydown = function(e){ 	
-			if (e == null) { // ie
-				keycode = event.keyCode;
-			} else { // mozilla
-				keycode = e.which;
-			}
-
-			if(keycode == 27){ // close
-				window.parent.tb_remove();
-			}
-		}
 	}); 
-
-	var i18n_patient_identifiers = '$encoder.jsEscape( $i18n.getString( "patient_identifiers" ) , "'")';
-	var i18n_patient_attributes = '$encoder.jsEscape( $i18n.getString( "patient_attributes" ) , "'")';
-	var i18n_patient_fullName = '$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_age = '$encoder.jsEscape( $i18n.getString( "age" ) , "'")';
-	var i18n_patient_blood_group = '$encoder.jsEscape( $i18n.getString( "blood_group" ) , "'")';
-	var i18n_choose_this_person = '$encoder.jsEscape( $i18n.getString( "choose_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" ) , "'")';
-	var i18n_child_representative = '$encoder.jsEscape( $i18n.getString( "child_representative" ) , "'")';
-	var i18n_no_result = '$encoder.jsEscape( $i18n.getString( "no_result" ) , "'")';
-	var i18n_error_connect_to_server = '$encoder.jsEscape( $i18n.getString( "error_connect_to_server" ) , "'")';
-	var i18n_please_enter_value = '$encoder.jsEscape( $i18n.getString( "please_enter_value" ) , "'")';
-	var i18n_please_select_search_type = '$encoder.jsEscape( $i18n.getString( "please_select_search_type" ) , "'")';
-	var i18n_please_select_identifier_type = '$encoder.jsEscape( $i18n.getString( "please_select_identifier_type" ) , "'")';
-	var i18n_please_select_attribute_type = '$encoder.jsEscape( $i18n.getString( "please_select_attribute_type" ) , "'")';
-	var i18n_add_person_successfully = '$encoder.jsEscape( $i18n.getString( "add_person_successfully" ) , "'")';
-	var i18n_please_select_relationshipType = '$encoder.jsEscape( $i18n.getString( "please_select_relationshipType" ) , "'")';
-	var i18n_no_patients_found = '$encoder.jsEscape( $i18n.getString( "no_patients_found" ) , "'")';
-	var i18n_search_result = '$encoder.jsEscape( $i18n.getString( "search_result" ) , "'")';
 </script>
 
 <!-- TAB Header -->

=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttributeValueForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttributeValueForm.vm	2011-04-28 08:15:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttributeValueForm.vm	1970-01-01 00:00:00 +0000
@@ -1,187 +0,0 @@
-<div>
-    <input type="button" value="$i18n.getString( 'back_to_search' )" onclick="window.location.href='patient.action'" style="width:10em"/>
-</div>
-
-
-<h3>$i18n.getString( "update_patient_attribute" )</h3>
-
-<form id="updatePatientAttributeValueForm" name="updatePatientAttributeValueForm" action="updatePatientAttribute.action" method="post" onsubmit="return validateUpdatePatientAttribute()">
-
-<div>
-    <input type="hidden" id="patientId" name="patientId" value="$patient.id"/>
-</div>
-
-<table>
-    <tr>
-        <td><strong>$i18n.getString( "full_name" ):</strong></td>
-        <td>           
-            $encoder.htmlEncode( $patient.getFullName() )  
-        </td>
-    </tr>
-    <tr>
-        <td><strong>$i18n.getString( "gender" ):</strong></td>
-        <td>            
-            $encoder.htmlEncode( $patient.gender )
-        </td>
-    </tr>    
-    <tr>
-        <td><strong>$i18n.getString( "date_of_birth" ):</strong></td>
-        <td>            
-            $format.formatDate( $patient.birthDate )
-        </td>
-    </tr>
-    <tr>
-        <td><strong>$i18n.getString( "age" ):</strong></td>
-        <td>            
-            $encoder.htmlEncode( $patient.getAge() )
-        </td>
-    </tr>     
-    <tr>
-        <td>&nbsp;</td>
-    </tr>
-        
-</table>
-
-<br/><br/>
-<table width="100%">
-	<col width="10%"/>
-    <col width="40%"/>    
-    <col width="20%"/>
-    <col width="30"/>
-    <tr>
-        <th style="text-align: center">$i18n.getString( "nr" )</th>
-        <th>$i18n.getString( "attribute" )</th>  
-        <th>$i18n.getString( "value_type" )</th>              
-        <th>$i18n.getString( "entry" )</th>        
-    </tr>
-    
-#set( $rowCount = 0 )
-#set( $mark = 0 )
-#set( $tabIndex = 1 )
-#foreach( $attributeGroup in $patientAttributeGroups )
-<tr style="background-color: #BFD0FF; "><td colspan="4">$attributeGroup.name</td></tr>
-#set( $patientAttributes = $attributeGroup.getAttributes() )
-#foreach( $patientAttribute in $patientAttributes )
-    #set( $rowCount = $rowCount + 1 )    
-    #if( $mark == 1 )
-        #set( $mark = 0 )
-    #else
-        #set( $mark = 1 )
-    #end    
-    #set( $patientAttributeValue = false )
-    #set( $patientAttributeValue = $patientAttributeValueMap.get( $patientAttribute.id ) )    
-    <tr #if( $mark == 0 ) style="background-color:#dddddd" #end>
-        ##rowCount
-        <td style="text-align: center">$rowCount</td>
-                
-        ##attribute name
-        <td>
-            <span id="value[$patientAttribute.id].name" title="$!encoder.htmlEncode( $patientAttribute.description )">
-                $encoder.htmlEncode( $patientAttribute.name )            
-            </span>
-        </td>        
-        ##type        
-        <td>            
-            <span id="value[$patientAttribute.id].valueType">$encoder.htmlEncode( $patientAttribute.valueType )</span>
-        </td>       
-        ##entry        
-        <td>        
-            #if( $patientAttribute.valueType == "YES/NO" )
-                <select name="entryselect" id="value[$patientAttribute.id].boolean" onchange="saveBoolean( $patient.id, $patientAttribute.id, this )" style="width:100%" tabindex="$tabIndex">              
-                    <option value="">[$i18n.getString( "please_select" )]</option>
-                    <option value="true" #if( $patientAttributeValue.value == "true" ) selected="selected" #end>$i18n.getString( "yes" )</option>
-                    <option value="false" #if( $patientAttributeValue.value == "false" ) selected="selected" #end>$i18n.getString( "no" )</option>
-                </select>                
-            #elseif( $patientAttribute.valueType == "DATE" )
-                <input type="text" id="value[$patientAttribute.id].date" name="entryfield" value="$!encoder.htmlEncode( $patientAttributeValue.value )" onchange="saveDate( $patient.id, $patientAttribute.id, '$encoder.jsEncode( $patientAttribute.name )' )" tabindex="$tabIndex" />
-                <img src="../images/calendar_icon.gif" width="16" height="16" id="getDateValue$patientAttribute.id" style="cursor: pointer;" title="$i18n.getString( 'date_selector' )" onmouseover="this.style.background='orange';" onmouseout="this.style.background=''" alt="$i18n.getString( 'date' )"/>
-                    <script type="text/javascript">
-                        Calendar.setup({
-                            inputField     :    "value[$patientAttribute.id].date",      // id of the input field
-                            ifFormat       :    "$i18n.getString("format.date.label")",       // format of the input field
-                            button         :    "getDateValue$patientAttribute.id"   // trigger for the calendar (button ID)
-                        });
-                    </script>     
-            #elseif( $patientAttribute.valueType == "COMBO" )
-					<select name="entryselect" id="value[$patientAttribute.id].combo"  name="entryfield" onchange="saveCombo( $patient.id, $patientAttribute.id, this)" tabindex="$tabIndex" >
-						<option value="">[$i18n.getString( "please_select" )]</option>
-						#foreach ($option in $patientAttribute.attributeOptions )
-							<option value="$option.id" #if($patientAttributeValue.patientAttributeOption.id == $option.id ) selected="selected" #end>$option.name</option>
-						#end
-					</select>
-            #else
-                <input name="entryfield" id="value[$patientAttribute.id].value" type="text" value="$!encoder.htmlEncode( $patientAttributeValue.value )" onchange="saveAttributeValue( $patient.id, $patientAttribute.id, '$encoder.jsEncode( $dataElement.name )' )" onkeypress="return keyPress(event, this)" tabindex="$tabIndex" />
-            #end
-        </td>
-    </tr>
-    #set( $tabIndex = $tabIndex + 1 )
-#end
-#end
-<tr style="background-color: #BFD0FF;"><td colspan="4">$i18n.getString("other_attributes")</td></tr>
-#foreach( $patientAttribute in $patientNoGroupAttributes )
-    #set( $rowCount = $rowCount + 1 )    
-    #if( $mark == 1 )
-        #set( $mark = 0 )
-    #else
-        #set( $mark = 1 )
-    #end    
-    #set( $patientAttributeValue = false )
-    #set( $patientAttributeValue = $patientAttributeValueMap.get( $patientAttribute.id ) )    
-    <tr #if( $mark == 0 ) style="background-color:#dddddd" #end>
-        ##rowCount
-        <td style="text-align: center">$rowCount</td>
-                
-        ##attribute name
-        <td>
-            <span id="value[$patientAttribute.id].name" title="$!encoder.htmlEncode( $patientAttribute.description )">
-                $encoder.htmlEncode( $patientAttribute.name )            
-            </span>
-        </td>        
-        ##type        
-        <td>            
-            <span id="value[$patientAttribute.id].valueType">$encoder.htmlEncode( $patientAttribute.valueType )</span>
-        </td>       
-        ##entry        
-        <td>        
-            #if( $patientAttribute.valueType == "YES/NO" )
-                <select name="entryselect" id="value[$patientAttribute.id].boolean" onchange="saveBoolean( $patient.id, $patientAttribute.id, this )" style="width:100%" tabindex="$tabIndex">              
-                    <option value="">[$i18n.getString( "please_select" )]</option>
-                    <option value="true" #if( $patientAttributeValue.value == "true" ) selected="selected" #end>$i18n.getString( "yes" )</option>
-                    <option value="false" #if( $patientAttributeValue.value == "false" ) selected="selected" #end>$i18n.getString( "no" )</option>
-                </select>                
-            #elseif( $patientAttribute.valueType == "DATE" )
-                <input type="text" id="value[$patientAttribute.id].date" name="entryfield" value="$!encoder.htmlEncode( $patientAttributeValue.value )" onchange="saveDate( $patient.id, $patientAttribute.id, '$encoder.jsEncode( $patientAttribute.name )' )" tabindex="$tabIndex" >
-                    <img src="../images/calendar_icon.gif" width="16" height="16" id="getDateValue$patientAttribute.id" style="cursor: pointer;" title="$i18n.getString( 'date_selector' )" onmouseover="this.style.background='orange';" onmouseout="this.style.background=''" alt="$i18n.getString( 'date' )"/>
-                    <script type="text/javascript">
-                        Calendar.setup({
-                            inputField     :    "value[$patientAttribute.id].date",      // id of the input field
-                            ifFormat       :    "$i18n.getString("format.date.label")",       // format of the input field
-                            button         :    "getDateValue$patientAttribute.id"   // trigger for the calendar (button ID)
-                        });
-                    </script>     
-            #elseif( $patientAttribute.valueType == "COMBO" )
-					<select name="entryselect" id="value[$patientAttribute.id].combo"  name="entryfield" onchange="saveCombo( $patient.id, $patientAttribute.id, this )" tabindex="$tabIndex"  >
-						<option value="">[$i18n.getString( "please_select" )]</option>
-						#foreach ($option in $patientAttribute.attributeOptions )
-							<option value="$option.id" #if($patientAttributeValue.patientAttributeOption.id == $option.id ) selected="selected" #end>$option.name</option>
-						#end
-					</select>
-            #else
-                <input name="entryfield" id="value[$patientAttribute.id].value" type="text" value="$!encoder.htmlEncode( $patientAttributeValue.value )" onchange="saveAttributeValue( $patient.id, $patientAttribute.id, '$encoder.jsEncode( $dataElement.name )' )" onkeypress="return keyPress(event, this)" tabindex="$tabIndex" />
-            #end
-        </td>       
-    </tr>
-    #set( $tabIndex = $tabIndex + 1 )
-#end
-</table>
-
-</form>
-
-<script type="text/javascript">    
-    var i18n_value_must_integer = '$encoder.jsEscape( $i18n.getString( "value_must_integer" ) , "'")';
-    var i18n_invalid_date = '$encoder.jsEscape( $i18n.getString( "invalid_date" ) , "'")'; 
-    var i18n_saving_value_failed_status_code = '$encoder.jsEscape( $i18n.getString( "saving_value_failed_status_code" ) , "'")';
-    var i18n_saving_value_failed_error_code = '$encoder.jsEscape( $i18n.getString( "saving_value_failed_error_code" ) , "'")';
-    var i18n_searching_patient_failed = '$encoder.jsEscape( $i18n.getString( "searching_patient_failed" ) , "'")';
-    var i18n_duplicate_identifier = 'Duplicate Identifier';
-</script>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientForm.vm	2011-07-29 08:58:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientForm.vm	2011-08-01 02:39:52 +0000
@@ -12,8 +12,8 @@
 	
 	jQuery(document).ready(	function(){
 
-		datePickerValid( 'birthDate' );
-		datePickerValid( 'deathDate' );
+		datePickerValid( 'updatePatientForm [id=birthDate]' );
+		datePickerValid( 'updatePatientForm [id=deathDate]' );
 		addEventForPatientForm('updatePatientForm');
 		
 		jQuery("#btnRepresentativeInfo").cluetip(
@@ -30,22 +30,28 @@
 					}
 				,beforeValidateHandler: function(form)
 					{
-						var dobType = $('#dobType').val();
+						var dobType = $('#updatePatientForm [id=dobType]').val();
 						
 						if( dobType=='V' || dobType=='D' ) 
 						{
-							var birthDate = $('#birthDate').val();
+							var birthDate = $('#updatePatientForm [id=birthDate]').val();
 							if( birthDate != '' ){
-								$("#memberValidator").val(birthDate);
+								$("#updatePatientForm [id=memberValidator]").val(birthDate);
 							}
 						}else{
-							var age = $('#age').val();
-							$("#memberValidator").val(age);
+							var age = $('#updatePatientForm [id=age]').val();
+							$("#updatePatientForm [id=memberValidator]").val(age);
 						}
 						
 					}
 			});
-					
+		
+		dobTypeOnChange( 'updatePatientForm' );
+		checkedDuplicate = false;
+		if("$!patient.dobType" == 'A'){ 
+			var i18n_please_select_relationshipType = '$encoder.jsEscape( $i18n.getString( "please_verify_birthday" ) , "'")';
+			alert(i18n_please_select_relationshipType);
+		}			
 	});
 	
 </script>
@@ -92,7 +98,6 @@
 				<option value="A" #if($patient.dobType=='A') selected #end>$i18n.getString( "approximated" )</option>
 			</select>
         </td>
-	   <td></td>
 	</tr>
 	
 	<tr id='ageSpan' style="display:none" >
@@ -103,7 +108,8 @@
 				<option value="M" #if($patient.getAgeType()=='M') selected #end> $i18n.getString('month')</option>
 				<option value="Y" #if($patient.getAgeType()=='Y') selected #end> $i18n.getString('year')</option>
 			</select>
-			<input type="text" id="age" name="age" value="$patient.getIntegerValueOfAge()" style="width:12em" class="{validate:{number:true, alphanumeric: true}}">
+			<input type="text" id="age" name="age" style="width:12em" class="{validate:{number:true, alphanumeric: true}}">
+			$!patient.getAge()
 		</td>
 	</tr>
 
@@ -142,7 +148,7 @@
 	<tr>
 		<td>$i18n.getString("is_underage")</td>
 		<td>
-			<input type="checkbox" name="underAge" id="underAge" onclick="toggleUnderAge(this);" value="true" #if($patient.underAge) checked="checked" #end/>
+			<input type="checkbox" name="underAge" id="underAge" onclick="toggleUnderAge(this);" value="true" #if($patient.underAge == "true") checked="checked" #end/>
 		</td>
 	</tr>
 	
@@ -321,13 +327,3 @@
 	       
 </table>
 </div>
-
-<script>
-	dobTypeOnChange();
-	checkedDuplicate = false;
-	if('$!patient.dobType' == 'A'){
-		var i18n_please_select_relationshipType = '$encoder.jsEscape( $i18n.getString( "please_verify_birthday" ) , "'")';
-		alert(i18n_please_select_relationshipType);
-	}
-	
-</script>
\ No newline at end of file