=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientLocationAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientLocationAction.java 2012-03-27 14:19:09 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientLocationAction.java 2012-08-12 06:10:50 +0000 @@ -60,7 +60,7 @@ } // ------------------------------------------------------------------------- - // Action implementation + // Getter && Setter // ------------------------------------------------------------------------- private Integer patientId; === added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/PatientDashboardAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/PatientDashboardAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/PatientDashboardAction.java 2012-08-12 06:10:50 +0000 @@ -0,0 +1,204 @@ +/* + * Copyright (c) 2004-2009, University of Oslo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of the HISP project nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package org.hisp.dhis.caseentry.action.patient; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.hisp.dhis.patient.Patient; +import org.hisp.dhis.patient.PatientIdentifier; +import org.hisp.dhis.patient.PatientService; +import org.hisp.dhis.patientattributevalue.PatientAttributeValue; +import org.hisp.dhis.patientattributevalue.PatientAttributeValueService; +import org.hisp.dhis.program.ProgramInstance; +import org.hisp.dhis.program.ProgramInstanceService; +import org.hisp.dhis.program.ProgramStageInstance; +import org.hisp.dhis.program.ProgramStageInstanceService; +import org.hisp.dhis.program.comparator.ProgramStageInstanceDueDateComparator; +import org.hisp.dhis.relationship.Relationship; +import org.hisp.dhis.relationship.RelationshipService; + +import com.opensymphony.xwork2.Action; + +/** + * @author Chau Thu Tran + * + * @version PatientDashboardAction.java 1:30:29 PM Aug 10, 2012 $ + */ +public class PatientDashboardAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private PatientService patientService; + + private PatientAttributeValueService patientAttributeValueService; + + private RelationshipService relationshipService; + + private ProgramInstanceService programInstanceService; + + private ProgramStageInstanceService programStageInstanceService; + + // ------------------------------------------------------------------------- + // Input && Output + // ------------------------------------------------------------------------- + + private Integer patientId; + + private Patient patient; + + private Set identifiers; + + private Collection attributeValues; + + private Collection relationship; + + private Collection activeProgramInstances; + + private Collection completedProgramInstances; + + private Map statusMap = new HashMap(); + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService ) + { + this.programStageInstanceService = programStageInstanceService; + } + + public void setPatientAttributeValueService( PatientAttributeValueService patientAttributeValueService ) + { + this.patientAttributeValueService = patientAttributeValueService; + } + + public Collection getActiveProgramInstances() + { + return activeProgramInstances; + } + + public Collection getCompletedProgramInstances() + { + return completedProgramInstances; + } + + public void setRelationshipService( RelationshipService relationshipService ) + { + this.relationshipService = relationshipService; + } + + public void setProgramInstanceService( ProgramInstanceService programInstanceService ) + { + this.programInstanceService = programInstanceService; + } + + public Patient getPatient() + { + return patient; + } + + public Set getIdentifiers() + { + return identifiers; + } + + public Collection getAttributeValues() + { + return attributeValues; + } + + public Collection getRelationship() + { + return relationship; + } + + public void setPatientService( PatientService patientService ) + { + this.patientService = patientService; + } + + public void setPatientId( Integer patientId ) + { + this.patientId = patientId; + } + + public Map getStatusMap() + { + return statusMap; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + @Override + public String execute() + throws Exception + { + patient = patientService.getPatient( patientId ); + + identifiers = patient.getIdentifiers(); + + attributeValues = patientAttributeValueService.getPatientAttributeValues( patient ); + + relationship = relationshipService.getRelationshipsForPatient( patient ); + + Collection programInstances = programInstanceService.getProgramInstances( patient ); + + activeProgramInstances = new HashSet(); + + completedProgramInstances = new HashSet(); + + for ( ProgramInstance programInstance : programInstances ) + { + if( programInstance.isCompleted() ) + { + completedProgramInstances.add( programInstance ); + } + else + { + activeProgramInstances.add( programInstance ); + } + statusMap.putAll( programStageInstanceService.statusProgramStageInstances( programInstance + .getProgramStageInstances() ) ); + } + + return SUCCESS; + } + +} === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2012-08-09 10:47:22 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2012-08-12 06:10:50 +0000 @@ -986,5 +986,22 @@ + + + + + + + + + + === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2012-08-09 14:21:01 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2012-08-12 06:10:50 +0000 @@ -391,7 +391,7 @@ sms = SMS sms_reminder = SMS Reminder sms_reminder_list = SMS reminder list -patient_did_not_register_a_phone_number = The patient did not register a phone number +patient_did_not_register_a_phone_number = The person did not register a phone number sms_message_management = SMS message management date = Date sms_message_details = SMS message details @@ -403,4 +403,8 @@ clickatell_gw=Clickatell Gateway generic_http_gw=Generic HTTP Gateway modem_gw=Modem Gateway -messages = messages \ No newline at end of file +messages = messages +patient_dashboard = Person dashboard +completed_programs = Completed programs +active_programs = Active programs +completed = Completed \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2012-08-09 10:47:22 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2012-08-12 06:10:50 +0000 @@ -819,6 +819,14 @@ /dhis-web-commons/ajax/jsonResponseError.vm plainTextError + + + + + /content.vm + /dhis-web-caseentry/patientDashboard.vm + style/style.css + === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/images/close.gif' Binary files dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/images/close.gif 2010-02-22 09:19:15 +0000 and dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/images/close.gif 2012-08-12 06:10:50 +0000 differ === added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/images/flag-blue.png' Binary files dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/images/flag-blue.png 1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/images/flag-blue.png 2012-08-12 06:10:50 +0000 differ === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js 2012-08-06 09:34:34 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js 2012-08-12 06:10:50 +0000 @@ -305,16 +305,17 @@ hideById('selectDiv'); hideById('searchDiv'); hideById('migrationPatientDiv'); - + setInnerHTML('patientDashboard',''); + jQuery('#loaderDiv').show(); jQuery('#editPatientDiv').load('showUpdatePatientForm.action', { id:patientId }, function() { - showById('editPatientDiv'); jQuery('#searchPatientsDiv').dialog('close'); jQuery('#loaderDiv').hide(); + showById('editPatientDiv'); }); jQuery('#resultSearchDiv').dialog('close'); @@ -343,6 +344,7 @@ hideById('selectDiv'); hideById('searchDiv'); hideById('migrationPatientDiv'); + setInnerHTML('patientDashboard',''); jQuery('#loaderDiv').show(); jQuery('#enrollmentDiv').load('showProgramEnrollmentForm.action', @@ -531,6 +533,7 @@ function showRelationshipList( patientId ) { hideById('addRelationshipDiv'); + setInnerHTML('patientDashboard',''); if ( getFieldValue('isShowPatientList') == 'false' ) { @@ -569,6 +572,7 @@ hideById('listRelationshipDiv'); hideById('addRelationshipDiv'); hideById('migrationPatientDiv'); + setInnerHTML('patientDashboard',''); } function loadPatientList() @@ -814,6 +818,7 @@ hideById('listPatientDiv'); hideById('selectDiv'); hideById('searchDiv'); + setInnerHTML('patientDashboard',''); jQuery('#loaderDiv').show(); @@ -835,3 +840,74 @@ showSuccessMessage( i18n_save_success ); } ); } + +// ---------------------------------------------------------------- +// Dash board +// ---------------------------------------------------------------- + +function activeProgramInstanceDiv( programInstanceId ) +{ + jQuery("[name=eventDiv]").each(function(){ + jQuery(this).removeClass("link-area-active"); + }); + + jQuery("[name=imgActive]").each(function(){ + jQuery(this).attr('src',''); + }); + + jQuery('#pi_' + programInstanceId ).addClass("link-area-active"); + jQuery("#img_" + programInstanceId ).attr('src','images/flag-blue.png'); + showById('pi_' + programInstanceId); +} + +function hideProgramInstanceDiv( programInstanceId ) +{ + hideById('pi_' + programInstanceId); + jQuery('#pi_' + programInstanceId).removeClass("link-area-active"); + jQuery("#img_" + programInstanceId ).attr('src',''); +} + +function showPatientDashboardForm( patientId ) +{ + hideById('listPatientDiv'); + hideById('editPatientDiv'); + hideById('selectDiv'); + hideById('searchDiv'); + hideById('migrationPatientDiv'); + + jQuery('#loaderDiv').show(); + jQuery('#patientDashboard').load('patientDashboard.action', + { + patientId:patientId + }, function() + { + showById('patientDashboard'); + jQuery('#loaderDiv').hide(); + }); +} + +function loadProgramStageRecords( programStageInstanceId, completed ) +{ + showLoader(); + jQuery('#dataEntryFromDashboard').load( "viewProgramStageRecords.action", + { + programStageInstanceId: programStageInstanceId + }, function() { + if(completed){ + jQuery( "#dataEntryFromDashboard :input").each(function(){ + disable(this.id); + }); + } + showById('dataEntryFormDashboardDiv'); + hideLoader(); + }).dialog( + { + title:i18n_program_stage, + maximize:true, + closable:true, + modal:false, + overlay:{background:'#000000', opacity:0.1}, + width:1000, + height:500 + }); +} === added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm 2012-08-12 06:10:50 +0000 @@ -0,0 +1,196 @@ +

$i18n.getString("patient_dashboard") + • $i18n.getString( "edit_profile" ) + • $i18n.getString( "manage_relationship" ) + • $i18n.getString( "change_patient_location" ) +

+ + + + + + + + + + +
+ + + + + + + + + + + + +
+ +
+ +
+ +
+
+ + #foreach( $programInstance in $activeProgramInstances ) +
+ + + + +
$programInstance.program.name ($format.formatDate($programInstance.enrollmentDate) - $i18n.getString("active")) +
+
+ + + #foreach( $programStageInstance in $programInstance.programStageInstances ) + + + + #end + +
+ +
+
+
+ #end + + + #foreach( $programInstance in $completedProgramInstances ) +
+ + + + +
$programInstance.program.name ($format.formatDate($programInstance.enrollmentDate) - $i18n.getString("completed")) +
+ +
+ + + #foreach( $programStageInstance in $programInstance.programStageInstances ) + + + + #end + +
+ +
+
+
+ #end +
+ +
\ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientRegistrationList.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientRegistrationList.vm 2012-08-07 05:43:56 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientRegistrationList.vm 2012-08-12 06:10:50 +0000 @@ -98,8 +98,9 @@ $i18n.getString( "program_enrollment" ) $i18n.getString( "edit_profile" ) $i18n.getString( "manage_relationship" ) - $i18n.getString( "change_patient_location" )$i18n.getString( "remove" ) - + $i18n.getString( "change_patient_location" ) + $i18n.getString( "edit_profile" ) + $i18n.getString( "remove" ) $i18n.getString( "patient_details_and_history" ) === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.vm 2012-08-02 09:55:03 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.vm 2012-08-12 06:10:50 +0000 @@ -22,6 +22,7 @@
+
@@ -102,9 +103,10 @@ var i18n_add_person_successfully = '$encoder.jsEscape( $i18n.getString( "add_person_successfully" ) , "'")'; var i18n_please_select_relationship_type = '$encoder.jsEscape( $i18n.getString( "please_select_relationship_type" ) , "'")'; var i18n_please_select_a_patient_for_setting_relationship = '$encoder.jsEscape( $i18n.getString( "please_select_a_patient_for_setting_relationship" ) , "'")'; - + var i18n_update_patient = '$encoder.jsEscape( $i18n.getString( "update_patient" ) , "'")'; var i18n_violate_validation = '$encoder.jsEscape( $i18n.getString( "violate_validation" ) , "'")'; var i18n_show_all_items = '$encoder.jsEscape( $i18n.getString( "show_all_items" ) , "'")'; + var i18n_create_new_event = '$encoder.jsEscape( $i18n.getString( "create_new_event" ) , "'")'; var checkedDuplicate = false; // -1: no search anything // 0: show list all patient === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css 2012-08-09 14:21:01 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css 2012-08-12 06:10:50 +0000 @@ -192,7 +192,6 @@ .ui-button { max-height: 100px; - max-height: 100px; } .ui-autocomplete @@ -223,3 +222,91 @@ text-align:center; } +div.link-area +{ + border:1px solid #d0d0d0; + padding-top:1px; + padding-right:1px; + padding-left:1px; + padding-bottom:0px; + height:200px; + width:350px; + overflow:hidden; + position:relative; + top: 45px; +} + +.contentProviderTable +{ + height: 150px; + width: 340px; + margin-top:-10px; + overflow-y: auto; + overflow-x:hidden; +} + +.contentProviderTable td +{ + padding-top:3px; + padding-bottom:3px; + border-bottom:1px solid #cad5e5; +} + +div.event-dashboard +{ + width:900px; + border:1px solid #d0d0d0; + position:relative; + top: 47px; +} + +div.link-area-active +{ + width:900px; + border:10px solid #d0d0d0; + position:relative; + top: 47px; +} + +div.event-flow-dashboard +{ + width:900px; + height:140px; + overflow-x:auto; + overflow-y:hidden; +} + +#subMenu +{ + position:absolute; +} + +#subMenu ul +{ + list-style-type:none; + margin: 0; +} + +#subMenu li +{ + float:left; +} + +#subMenu a +{ + padding: 6px 12px; + height: 25px; + border: 1px solid #aaa; + border-radius: 3px; + margin-right: 4px; + font-family: LiberationSansBold, arial; + font-size: 13px; + color: #606060; + background-color: #f3f3f3; +} + +#subMenu a:hover +{ + text-decoration: none; + background-color: #f8f8f8; +} === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm 2012-08-02 02:48:18 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm 2012-08-12 06:10:50 +0000 @@ -20,7 +20,7 @@ ,errorElement:"span" ,submitHandler: function(form) { - validateUpdatePatient(); + validateUpdatePatient( false ); } ,beforeValidateHandler: function(form) { @@ -253,7 +253,7 @@ - +