← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8033: Create a link between patient and health worker (DHIS User); display this information in dashboard.

 

------------------------------------------------------------
revno: 8033
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-09-11 14:31:17 +0700
message:
  Create a link between patient and health worker (DHIS User); display this information in dashboard.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java
  dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/Patient.hbm.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/AddPatientAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ShowAddPatientFormAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/UpdatePatientAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientProgramTracking.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/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-api/src/main/java/org/hisp/dhis/patient/Patient.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java	2012-09-06 09:44:43 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/Patient.java	2012-09-11 07:31:17 +0000
@@ -35,6 +35,7 @@
 
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.program.Program;
+import org.hisp.dhis.user.User;
 
 /**
  * @author Abyot Asalefew Gizaw
@@ -101,6 +102,8 @@
     private boolean underAge;
 
     private Character dobType;
+    
+    private User healthWorker;
 
     // -------------------------------------------------------------------------
     // Constructors
@@ -355,6 +358,16 @@
         this.programs = programs;
     }
 
+    public User getHealthWorker()
+    {
+        return healthWorker;
+    }
+
+    public void setHealthWorker( User healthWorker )
+    {
+        this.healthWorker = healthWorker;
+    }
+
     public void setRegistrationDate( Date registrationDate )
     {
         this.registrationDate = registrationDate;

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/Patient.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/Patient.hbm.xml	2012-07-06 04:04:41 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/Patient.hbm.xml	2012-09-11 07:31:17 +0000
@@ -53,5 +53,7 @@
     <many-to-one name="organisationUnit" class="org.hisp.dhis.organisationunit.OrganisationUnit" column="organisationunitid"
       foreign-key="fk_patient_organisationunitid" />
  	
+ 	<many-to-one name="healthWorker" column="healthworkerid" class="org.hisp.dhis.user.User" foreign-key="fk_user_patientid" />
+    
   </class>
 </hibernate-mapping>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/AddPatientAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/AddPatientAction.java	2012-06-14 13:07:22 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/AddPatientAction.java	2012-09-11 07:31:17 +0000
@@ -52,6 +52,7 @@
 import org.hisp.dhis.patient.PatientIdentifierTypeService;
 import org.hisp.dhis.patient.PatientService;
 import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
+import org.hisp.dhis.user.UserService;
 
 import com.opensymphony.xwork2.Action;
 
@@ -86,6 +87,8 @@
 
     private PatientAttributeOptionService patientAttributeOptionService;
 
+    private UserService userService;
+
     // -------------------------------------------------------------------------
     // Input
     // -------------------------------------------------------------------------
@@ -110,6 +113,8 @@
 
     private Integer relationshipTypeId;
 
+    private Integer healthWorkerId;
+
     private String message;
 
     // -------------------------------------------------------------------------
@@ -169,6 +174,7 @@
         patient.setPhoneNumber( phoneNumber );
         patient.setUnderAge( underAge );
         patient.setOrganisationUnit( organisationUnit );
+        patient.setHealthWorker( userService.getUser( healthWorkerId ) );
 
         Character dobType = (verified) ? 'V' : 'D';
 
@@ -310,12 +316,22 @@
     // -----------------------------------------------------------------------------
     // Getter/Setter
     // -----------------------------------------------------------------------------
+    
+    public void setUserService( UserService userService )
+    {
+        this.userService = userService;
+    }
 
     public String getMessage()
     {
         return message;
     }
 
+    public void setHealthWorkerId( Integer healthWorkerId )
+    {
+        this.healthWorkerId = healthWorkerId;
+    }
+
     public void setVerified( Boolean verified )
     {
         this.verified = verified;

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientAction.java	2012-09-05 14:30:23 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientAction.java	2012-09-11 07:31:17 +0000
@@ -47,6 +47,7 @@
 import org.hisp.dhis.program.ProgramService;
 import org.hisp.dhis.relationship.Relationship;
 import org.hisp.dhis.relationship.RelationshipService;
+import org.hisp.dhis.user.User;
 
 import com.opensymphony.xwork2.Action;
 
@@ -72,9 +73,9 @@
     private PatientAttributeService patientAttributeService;
 
     private PatientIdentifierTypeService patientIdentifierTypeService;
-    
+
     private RelationshipService relationshipService;
-    
+
     // -------------------------------------------------------------------------
     // Input/Output
     // -------------------------------------------------------------------------
@@ -104,9 +105,11 @@
     private String systemIdentifier;
 
     private Relationship relationship;
-    
+
     private Map<PatientAttributeGroup, Collection<PatientAttribute>> attributeGroupsMap = new HashMap<PatientAttributeGroup, Collection<PatientAttribute>>();
 
+    private Collection<User> healthWorkers;
+
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -117,7 +120,7 @@
         patient = patientService.getPatient( id );
 
         programs = programService.getAllPrograms();
-        
+
         // -------------------------------------------------------------------------
         // Get identifier-types && attributes
         // -------------------------------------------------------------------------
@@ -126,27 +129,28 @@
 
         identifierTypes = patientIdentifierTypeService.getAllPatientIdentifierTypes();
         Collection<PatientAttribute> patientAttributes = patientAttributeService.getAllPatientAttributes();
-        
+
         Collection<Program> programs = programService.getAllPrograms();
         for ( Program program : programs )
         {
             identifierTypes.removeAll( program.getPatientIdentifierTypes() );
             patientAttributes.removeAll( program.getPatientAttributes() );
         }
-        
-        for( PatientAttribute patientAttribute : patientAttributes )
+
+        for ( PatientAttribute patientAttribute : patientAttributes )
         {
             PatientAttributeGroup attributeGroup = patientAttribute.getPatientAttributeGroup();
-            if( attributeGroup!=null){
-                if( attributeGroupsMap.containsKey( attributeGroup ) )
+            if ( attributeGroup != null )
+            {
+                if ( attributeGroupsMap.containsKey( attributeGroup ) )
                 {
                     Collection<PatientAttribute> attributes = attributeGroupsMap.get( attributeGroup );
-                    attributes.add(patientAttribute);
+                    attributes.add( patientAttribute );
                 }
                 else
                 {
-                    Collection<PatientAttribute> attributes = new HashSet<PatientAttribute>(); 
-                    attributes.add(patientAttribute);
+                    Collection<PatientAttribute> attributes = new HashSet<PatientAttribute>();
+                    attributes.add( patientAttribute );
                     attributeGroupsMap.put( attributeGroup, attributes );
                 }
             }
@@ -155,7 +159,7 @@
                 noGroupAttributes.add( patientAttribute );
             }
         }
-        
+
         // -------------------------------------------------------------------------
         // Get data
         // -------------------------------------------------------------------------
@@ -165,7 +169,7 @@
         PatientIdentifierType idType = null;
         Patient representative = patient.getRepresentative();
         relationship = relationshipService.getRelationship( representative, patient );
-        
+
         if ( patient.isUnderAge() && representative != null )
         {
             for ( PatientIdentifier representativeIdentifier : representative.getIdentifiers() )
@@ -173,8 +177,8 @@
                 if ( representativeIdentifier.getIdentifierType() != null
                     && representativeIdentifier.getIdentifierType().isRelated() )
                 {
-                    identiferMap.put( representativeIdentifier.getIdentifierType().getId(), representativeIdentifier
-                        .getIdentifier() );
+                    identiferMap.put( representativeIdentifier.getIdentifierType().getId(),
+                        representativeIdentifier.getIdentifier() );
                 }
             }
         }
@@ -196,21 +200,21 @@
         // -------------------------------------------------------------------------
         // Get patient-attribute values
         // -------------------------------------------------------------------------
-        
 
-        for( PatientAttribute patientAttribute : patientAttributes )
+        for ( PatientAttribute patientAttribute : patientAttributes )
         {
             PatientAttributeGroup attributeGroup = patientAttribute.getPatientAttributeGroup();
-            if( attributeGroup!=null){
-                if( attributeGroupsMap.containsKey( attributeGroup ) )
+            if ( attributeGroup != null )
+            {
+                if ( attributeGroupsMap.containsKey( attributeGroup ) )
                 {
                     Collection<PatientAttribute> attributes = attributeGroupsMap.get( attributeGroup );
-                    attributes.add(patientAttribute);
+                    attributes.add( patientAttribute );
                 }
                 else
                 {
-                    Collection<PatientAttribute> attributes = new HashSet<PatientAttribute>(); 
-                    attributes.add(patientAttribute);
+                    Collection<PatientAttribute> attributes = new HashSet<PatientAttribute>();
+                    attributes.add( patientAttribute );
                     attributeGroupsMap.put( attributeGroup, attributes );
                 }
             }
@@ -219,7 +223,7 @@
                 noGroupAttributes.add( patientAttribute );
             }
         }
-        
+
         Collection<PatientAttributeValue> patientAttributeValues = patientAttributeValueService
             .getPatientAttributeValues( patient );
 
@@ -238,19 +242,26 @@
             }
         }
 
+        healthWorkers = patient.getOrganisationUnit().getUsers();
+        
         return SUCCESS;
-
+        
     }
 
     // -----------------------------------------------------------------------------
     // Getter / Setter
     // -----------------------------------------------------------------------------
-    
+
+    public Collection<User> getHealthWorkers()
+    {
+        return healthWorkers;
+    }
+
     public Map<PatientAttributeGroup, Collection<PatientAttribute>> getAttributeGroupsMap()
     {
         return attributeGroupsMap;
     }
-    
+
     public void setPatientService( PatientService patientService )
     {
         this.patientService = patientService;
@@ -280,7 +291,7 @@
     {
         this.patientAttributeService = patientAttributeService;
     }
-    
+
     public void setPatientIdentifierTypeService( PatientIdentifierTypeService patientIdentifierTypeService )
     {
         this.patientIdentifierTypeService = patientIdentifierTypeService;

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ShowAddPatientFormAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ShowAddPatientFormAction.java	2012-09-05 14:30:23 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ShowAddPatientFormAction.java	2012-09-11 07:31:17 +0000
@@ -41,6 +41,7 @@
 import org.hisp.dhis.patient.PatientIdentifierTypeService;
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.program.ProgramService;
+import org.hisp.dhis.user.User;
 
 import com.opensymphony.xwork2.Action;
 
@@ -87,6 +88,13 @@
     // Input/Output
     // -------------------------------------------------------------------------
 
+    private Collection<User> healthWorkers;
+    
+    public Collection<User> getHealthWorkers()
+    {
+        return healthWorkers;
+    }
+
     private Boolean addNewForm;
 
     public Boolean getAddNewForm()
@@ -101,12 +109,32 @@
 
     private Collection<PatientAttribute> noGroupAttributes = new HashSet<PatientAttribute>();
 
+    public Collection<PatientAttribute> getNoGroupAttributes()
+    {
+        return noGroupAttributes;
+    }
+
     private Collection<PatientIdentifierType> identifierTypes;
 
+    public Collection<PatientIdentifierType> getIdentifierTypes()
+    {
+        return identifierTypes;
+    }
+
     private OrganisationUnit organisationUnit;
 
+    public OrganisationUnit getOrganisationUnit()
+    {
+        return organisationUnit;
+    }
+
     private Map<PatientAttributeGroup, Collection<PatientAttribute>> attributeGroupsMap = new HashMap<PatientAttributeGroup, Collection<PatientAttribute>>();
 
+    public Map<PatientAttributeGroup, Collection<PatientAttribute>> getAttributeGroupsMap()
+    {
+        return attributeGroupsMap;
+    }
+
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -147,7 +175,8 @@
         }
 
         organisationUnit = selectionManager.getSelectedOrganisationUnit();
-
+        healthWorkers = organisationUnit.getUsers();
+        
         return SUCCESS;
     }
 
@@ -155,23 +184,4 @@
     // Getter/Setter
     // -------------------------------------------------------------------------
 
-    public Collection<PatientIdentifierType> getIdentifierTypes()
-    {
-        return identifierTypes;
-    }
-    
-    public Collection<PatientAttribute> getNoGroupAttributes()
-    {
-        return noGroupAttributes;
-    }
-
-    public OrganisationUnit getOrganisationUnit()
-    {
-        return organisationUnit;
-    }
-
-    public Map<PatientAttributeGroup, Collection<PatientAttribute>> getAttributeGroupsMap()
-    {
-        return attributeGroupsMap;
-    }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/UpdatePatientAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/UpdatePatientAction.java	2012-05-29 15:37:40 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/UpdatePatientAction.java	2012-09-11 07:31:17 +0000
@@ -50,6 +50,7 @@
 import org.hisp.dhis.patient.PatientService;
 import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
 import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
+import org.hisp.dhis.user.UserService;
 
 import com.opensymphony.xwork2.Action;
 
@@ -80,6 +81,8 @@
 
     private PatientAttributeOptionService patientAttributeOptionService;
 
+    private UserService userService;
+
     // -------------------------------------------------------------------------
     // Input
     // -------------------------------------------------------------------------
@@ -99,7 +102,7 @@
     private Boolean verified;
 
     private String gender;
-    
+
     private String phoneNumber;
 
     private boolean underAge;
@@ -108,8 +111,10 @@
 
     private Integer relationshipTypeId;
 
+    private Integer healthWorkerId;
+
     private Character dobType;
-    
+
     // -------------------------------------------------------------------------
     // Output
     // -------------------------------------------------------------------------
@@ -166,13 +171,14 @@
         patient.setGender( gender );
         patient.setIsDead( isDead );
         patient.setPhoneNumber( phoneNumber );
+        patient.setHealthWorker( userService.getUser( healthWorkerId ) );
 
         if ( deathDate != null )
         {
             deathDate = deathDate.trim();
             patient.setDeathDate( format.parseDate( deathDate ) );
         }
-
+        
         patient.setUnderAge( underAge );
         patient.setOrganisationUnit( organisationUnit );
 
@@ -229,7 +235,6 @@
                 else if ( identifier != null )
                 {
                     patient.getIdentifiers().remove( identifier );
-//                    patientIdentifierService.deletePatientIdentifier( identifier );
                 }
             }
         }
@@ -325,6 +330,16 @@
     // -----------------------------------------------------------------------------
     // Getter/Setter
     // -----------------------------------------------------------------------------
+    
+    public void setUserService( UserService userService )
+    {
+        this.userService = userService;
+    }
+
+    public void setHealthWorkerId( Integer healthWorkerId )
+    {
+        this.healthWorkerId = healthWorkerId;
+    }
 
     public void setPatientIdentifierTypeService( PatientIdentifierTypeService patientIdentifierTypeService )
     {
@@ -395,7 +410,7 @@
     {
         this.gender = gender;
     }
-    
+
     public void setPhoneNumber( String phoneNumber )
     {
         this.phoneNumber = phoneNumber;

=== 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-09-07 07:57:47 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2012-09-11 07:31:17 +0000
@@ -33,7 +33,7 @@
 		<property name="patientService" ref="org.hisp.dhis.patient.PatientService" />
 		<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
 	</bean>
-	
+
 	<bean
 		id="org.hisp.dhis.caseentry.action.caseentry.DataRecordingSelectAction"
 		class="org.hisp.dhis.caseentry.action.caseentry.DataRecordingSelectAction"
@@ -112,7 +112,7 @@
 			ref="org.hisp.dhis.program.ProgramStageInstanceService" />
 		<property name="programInstanceService" ref="org.hisp.dhis.program.ProgramInstanceService" />
 	</bean>
-	
+
 	<bean
 		id="org.hisp.dhis.caseentry.action.caseentry.UncompleteDataEntryAction"
 		class="org.hisp.dhis.caseentry.action.caseentry.UncompleteDataEntryAction"
@@ -128,20 +128,16 @@
 		scope="prototype">
 		<property name="programStageInstanceService"
 			ref="org.hisp.dhis.program.ProgramStageInstanceService" />
-		<property name="programStageService"
-			ref="org.hisp.dhis.program.ProgramStageService" />
-		<property name="programInstanceService"
-			ref="org.hisp.dhis.program.ProgramInstanceService" />
+		<property name="programStageService" ref="org.hisp.dhis.program.ProgramStageService" />
+		<property name="programInstanceService" ref="org.hisp.dhis.program.ProgramInstanceService" />
 	</bean>
-	
+
 	<bean
 		id="org.hisp.dhis.caseentry.action.caseentry.GetOptionsByDataElementAction"
 		class="org.hisp.dhis.caseentry.action.caseentry.GetOptionsByDataElementAction"
 		scope="prototype">
-		<property name="dataElementService"
-			ref="org.hisp.dhis.dataelement.DataElementService" />
-		<property name="optionService"
-			ref="org.hisp.dhis.option.OptionService" />
+		<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+		<property name="optionService" ref="org.hisp.dhis.option.OptionService" />
 	</bean>
 
 	<!-- Multi DataEntry -->
@@ -193,19 +189,18 @@
 		<property name="programStageInstanceService"
 			ref="org.hisp.dhis.program.ProgramStageInstanceService" />
 	</bean>
-	
+
 	<!-- Single-event DataEntry -->
-	
+
 	<bean
 		id="org.hisp.dhis.caseentry.action.caseentry.GetSingleEventProgramListAction"
 		class="org.hisp.dhis.caseentry.action.caseentry.GetSingleEventProgramListAction"
 		scope="prototype">
 		<property name="selectionManager"
 			ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
-		<property name="programService"
-			ref="org.hisp.dhis.program.ProgramService" />
+		<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
 	</bean>
-	
+
 	<bean
 		id="org.hisp.dhis.caseentry.action.caseentry.ShowEventWithRegistrationFormAction"
 		class="org.hisp.dhis.caseentry.action.caseentry.ShowEventWithRegistrationFormAction"
@@ -216,30 +211,24 @@
 			ref="org.hisp.dhis.patient.PatientAttributeService" />
 		<property name="patientIdentifierTypeService"
 			ref="org.hisp.dhis.patient.PatientIdentifierTypeService" />
-		<property name="programService"
-			ref="org.hisp.dhis.program.ProgramService" />
+		<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
 		<property name="programDataEntryService"
 			ref="org.hisp.dhis.program.ProgramDataEntryService" />
 	</bean>
-	
-	<bean
-		id="org.hisp.dhis.caseentry.action.caseentry.SaveValuesAction"
+
+	<bean id="org.hisp.dhis.caseentry.action.caseentry.SaveValuesAction"
 		class="org.hisp.dhis.caseentry.action.caseentry.SaveValuesAction"
 		scope="prototype">
-		<property name="programService"
-			ref="org.hisp.dhis.program.ProgramService" />
-		<property name="patientService"
-			ref="org.hisp.dhis.patient.PatientService" />
+		<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
+		<property name="patientService" ref="org.hisp.dhis.patient.PatientService" />
 		<property name="patientDataValueService"
 			ref="org.hisp.dhis.patientdatavalue.PatientDataValueService" />
 		<property name="programStageInstanceService"
 			ref="org.hisp.dhis.program.ProgramStageInstanceService" />
-		<property name="programInstanceService"
-			ref="org.hisp.dhis.program.ProgramInstanceService" />
+		<property name="programInstanceService" ref="org.hisp.dhis.program.ProgramInstanceService" />
 		<property name="selectedStateManager"
 			ref="org.hisp.dhis.caseentry.state.SelectedStateManager" />
-		<property name="currentUserService"
-			ref="org.hisp.dhis.user.CurrentUserService" />
+		<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
 	</bean>
 
 	<!-- Visit Plan -->
@@ -404,7 +393,8 @@
 		scope="prototype">
 		<property name="selectionManager"
 			ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
-		<property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+		<property name="organisationUnitService"
+			ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
 		<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
 	</bean>
 
@@ -427,20 +417,21 @@
 		<property name="programStageInstanceService"
 			ref="org.hisp.dhis.program.ProgramStageInstanceService" />
 	</bean>
-	
+
 	<bean
 		id="org.hisp.dhis.caseentry.action.caseentry.GetProgramStageDataElementsAction"
 		class="org.hisp.dhis.caseentry.action.caseentry.GetProgramStageDataElementsAction"
 		scope="prototype">
 		<property name="programStageService" ref="org.hisp.dhis.program.ProgramStageService" />
 	</bean>
-	
+
 	<bean
 		id="org.hisp.dhis.caseentry.action.caseentry.RemoveEmptyEventsAction"
 		class="org.hisp.dhis.caseentry.action.caseentry.RemoveEmptyEventsAction"
 		scope="prototype">
 		<property name="programStageService" ref="org.hisp.dhis.program.ProgramStageService" />
-		<property name="programStageInstanceService" ref="org.hisp.dhis.program.ProgramStageInstanceService" />
+		<property name="programStageInstanceService"
+			ref="org.hisp.dhis.program.ProgramStageInstanceService" />
 	</bean>
 
 	<!-- Patient -->
@@ -493,6 +484,7 @@
 			ref="org.hisp.dhis.patient.PatientIdentifierTypeService" />
 		<property name="patientAttributeOptionService"
 			ref="org.hisp.dhis.patient.PatientAttributeOptionService" />
+		<property name="userService" ref="org.hisp.dhis.user.UserService" />
 	</bean>
 
 	<bean id="org.hisp.dhis.caseentry.action.patient.RemovePatientAction"
@@ -519,6 +511,7 @@
 			ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
 		<property name="patientAttributeOptionService"
 			ref="org.hisp.dhis.patient.PatientAttributeOptionService" />
+		<property name="userService" ref="org.hisp.dhis.user.UserService" />
 	</bean>
 
 	<bean id="org.hisp.dhis.caseentry.action.patient.ShowAddPatientFormAction"
@@ -584,8 +577,9 @@
 		<property name="patientService" ref="org.hisp.dhis.patient.PatientService" />
 		<property name="programInstanceService" ref="org.hisp.dhis.program.ProgramInstanceService" />
 	</bean>
-	
-	<bean id="org.hisp.dhis.caseentry.action.patient.GetProgramInstanceHistoryAction"
+
+	<bean
+		id="org.hisp.dhis.caseentry.action.patient.GetProgramInstanceHistoryAction"
 		class="org.hisp.dhis.caseentry.action.patient.GetProgramInstanceHistoryAction"
 		scope="prototype">
 		<property name="programInstanceService" ref="org.hisp.dhis.program.ProgramInstanceService" />
@@ -680,16 +674,15 @@
 			ref="org.hisp.dhis.patient.PatientAttributeOptionService" />
 		<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
 	</bean>
-	
-	<bean
-		id="org.hisp.dhis.caseentry.action.patient.RemoveEnrollmentAction"
+
+	<bean id="org.hisp.dhis.caseentry.action.patient.RemoveEnrollmentAction"
 		class="org.hisp.dhis.caseentry.action.patient.RemoveEnrollmentAction"
 		scope="prototype">
 		<property name="patientService" ref="org.hisp.dhis.patient.PatientService" />
 		<property name="programInstanceService" ref="org.hisp.dhis.program.ProgramInstanceService" />
 	</bean>
 
-	<!--  Relationship -->
+	<!-- Relationship -->
 
 	<bean
 		id="org.hisp.dhis.caseentry.action.patient.AddRelationshipPatientAction"
@@ -905,7 +898,8 @@
 		<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
 		<property name="patientAttributeService"
 			ref="org.hisp.dhis.patient.PatientAttributeService" />
-		<property name="patientIdentifierTypeService" ref="org.hisp.dhis.patient.PatientIdentifierTypeService" />
+		<property name="patientIdentifierTypeService"
+			ref="org.hisp.dhis.patient.PatientIdentifierTypeService" />
 	</bean>
 
 	<bean
@@ -963,88 +957,82 @@
 		<property name="tabularReportService"
 			ref="org.hisp.dhis.patientreport.PatientTabularReportService" />
 	</bean>
-	
+
 	<!-- SMS Reminder -->
-	
+
 	<bean id="org.hisp.dhis.caseentry.action.reminder.GetGatewayAction"
 		class="org.hisp.dhis.caseentry.action.reminder.GetGatewayAction"
 		scope="prototype">
 	</bean>
-	
-	<bean id="org.hisp.dhis.caseentry.action.reminder.GetOutboundSmsListAction"
+
+	<bean
+		id="org.hisp.dhis.caseentry.action.reminder.GetOutboundSmsListAction"
 		class="org.hisp.dhis.caseentry.action.reminder.GetOutboundSmsListAction"
 		scope="prototype">
 		<property name="programStageInstanceService"
 			ref="org.hisp.dhis.program.ProgramStageInstanceService" />
-		<property name="currentUserService"
-			ref="org.hisp.dhis.user.CurrentUserService" />
+		<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
 		<property name="patientAttributeValueService"
 			ref="org.hisp.dhis.patientattributevalue.PatientAttributeValueService" />
 	</bean>
-	
+
 	<bean id="org.hisp.dhis.caseentry.action.reminder.SendSmsAction"
-		class="org.hisp.dhis.caseentry.action.reminder.SendSmsAction"
-		scope="prototype">
+		class="org.hisp.dhis.caseentry.action.reminder.SendSmsAction" scope="prototype">
 		<property name="outboundSmsService"
 			ref="org.hisp.dhis.sms.outbound.OutboundSmsService" />
 		<property name="programStageInstanceService"
 			ref="org.hisp.dhis.program.ProgramStageInstanceService" />
 	</bean>
-	
+
 	<bean id="org.hisp.dhis.caseentry.action.reminder.SendSmsToListAction"
 		class="org.hisp.dhis.caseentry.action.reminder.SendSmsToListAction"
 		scope="prototype">
 		<property name="selectionManager"
 			ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
-		<property name="patientService"
-			ref="org.hisp.dhis.patient.PatientService" />
+		<property name="patientService" ref="org.hisp.dhis.patient.PatientService" />
 		<property name="outboundSmsService"
 			ref="org.hisp.dhis.sms.outbound.OutboundSmsService" />
 		<property name="programStageInstanceService"
 			ref="org.hisp.dhis.program.ProgramStageInstanceService" />
 	</bean>
-	
+
 	<bean id="org.hisp.dhis.caseentry.action.reminder.SetEventStatusAction"
 		class="org.hisp.dhis.caseentry.action.reminder.SetEventStatusAction"
 		scope="prototype">
 		<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="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="programInstanceService" ref="org.hisp.dhis.program.ProgramInstanceService" />
 		<property name="programStageInstanceService"
 			ref="org.hisp.dhis.program.ProgramStageInstanceService" />
 	</bean>
-	
+
 	<!-- Comment -->
-	
+
 	<bean id="org.hisp.dhis.caseentry.action.reminder.AddCommentAction"
 		class="org.hisp.dhis.caseentry.action.reminder.AddCommentAction"
 		scope="prototype">
 		<property name="programStageInstanceService"
 			ref="org.hisp.dhis.program.ProgramStageInstanceService" />
-		<property name="currentUserService"
-			ref="org.hisp.dhis.user.CurrentUserService" />
+		<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
 	</bean>
-	
+
 	<bean id="org.hisp.dhis.caseentry.action.reminder.RemoveCommentAction"
 		class="org.hisp.dhis.caseentry.action.reminder.RemoveCommentAction"
 		scope="prototype">
-		<property name="commentService"
-			ref="org.hisp.dhis.patient.comment.CommentService" />
+		<property name="commentService" ref="org.hisp.dhis.patient.comment.CommentService" />
 		<property name="programStageInstanceService"
 			ref="org.hisp.dhis.program.ProgramStageInstanceService" />
 	</bean>

=== 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-09-07 09:53:13 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2012-09-11 07:31:17 +0000
@@ -441,4 +441,5 @@
 reschedule_due_date = Re-schedule due date
 status = Status
 skipped = Skipped
-unknown = Unknown
\ No newline at end of file
+unknown = Unknown
+health_worker = Health worker
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm	2012-09-07 09:53:13 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm	2012-09-11 07:31:17 +0000
@@ -40,6 +40,16 @@
 											#end
 										</td>
 									</tr>
+									<tr>
+										<td>$i18n.getString("health_worker")</td>
+										<td>
+											#if($!patient.healthWorker )
+												$!patient.healthWorker.name
+											#else
+												[$i18n.getString('none')]
+											#end
+										</td>
+									</tr>
 									#foreach( $identifier in $identifiers )
 									<tr>
 										#if($!identifier.identifierType)

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm	2012-09-05 14:30:23 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm	2012-09-11 07:31:17 +0000
@@ -59,6 +59,18 @@
 	</td>
 </tr>
 
+<tr>
+	<td class='text-column'><label for="healthWorker">$i18n.getString( "health_worker" )</label></td>
+	<td class="input-column">
+		<select id="healthWorkerId" name="healthWorkerId">
+			<option value="">[$i18n.getString("please_select")]</option>
+			#foreach( $healthWorker in $healthWorkers)
+				<option value="$healthWorker.id">$healthWorker.name</option>
+			#end
+		</select>
+	</td>
+</tr>
+
 <!-- UNDERAGE -->
 <tr id='underAgeDiv'>
 	<td class='text-column'>$i18n.getString("has_guardian")</td>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientProgramTracking.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientProgramTracking.vm	2012-09-10 10:28:33 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientProgramTracking.vm	2012-09-11 07:31:17 +0000
@@ -41,7 +41,17 @@
 	<!-- Demographics -->
 	<div id="tab-2">
 		<table class="mainPageTable">
-			#set( $mark = false )
+			<tr>
+				<td>$i18n.getString("health_worker")</td>
+				<td>
+					#if($!programInstance.patient.healthWorker )
+						$!programInstance.patient.healthWorker.name
+					#else
+						[$i18n.getString('none')]
+					#end
+				</td>
+			</tr>
+		#set( $mark = true )
 			#foreach ($identifierType in $identifierTypes) 
 				#set( $identifier = '')
 				#set( $identifier = $identiferMap.get( $identifierType.id ) )

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm	2012-09-07 07:57:47 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm	2012-09-11 07:31:17 +0000
@@ -40,6 +40,16 @@
 		</td>
 	</tr>
 	<tr>
+		<td>$i18n.getString("health_worker")</td>
+		<td>
+			#if($!programStageInstance.programInstance.patient.healthWorker )
+				$!programStageInstance.programInstance.patient.healthWorker.name
+			#else
+				[$i18n.getString('none')]
+			#end
+		</td>
+	</tr>
+	<tr>
 		<td>
 			<br><input type='button' value='$i18n.getString("back")' onclick='onClickBackBtn();'>
 			<input type='button' value='$i18n.getString("patient_dashboard")' onclick='javascript:showPatientProgramTracking( "$programStageInstance.programInstance.id" );'>

=== 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-09-05 14:30:23 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm	2012-09-11 07:31:17 +0000
@@ -118,6 +118,18 @@
 		</td>
 	</tr>
 	
+	<tr>
+		<td class='text-column'><label for="healthWorker">$i18n.getString( "health_worker" )</label></td>
+		<td class="input-column">
+			<select id="healthWorkerId" name="healthWorkerId">
+				<option value="">[$i18n.getString("please_select")]</option>
+				#foreach( $healthWorker in $healthWorkers)
+					<option value="$healthWorker.id" #if($patient.healthWorker.id == $healthWorker.id) selected #end>$healthWorker.name</option>
+				#end
+			</select>
+		</td>
+	</tr>
+
 	<!-- UNDERAGE -->
 
 	<tr>