dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #22050
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10570: Add completeduser and completeddate for program-stage-instance. Update values for these propertie...
------------------------------------------------------------
revno: 10570
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-04-16 09:02:11 +0700
message:
Add completeduser and completeddate for program-stage-instance. Update values for these properties when to completed an event.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java
dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageInstance.hbm.xml
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CompleteDataEntryAction.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/programTrackingRecords.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/program/ProgramStageInstance.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java 2013-04-04 18:06:19 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java 2013-04-16 02:02:11 +0000
@@ -80,6 +80,10 @@
private String coordinates;
+ private String completedUser;
+
+ private Date completedDate;
+
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
@@ -188,6 +192,16 @@
this.programStage = programStage;
}
+ public String getCompletedUser()
+ {
+ return completedUser;
+ }
+
+ public void setCompletedUser( String completedUser )
+ {
+ this.completedUser = completedUser;
+ }
+
/**
* @return the dueDate
*/
@@ -266,6 +280,16 @@
this.patientComments = patientComments;
}
+ public Date getCompletedDate()
+ {
+ return completedDate;
+ }
+
+ public void setCompletedDate( Date completedDate )
+ {
+ this.completedDate = completedDate;
+ }
+
public Integer getStatus()
{
return status;
@@ -316,7 +340,7 @@
{
return ProgramStageInstance.LATE_VISIT_STATUS;
}
-
+
return ProgramStageInstance.FUTURE_VISIT_STATUS;
}
}
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageInstance.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageInstance.hbm.xml 2013-03-01 14:09:05 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageInstance.hbm.xml 2013-04-16 02:02:11 +0000
@@ -40,5 +40,9 @@
<property name="coordinates" type="text" />
+ <property name="completedUser" />
+
+ <property name="completedDate" />
+
</class>
</hibernate-mapping>
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CompleteDataEntryAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CompleteDataEntryAction.java 2013-04-10 03:13:47 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CompleteDataEntryAction.java 2013-04-16 02:02:11 +0000
@@ -26,16 +26,19 @@
*/
package org.hisp.dhis.caseentry.action.caseentry;
+import java.util.Calendar;
import java.util.Date;
import java.util.Set;
import org.hisp.dhis.patient.Patient;
import org.hisp.dhis.patient.PatientService;
+import org.hisp.dhis.period.PeriodType;
import org.hisp.dhis.program.Program;
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.user.CurrentUserService;
import com.opensymphony.xwork2.Action;
@@ -70,6 +73,13 @@
this.patientService = patientService;
}
+ private CurrentUserService currentUserService;
+
+ public void setCurrentUserService( CurrentUserService currentUserService )
+ {
+ this.currentUserService = currentUserService;
+ }
+
// -------------------------------------------------------------------------
// Input / Output
// -------------------------------------------------------------------------
@@ -110,6 +120,13 @@
programStageInstance.setCompleted( true );
+ Calendar today = Calendar.getInstance();
+ PeriodType.clearTimeOfDay( today );
+ Date date = today.getTime();
+
+ programStageInstance.setCompletedDate( date );
+ programStageInstance.setCompletedUser( currentUserService.getCurrentUsername() );
+
programStageInstanceService.updateProgramStageInstance( programStageInstance );
// ----------------------------------------------------------------------
=== 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 2013-04-13 05:14:32 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2013-04-16 02:02:11 +0000
@@ -105,6 +105,7 @@
ref="org.hisp.dhis.program.ProgramStageInstanceService" />
<property name="programInstanceService" ref="org.hisp.dhis.program.ProgramInstanceService" />
<property name="patientService" ref="org.hisp.dhis.patient.PatientService" />
+ <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
</bean>
<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 2013-04-12 08:25:43 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2013-04-16 02:02:11 +0000
@@ -628,4 +628,5 @@
save_comment = Save comment
program_enrollement = Program enrollement
stored_by = Stored by
-stored_date = Stored date
\ No newline at end of file
+stored_date = Stored date
+marked = Marked
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm 2013-03-15 08:28:14 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm 2013-04-16 02:02:11 +0000
@@ -30,6 +30,7 @@
<thead>
<tr>
<th>#</th>
+ <th>$i18n.getString('followup')</th>
<th>$i18n.getString('date_scheduled')</th>
<th>$i18n.getString('full_name')</th>
<th>$i18n.getString('phone_number')</th>
@@ -46,7 +47,14 @@
#set( $nr = ( ( $paging.getCurrentPage() - 1 ) * $paging.pageSize ) + $velocityCount )
$nr
</td>
-
+ <td>
+ #set( $comment = $!programStageInstance.programInstance.patientComment.commentText )
+ #if( $!programStageInstance.programInstance.followup=='true')
+ <img src='../images/marked.png' title='$!comment'>
+ #else
+ <img src='../images/unmarked.png' title='$!comment'>
+ #end
+ </td>
<td>
#if($!programStageInstance.executionDate)
$format.formatDate($!programStageInstance.executionDate)