← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7299: "Show representative information for patient in Update patient form.

 

------------------------------------------------------------
revno: 7299
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-06-14 20:19:46 +0700
message:
  "Show representative information for patient in Update patient form.
modified:
  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/patient.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.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/webapp/dhis-web-caseentry/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2012-06-07 09:55:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2012-06-14 13:19:46 +0000
@@ -3,23 +3,26 @@
 
 	var type = jQuery('#' + container + ' [id=dobType]').val();
 	if(type == 'V' || type == 'D'){
-		jQuery('#' + container + ' [id=age]').rules("remove","required");
+		jQuery('#' + container + ' [id=age]').rules("remove");
+		jQuery('#' + container + ' [id=age]').css("display","none");
+		
 		jQuery('#' + container + ' [id=birthDate]').rules("add",{required:true});
 		datePickerValid( container + ' [id=birthDate]' );
 		jQuery('#' + container + ' [id=birthDate]').css("display","");
-		jQuery('#' + container + ' [id=age]').css("display","none");
 	}else if(type == 'A'){
+		jQuery('#' + container + ' [id=age]').rules("add",{required:true, number: true});
+		jQuery('#' + container + ' [id=age]').css("display","");
+		
 		jQuery('#' + container + ' [id=birthDate]').rules("remove","required");
-		jQuery('#' + container + ' [id=age]').rules("add",{required:true});
 		$('#' + container+ ' [id=birthDate]').datepicker("destroy");
 		jQuery('#' + container + ' [id=birthDate]').css("display","none");
-		jQuery('#' + container + ' [id=age]').css("display","");
 	}else {
-		jQuery('#' + container + ' [id=age]').rules("remove","required");
+		jQuery('#' + container + ' [id=age]').rules("remove");
+		jQuery('#' + container + ' [id=age]').css("display","");
+		
 		jQuery('#' + container + ' [id=birthDate]').rules("remove","required");
 		$('#' + container+ ' [id=birthDate]').datepicker("destroy");
 		jQuery('#' + container + ' [id=birthDate]').css("display","none");
-		jQuery('#' + container + ' [id=age]').css("display","");
 	}
 }
 

=== 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-06-07 09:55:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js	2012-06-14 13:19:46 +0000
@@ -68,7 +68,7 @@
 	if ( type == 'success' )
 	{
 		removeDisabledIdentifier( );
-		addPatient( );
+		addPatient();
 	}
 	else
 	{
@@ -315,8 +315,12 @@
       url: 'addPatient.action',
       data: getParamsForDiv('editPatientDiv'),
       success: function(json) {
-		var type = json.response;
-		showProgramEnrollmentSelectForm( json.message );
+		var patientId = json.message.split('_')[0];
+		var systemIdentifierId = json.message.split('_')[1];
+		jQuery('#advSearchBox0 [id="searchText"]').val( systemIdentifierId );
+		statusSearching = 1;
+		
+		showProgramEnrollmentSelectForm( patientId );
 		jQuery('#resultSearchDiv').dialog('close');
       }
      });
@@ -750,8 +754,8 @@
 			title: i18n_representative_info,
 			maximize: true, 
 			closable: true,
-			modal:true,
-			overlay:{background:'#000000', opacity:0.1},
+			modal: false,
+			overlay: {background:'#000000', opacity:0.1},
 			width: 400,
 			height: 300
 		});

=== 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-06-14 03:58:46 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm	2012-06-14 13:19:46 +0000
@@ -25,7 +25,6 @@
 			,beforeValidateHandler: function(form)
 				{
 					var dobType = $('#patientForm [id=dobType]').val();
-					
 					if( dobType=='V' || dobType=='D' ) 
 					{
 						var birthDate = $('#patientForm [id=birthDate]').val();
@@ -57,13 +56,10 @@
 <p>
 <form id="patientForm" name="patientForm" action="updatePatient.action" method="post" >
 <input type="hidden" id="representativeId" name="representativeId" value='$!patient.representative.id' /> 
-<input type="hidden" id="relationshipTypeId" name="relationshipTypeId"/>
-<div>
-	<input type="hidden" id="id" name="id" value="$patient.id">
+<input type="hidden" id="relationshipTypeId" name='relationshipTypeId' value="$!relationship.relationshipType.id"/>
+<input type="hidden" id="id" name="id" value="$patient.id">
 
-</div>
-<table>
-		
+<table>		
 	<tr>
 		<th colspan="2" class="heading-column">$i18n.getString( "system_identifier" )</th>
 	</tr>	
@@ -78,10 +74,12 @@
 	<tr>
 		<th colspan="2" class="heading-column">$i18n.getString( "demographics" )</th>
 	</tr>
+	
 	<tr>
 		<td class='text-column'><label for="fullName">$i18n.getString( "full_name" )</label></td>
 		<td class="input-column"><input type="text" id="fullName" name="fullName" value="$!patient.getFullName()" class="{validate:{required:true, unicodechars:true, rangelength:[7,50]}}"></td>
 	</tr>
+	
 	<tr>
 		<td class='text-column'><label for="gender">$i18n.getString( "gender" )<em title="$i18n.getString( "required" )" class="required">*</em></label></td>
 		<td class="input-column">
@@ -95,14 +93,14 @@
 	
 	<tr>
 		<td class='text-column' ><label for="birthDate">$i18n.getString( "date_of_birth" )<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
-		<td class="input-column">	
+		<td class="input-column">
 			<select id='dobType' name="dobType" style='width:100px' onchange='dobTypeOnChange("patientForm")' >
-				<option value="A" #if($patient.dobType=='A') checked #end >$i18n.getString( "approximated" )</option>
-				<option value="D" #if($patient.dobType=='D') checked #end >$i18n.getString( "declared" )</option>
-				<option value="V" #if($patient.dobType=='V') checked #end >$i18n.getString( "verified" )</option>
+				<option value="A" #if($patient.dobType=='A') selected #end >$i18n.getString( "approximated" )</option>
+				<option value="D" #if($patient.dobType=='D') selected #end >$i18n.getString( "declared" )</option>
+				<option value="V" #if($patient.dobType=='V') selected #end >$i18n.getString( "verified" )</option>
 			</select>
 			<input type="text" id="birthDate" name="birthDate" value='$format.formatDate($!patient.birthDate)' style='width:145px;' />
-			<input type="text" id="age" name="age" value='$!patient.getAge()' class="{validate:{number:true}}" style='width:145px;' />
+			<input type="text" id="age" name="age" value='$!patient.getIntegerValueOfAge()' class="{validate:{number:true}}" style='width:145px;' />
 		</td>
 	</tr>
 
@@ -269,6 +267,10 @@
 			<td>$!representative.getFullName()</td>
 		</tr>
 		<tr>
+			<td class="bold text-column">$i18n.getString("relationship"):</td>
+			<td>$!relationship.relationshipType.aIsToB</td>
+		</tr>
+		<tr>
 			<td class="bold text-column">$i18n.getString("gender"):</td>
 			<td> $!representative.gender</td>
 		</tr>