← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11032: Add more program-instance information into Program report tab of Person Dashboard, includes ident...

 

------------------------------------------------------------
revno: 11032
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-05-28 12:49:19 +0700
message:
  Add more program-instance information into Program report tab of Person Dashboard, includes identitiers and attributes belong to the program, sms message of progam-instance and program-stage-instances.
modified:
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java
  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/eventMessage.vm
  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/programEnrollmentForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programInstanceHistory.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitSchedule.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties


--
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-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java	2013-04-11 03:23:04 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramInstanceService.java	2013-05-28 05:49:19 +0000
@@ -44,9 +44,12 @@
 import org.hisp.dhis.patient.PatientReminder;
 import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
 import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
+import org.hisp.dhis.patientcomment.PatientComment;
 import org.hisp.dhis.patientdatavalue.PatientDataValue;
 import org.hisp.dhis.patientdatavalue.PatientDataValueService;
+import org.hisp.dhis.sms.outbound.OutboundSms;
 import org.hisp.dhis.system.grid.ListGrid;
+import org.smslib.OutboundMessage;
 import org.springframework.transaction.annotation.Transactional;
 
 /**
@@ -324,9 +327,8 @@
         // Headers
         // ---------------------------------------------------------------------
 
-        grid.addHeader( new GridHeader( i18n.getString( "name" ), false, false ) );
-        grid.addHeader( new GridHeader( i18n.getString( "value" ), false, false ) );
-        grid.addHeader( new GridHeader( "", true, false ) );
+        grid.addHeader( new GridHeader( "", false, false ) );
+        grid.addHeader( new GridHeader( "", false, false ) );
 
         // ---------------------------------------------------------------------
         // Grids for program-stage-instance
@@ -336,6 +338,59 @@
         grid.addValue( programInstance.getProgram().getDateOfEnrollmentDescription() );
         grid.addValue( format.formatDate( programInstance.getEnrollmentDate() ) );
 
+        // Get patient-identifiers which belong to the program
+
+        Patient patient = programInstance.getPatient();
+
+        Collection<PatientIdentifierType> identifierTypes = programInstance.getProgram().getPatientIdentifierTypes();
+
+        Collection<PatientIdentifier> identifiers = patient.getIdentifiers();
+
+        if ( identifiers.size() > 0 )
+        {
+            for ( PatientIdentifierType identifierType : identifierTypes )
+            {
+                for ( PatientIdentifier identifier : identifiers )
+                {
+                    if ( identifier.getIdentifierType().equals( identifierType ) )
+                    {
+                        grid.addRow();
+                        grid.addValue( identifierType.getDisplayName() );
+                        grid.addValue( identifier.getIdentifier() );
+                    }
+                }
+            }
+        }
+
+        // Get patient-attribute-values which belong to the program
+
+        Collection<PatientAttribute> attrtibutes = programInstance.getProgram().getPatientAttributes();
+        for ( PatientAttribute attrtibute : attrtibutes )
+        {
+            PatientAttributeValue attributeValue = patientAttributeValueService.getPatientAttributeValue( patient,
+                attrtibute );
+            if ( attributeValue != null )
+            {
+                grid.addRow();
+                grid.addValue( attrtibute.getDisplayName() );
+                grid.addValue( attributeValue.getValue() );
+            }
+        }
+
+        // Get sms of the program-instance
+
+        List<OutboundSms> messasges = programInstance.getOutboundSms();
+
+        for ( OutboundSms messasge : messasges )
+        {
+            grid.addRow();
+            grid.addValue( i18n.getString( "message" ) + " " + i18n.getString( "on" ) + " "
+                + format.formatDateTime( messasge.getDate() ) );
+            grid.addValue( messasge.getMessage() );
+        }
+
+        // Program-instance attributes
+
         if ( programInstance.getProgram().getDisplayIncidentDate() != null
             && programInstance.getProgram().getDisplayIncidentDate() )
         {
@@ -392,7 +447,7 @@
             grid.addValue( "" );
 
             grid.addRow();
-            grid.addValue( ">> " + programStageInstance.getProgramStage().getName() );
+            grid.addValue( programStageInstance.getProgramStage().getName() );
             grid.addValue( "" );
 
             // -----------------------------------------------------------------
@@ -410,6 +465,30 @@
                 grid.addValue( format.formatDate( programStageInstance.getExecutionDate() ) );
             }
 
+            // Comments
+
+            List<PatientComment> comments = new ArrayList<PatientComment>( programStageInstance.getPatientComments() );
+
+            for ( PatientComment comment : comments )
+            {
+                grid.addRow();
+                grid.addValue( i18n.getString( "comment" ) + " " + i18n.getString( "on" ) + " "
+                    + format.formatDateTime( comment.getCreatedDate() ) );
+                grid.addValue( comment.getCommentText() );
+            }
+
+            // SMS messages
+
+            List<OutboundSms> messasges = programStageInstance.getOutboundSms();
+
+            for ( OutboundSms messasge : messasges )
+            {
+                grid.addRow();
+                grid.addValue( i18n.getString( "messsage" ) + " " + i18n.getString( "on" ) + " "
+                    + format.formatDateTime( messasge.getDate() ) );
+                grid.addValue( messasge.getMessage() );
+            }
+
             // -----------------------------------------------------------------
             // Values
             // -----------------------------------------------------------------
@@ -422,7 +501,7 @@
                 DataElement dataElement = patientDataValue.getDataElement();
 
                 grid.addRow();
-                grid.addValue( dataElement.getName() );
+                grid.addValue( dataElement.getFormNameFallback() );
 
                 if ( dataElement.getType().equals( DataElement.VALUE_TYPE_BOOL ) )
                 {

=== 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-05-23 16:04:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2013-05-28 05:49:19 +0000
@@ -416,9 +416,9 @@
 please_select_program_stage = Please select program stage
 comment_added = Comment added
 enroll_program = Enroll into program
-comments_and_sms_message = Comments and messages
+comments_and_sms_message = Message history
 no_message = No message
-program_reports = Program reports
+program_report = Program report
 show_hide_content = Show/Hide content
 completed_date = Completed date
 find_and_add_person = Find/Add Person
@@ -626,7 +626,7 @@
 unmark_followup = Un-mark followup
 mark_followup = Mark followup
 save_comment = Save comment
-program_enrollement = Program enrollement
+program_enrollment = Program enrollment
 stored_by = Stored by
 stored_date = Stored date
 marked = Marked
@@ -646,4 +646,7 @@
 list_events = List events
 orgunit_code = Code
 display_orgunit_code = Display orgunit code
-hide = Hide
\ No newline at end of file
+hide = Hide
+none_program = None program
+none_dataset = None dataset
+access_log = Access Log
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/eventMessage.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/eventMessage.vm	2013-01-23 10:27:28 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/eventMessage.vm	2013-05-28 05:49:19 +0000
@@ -11,6 +11,7 @@
 			<th>$i18n.getString( "date" )</th>
 			<th>$i18n.getString( "program_stage" )</th>
 			<th>$i18n.getString( "sender" )</th>
+			<th>$i18n.getString( "type" )</th>
 			<th>$i18n.getString( "message" )</th>
 		</tr>
 	</thead>
@@ -21,6 +22,7 @@
 				<tr id="comment_$comment.id" #alternate( $mark )>
 					<td>$format.formatDateTime($comment.createdDate)</td>
 					<td>$programStageInstance.programStage.displayName</td>
+					<td>$i18n.getString('comment')</td>
 					<td>$comment.creator</td>
 					<td>$comment.commentText</td>
 				</tr>
@@ -33,6 +35,7 @@
 					<td>$format.formatDateTime($!sms.date)</td>
 					<td>$programStageInstance.programStage.displayName</td>
 					<td>$sms.sender</td>
+					<td>$i18n.getString('message')</td>
 					<td>$sms.message</td>
 				</tr>
 				#set( $mark = !$mark )

=== 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	2013-05-21 04:39:29 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm	2013-05-28 05:49:19 +0000
@@ -1,7 +1,7 @@
 <h3>
  <a name="mainPagelink" href="javascript:onClickBackBtn();">$i18n.getString( 'patient_management' )</a>
  &#8226; $i18n.getString( 'patient_dashboard' )
- &raquo; <a href="javascript:dashboardHistoryToggle();" >$i18n.getString( 'history' )</a>
+ &raquo; <a href="javascript:dashboardHistoryToggle();" >$i18n.getString( 'access_log' )</a>
 </h3>
 
 <div class='dashboard-area'>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm	2013-05-21 02:48:56 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm	2013-05-28 05:49:19 +0000
@@ -20,7 +20,7 @@
 			<li><a href="#tab-3">$i18n.getString("reschedule_and_set_status")</a></li>
 			<li><a href="#tab-4">$i18n.getString("comments_and_sms_message")</a></li>
 		#end
-		<li><a href="#tab-5">$i18n.getString("program_reports")</a></li>
+		<li><a href="#tab-5">$i18n.getString("program_report")</a></li>
 	</ul>
 	
 	#if( $hasDataEntry == 'true')

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programInstanceHistory.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programInstanceHistory.vm	2012-12-10 12:54:54 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programInstanceHistory.vm	2013-05-28 05:49:19 +0000
@@ -1,27 +1,34 @@
+<h3>$grid.title</h3>
+
 <table class="contentProviderTable" width="100%;">
 	<colgroup>
 		<col width="40%">
 		<col width="60%">
 	</colgroup>
-	<thead>
-		<tr>
-		#foreach( $header in $grid.getVisibleHeaders() )
-			<th>$!encoder.htmlEncode( $header.name )</th>
-		#end
-		</tr>
-	</thead>
-
+	
 	<tbody>  
 		#set( $mark = false )
 		#set( $flag = 0 )
+		#set( $flagCol = false )
 		#foreach( $row in $grid.getVisibleRows() )
 			<tr #alternate($mark)>
 				#foreach( $col in $row )
-					#set( $index = ( $velocityCount - 1 ) )
-					#if( $grid.getVisibleHeaders().get( $index ).meta )
+					#if( $flag == 2 && $velocityCount == 1 )
+						<td><h5>$col</h5></td>
+						#set( $flag = 0 )
+						#set( $flagCol = true )
+					#elseif( $velocityCount == 1 && $col != '' )
 						<td>$!encoder.htmlEncode( $col )</td>
-					#else 
+					#elseif( $col != '' || $flagCol == true)
 						<td>$!col</td>
+						#set( $flagCol = false )
+					#end
+					
+					#if($velocityCount == 1)
+						#set( $flag = 0 )
+					#end
+					#if( $col=='')
+						#set( $flag = $flag + 1 )
 					#end
 				#end
 			</tr>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitSchedule.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitSchedule.vm	2013-05-15 03:40:15 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitSchedule.vm	2013-05-28 05:49:19 +0000
@@ -16,7 +16,7 @@
 		</td>
 		<!-- Progam Enrollement -->
 		<td style="height:24px" valign="bottom">       
-            <div class="commentHeader">$encoder.htmlEncode( $i18n.getString( "program_enrollement" ) )</div>
+            <div class="commentHeader">$encoder.htmlEncode( $i18n.getString( "program_enrollment" ) )</div>
         </td>
     </tr>
     <tr>
@@ -86,13 +86,16 @@
 		<tr>
 			<td><span class="commentHeader">$i18n.getString('message')</span><td>
 		</tr>
+		<tbody id="commentTB">
 		#foreach($sms in $programInstance.outboundSms)
 			<tr>
 				<td>
-				($format.formatDateTime($!sms.date) - $encoder.htmlEncode($sms.sender) )
-				$encoder.htmlEncode($sms.message)</td>
+					($format.formatDateTime($!sms.date) - $encoder.htmlEncode($sms.sender) )
+					$encoder.htmlEncode($sms.message)
+				</td>
 			</tr>
 		#end
+		</tbody>
 	</table>
 #end
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties	2013-05-28 03:16:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties	2013-05-28 05:49:19 +0000
@@ -411,8 +411,4 @@
 patient_attribute_visit_schedule = Patient Attribute Visit Schedule
 patient_attribute_visit_schedule_form = Patient attribute visit schedule
 intro_patient_attribute_visit_schedule = Allow to configure which person attributes that are added to the visit schedule.This is very useful when the list is printed and used for tracking in the community.
-selected_program_stages = Selected program stages
-list_events = List events
-none_program = None program
-none_dataset = None dataset
-access_log = Access Log
\ No newline at end of file
+selected_program_stages = Selected program stages
\ No newline at end of file