← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9775: Add program-enrollment fields into Registration patient form.

 

------------------------------------------------------------
revno: 9775
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-02-08 19:46:09 +0700
message:
  Add program-enrollment fields into Registration patient form.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ShowAddPatientFormAction.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/addPatientForm.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/multiDataEntrySelect.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm
  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/singleEventSelect.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/ShowAddPatientFormAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ShowAddPatientFormAction.java	2013-02-05 19:20:14 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ShowAddPatientFormAction.java	2013-02-08 12:46:09 +0000
@@ -94,7 +94,7 @@
     {
         this.patientRegistrationFormService = patientRegistrationFormService;
     }
-    
+
     private I18n i18n;
 
     public void setI18n( I18n i18n )
@@ -162,6 +162,13 @@
         return customRegistrationForm;
     }
 
+    private Program program;
+
+    public Program getProgram()
+    {
+        return program;
+    }
+
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -184,14 +191,14 @@
         }
         else
         {
-            Program program = programService.getProgram( programId );
+            program = programService.getProgram( programId );
             PatientRegistrationForm patientRegistrationForm = patientRegistrationFormService
                 .getPatientRegistrationForm( program );
-            
+
             if ( patientRegistrationForm != null )
             {
-                customRegistrationForm = patientRegistrationFormService.prepareDataEntryFormForAdd( patientRegistrationForm
-                    .getDataEntryForm().getHtmlCode(), healthWorkers, null, null, i18n, format );
+                customRegistrationForm = patientRegistrationFormService.prepareDataEntryFormForAdd(
+                    patientRegistrationForm.getDataEntryForm().getHtmlCode(), healthWorkers, null, null, i18n, format );
             }
         }
 

=== 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-02-06 14:08:33 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2013-02-08 12:46:09 +0000
@@ -474,7 +474,7 @@
 show_all = Show all
 you_have_active_filters = You have active filters
 back_to_event_list = Back to event list
-add_patient_and_add_new = Add person and Add new
+add_and_register_new = Add && Register new
 events_completed = Events completed
 statistical_program = Statistical Program
 statistical_program_report = Statistical program report
@@ -547,4 +547,5 @@
 confirm_delete_date_range_list=Are you sure you want to delete date range list?
 invalid_position = Please select at most two row positions or two filter positions.
 select_a_dataelement_for_sum_avg_operator = Please select a data element for sum/avg operator
-runing_validation_rules = Validation rules are being processed, please wait ...
\ No newline at end of file
+runing_validation_rules = Validation rules are being processed, please wait ...
+program_enrollment = Program enrollment
\ 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	2012-12-10 12:54:54 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm	2013-02-08 12:46:09 +0000
@@ -51,14 +51,9 @@
 	<tr>
 		<td></td>
 		<td>
-			<input type="submit" class="button" value="$i18n.getString( 'add' )" onclick="isContinue=false;"/>
-			<input type='button' class="button" value="$i18n.getString( 'cancel' )" onclick="loadPatientList();" />
-		</td>
-	</tr>
-	<tr>
-		<td></td>
-		<td>			
-			<input type="submit" class="button" value="$i18n.getString( 'add_patient_and_add_new' )" style="width:260px;" onclick="isContinue=true;"/>
+			<input type="submit" class="button" value="$i18n.getString( 'add' )" onclick="isContinue=false;" style="width:80px;" />
+			<input type="submit" class="button" value="$i18n.getString( 'add_and_register_new' )" style="width:160px;" onclick="isContinue=true;"/>
+			<input type='button' class="button" value="$i18n.getString( 'cancel' )" onclick="loadPatientList();" style="width:80px;" />
 		</td>
 	</tr>
 </table>

=== 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-02-02 10:34:22 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2013-02-08 12:46:09 +0000
@@ -472,21 +472,26 @@
 }
 
 function enableBtn(){
-	var programIdAddPatient = getFieldValue('programIdAddPatient');
-	if( programIdAddPatient!='' ){
-		enable('listPatientBtn');
-		enable('advancedSearchBtn');
-		jQuery('#advanced-search :input').each( function( idx, item ){
-			enable(this.id);
-		});
-	}
-	else
+	if(registration==undefined || !registration)
 	{
-		disable('listPatientBtn');
-		disable('advancedSearchBtn');
-		jQuery('#advanced-search :input').each( function( idx, item ){
-			disable(this.id);
-		});
+		var programIdAddPatient = getFieldValue('programIdAddPatient');
+		if( programIdAddPatient!='' ){
+			enable('listPatientBtn');
+			enable('addPatientBtn');
+			enable('advancedSearchBtn');
+			jQuery('#advanced-search :input').each( function( idx, item ){
+				enable(this.id);
+			});
+		}
+		else
+		{
+			disable('listPatientBtn');
+			disable('addPatientBtn');
+			disable('advancedSearchBtn');
+			jQuery('#advanced-search :input').each( function( idx, item ){
+				disable(this.id);
+			});
+		}
 	}
 }
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/multiDataEntrySelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/multiDataEntrySelect.vm	2013-02-02 10:34:22 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/multiDataEntrySelect.vm	2013-02-08 12:46:09 +0000
@@ -8,6 +8,7 @@
 		});
 		
 		jQuery("#searchObjectId [value=prg]").remove();
+		registration = false;
 		hideById('addPatientBtn');
 		disable('advancedSearchBtn');
 	});	

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm	2013-02-04 16:14:38 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm	2013-02-08 12:46:09 +0000
@@ -219,6 +219,27 @@
 			#end
 		#end
 	#end
+	
+	<!-- PROGRAM ENROLLMENT -->
+	
+	#if($!program)
+		<tr><td>&nbsp;</td></tr>
+		<tr><th colspan="2" class="heading-column">$i18n.getString( "program_enrollment" )</th></tr>
+		<tr>
+			<tr>
+			<td class='text-column'><label for="enrollmentDate">$encoder.htmlEncode($program.dateOfEnrollmentDescription) <em title="$i18n.getString( "required" )" class="required"> * </em></label></td>
+			<td colspan='2' class='input-column'><input type="text" id="enrollmentDate" name="enrollmentDate" class="{validate:{required:true}}"></td>
+		</tr>
+		#if($!program.displayIncidentDate=='true')
+			<tr>
+				<td class='text-column'><label for="dateOfIncident">$encoder.htmlEncode($program.dateOfIncidentDescription) <em title="$i18n.getString( "required" )" class="required"> * </em></label></td>
+				<td colspan='2' class='input-column'><input type="text" id="dateOfIncident" name="dateOfIncident"  class="{validate:{required:true}}"></td>
+			</tr>
+			<script>datePickerInRangeValid( 'dateOfIncident' , 'enrollmentDate' );</script>
+		#else
+			<script>datePickerValid( 'enrollmentDate', false );</script>
+		#end
+	#end
 
 #end
 

=== 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-12-10 12:54:54 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.vm	2013-02-08 12:46:09 +0000
@@ -104,6 +104,7 @@
 	unSave = false;
 	isAjax = true;
 	contentDiv = '';
+	registration = true;
 	
 	// ----------------------------------------------------------------
 	// Search field

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.vm	2013-02-02 10:34:22 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.vm	2013-02-08 12:46:09 +0000
@@ -9,6 +9,7 @@
 		disable('advancedSearchBtn');
 		hideById('removeEventLink');
 		setFieldValue('isSearchByProgram', true);
+		registration = false;
 		$("#searchObjectId option[value='prg']").remove();
 	});
 </script>