← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8262: Audit log of who and when person dashboard has been accessed.

 

------------------------------------------------------------
revno: 8262
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-09-26 12:19:53 +0700
message:
  Audit log of who and when person dashboard has been accessed.
added:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAudit.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAuditService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAuditStore.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientAuditService.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientAuditStore.java
  dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientAudit.hbm.xml
modified:
  dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml
  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/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/identifierAndAttributeForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css


--
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-api/src/main/java/org/hisp/dhis/patient/PatientAudit.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAudit.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAudit.java	2012-09-26 05:19:53 +0000
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2004-2009, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.hisp.dhis.patient;
+
+import java.util.Date;
+
+/**
+ * @author Chau Thu Tran
+ * 
+ * @version PatientAudit.java 8:56:01 AM Sep 26, 2012 $
+ */
+public class PatientAudit
+{
+    private int id;
+
+    private Patient patient;
+
+    private Date date;
+
+    // -------------------------------------------------------------------------
+    // Constructor
+    // -------------------------------------------------------------------------
+
+    public PatientAudit()
+    {
+
+    }
+
+    public PatientAudit( Patient patient, Date date )
+    {
+        super();
+        this.patient = patient;
+        this.date = date;
+    }
+
+    // -------------------------------------------------------------------------
+    // Getters && Setters
+    // -------------------------------------------------------------------------
+
+    public int getId()
+    {
+        return id;
+    }
+
+    public void setId( int id )
+    {
+        this.id = id;
+    }
+
+    public Patient getPatient()
+    {
+        return patient;
+    }
+
+    public void setPatient( Patient patient )
+    {
+        this.patient = patient;
+    }
+
+    public Date getDate()
+    {
+        return date;
+    }
+
+    public void setDate( Date date )
+    {
+        this.date = date;
+    }
+
+}

=== added file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAuditService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAuditService.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAuditService.java	2012-09-26 05:19:53 +0000
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2004-2009, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.hisp.dhis.patient;
+
+import java.util.Collection;
+import java.util.Date;
+
+/**
+ * @author Chau Thu Tran
+ * 
+ * @version PatientAuditService.java 9:01:49 AM Sep 26, 2012 $
+ */
+public interface PatientAuditService
+{
+    String ID = PatientAuditService.class.getName();
+
+    int savePatientAudit( PatientAudit patientAudit );
+
+    void deletePatientAudit( PatientAudit patientAudit );
+
+    PatientAudit getPatientAudit( int id );
+
+    Collection<PatientAudit> getAllPatientAudit();
+
+    Collection<PatientAudit> getPatientAudits( Patient patient );
+
+    PatientAudit get( Patient patient, Date date );
+
+}

=== added file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAuditStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAuditStore.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAuditStore.java	2012-09-26 05:19:53 +0000
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2004-2009, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.hisp.dhis.patient;
+
+import java.util.Collection;
+import java.util.Date;
+
+import org.hisp.dhis.common.GenericStore;
+
+/**
+ * @author Chau Thu Tran
+ *
+ * @version PatientAuditStore.java 9:04:53 AM Sep 26, 2012 $
+ */
+public interface PatientAuditStore extends GenericStore<PatientAudit>
+{
+    Collection<PatientAudit> get( Patient patient );
+
+    PatientAudit get( Patient patient, Date date );
+}

=== added file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientAuditService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientAuditService.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientAuditService.java	2012-09-26 05:19:53 +0000
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2004-2009, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.hisp.dhis.patient;
+
+import java.util.Collection;
+import java.util.Date;
+
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * @author Chau Thu Tran
+ * 
+ * @version DefaultPatientAuditService.java 9:08:54 AM Sep 26, 2012 $
+ */
+@Transactional
+public class DefaultPatientAuditService
+    implements PatientAuditService
+{
+    private PatientAuditStore patientAuditStore;
+
+    public void setPatientAuditStore( PatientAuditStore patientAuditStore )
+    {
+        this.patientAuditStore = patientAuditStore;
+    }
+
+    @Override
+    public int savePatientAudit( PatientAudit patientAudit )
+    {
+        return patientAuditStore.save( patientAudit );
+    }
+
+    @Override
+    public void deletePatientAudit( PatientAudit patientAudit )
+    {
+        patientAuditStore.update( patientAudit );
+    }
+
+    @Override
+    public PatientAudit getPatientAudit( int id )
+    {
+        return patientAuditStore.get( id );
+    }
+
+    @Override
+    public Collection<PatientAudit> getAllPatientAudit()
+    {
+        return patientAuditStore.getAll();
+    }
+
+    @Override
+    public Collection<PatientAudit> getPatientAudits( Patient patient )
+    {
+        return patientAuditStore.get( patient );
+    }
+
+    @Override
+    public PatientAudit get( Patient patient, Date date )
+    {
+        return patientAuditStore.get( patient, date );
+    }
+
+}

=== added file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientAuditStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientAuditStore.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientAuditStore.java	2012-09-26 05:19:53 +0000
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2004-2009, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.hisp.dhis.patient.hibernate;
+
+import java.util.Collection;
+import java.util.Date;
+
+import org.hibernate.criterion.Restrictions;
+import org.hisp.dhis.hibernate.HibernateGenericStore;
+import org.hisp.dhis.patient.Patient;
+import org.hisp.dhis.patient.PatientAudit;
+import org.hisp.dhis.patient.PatientAuditStore;
+
+/**
+ * @author Chau Thu Tran
+ * 
+ * @version HibernatePatientAuditStore.java 9:12:20 AM Sep 26, 2012 $
+ */
+public class HibernatePatientAuditStore
+    extends HibernateGenericStore<PatientAudit>
+    implements PatientAuditStore
+{
+    @SuppressWarnings( "unchecked" )
+    @Override
+    public Collection<PatientAudit> get( Patient patient )
+    {
+        return getCriteria( Restrictions.eq( "patient", patient ) ).list();
+    }
+
+    @Override
+    public PatientAudit get( Patient patient, Date date )
+    {
+        return (PatientAudit) getCriteria( Restrictions.eq( "patient", patient ), Restrictions.eq( "date", date ) )
+            .uniqueResult();
+    }
+}

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml	2012-09-25 06:44:53 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml	2012-09-26 05:19:53 +0000
@@ -9,7 +9,8 @@
 
 	<bean id="org.hisp.dhis.caseaggregation.CaseAggregationConditionStore"
 		class="org.hisp.dhis.caseaggregation.jdbc.JdbcCaseAggregationConditionStore">
-		<property name="clazz" value="org.hisp.dhis.caseaggregation.CaseAggregationCondition" />
+		<property name="clazz"
+			value="org.hisp.dhis.caseaggregation.CaseAggregationCondition" />
 		<property name="sessionFactory" ref="sessionFactory" />
 		<property name="jdbcTemplate" ref="jdbcTemplate" />
 	</bean>
@@ -44,7 +45,7 @@
 		<property name="clazz" value="org.hisp.dhis.program.ProgramStage" />
 		<property name="sessionFactory" ref="sessionFactory" />
 	</bean>
-	
+
 	<bean id="org.hisp.dhis.program.ProgramStageSectionStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
 		<property name="clazz" value="org.hisp.dhis.program.ProgramStageSection" />
 		<property name="sessionFactory" ref="sessionFactory" />
@@ -127,6 +128,13 @@
 		<property name="sessionFactory" ref="sessionFactory" />
 	</bean>
 
+
+	<bean id="org.hisp.dhis.patient.PatientAuditStore"
+		class="org.hisp.dhis.patient.hibernate.HibernatePatientAuditStore">
+		<property name="clazz" value="org.hisp.dhis.patient.PatientAudit" />
+		<property name="sessionFactory" ref="sessionFactory" />
+	</bean>
+
 	<!-- Service definitions -->
 
 	<bean id="org.hisp.dhis.program.ProgramDataEntryService" class="org.hisp.dhis.program.DefaultProgramDataEntryService">
@@ -143,7 +151,7 @@
 		<property name="programStageDataElementService"
 			ref="org.hisp.dhis.program.ProgramStageDataElementService" />
 	</bean>
-	
+
 	<bean id="org.hisp.dhis.caseaggregation.CaseAggregationConditionService"
 		class="org.hisp.dhis.caseaggregation.DefaultCaseAggregationConditionService">
 		<property name="aggregationConditionStore"
@@ -193,9 +201,10 @@
 	</bean>
 
 	<bean id="org.hisp.dhis.program.ProgramStageSectionService" class="org.hisp.dhis.program.DefaultProgramStageSectionService">
-		<property name="programStageSectionStore" ref="org.hisp.dhis.program.ProgramStageSectionStore" />
+		<property name="programStageSectionStore"
+			ref="org.hisp.dhis.program.ProgramStageSectionStore" />
 	</bean>
-	
+
 	<bean id="org.hisp.dhis.program.ProgramService" class="org.hisp.dhis.program.DefaultProgramService">
 		<property name="programStore" ref="org.hisp.dhis.program.ProgramStore" />
 	</bean>
@@ -274,7 +283,11 @@
 		<property name="tabularReportStore"
 			ref="org.hisp.dhis.patientreport.PatientTabularReportStore" />
 	</bean>
-	
+
+	<bean id="org.hisp.dhis.patient.PatientAuditService" class="org.hisp.dhis.patient.DefaultPatientAuditService">
+		<property name="patientAuditStore" ref="org.hisp.dhis.patient.PatientAuditStore" />
+	</bean>
+
 	<!-- DeletionHandlers -->
 
 	<bean id="org.hisp.dhis.patient.PatientIdentifierDeletionHandler"
@@ -351,47 +364,53 @@
 	</bean>
 
 	<!-- PatientComment -->
-	
+
 	<bean id="org.hisp.dhis.patientcomment.PatientCommentService"
 		class="org.hisp.dhis.patientcomment.DefaultPatientCommentService">
-		<property name="patientCommentStore" ref="org.hisp.dhis.patientcomment.PatientCommentStore" />
+		<property name="patientCommentStore"
+			ref="org.hisp.dhis.patientcomment.PatientCommentStore" />
 	</bean>
-	
-	<bean id="org.hisp.dhis.patientcomment.PatientCommentStore"
-		class="org.hisp.dhis.hibernate.HibernateGenericStore">
+
+	<bean id="org.hisp.dhis.patientcomment.PatientCommentStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
 		<property name="clazz" value="org.hisp.dhis.patientcomment.PatientComment" />
 		<property name="sessionFactory" ref="sessionFactory" />
 	</bean>
-	
+
 	<!-- Scheduling -->
-	
-	<bean id="org.hisp.dhis.patient.scheduling.ProgramSchedulingManager" class="org.hisp.dhis.patient.scheduling.DefaultProgramSchedulingManager"
-   	 init-method="scheduleTasks">
-    <property name="systemSettingManager" ref="org.hisp.dhis.setting.SystemSettingManager" />
-    <property name="scheduler" ref="scheduler" />
-    <property name="tasks">
-      <map>
-        <entry key="scheduleMessage" value-ref="scheduleMessage" />
-        <entry key="sendMessageScheduled" value-ref="sendMessageScheduled" />
-      </map>
-    </property>
-   </bean>
-  
- 	<bean id="abstractScheduledMessageTask" class="org.hisp.dhis.patient.scheduling.SendScheduledMessageTask" >
- 		<constructor-arg ref="org.hisp.dhis.program.ProgramStageInstanceService" />
- 		<constructor-arg ref="org.hisp.dhis.sms.outbound.OutboundSmsService" />
- 		<constructor-arg ref="jdbcTemplate" />
- 	</bean>
- 	
- 	<bean id="sendMessageScheduled" class="org.hisp.dhis.patient.scheduling.SendScheduledMessageTask" parent="abstractScheduledMessageTask">
-		<property name="sendingMessage" value="true"/>
-	</bean>  
-	
-	<bean id="scheduleMessage" class="org.hisp.dhis.patient.scheduling.SendScheduledMessageTask" parent="abstractScheduledMessageTask">
-		<property name="sendingMessage" value="false"/>
-	</bean>  
-  	
-    <!-- Startup -->
+
+	<bean id="org.hisp.dhis.patient.scheduling.ProgramSchedulingManager"
+		class="org.hisp.dhis.patient.scheduling.DefaultProgramSchedulingManager"
+		init-method="scheduleTasks">
+		<property name="systemSettingManager" ref="org.hisp.dhis.setting.SystemSettingManager" />
+		<property name="scheduler" ref="scheduler" />
+		<property name="tasks">
+			<map>
+				<entry key="scheduleMessage" value-ref="scheduleMessage" />
+				<entry key="sendMessageScheduled" value-ref="sendMessageScheduled" />
+			</map>
+		</property>
+	</bean>
+
+	<bean id="abstractScheduledMessageTask"
+		class="org.hisp.dhis.patient.scheduling.SendScheduledMessageTask">
+		<constructor-arg ref="org.hisp.dhis.program.ProgramStageInstanceService" />
+		<constructor-arg ref="org.hisp.dhis.sms.outbound.OutboundSmsService" />
+		<constructor-arg ref="jdbcTemplate" />
+	</bean>
+
+	<bean id="sendMessageScheduled"
+		class="org.hisp.dhis.patient.scheduling.SendScheduledMessageTask"
+		parent="abstractScheduledMessageTask">
+		<property name="sendingMessage" value="true" />
+	</bean>
+
+	<bean id="scheduleMessage"
+		class="org.hisp.dhis.patient.scheduling.SendScheduledMessageTask"
+		parent="abstractScheduledMessageTask">
+		<property name="sendingMessage" value="false" />
+	</bean>
+
+	<!-- Startup -->
 
 	<bean id="org.hisp.dhis.patient.startup.TableAlteror" class="org.hisp.dhis.patient.startup.TableAlteror">
 		<property name="statementManager" ref="statementManager" />

=== added file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientAudit.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientAudit.hbm.xml	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientAudit.hbm.xml	2012-09-26 05:19:53 +0000
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+  "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+  "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd";>
+
+<hibernate-mapping>
+	<class name="org.hisp.dhis.patient.PatientAudit" table="patientaudit">
+
+		<id name="id" column="patientauditid">
+			<generator class="native" />
+		</id>
+
+		<many-to-one name="patient" column="patientid"
+			class="org.hisp.dhis.patient.Patient" foreign-key="fk_patientauditid_patientid" />
+
+		<property name="date" />
+
+	</class>
+</hibernate-mapping>

=== modified 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	2012-09-11 06:12:20 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/PatientDashboardAction.java	2012-09-26 05:19:53 +0000
@@ -28,19 +28,19 @@
 package org.hisp.dhis.caseentry.action.patient;
 
 import java.util.Collection;
-import java.util.HashMap;
+import java.util.Date;
 import java.util.HashSet;
-import java.util.Map;
 import java.util.Set;
 
 import org.hisp.dhis.patient.Patient;
+import org.hisp.dhis.patient.PatientAudit;
+import org.hisp.dhis.patient.PatientAuditService;
 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.ProgramStageInstanceService;
 import org.hisp.dhis.relationship.Relationship;
 import org.hisp.dhis.relationship.RelationshipService;
 
@@ -66,7 +66,7 @@
 
     private ProgramInstanceService programInstanceService;
 
-    private ProgramStageInstanceService programStageInstanceService;
+    private PatientAuditService patientAuditService;
 
     // -------------------------------------------------------------------------
     // Input && Output
@@ -83,18 +83,18 @@
     private Collection<Relationship> relationship;
 
     private Collection<ProgramInstance> activeProgramInstances;
+
+    private Collection<ProgramInstance> completedProgramInstances;
     
-    private Collection<ProgramInstance> completedProgramInstances;
-
-    private Map<Integer, Integer> statusMap = new HashMap<Integer, Integer>();
+    private Collection<PatientAudit> patientAudits;
 
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
 
-    public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService )
+    public void setPatientAuditService( PatientAuditService patientAuditService )
     {
-        this.programStageInstanceService = programStageInstanceService;
+        this.patientAuditService = patientAuditService;
     }
 
     public void setPatientAttributeValueService( PatientAttributeValueService patientAttributeValueService )
@@ -107,6 +107,11 @@
         return activeProgramInstances;
     }
 
+    public Collection<PatientAudit> getPatientAudits()
+    {
+        return patientAudits;
+    }
+
     public Collection<ProgramInstance> getCompletedProgramInstances()
     {
         return completedProgramInstances;
@@ -152,11 +157,6 @@
         this.patientId = patientId;
     }
 
-    public Map<Integer, Integer> getStatusMap()
-    {
-        return statusMap;
-    }
-
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -176,12 +176,12 @@
         Collection<ProgramInstance> programInstances = programInstanceService.getProgramInstances( patient );
 
         activeProgramInstances = new HashSet<ProgramInstance>();
-        
+
         completedProgramInstances = new HashSet<ProgramInstance>();
-        
+
         for ( ProgramInstance programInstance : programInstances )
         {
-            if( programInstance.isCompleted() )
+            if ( programInstance.isCompleted() )
             {
                 completedProgramInstances.add( programInstance );
             }
@@ -189,8 +189,19 @@
             {
                 activeProgramInstances.add( programInstance );
             }
-            statusMap.putAll( programStageInstanceService.statusProgramStageInstances( programInstance
-                .getProgramStageInstances() ) );
+        }
+
+        patientAudits = patientAuditService.getPatientAudits( patient );
+       
+        long millisInDay = 60 * 60 * 24 * 1000;
+        long currentTime = new Date().getTime();
+        long dateOnly = (currentTime / millisInDay) * millisInDay;
+        Date date = new Date(dateOnly);        
+        PatientAudit patientAudit = patientAuditService.get( patient, date );
+        if ( patientAudit == null )
+        {
+            patientAudit = new PatientAudit( patient, date );
+            patientAuditService.savePatientAudit( patientAudit );
         }
 
         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-09-25 02:50:39 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2012-09-26 05:19:53 +0000
@@ -998,8 +998,7 @@
 		<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" />
+		<property name="patientAuditService" ref="org.hisp.dhis.patient.PatientAuditService" />
 	</bean>
 
 	<!-- Comment -->

=== 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-23 13:07:21 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2012-09-26 05:19:53 +0000
@@ -460,4 +460,6 @@
 the_date_is_scheduled = The date is scheduled
 move_to_dashboard_of = Move to dashboard of
 management = Management
-change_location = Change location
\ No newline at end of file
+change_location = Change location
+user_access = User access
+history = History
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/identifierAndAttributeForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/identifierAndAttributeForm.vm	2012-09-20 13:04:02 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/identifierAndAttributeForm.vm	2012-09-26 05:19:53 +0000
@@ -1,6 +1,6 @@
 
 #foreach ($identifierType in $program.patientIdentifierTypes) 
-	<tr #alternate( $mark )>
+	<tr>
 		<td class='text-column'><label>$identifierType.name #if($identifierType.mandatory == true )<em title="$i18n.getString( 'required' )" class="required">*</em> #end</label></td>       
 		<td class="input-column">
 			<input type="text" id="iden$identifierType.id" name="iden$identifierType.id" class="{validate:{required:$identifierType.mandatory, #if($!identifierType.noChars) maxlength:$identifierType.noChars, #end #if($identifierType.type=='number') number:true #elseif($!identifierType.type=='letter') lettersonly:true #end }}" />
@@ -9,7 +9,7 @@
 #end
 				
 #foreach($attribute in $program.patientAttributes )
-	<tr #alternate( $mark )>
+	<tr>
 		<td class='text-column'><label>$attribute.name #if($attribute.mandatory)<em title="$i18n.getString( "required" )" class="required">*</em> #end</label></td>
 		<td class="input-column" >
 			#if( $attribute.valueType == "YES/NO" )

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2012-09-25 14:39:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2012-09-26 05:19:53 +0000
@@ -1575,6 +1575,11 @@
 	$('#eventMessagesDiv').load("getEventMessages.action", {programInstanceId:programInstanceId});
 }
 
+function dashboardHistoryToggle()
+{
+	jQuery('#dashboardHistoryDiv').toggle();
+}
+
 // --------------------------------------------------------------------
 // Comment && Message
 // --------------------------------------------------------------------

=== 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-25 06:10:24 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm	2012-09-26 05:19:53 +0000
@@ -1,6 +1,7 @@
 <h3>
  <a href="javascript:onClickBackBtn();" id='mainFormLink' name='mainFormLink'>$i18n.getString( 'patient_management' )</a>
  &#8226; $i18n.getString( 'patient_dashboard' )
+ &raquo; <a href="javascript:dashboardHistoryToggle();" >$i18n.getString( 'history' )</a>
 </h3>
 
 <table>
@@ -184,7 +185,26 @@
 
 <div id='programEnrollmentDiv' class='hidden'></div>
 <div id='dataEntryFormDiv'></div>
+<div id='dashboardHistoryDiv' class="dashboard-history" style="display:none;">
+	<table class='mainPageTable'>
+		<thead>
+		<tr>
+			<th>$i18n.getString("user_access")</th>
+			<th>$i18n.getString("date")</th>
+		</tr>
+		</thead>
+		#set( $mark = false )
+		#foreach( $patientAudit in $patientAudits )
+		<tr #alternate( $mark )>
+			<td>$patientAudit.patient.getFullName()</td>
+			<td>$format.formatDate($patientAudit.date)</td>
+		</tr>
+		#set( $mark = !$mark )
+		#end
+	</table>
+</div>
 
 <script>
 	hideById('mainLinkLbl');
+	var i18n_history = '$encoder.jsEscape( $i18n.getString( "history" ) , "'" )';
 </script>
\ No newline at end of file

=== 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-09-23 09:30:13 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css	2012-09-26 05:19:53 +0000
@@ -401,4 +401,20 @@
 	border: 1px solid #aaa;
 	margin: 5px;
 	border-radius: 2px;
+}
+
+div.dashboard-history
+{
+	z-index:100; 
+	width:400px; 
+	height:200px; 
+	position:absolute; 
+	left:650px; 
+	top:95px; 
+	background-color:#ffffff;
+	border:4px solid #d0d0d0;
+	padding-top:1px;
+	padding-right:1px;
+	padding-left:1px;
+	padding-bottom:1px;
 }
\ No newline at end of file