← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10012: Some minor fixes for patient management function.

 

------------------------------------------------------------
revno: 10012
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-03-06 21:31:30 +0700
message:
  Some minor fixes for patient management function.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ShowAddRepresentativeAction.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/addPatientForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addSingleEventRegistration.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/searchPatientCriteria.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-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ShowAddRepresentativeAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ShowAddRepresentativeAction.java	2011-09-14 06:36:13 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ShowAddRepresentativeAction.java	2013-03-06 14:31:30 +0000
@@ -31,12 +31,15 @@
 import java.util.Collection;
 import java.util.List;
 
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
 import org.hisp.dhis.patient.PatientAttribute;
 import org.hisp.dhis.patient.PatientAttributeService;
 import org.hisp.dhis.patient.PatientIdentifierType;
 import org.hisp.dhis.patient.PatientIdentifierTypeService;
 import org.hisp.dhis.relationship.RelationshipType;
 import org.hisp.dhis.relationship.RelationshipTypeService;
+import org.hisp.dhis.user.User;
 
 import com.opensymphony.xwork2.Action;
 
@@ -47,6 +50,8 @@
     // Dependencies
     // -------------------------------------------------------------------------
 
+    private OrganisationUnitSelectionManager selectionManager;
+
     private RelationshipTypeService relationshipTypeService;
 
     private PatientIdentifierTypeService patientIdentifierTypeService;
@@ -63,6 +68,8 @@
 
     private Collection<PatientAttribute> attributes;
 
+    private Collection<User> healthWorkers;
+
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -70,17 +77,25 @@
     public String execute()
     {
         relationshipTypes = new ArrayList<RelationshipType>( relationshipTypeService.getAllRelationshipTypes() );
-        
+
         identifierTypes = patientIdentifierTypeService.getAllPatientIdentifierTypes();
-        
+
         attributes = patientAttributeService.getAllPatientAttributes();
 
+        OrganisationUnit organisationUnit = selectionManager.getSelectedOrganisationUnit();
+        healthWorkers = organisationUnit.getUsers();
+
         return SUCCESS;
     }
 
     // -----------------------------------------------------------------------------
     // Getter/Setter
     // -----------------------------------------------------------------------------
+   
+    public void setSelectionManager( OrganisationUnitSelectionManager selectionManager )
+    {
+        this.selectionManager = selectionManager;
+    }
 
     public void setRelationshipTypeService( RelationshipTypeService relationshipTypeService )
     {
@@ -111,4 +126,9 @@
     {
         return attributes;
     }
+
+    public Collection<User> getHealthWorkers()
+    {
+        return healthWorkers;
+    }
 }

=== 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-03-05 07:29:03 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2013-03-06 14:31:30 +0000
@@ -546,6 +546,8 @@
 		id="org.hisp.dhis.caseentry.action.patient.ShowAddRepresentativeAction"
 		class="org.hisp.dhis.caseentry.action.patient.ShowAddRepresentativeAction"
 		scope="prototype">
+		<property name="selectionManager"
+			ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
 		<property name="relationshipTypeService"
 			ref="org.hisp.dhis.relationship.RelationshipTypeService" />
 		<property name="patientIdentifierTypeService"

=== 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-03-05 13:20:03 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2013-03-06 14:31:30 +0000
@@ -476,7 +476,7 @@
 show_all = Show all
 you_have_active_filters = You have active filters
 back_to_event_list = Back to event list
-add_and_register_new = Add && Register new
+add_and_register_new = Add & Register new
 events_completed = Events completed
 statistical_program = Statistical Program
 statistical_program_report = Statistical program report
@@ -575,4 +575,5 @@
 missing_patient_identifier_type = Missing patient identifier type
 advanced_search = Advanced search
 insert_a_report_date = Please enter a report date.
-insert_a_due_date = Please enter a due date.
\ No newline at end of file
+insert_a_due_date = Please enter a due date.
+view_all = View all
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm	2013-03-05 14:47:06 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm	2013-03-06 14:31:30 +0000
@@ -31,7 +31,7 @@
 		
 		#if($!customRegistrationForm)
 		#else
-			datePickerValid( 'patientForm [id=registrationDate]' );
+			datePickerValid( 'patientForm [id=registrationDate]', true );
 			datePickerValid( 'patientForm [id=birthDate]' );
 			datePickerValid( 'patientForm [id=deathDate]', false );
 		#end

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addSingleEventRegistration.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addSingleEventRegistration.vm	2013-03-05 04:09:58 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addSingleEventRegistration.vm	2013-03-06 14:31:30 +0000
@@ -30,7 +30,7 @@
 			});
 		#if($!customRegistrationForm)
 		#else
-			datePickerValid( 'patientForm [id=registrationDate]' );
+			datePickerValid( 'patientForm [id=registrationDate]', true );
 			datePickerValid( 'patientForm [id=birthDate]' );
 		#end
 		addEventForPatientForm( 'patientForm' );

=== 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	2013-03-06 04:14:33 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2013-03-06 14:31:30 +0000
@@ -72,14 +72,18 @@
 		contend = '<tr id="' + rowId + '">' + contend + '</tr>';
 
 	jQuery('#advancedSearchTB').append( contend );
+	var rowspan = eval( jQuery('[name=addAndSearchBtn]').attr('rowspan') );
+	jQuery('[name=addAndSearchBtn]').attr('rowspan', rowspan + 1);
 }	
 
 function removeAttributeOption( rowId )
 {
 	jQuery( '#' + rowId ).remove();
-	if( jQuery( '#advancedSearchTB tr' ).length == 3 ){
+	if( jQuery( '#advancedSearchTB tr' ).length == 2 ){
 		jQuery('#advancedSearchTB [name=clearSearchBtn]').attr('disabled', true);
-	}	
+	}
+	var rowspan = eval( jQuery('[name=addAndSearchBtn]').attr('rowspan') );
+	jQuery('[name=addAndSearchBtn]').attr('rowspan', rowspan - 1);
 }	
 
 //------------------------------------------------------------------------------
@@ -189,7 +193,7 @@
 	
 	if (getFieldValue('searchByProgramStage') == "false" 
 		|| ( getFieldValue('searchByProgramStage') == "true"  
-			&& jQuery( '#advancedSearchTB tr' ).length > 2) ){
+			&& jQuery( '#advancedSearchTB tr' ).length > 1) ){
 		jQuery("#searchDiv :input").each( function( i, item )
 		{
 			var elementName = $(this).attr('name');

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm	2013-03-05 14:47:06 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm	2013-03-06 14:31:30 +0000
@@ -21,7 +21,7 @@
 		<td>$i18n.getString('program')</td>
 		<td>
 			<select id='programIdAddPatient' name='programIdAddPatient' onchange='enableBtn();'>
-				<option value='' type='2'>[$i18n.getString("please_select")]</option>
+				<option value='' type='2'>[$i18n.getString("view_all")]</option>
 				#foreach($program in $programs)
 					<option value="$program.id" type='$program.type'>$program.displayName</option>
 				#end
@@ -83,13 +83,13 @@
 			<tr>
 				<td></td>
 				<td></td>
-				<td rowspan='30' valign='bottom'>
+				<td name='addAndSearchBtn' rowspan='2' valign='bottom'>
 					<input type="button" class='normal-button' value='$i18n.getString( "add" )' onclick='addAttributeOption();'>
 				</td>
-				<td rowspan='30' valign='bottom' align="right" >
+				<td name='addAndSearchBtn' rowspan='2' valign='bottom' align="right" >
 					<input type="button" class='normal-button' value='$i18n.getString( "search" )' onclick='validateAdvancedSearch();' id='searchPatientBtn'>
 				</td>
-				<td rowspan='30' valign='bottom' align="right" >
+				<td name='addAndSearchBtn' rowspan='2' valign='bottom' align="right" >
 					<input type="button" class='normal-button hidden' id='sendSmsToListBtn' value="$i18n.getString('sms')" onclick="setFieldValue('sendToList', true);showSendSmsForm();" >
 				</td>
 			</tr>
@@ -115,10 +115,6 @@
 					<input type="button" class='normal-button' name="clearSearchBtn" value='$i18n.getString( "clear" )' onclick="removeAttributeOption('advSearchBox0');" disabled>
 				</td>
 			</tr>
-			<tr>
-				<td></td>
-				<td></td>
-			</tr>
 		</tbody>
 	</table>
 </div>