← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2306: Display all of details of a patient.

 

------------------------------------------------------------
revno: 2306
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2010-12-08 10:16:36 +0700
message:
  Display all of details of a patient.
modified:
  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/webapp/dhis-web-maintenance-patient/javascript/patient.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/listPatient.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/responsePatient.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-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	2010-12-01 08:10:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties	2010-12-08 03:16:36 +0000
@@ -458,4 +458,5 @@
 not_enough_mandatory_identifier = Not enough data for the mandatory identifier(s)
 not_enough_madatory_attribute = Not enough data for the mandatory attribute(s)
 get_data_error = Get data error
+common_info = Common information
  
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js	2010-11-09 09:07:39 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js	2010-12-08 03:16:36 +0000
@@ -154,7 +154,31 @@
 
 function patientReceived( patientElement )
 {   
-    var identifiers = patientElement.getElementsByTagName( "identifier" );   
+	// ----------------------------------------------------------------------------
+	// Get common-information
+    // ----------------------------------------------------------------------------
+	
+	var id = patientElement.getElementsByTagName( "id" )[0].firstChild.nodeValue;
+	var fullName = patientElement.getElementsByTagName( "fullName" )[0].firstChild.nodeValue;   
+	var gender = patientElement.getElementsByTagName( "gender" )[0].firstChild.nodeValue;   
+	var dobType = patientElement.getElementsByTagName( "dobType" )[0].firstChild.nodeValue;   
+	var birthDate = patientElement.getElementsByTagName( "dateOfBirth" )[0].firstChild.nodeValue;   
+	var bloodGroup= patientElement.getElementsByTagName( "bloodGroup" )[0].firstChild.nodeValue;   
+    
+	var commonInfo =  '<strong>'  + i18n_id + ':</strong> ' + id + "<br>" 
+					+ '<strong>' + i18n_full_name + ':</strong> ' + fullName + "<br>" 
+					+ '<strong>' + i18n_gender + ':</strong> ' + gender+ "<br>" 
+					+ '<strong>' + i18n_dob_type + ':</strong> ' + dobType+ "<br>" 
+					+ '<strong>' + i18n_date_of_birth + ':</strong> ' + birthDate+ "<br>" 
+					+ '<strong>' + i18n_blood_group  + ':</strong> ' + bloodGroup;
+	
+	setInnerHTML( 'commonInfoField', commonInfo );
+	
+	// ----------------------------------------------------------------------------
+	// Get identifier
+    // ----------------------------------------------------------------------------
+	
+	var identifiers = patientElement.getElementsByTagName( "identifier" );   
     
     var identifierText = '';
 	
@@ -165,6 +189,12 @@
 	
 	setInnerHTML( 'identifierField', identifierText );
 	
+	
+	
+	// ----------------------------------------------------------------------------
+	// Get attribute
+    // ----------------------------------------------------------------------------
+	
 	var attributes = patientElement.getElementsByTagName( "attribute" );   
     
     var attributeValues = '';

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/listPatient.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/listPatient.vm	2010-11-16 05:45:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/listPatient.vm	2010-12-08 03:16:36 +0000
@@ -4,7 +4,7 @@
 	#set ($sText = $searchText )
 #else 
 	#set ($sText = "" )
- #end
+#end
 
 <style>
 tr.relationship-row{background-color: #BFFFC2; display : none}
@@ -219,13 +219,21 @@
 	var i18n_adding_patient_failed = '$encoder.jsEscape( $i18n.getString( "adding_patient_failed" ), "'")';
 	var i18n_updating_patient_failed = '$encoder.jsEscape( $i18n.getString( "updating_patient_failed" ), "'")';	
 	var i18n_none = '$encoder.jsEscape( $i18n.getString( "none" ), "'")';
+	
+	var i18n_id = '$encoder.jsEscape( $i18n.getString( "id" ), "'")';
+	var i18n_full_name = '$encoder.jsEscape( $i18n.getString( "full_name" ), "'")';
+	var i18n_gender = '$encoder.jsEscape( $i18n.getString( "gender" ), "'")';
+	var i18n_dob_type = '$encoder.jsEscape( $i18n.getString( "dob_type" ), "'")';
+	var i18n_date_of_birth = '$encoder.jsEscape( $i18n.getString( "date_of_birth" ), "'")';
+	var i18n_blood_group = '$encoder.jsEscape( $i18n.getString( "blood_group" ), "'")';
 </script>
 
 <div id="detailsArea" style="display:none;overflow:auto;height:250px;width:250px">
 	<div style="float:right">
 		<a href="javascript:hideDetails()" title="$i18n.getString( "hide_details" )"><img src="../images/close.png" alt="$i18n.getString( "hide_details" )"></a>
-	</div>			    
-	<p><label>$i18n.getString( "identifier" ):</label><br><span id="identifierField"></span></p>				    
+	</div>
+	<p><label>$i18n.getString( "common_info" ):</label><br><span id="commonInfoField"></span></p>	
+	<p><label>$i18n.getString( "identifier" ):</label><br><span id="identifierField"></span></p>
 	<p><label>$i18n.getString( "attributes" ):</label><br><span id="attributeField"></span></p>
 	<p><label>$i18n.getString( "enrolled_in_program" ):</label><br><span id="programField"></span></p>
 </div>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/responsePatient.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/responsePatient.vm	2010-02-22 09:19:15 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/responsePatient.vm	2010-12-08 03:16:36 +0000
@@ -3,9 +3,10 @@
   <id>$patient.id</id>  
   <fullName>$encoder.xmlEncode( $patient.getFullName() )</fullName>
   <gender>$encoder.xmlEncode( $patient.gender )</gender>
-  <dateOfBirth>$format.formatDate( $patient.birthDate )</dateOfBirth>
+  <dobType>#if($!patient.dobType) $encoder.xmlEncode( $!patient.dobType )#else $i18n.getString('none') #end</dobType>
+  <dateOfBirth>$format.formatDate( $!patient.birthDate )</dateOfBirth>
   <age>$encoder.xmlEncode( $patient.getAge() )</age>
-  <bloodGroup>$encoder.xmlEncode( $patient.getBloodGroup() )</bloodGroup>
+  <bloodGroup>#if($!patient.bloodGroup) $patient.bloodGroup #else $i18n.getString('none') #end</bloodGroup>
   #foreach( $patientIdentifier in $patient.identifiers )
     <identifier>        
         <identifierText>$encoder.xmlEncode( $patientIdentifier.identifier )</identifierText>