← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7896: Add dashboard function for patient module.

 

------------------------------------------------------------
revno: 7896
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2012-08-12 13:10:50 +0700
message:
  Add dashboard function for patient module.
added:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/PatientDashboardAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/images/flag-blue.png
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientLocationAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/images/close.gif
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientRegistrationList.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/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
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientLocationAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientLocationAction.java	2012-03-27 14:19:09 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientLocationAction.java	2012-08-12 06:10:50 +0000
@@ -60,7 +60,7 @@
     }
 
     // -------------------------------------------------------------------------
-    // Action implementation
+    // Getter && Setter
     // -------------------------------------------------------------------------
 
     private Integer patientId;

=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/PatientDashboardAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/PatientDashboardAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/PatientDashboardAction.java	2012-08-12 06:10:50 +0000
@@ -0,0 +1,204 @@
+/*
+ * 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.caseentry.action.patient;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.hisp.dhis.patient.Patient;
+import org.hisp.dhis.patient.PatientIdentifier;
+import org.hisp.dhis.patient.PatientService;
+import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
+import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
+import org.hisp.dhis.program.ProgramInstance;
+import org.hisp.dhis.program.ProgramInstanceService;
+import org.hisp.dhis.program.ProgramStageInstance;
+import org.hisp.dhis.program.ProgramStageInstanceService;
+import org.hisp.dhis.program.comparator.ProgramStageInstanceDueDateComparator;
+import org.hisp.dhis.relationship.Relationship;
+import org.hisp.dhis.relationship.RelationshipService;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Chau Thu Tran
+ * 
+ * @version PatientDashboardAction.java 1:30:29 PM Aug 10, 2012 $
+ */
+public class PatientDashboardAction
+    implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private PatientService patientService;
+
+    private PatientAttributeValueService patientAttributeValueService;
+
+    private RelationshipService relationshipService;
+
+    private ProgramInstanceService programInstanceService;
+
+    private ProgramStageInstanceService programStageInstanceService;
+
+    // -------------------------------------------------------------------------
+    // Input && Output
+    // -------------------------------------------------------------------------
+
+    private Integer patientId;
+
+    private Patient patient;
+
+    private Set<PatientIdentifier> identifiers;
+
+    private Collection<PatientAttributeValue> attributeValues;
+
+    private Collection<Relationship> relationship;
+
+    private Collection<ProgramInstance> activeProgramInstances;
+    
+    private Collection<ProgramInstance> completedProgramInstances;
+
+    private Map<Integer, Integer> statusMap = new HashMap<Integer, Integer>();
+
+    // -------------------------------------------------------------------------
+    // Action implementation
+    // -------------------------------------------------------------------------
+
+    public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService )
+    {
+        this.programStageInstanceService = programStageInstanceService;
+    }
+
+    public void setPatientAttributeValueService( PatientAttributeValueService patientAttributeValueService )
+    {
+        this.patientAttributeValueService = patientAttributeValueService;
+    }
+
+    public Collection<ProgramInstance> getActiveProgramInstances()
+    {
+        return activeProgramInstances;
+    }
+
+    public Collection<ProgramInstance> getCompletedProgramInstances()
+    {
+        return completedProgramInstances;
+    }
+
+    public void setRelationshipService( RelationshipService relationshipService )
+    {
+        this.relationshipService = relationshipService;
+    }
+
+    public void setProgramInstanceService( ProgramInstanceService programInstanceService )
+    {
+        this.programInstanceService = programInstanceService;
+    }
+
+    public Patient getPatient()
+    {
+        return patient;
+    }
+
+    public Set<PatientIdentifier> getIdentifiers()
+    {
+        return identifiers;
+    }
+
+    public Collection<PatientAttributeValue> getAttributeValues()
+    {
+        return attributeValues;
+    }
+
+    public Collection<Relationship> getRelationship()
+    {
+        return relationship;
+    }
+
+    public void setPatientService( PatientService patientService )
+    {
+        this.patientService = patientService;
+    }
+
+    public void setPatientId( Integer patientId )
+    {
+        this.patientId = patientId;
+    }
+
+    public Map<Integer, Integer> getStatusMap()
+    {
+        return statusMap;
+    }
+
+    // -------------------------------------------------------------------------
+    // Action implementation
+    // -------------------------------------------------------------------------
+
+    @Override
+    public String execute()
+        throws Exception
+    {
+        patient = patientService.getPatient( patientId );
+
+        identifiers = patient.getIdentifiers();
+
+        attributeValues = patientAttributeValueService.getPatientAttributeValues( patient );
+
+        relationship = relationshipService.getRelationshipsForPatient( patient );
+
+        Collection<ProgramInstance> programInstances = programInstanceService.getProgramInstances( patient );
+
+        activeProgramInstances = new HashSet<ProgramInstance>();
+        
+        completedProgramInstances = new HashSet<ProgramInstance>();
+        
+        for ( ProgramInstance programInstance : programInstances )
+        {
+            if( programInstance.isCompleted() )
+            {
+                completedProgramInstances.add( programInstance );
+            }
+            else
+            {
+                activeProgramInstances.add( programInstance );
+            }
+            statusMap.putAll( programStageInstanceService.statusProgramStageInstances( programInstance
+                .getProgramStageInstances() ) );
+        }
+
+        return SUCCESS;
+    }
+
+}

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2012-08-09 10:47:22 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2012-08-12 06:10:50 +0000
@@ -986,5 +986,22 @@
 		<property name="programStageInstanceService"
 			ref="org.hisp.dhis.program.ProgramStageInstanceService" />
 	</bean>
+	
+	<!-- Dashboard -->
+	
+	<bean id="org.hisp.dhis.caseentry.action.patient.PatientDashboardAction"
+		class="org.hisp.dhis.caseentry.action.patient.PatientDashboardAction"
+		scope="prototype">
+		<property name="patientService"
+			ref="org.hisp.dhis.patient.PatientService" />
+		<property name="patientAttributeValueService"
+			ref="org.hisp.dhis.patientattributevalue.PatientAttributeValueService" />
+		<property name="relationshipService"
+			ref="org.hisp.dhis.relationship.RelationshipService" />
+		<property name="programInstanceService"
+			ref="org.hisp.dhis.program.ProgramInstanceService" />
+		<property name="programStageInstanceService"
+			ref="org.hisp.dhis.program.ProgramStageInstanceService" />
+	</bean>
 
 </beans>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2012-08-09 14:21:01 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2012-08-12 06:10:50 +0000
@@ -391,7 +391,7 @@
 sms = SMS
 sms_reminder = SMS Reminder
 sms_reminder_list = SMS reminder list
-patient_did_not_register_a_phone_number = The patient did not register a phone number
+patient_did_not_register_a_phone_number = The person did not register a phone number
 sms_message_management = SMS message management
 date = Date
 sms_message_details = SMS message details
@@ -403,4 +403,8 @@
 clickatell_gw=Clickatell Gateway
 generic_http_gw=Generic HTTP Gateway
 modem_gw=Modem Gateway
-messages = messages
\ No newline at end of file
+messages = messages
+patient_dashboard = Person dashboard
+completed_programs = Completed programs
+active_programs = Active programs
+completed = Completed
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2012-08-09 10:47:22 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2012-08-12 06:10:50 +0000
@@ -819,6 +819,14 @@
 	      <result name="error" type="velocity-json">/dhis-web-commons/ajax/jsonResponseError.vm</result>
 	      <param name="onExceptionReturn">plainTextError</param>
 	    </action>
+	    
+	    <!-- Dashboard -->
+	    
+	    <action name="patientDashboard" class="org.hisp.dhis.caseentry.action.patient.PatientDashboardAction">
+	      <result name="success" type="velocity">/content.vm</result>
+		  <param name="page">/dhis-web-caseentry/patientDashboard.vm</param>
+		  <param name="stylesheets">style/style.css</param>
+	    </action>
 		
 	</package>
 </struts>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/images/close.gif'
Binary files dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/images/close.gif	2010-02-22 09:19:15 +0000 and dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/images/close.gif	2012-08-12 06:10:50 +0000 differ
=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/images/flag-blue.png'
Binary files dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/images/flag-blue.png	1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/images/flag-blue.png	2012-08-12 06:10:50 +0000 differ
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js	2012-08-06 09:34:34 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js	2012-08-12 06:10:50 +0000
@@ -305,16 +305,17 @@
 	hideById('selectDiv');
 	hideById('searchDiv');
 	hideById('migrationPatientDiv');
-				
+	setInnerHTML('patientDashboard','');
+	
 	jQuery('#loaderDiv').show();
 	jQuery('#editPatientDiv').load('showUpdatePatientForm.action',
 		{
 			id:patientId
 		}, function()
 		{
-			showById('editPatientDiv');
 			jQuery('#searchPatientsDiv').dialog('close');
 			jQuery('#loaderDiv').hide();
+			showById('editPatientDiv');
 		});
 		
 	jQuery('#resultSearchDiv').dialog('close');
@@ -343,6 +344,7 @@
 	hideById('selectDiv');
 	hideById('searchDiv');
 	hideById('migrationPatientDiv');
+	setInnerHTML('patientDashboard','');
 				
 	jQuery('#loaderDiv').show();
 	jQuery('#enrollmentDiv').load('showProgramEnrollmentForm.action',
@@ -531,6 +533,7 @@
 function showRelationshipList( patientId )
 {
 	hideById('addRelationshipDiv');
+	setInnerHTML('patientDashboard','');
 	
 	if ( getFieldValue('isShowPatientList') == 'false' )
 	{
@@ -569,6 +572,7 @@
 	hideById('listRelationshipDiv');
 	hideById('addRelationshipDiv');
 	hideById('migrationPatientDiv');
+	setInnerHTML('patientDashboard','');
 }
 
 function loadPatientList()
@@ -814,6 +818,7 @@
 	hideById('listPatientDiv');
 	hideById('selectDiv');
 	hideById('searchDiv');
+	setInnerHTML('patientDashboard','');
 				
 	jQuery('#loaderDiv').show();
 	
@@ -835,3 +840,74 @@
 			showSuccessMessage( i18n_save_success );
 		} );
 }
+
+// ----------------------------------------------------------------
+// Dash board
+// ----------------------------------------------------------------
+
+function activeProgramInstanceDiv( programInstanceId )
+{
+	jQuery("[name=eventDiv]").each(function(){
+		jQuery(this).removeClass("link-area-active");
+	});
+	
+	jQuery("[name=imgActive]").each(function(){
+		jQuery(this).attr('src','');
+	});
+	
+	jQuery('#pi_' + programInstanceId ).addClass("link-area-active");
+	jQuery("#img_" + programInstanceId ).attr('src','images/flag-blue.png');
+	showById('pi_' + programInstanceId);
+}
+
+function hideProgramInstanceDiv( programInstanceId )
+{
+	hideById('pi_' + programInstanceId);
+	jQuery('#pi_' + programInstanceId).removeClass("link-area-active");
+	jQuery("#img_" + programInstanceId ).attr('src','');
+}
+
+function showPatientDashboardForm( patientId )
+{
+	hideById('listPatientDiv');
+	hideById('editPatientDiv');
+	hideById('selectDiv');
+	hideById('searchDiv');
+	hideById('migrationPatientDiv');
+				
+	jQuery('#loaderDiv').show();
+	jQuery('#patientDashboard').load('patientDashboard.action',
+		{
+			patientId:patientId
+		}, function()
+		{	
+			showById('patientDashboard');
+			jQuery('#loaderDiv').hide();
+		});
+}
+
+function loadProgramStageRecords( programStageInstanceId, completed ) 
+{
+	showLoader();
+    jQuery('#dataEntryFromDashboard').load( "viewProgramStageRecords.action",
+		{
+			programStageInstanceId: programStageInstanceId
+		}, function() {
+			if(completed){
+				jQuery( "#dataEntryFromDashboard :input").each(function(){
+					disable(this.id);
+				});
+			}
+			showById('dataEntryFormDashboardDiv');
+			hideLoader();
+		}).dialog(
+		{
+			title:i18n_program_stage,
+			maximize:true, 
+			closable:true,
+			modal:false,
+			overlay:{background:'#000000', opacity:0.1},
+			width:1000,
+			height:500
+		});
+}

=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm	2012-08-12 06:10:50 +0000
@@ -0,0 +1,196 @@
+<h4>$i18n.getString("patient_dashboard")
+ &#8226; <a href="javascript:showUpdatePatientForm( '$patient.id', true )">$i18n.getString( "edit_profile" )</a>
+ &#8226; <a href="javascript:setFieldValue( 'isShowPatientList', 'false' ); showRelationshipList( '$patient.id' );">$i18n.getString( "manage_relationship" )</a>
+ &#8226; <a href="javascript:getPatientLocation( '$patient.id' );">$i18n.getString( "change_patient_location" )</a>
+</h4>
+
+
+<div id="subMenu">
+	<ul>
+		<li><a href="javascript:onClickBackBtn();">$i18n.getString( 'back_to_registration' )</a></li>
+		<li><a href="javascript:showProgramEnrollmentSelectForm( '$patient.id' )">$i18n.getString( "program_management" )</a></li>
+	</ul>
+</div>
+
+<table>
+	<tr>
+		<td valign='top'>
+			<table>
+				<tr>
+					<td>
+						<div class="link-area">
+							<table width='100%'>
+								<tr><th>$i18n.getString("demographics")</th></tr>
+							</table>
+							<div class="contentProviderTable">
+								<table>
+									<tr>
+										<td>$i18n.getString("full_name")</td>
+										<td>$!patient.getFullName()</td>
+									</tr>
+									<tr>
+										<td>$i18n.getString("gender")</td>
+										<td>$i18n.getString($!patient.gender)</td>
+									</tr>
+									<tr>
+										<td>$i18n.getString("date_of_birth")</td>
+										<td>$format.formatDate( $!patient.birthDate) $!patient.getAge()</td>
+									</tr>
+									#foreach( $identifier in $identifiers )
+									<tr>
+										#if($!identifier.identifierType)
+											<td>$identifier.identifierType.name</td>
+										#else
+											<td>$i18n.getString("system_identifier")</td>
+										#end
+										<td>$identifier.identifier</td>
+									</tr>
+									#end
+									#foreach( $attributeValue in $attributeValues )
+									<tr>
+										<td>$attributeValue.patientAttribute.name</td>
+										<td>$attributeValue.value</td>
+									</tr>
+									#end
+									
+									#foreach( $rel in $relationship )
+										#if($rel.patientA.id==$patient.id)
+											<tr>
+												<td>$rel.relationshipType.bIsToA</td>
+												<td>$rel.patientB.getFullName()</td>
+											</tr>
+										#else
+											<tr>
+												<td>$rel.relationshipType.aIsToB</td>
+												<td>$rel.patientA.getFullName()</td>
+											</tr>
+										#end
+									#end
+								</table>
+							</div>
+						</div>
+					</td>
+				</tr>
+				<tr><td></td></tr>
+				<tr>
+					<td>
+						<div class="link-area">
+							<table width='100%'>
+								<tr><th>$i18n.getString("active_programs")</th></tr>
+							</table>
+							<div class="contentProviderTable">
+								<table width='100%'>
+									#foreach( $programInstance in $activeProgramInstances )
+										<tr onclick="javascript:activeProgramInstanceDiv('$programInstance.id');" style='cursor:pointer;'>
+											<td>
+												<a href='#pi_$programInstance.id'>$programInstance.program.name ($format.formatDate($programInstance.enrollmentDate))</a>
+												<img id="img_$programInstance.id" name='imgActive'>
+											</td>
+										</tr>
+										#set($flag = 'false')
+										#foreach( $programStageInstance in $programInstance.programStageInstances )
+											#set( $status = $statusMap.get( $programStageInstance.id ) )
+											#if( $status!=1 && $flag=='false')
+												<tr onclick="javascript:loadProgramStageRecords($programStageInstance.id, false)" style='cursor:pointer;'>
+													<td>
+														<a>>> $programStageInstance.programStage.name ($format.formatDate($programStageInstance.dueDate))</a>
+													</td>
+												</tr>
+											#set($flag = 'true')
+											#end
+										#end
+									#end
+								</table>
+							</div>
+						</div>
+					</td>
+				</tr>
+				<tr><td></td></tr>
+				<tr>
+					<td>
+						<div class="link-area">
+							<table width='100%'>
+								<tr><th>$i18n.getString("completed_programs")</th></tr>
+							</table>
+							<div class="contentProviderTable">
+								<table  width='100%'>
+									#foreach( $programInstance in $completedProgramInstances )
+										<tr>
+											<td onclick="javascript:activeProgramInstanceDiv('$programInstance.id');" style='cursor:pointer;'>
+												<a href='#pi_$programInstance.id'>$programInstance.program.name ($format.formatDate($programInstance.enrollmentDate))</a>
+												<img id="img_$programInstance.id" name='imgActive'>
+											</td>
+										</tr>
+									#end
+								</table>					
+							</div>
+						</div>
+					</td>
+				</tr>
+			</table>
+		</td>
+		
+		<td valign='top'>
+			<!-- Active program-stage-instances -->
+			#foreach( $programInstance in $activeProgramInstances )
+				<div id='pi_$programInstance.id' name="eventDiv" #if( $programInstance.completed!='true' ) class="event-dashboard" #else class="event-dashboard hidden" #end>
+					<table width="100%" onclick="hideProgramInstanceDiv('$programInstance.id')" style='cursor:pointer;'>
+						<tr>
+							<th>$programInstance.program.name ($format.formatDate($programInstance.enrollmentDate) - $i18n.getString("active"))
+							</th>
+						</tr>
+					</table>
+					<div class='event-flow-dashboard'>
+						<table>
+							<tr>
+							#foreach( $programStageInstance in $programInstance.programStageInstances )
+								<td>
+									<img src='images/rightarrow.png'>
+								</td>
+								<td><input type='button' id='ps_$programStageInstance.id' name='programStageBtn' class='stage-object' value='$programStageInstance.programStage.name $format.formatDate( $programStageInstance.dueDate )' 
+										onclick='javascript:loadProgramStageRecords($programStageInstance.id, $programInstance.completed );'></td>
+								<script>	
+									var status = $statusMap.get( $programStageInstance.id ); 
+									setEventColorStatus( 'ps_' + $programStageInstance.id ,status);
+								</script>
+							#end
+							</tr>
+						</table>
+					</div>
+				</div>
+			#end
+			
+			<!-- Completed program-stage-instances -->
+			#foreach( $programInstance in $completedProgramInstances )
+				<div id='pi_$programInstance.id' name="eventDiv" #if( $programInstance.completed!='true' ) class="event-dashboard" #else class="event-dashboard hidden" #end>
+					<table width="100%" onclick="hideProgramInstanceDiv('$programInstance.id')" style='cursor:pointer;'>
+						<tr>
+							<th>$programInstance.program.name ($format.formatDate($programInstance.enrollmentDate) - $i18n.getString("completed"))
+							</th>
+						</tr>
+					</table>
+					
+					<div class='event-flow-dashboard'>
+						<table>
+							<tr>
+							#foreach( $programStageInstance in $programInstance.programStageInstances )
+								<td>
+									<img src='images/rightarrow.png'>
+								</td>
+								<td><input type='button' id='ps_$programStageInstance.id' name='programStageBtn' class='stage-object' value='$programStageInstance.programStage.name $format.formatDate( $programStageInstance.dueDate )' 
+										onclick='javascript:loadProgramStageRecords($programStageInstance.id, $programInstance.completed );'></td>
+								<script>	
+									var status = $statusMap.get( $programStageInstance.id ); 
+									setEventColorStatus( 'ps_' + $programStageInstance.id ,status);
+								</script>
+							#end
+							</tr>
+						</table>
+					</div>
+				</div>
+			#end
+		</td>
+	</tr>
+</table>
+
+<div id='dataEntryFromDashboard'></div>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientRegistrationList.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientRegistrationList.vm	2012-08-07 05:43:56 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientRegistrationList.vm	2012-08-12 06:10:50 +0000
@@ -98,8 +98,9 @@
 				  <a href="javascript:showProgramEnrollmentSelectForm( '$patient.id' )" title='$i18n.getString( "program_management" )'><img src="../images/enroll.png" alt='$i18n.getString( "program_enrollment" )'></a> 
 				  <a href="javascript:showUpdatePatientForm( '$patient.id' )" title='$i18n.getString( "edit_profile" )'><img src="../images/edit.png" alt='$i18n.getString( "edit_profile" )'></a>
 				  <a href="javascript:setFieldValue( 'isShowPatientList', 'false' ); showRelationshipList('$patient.id')" title='$i18n.getString( "manage_relationship" )'><img src="../images/relationship.png" alt='$i18n.getString( "manage_relationship" )'></a>
-                  <a href="javascript:getPatientLocation( '$patient.id' ); " title='$i18n.getString( "change_patient_location" )'><img src="../icons/dataentry.png" alt='$i18n.getString( "change_patient_location" )' style='width:25px; height:25px'></a><a href="javascript:removePatient( '$patient.id', '$encoder.jsEncode( $patient.getFullName() )' )" title='$i18n.getString( "remove" )'><img src="../images/delete.png" alt='$i18n.getString( "remove" )'></a>
-				  <a href="javascript:removePatient( '$patient.id', '$encoder.jsEncode( $patient.getFullName() )' )" title='$i18n.getString( "remove" )'></a>
+                  <a href="javascript:getPatientLocation( '$patient.id' );" title='$i18n.getString( "change_patient_location" )'><img src="../icons/dataentry.png" alt='$i18n.getString( "change_patient_location" )' style='width:25px; height:25px'></a>
+				  <a href="javascript:showPatientDashboardForm( '$patient.id' )" title='$i18n.getString( "patient_dashboard" )'><img src="../images/edit_sections.png" alt='$i18n.getString( "edit_profile" )'></a>
+				  <a href="javascript:removePatient( '$patient.id', '$encoder.jsEncode( $patient.getFullName() )' )" title='$i18n.getString( "remove" )'><img src="../images/delete.png" alt='$i18n.getString( "remove" )'></a>
 				  <a href="javascript:showPatientHistory( '$patient.id' )" title='$i18n.getString( "patient_details_and_history" )'><img src="../images/information.png" alt='$i18n.getString( "patient_details_and_history" )'></a>
 				</td>
 				

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.vm	2012-08-02 09:55:03 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.vm	2012-08-12 06:10:50 +0000
@@ -22,6 +22,7 @@
 </div>
 
 <div id='listPatientDiv'></div> <!-- List searching patients -->
+<div id='patientDashboard'></div> <!-- Patient dashboard -->
 <div id='editPatientDiv'></div> <!-- Add Patient Form -->
 <div id='resultSearchDiv' style='font-size:13px'></div> <!-- List searching patients -->
 <div id='enrollmentDiv'></div> <!-- Program Enrollment Form -->
@@ -102,9 +103,10 @@
 	var i18n_add_person_successfully = '$encoder.jsEscape( $i18n.getString( "add_person_successfully" ) , "'")';
 	var i18n_please_select_relationship_type = '$encoder.jsEscape( $i18n.getString( "please_select_relationship_type" ) , "'")';
 	var i18n_please_select_a_patient_for_setting_relationship = '$encoder.jsEscape( $i18n.getString( "please_select_a_patient_for_setting_relationship" ) , "'")';
-	
+	var i18n_update_patient = '$encoder.jsEscape( $i18n.getString( "update_patient" ) , "'")';
 	var i18n_violate_validation = '$encoder.jsEscape( $i18n.getString( "violate_validation" ) , "'")';
 	var i18n_show_all_items = '$encoder.jsEscape( $i18n.getString( "show_all_items" ) , "'")';
+	var i18n_create_new_event = '$encoder.jsEscape( $i18n.getString( "create_new_event" ) , "'")';
 	var checkedDuplicate = false;
 	// -1: no search anything
 	//  0: show list all patient

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css	2012-08-09 14:21:01 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css	2012-08-12 06:10:50 +0000
@@ -192,7 +192,6 @@
 .ui-button
 {
 	max-height: 100px;
-	max-height: 100px;
 }
 
 .ui-autocomplete
@@ -223,3 +222,91 @@
 	text-align:center;
 }
 
+div.link-area
+{
+  border:1px solid #d0d0d0;
+  padding-top:1px;
+  padding-right:1px;
+  padding-left:1px;
+  padding-bottom:0px;
+  height:200px;
+  width:350px;
+  overflow:hidden;
+  position:relative;
+  top: 45px;
+}
+
+.contentProviderTable
+{
+  height: 150px;
+  width: 340px;
+  margin-top:-10px;
+  overflow-y: auto;
+  overflow-x:hidden;
+}
+
+.contentProviderTable td
+{
+  padding-top:3px;
+  padding-bottom:3px;
+  border-bottom:1px solid #cad5e5;
+}
+
+div.event-dashboard
+{
+	width:900px;
+	border:1px solid #d0d0d0;
+	position:relative;
+	top: 47px;
+}
+
+div.link-area-active
+{
+	width:900px;
+	border:10px solid #d0d0d0;
+	position:relative;
+	top: 47px;
+}
+
+div.event-flow-dashboard
+{
+	width:900px;
+	height:140px;
+	overflow-x:auto;
+	overflow-y:hidden;
+}
+
+#subMenu
+{
+  position:absolute;
+}
+
+#subMenu ul
+{
+  list-style-type:none;
+  margin: 0;
+}
+
+#subMenu li
+{
+  float:left;
+}
+
+#subMenu a
+{
+  padding: 6px 12px;
+  height: 25px;
+  border: 1px solid #aaa;
+  border-radius: 3px;
+  margin-right: 4px;
+  font-family: LiberationSansBold, arial;
+  font-size: 13px;
+  color: #606060;
+  background-color: #f3f3f3;
+}
+
+#subMenu a:hover
+{
+  text-decoration: none;
+  background-color: #f8f8f8;
+}

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm	2012-08-02 02:48:18 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm	2012-08-12 06:10:50 +0000
@@ -20,7 +20,7 @@
 			,errorElement:"span"
 			,submitHandler: function(form)
 				{
-					validateUpdatePatient();
+					validateUpdatePatient( false );
 				}
 			,beforeValidateHandler: function(form)
 				{
@@ -253,7 +253,7 @@
 		<td></td>
 		<td>
 			<input type="submit" class='button' value="$i18n.getString( 'update' )" >
-			<input type="button" class='button' value="$i18n.getString( 'back_to_registration' )" onclick="loadPatientList();" />
+			<input type="button" id="backUpdatePatientBtn" class='button' value="$i18n.getString( 'back_to_registration' )" onclick="loadPatientList();" />
 		</td>
 	</tr>
 </table>