← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7270: [mobile] add person relationship

 

------------------------------------------------------------
revno: 7270
committer: Long <thanhlongngo1988@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-06-11 17:11:21 +0700
message:
  [mobile] add person relationship
added:
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/AddNewRalationshipAction.java
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetAddNewRelationshipFormAction.java
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetRelationshipFormAction.java
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/addNewRelationshipForm.vm
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/findRelatedPatientForm.vm
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/relatedPatientList.vm
modified:
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/FindBeneficiarytAction.java
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetFindBeneficiaryFormAction.java
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetPatientProgramListAction.java
  dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties
  dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryList.vm
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryProgramList.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
=== added file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/AddNewRalationshipAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/AddNewRalationshipAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/AddNewRalationshipAction.java	2012-06-11 10:11:21 +0000
@@ -0,0 +1,134 @@
+package org.hisp.dhis.light.namebaseddataentry.action;
+
+import org.hisp.dhis.patient.Patient;
+import org.hisp.dhis.patient.PatientService;
+import org.hisp.dhis.relationship.Relationship;
+import org.hisp.dhis.relationship.RelationshipService;
+import org.hisp.dhis.relationship.RelationshipTypeService;
+
+import com.opensymphony.xwork2.Action;
+
+public class AddNewRalationshipAction
+    implements Action
+{
+    private static final String REDIRECT = "redirect";
+
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private RelationshipService relationshipService;
+
+    public RelationshipService getRelationshipService()
+    {
+        return relationshipService;
+    }
+
+    public void setRelationshipService( RelationshipService relationshipService )
+    {
+        this.relationshipService = relationshipService;
+    }
+
+    private RelationshipTypeService relationshipTypeService;
+
+    public RelationshipTypeService getRelationshipTypeService()
+    {
+        return relationshipTypeService;
+    }
+
+    public void setRelationshipTypeService( RelationshipTypeService relationshipTypeService )
+    {
+        this.relationshipTypeService = relationshipTypeService;
+    }
+
+    private PatientService patientService;
+
+    public PatientService getPatientService()
+    {
+        return patientService;
+    }
+
+    public void setPatientService( PatientService patientService )
+    {
+        this.patientService = patientService;
+    }
+
+    // -------------------------------------------------------------------------
+    // Input & Output
+    // -------------------------------------------------------------------------
+
+    private Integer relatedPatientId;
+
+    public Integer getRelatedPatientId()
+    {
+        return relatedPatientId;
+    }
+
+    public void setRelatedPatientId( Integer relatedPatientId )
+    {
+        this.relatedPatientId = relatedPatientId;
+    }
+
+    private Integer originalPatientId;
+
+    public void setOriginalPatientId( Integer originalPatientId )
+    {
+        this.originalPatientId = originalPatientId;
+    }
+
+    public Integer getOriginalPatientId()
+    {
+        return originalPatientId;
+    }
+
+    private Integer relationshipTypeId;
+
+    public Integer getRelationshipTypeId()
+    {
+        return relationshipTypeId;
+    }
+
+    public void setRelationshipTypeId( Integer relationshipTypeId )
+    {
+        this.relationshipTypeId = relationshipTypeId;
+    }
+
+    private String relationship;
+
+    public String getRelationship()
+    {
+        return relationship;
+    }
+
+    public void setRelationship( String relationship )
+    {
+        this.relationship = relationship;
+    }
+
+    @Override
+    public String execute()
+        throws Exception
+    {
+        Relationship newRelationship = new Relationship();
+        Patient patientA = patientService.getPatient( originalPatientId );
+        Patient patientB = patientService.getPatient( relatedPatientId );
+
+        newRelationship.setRelationshipType( relationshipTypeService.getRelationshipType( relationshipTypeId ) );
+
+        if ( relationship.equals( "A" ) )
+        {
+            newRelationship.setPatientA( patientA );
+            newRelationship.setPatientB( patientB );
+        }
+        else
+        {
+            newRelationship.setPatientA( patientB );
+            newRelationship.setPatientB( patientA );
+        }
+
+        relationshipService.saveRelationship( newRelationship );
+
+        return REDIRECT;
+    }
+
+}

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/FindBeneficiarytAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/FindBeneficiarytAction.java	2012-06-05 07:38:12 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/FindBeneficiarytAction.java	2012-06-11 10:11:21 +0000
@@ -35,6 +35,7 @@
     implements Action
 {
     private static final String REDIRECT = "redirect";
+
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------
@@ -90,9 +91,9 @@
     {
         this.organisationUnitId = organisationUnitId;
     }
-    
+
     private Integer patientId;
-    
+
     public Integer getPatientId()
     {
         return patientId;
@@ -103,6 +104,32 @@
         this.patientId = patientId;
     }
 
+    // Use in search related patient
+
+    private Integer originalPatientId;
+
+    public void setOriginalPatientId( Integer originalPatientId )
+    {
+        this.originalPatientId = originalPatientId;
+    }
+
+    public Integer getOriginalPatientId()
+    {
+        return originalPatientId;
+    }
+
+    private Integer relationshipTypeId;
+
+    public Integer getRelationshipTypeId()
+    {
+        return relationshipTypeId;
+    }
+
+    public void setRelationshipTypeId( Integer relationshipTypeId )
+    {
+        this.relationshipTypeId = relationshipTypeId;
+    }
+
     @Override
     public String execute()
         throws Exception
@@ -119,7 +146,8 @@
         }
 
         patients = patientService.getPatientsForMobile( keyword, organisationUnitId );
-        if (patients.size() == 1) {
+        if ( patients.size() == 1 )
+        {
             Patient patient = patients.iterator().next();
             patientId = patient.getId();
             return REDIRECT;

=== added file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetAddNewRelationshipFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetAddNewRelationshipFormAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetAddNewRelationshipFormAction.java	2012-06-11 10:11:21 +0000
@@ -0,0 +1,126 @@
+package org.hisp.dhis.light.namebaseddataentry.action;
+
+import org.hisp.dhis.patient.Patient;
+import org.hisp.dhis.patient.PatientService;
+import org.hisp.dhis.relationship.RelationshipType;
+import org.hisp.dhis.relationship.RelationshipTypeService;
+import com.opensymphony.xwork2.Action;
+
+public class GetAddNewRelationshipFormAction
+    implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+    private RelationshipTypeService relationshipTypeService;
+
+    public RelationshipTypeService getRelationshipTypeService()
+    {
+        return relationshipTypeService;
+    }
+
+    public void setRelationshipTypeService( RelationshipTypeService relationshipTypeService )
+    {
+        this.relationshipTypeService = relationshipTypeService;
+    }
+
+    private PatientService patientService;
+
+    public PatientService getPatientService()
+    {
+        return patientService;
+    }
+
+    public void setPatientService( PatientService patientService )
+    {
+        this.patientService = patientService;
+    }
+
+    // -------------------------------------------------------------------------
+    // Input & Output
+    // -------------------------------------------------------------------------
+
+    private Integer relatedPatientId;
+
+    public Integer getRelatedPatientId()
+    {
+        return relatedPatientId;
+    }
+
+    public void setRelatedPatientId( Integer relatedPatientId )
+    {
+        this.relatedPatientId = relatedPatientId;
+    }
+
+    private Integer originalPatientId;
+
+    public Integer getOriginalPatientId()
+    {
+        return originalPatientId;
+    }
+
+    public void setOriginalPatientId( Integer originalPatientId )
+    {
+        this.originalPatientId = originalPatientId;
+    }
+
+    private Integer relationshipTypeId;
+
+    public Integer getRelationshipTypeId()
+    {
+        return relationshipTypeId;
+    }
+
+    public void setRelationshipTypeId( Integer relationshipTypeId )
+    {
+        this.relationshipTypeId = relationshipTypeId;
+    }
+
+    private Patient relatedPatient;
+
+    public Patient getRelatedPatient()
+    {
+        return relatedPatient;
+    }
+
+    public void setRelatedPatient( Patient relatedPatient )
+    {
+        this.relatedPatient = relatedPatient;
+    }
+
+    private Patient originalPatient;
+
+    public Patient getOriginalPatient()
+    {
+        return originalPatient;
+    }
+
+    public void setOriginalPatient( Patient originalPatient )
+    {
+        this.originalPatient = originalPatient;
+    }
+
+    private RelationshipType relationshipType;
+
+    public RelationshipType getRelationshipType()
+    {
+        return relationshipType;
+    }
+
+    public void setRelationshipType( RelationshipType relationshipType )
+    {
+        this.relationshipType = relationshipType;
+    }
+
+    @Override
+    public String execute()
+        throws Exception
+    {
+        originalPatient = patientService.getPatient( originalPatientId );
+        relatedPatient = patientService.getPatient( relatedPatientId );
+        relationshipType = relationshipTypeService.getRelationshipType( relationshipTypeId );
+
+        return SUCCESS;
+    }
+
+}

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetFindBeneficiaryFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetFindBeneficiaryFormAction.java	2012-06-05 09:30:22 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetFindBeneficiaryFormAction.java	2012-06-11 10:11:21 +0000
@@ -70,6 +70,32 @@
     {
         this.organisationUnits = organisationUnits;
     }
+    
+    //use in find relation person
+    
+    private Integer originalPatientId;
+    
+    public Integer getOriginalPatientId()
+    {
+        return originalPatientId;
+    }
+
+    public void setOriginalPatientId( Integer originalPatientId )
+    {
+        this.originalPatientId = originalPatientId;
+    }
+    
+    private Integer relationshipTypeId;
+    
+    public Integer getRelationshipTypeId()
+    {
+        return relationshipTypeId;
+    }
+
+    public void setRelationshipTypeId( Integer relationshipTypeId )
+    {
+        this.relationshipTypeId = relationshipTypeId;
+    }
 
     @Override
     public String execute()

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetPatientProgramListAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetPatientProgramListAction.java	2012-06-05 07:38:12 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetPatientProgramListAction.java	2012-06-11 10:11:21 +0000
@@ -42,6 +42,8 @@
 import org.hisp.dhis.program.ProgramService;
 import org.hisp.dhis.relationship.Relationship;
 import org.hisp.dhis.relationship.RelationshipService;
+import org.hisp.dhis.relationship.RelationshipType;
+import org.hisp.dhis.relationship.RelationshipTypeService;
 
 import com.opensymphony.xwork2.Action;
 
@@ -111,6 +113,18 @@
     {
         this.relationshipService = relationshipService;
     }
+    
+    public RelationshipTypeService relationshipTypeService;
+    
+    public RelationshipTypeService getRelationshipTypeService()
+    {
+        return relationshipTypeService;
+    }
+
+    public void setRelationshipTypeService( RelationshipTypeService relationshipTypeService )
+    {
+        this.relationshipTypeService = relationshipTypeService;
+    }
 
     // -------------------------------------------------------------------------
     // Input & Output
@@ -163,7 +177,9 @@
     {
         this.enrollmentProgramList = enrollmentProgramList;
     }
-
+    
+    //Use for add relationship
+    
     private List<Patient> relatedPeople;
 
     public List<Patient> getRelatedPeople()
@@ -175,6 +191,30 @@
     {
         this.relatedPeople = relatedPeople;
     }
+    
+    private Collection<RelationshipType> relationshipTypes;
+    
+    public Collection<RelationshipType> getRelationshipTypes()
+    {
+        return relationshipTypes;
+    }
+
+    public void setRelationshipTypes( Collection<RelationshipType> relationshipTypes )
+    {
+        this.relationshipTypes = relationshipTypes;
+    }
+    
+    private Boolean validated;
+    
+    public Boolean getValidated()
+    {
+        return validated;
+    }
+
+    public void setValidated( Boolean validated )
+    {
+        this.validated = validated;
+    }
 
     @Override
     public String execute()
@@ -207,7 +247,8 @@
                 relatedPeople.add( relationship.getPatientB() );
             }
         }
-
+        
+        relationshipTypes = relationshipTypeService.getAllRelationshipTypes();
         return SUCCESS;
     }
 

=== added file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetRelationshipFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetRelationshipFormAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetRelationshipFormAction.java	2012-06-11 10:11:21 +0000
@@ -0,0 +1,22 @@
+package org.hisp.dhis.light.namebaseddataentry.action;
+
+import com.opensymphony.xwork2.Action;
+
+public class GetRelationshipFormAction implements Action
+{
+    private Integer originalPatientId;
+    
+    private Integer relatedPatientId;
+    
+    private Integer relationshipTypeId;
+    
+    
+    @Override
+    public String execute()
+        throws Exception
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml	2012-06-05 07:38:12 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml	2012-06-11 10:11:21 +0000
@@ -235,6 +235,8 @@
 			ref="org.hisp.dhis.program.ProgramService"/>
 		<property name="relationshipService"
 			ref="org.hisp.dhis.relationship.RelationshipService"/>
+		<property name="relationshipTypeService"
+			ref="org.hisp.dhis.relationship.RelationshipTypeService"/>
 		<property name="util"
 			ref="org.hisp.dhis.light.utils.NamebasedUtils"/>
 	</bean>
@@ -266,7 +268,28 @@
 			ref="org.hisp.dhis.program.ProgramStageService"/>
 		<property name="programStageInstanceService"
 			ref="org.hisp.dhis.program.ProgramStageInstanceService"/>
+	</bean>
+	
+	<bean
+		id="org.hisp.dhis.light.namebaseddataentry.action.GetAddNewRelationshipFormAction"
+		class="org.hisp.dhis.light.namebaseddataentry.action.GetAddNewRelationshipFormAction">
+		<property name="relationshipTypeService"
+			ref="org.hisp.dhis.relationship.RelationshipTypeService"/>
+		<property name="patientService"
+			ref="org.hisp.dhis.patient.PatientService"/>
 	</bean>
+	
+	<bean
+		id="org.hisp.dhis.light.namebaseddataentry.action.AddNewRalationshipAction"
+		class="org.hisp.dhis.light.namebaseddataentry.action.AddNewRalationshipAction">
+		<property name="relationshipTypeService"
+			ref="org.hisp.dhis.relationship.RelationshipTypeService"/>
+		<property name="patientService"
+			ref="org.hisp.dhis.patient.PatientService"/>
+		<property name="relationshipService"
+			ref="org.hisp.dhis.relationship.RelationshipService"/>
+	</bean>
+	
 	
 	<!-- Beneficiary Registration -->
 	

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties	2012-06-05 07:38:12 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties	2012-06-11 10:11:21 +0000
@@ -86,4 +86,8 @@
 please_select=Please Select
 enroll_in_program=Enroll In Program
 relationships=Relationships
-phone_number=Phone Number
\ No newline at end of file
+phone_number=Phone Number
+add_relationships=Add Relationships
+related_person_search=Related Person Search
+related_person_list=Related Person List
+add_relationship=Add Relationship
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml	2012-06-05 07:38:12 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml	2012-06-11 10:11:21 +0000
@@ -159,6 +159,14 @@
 				/dhis-web-light/namebased/findBeneficiaryForm.vm</param>
 		</action>
 		
+		<action name="showFindRelatedPatientForm"
+			class="org.hisp.dhis.light.namebaseddataentry.action.GetFindBeneficiaryFormAction">
+			<result name="success" type="velocity">
+				/dhis-web-light/main.vm</result>
+			<param name="page">
+				/dhis-web-light/namebased/findRelatedPatientForm.vm</param>
+		</action>
+		
 		<action name="findBeneficiary"
 			class="org.hisp.dhis.light.namebaseddataentry.action.FindBeneficiarytAction">
 			<result name="redirect" type="redirect">showPatientProgramList.action?patientId=${patientId}</result>
@@ -168,6 +176,28 @@
 				/dhis-web-light/namebased/beneficiaryList.vm</param>
 		</action>
 		
+		<action name="showAddNewRelationshipForm"
+			class="org.hisp.dhis.light.namebaseddataentry.action.GetAddNewRelationshipFormAction">
+			<result name="success" type="velocity">
+				/dhis-web-light/main.vm</result>
+			<param name="page">
+				/dhis-web-light/namebased/addNewRelationshipForm.vm</param>
+		</action>
+		
+		<action name="findRelatedPatient"
+			class="org.hisp.dhis.light.namebaseddataentry.action.FindBeneficiarytAction">
+			<result name="redirect" type="redirect">showAddNewRelationshipForm.action?originalPatientId=${originalPatientId}&amp;relatedPatientId=${patientId}&amp;relationshipTypeId=${relationshipTypeId}</result>
+			<result name="success" type="velocity">
+				/dhis-web-light/main.vm</result>
+			<param name="page">
+				/dhis-web-light/namebased/relatedPatientList.vm</param>
+		</action>
+		
+		<action name="addNewRelationship"
+			class="org.hisp.dhis.light.namebaseddataentry.action.AddNewRalationshipAction">
+			<result name="redirect" type="redirect">showPatientProgramList.action?patientId=${originalPatientId}&amp;validated=true</result>
+		</action>
+		
 		<action name="showPatientProgramList"
 			class="org.hisp.dhis.light.namebaseddataentry.action.GetPatientProgramListAction">
 			<result name="success" type="velocity">

=== added file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/addNewRelationshipForm.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/addNewRelationshipForm.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/addNewRelationshipForm.vm	2012-06-11 10:11:21 +0000
@@ -0,0 +1,34 @@
+<h2>$i18n.getString( "add_relationship" )</h2>
+
+<form action="addNewRelationship.action" method="POST">
+<div class="header-box" align="center">
+<input type="hidden" name="originalPatientId" value="$originalPatientId"/>	
+<input type="hidden" name="relatedPatientId" value="$relatedPatientId"/>	
+<input type="hidden" name="relationshipTypeId" value="$relationshipTypeId"/>	
+	<p style="text-align: left;">
+		<label>$originalPatient.getFullName() is</label>
+		<select name="relationship" style="width: 100%;">
+			<option value="$relationshipType.getaIsToB()">$relationshipType.getaIsToB()</option>
+			<option value="$relationshipType.getbIsToA()">$relationshipType.getbIsToA()</option>
+		</select>
+		<label>of $relatedPatient.getFullName()</label>
+	</p>
+
+</div>
+
+<div class="header-box" align="center">
+	<p>
+		<input type="submit" style="width: 100%;" value="$i18n.getString("add")" />
+	</p>
+</div>
+
+</form>
+
+<div id="footer">
+<h2>$i18n.getString( "navigate_to" )</h2>
+<ul>
+	<li> <a href="showPatientProgramList.action?patientId=$originalPatientId"> $i18n.getString("program_list")</a> </li>
+	<li> <a href="trackingMenu.action"> $i18n.getString("tracking_menu")</a> </li>
+	<li><a href="index.action">$i18n.getString("home")</a></li>
+</ul>
+</div>

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryList.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryList.vm	2012-06-05 07:38:12 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryList.vm	2012-06-11 10:11:21 +0000
@@ -1,11 +1,5 @@
 <h2>$i18n.getString( "beneficiary_list" )</h2>
-	#if( $validated)
-		<div class="header-box">
-			<h3 style="text-align: left;">$i18n.getString("successfully_saved")</h3>
-		</div>
-	#else	
-	
-	#end
+
 <p>
 <ul>
 #foreach( $patient in $patients )

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryProgramList.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryProgramList.vm	2012-06-05 07:38:12 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryProgramList.vm	2012-06-11 10:11:21 +0000
@@ -1,4 +1,11 @@
 <h2>$!encoder.htmlEncode( ${patient.getFullName()} )</h2>
+	#if( $validated)
+		<div class="header-box">
+			<h3 style="text-align: left;">$i18n.getString("successfully_saved")</h3>
+		</div>
+	#else	
+	
+	#end
 <p>
 	<ul>
 		#foreach( $programInstance in $programInstances )
@@ -45,7 +52,16 @@
 <p>
 	<ul>
 		#foreach( $person in $relatedPeople )
-			<li><a href="">$!encoder.htmlEncode( ${person.getFullName()} )</a></li>
+			<li><a href="showPatientProgramList.action?patientId=$person.id">$!encoder.htmlEncode( ${person.getFullName()} )</a></li>
+		#end
+	</ul>
+</p>
+
+<h2>$i18n.getString("add_relationships")</h2>
+<p>
+	<ul>
+		#foreach( $relationshipType in $relationshipTypes )
+			<li><a href="showFindRelatedPatientForm.action?originalPatientId=$patient.id&relationshipTypeId=$relationshipType.id">Add $relationshipType.getName()</a></li>
 		#end
 	</ul>
 </p>

=== added file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/findRelatedPatientForm.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/findRelatedPatientForm.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/findRelatedPatientForm.vm	2012-06-11 10:11:21 +0000
@@ -0,0 +1,49 @@
+<h2>$i18n.getString( "related_person_search" )</h2>
+
+	#if( $validated == true)
+		<div class="header-box">
+			<h3 style="text-align: left;">$i18n.getString("successfully_saved")</h3>
+		</div>
+	#else
+	
+	#end
+
+<form action="findRelatedPatient.action" method="POST">
+<div class="header-box" align="center">
+<input type="hidden" name="originalPatientId" value="$originalPatientId"/>	
+<input type="hidden" name="relationshipTypeId" value="$relationshipTypeId"/>	
+	<p style="text-align: left;">
+		<label>$i18n.getString( "search_by_name_or_id" )</label>
+		#if( $validationMap.get( "keyword" ) )
+           	<br /><span style="color: #990000;"> $i18n.getString($validationMap.get( "fullName" ))</span>
+     	#end
+		<input type="text" name="keyword" value="$!previousValues.get("fullName")" />
+	</p>
+		<p style="text-align: left;">
+		<label>$i18n.getString( "select_orgunit" )</label>
+		<select name="organisationUnitId">
+			<option value="0">$i18n.getString( "all_orgunit" )</option>
+			#foreach($orgUnit in $organisationUnits)
+				<option value="$orgUnit.getId()">$orgUnit.getName()</option>
+			#end
+		</select>
+	</p>
+	
+</div>
+
+<div class="header-box" align="center">
+	<p>
+		<input type="submit" style="width: 100%;" value="$i18n.getString("search")" />
+	</p>
+</div>
+
+</form>
+
+<div id="footer">
+<h2>$i18n.getString( "navigate_to" )</h2>
+<ul>
+	<li> <a href="showPatientProgramList.action?patientId=$originalPatientId"> $i18n.getString("program_list")</a> </li>
+	<li><a href="selectRegistrationOrganisationUnit.action">$i18n.getString( "beneficiary_registration" )</a></li>
+	<li><a href="index.action">$i18n.getString("home")</a></li>
+</ul>
+</div>

=== added file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/relatedPatientList.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/relatedPatientList.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/relatedPatientList.vm	2012-06-11 10:11:21 +0000
@@ -0,0 +1,24 @@
+<h2>$i18n.getString( "related_person_list" )</h2>
+	#if( $validated)
+		<div class="header-box">
+			<h3 style="text-align: left;">$i18n.getString("successfully_saved")</h3>
+		</div>
+	#else	
+	
+	#end
+<p>
+<ul>
+#foreach( $patient in $patients )
+	<li><a href="showAddNewRelationshipForm.action?originalPatientId=$originalPatientId&relatedPatientId=$patient.id&relationshipTypeId=$relationshipTypeId">$!encoder.htmlEncode( ${patient.getFullName()} )</a></li>
+#end
+</ul>
+</p>
+<p><strong>Total found: $patients.size() </strong> #if($patients.size() == 0)<a href="selectRegistrationOrganisationUnit.action">$i18n.getString( "add_new_person" )</a> #end</p>
+
+<div id="footer">
+<h2>$i18n.getString( "navigate_to" )</h2>
+<ul>
+	<li> <a href="showFindRelatedPatientForm.action?originalPatientId=$originalPatientId&relationshipTypeId=$relationshipTypeId"> $i18n.getString("find_related_person")</a></li>
+	<li><a href="index.action">$i18n.getString("home")</a></li>
+</ul>
+</div>
\ No newline at end of file