← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2536: Add Description for a condition and add Enrollment-date and Incident-date properties into Benific...

 

------------------------------------------------------------
revno: 2536
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-01-12 09:42:54 +0700
message:
  Add Description for a condition and add Enrollment-date and Incident-date properties into Benificiary Aggregation Engine function - finished.
added:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/responseCaseAggDescription.vm
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addCaseAggregation.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/caseaggregation.js


--
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/webapp/dhis-web-maintenance-patient/addCaseAggregation.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addCaseAggregation.vm	2010-11-30 06:17:34 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addCaseAggregation.vm	2011-01-12 02:42:54 +0000
@@ -42,12 +42,15 @@
 			</select>
 		</td>				
 	</tr>
+	
 	<tr>
-		<td width="20em"><label for="operator">$i18n.getString( "operator" )<em title="$i18n.getString( "required" )" class="required">*</em></label></td>
+		<input type="radio" id="operator" name="operator" value="COUNT" checked style='display:none;'>
+			
+		<!-- <td width="20em"><label for="operator">$i18n.getString( "operator" )<em title="$i18n.getString( "required" )" class="required">*</em></label></td>
 		<td>
-			<input type="radio" id="operator" name="operator" value="COUNT" checked>$i18n.getString( "count" )
-			<!-- <input type="radio" id="operator" name="operator" value="SUM"> $i18n.getString( "sum" ) -->
-		</td>				
+			<input type="radio" id="operator" name="operator" value="COUNT" checked style='display:none;'> $i18n.getString( "count" ) 
+			<input type="radio" id="operator" name="operator" value="SUM"> $i18n.getString( "sum" )
+		</td> -->		
 	</tr>
 	<tr>
         <td colspan="2"><p></p></td>
@@ -109,6 +112,11 @@
 			</tr>
 			<tr>
 				<td>
+					<input type='text' style="min-width:19.8em" onkeyup="filterDE(event, this.value);">
+				</td>
+			</tr>
+			<tr>
+				<td>
 					<select id="programstageDE" name="programstageDE" size="5" style="width:20em" ondblclick="insertInfo(this);">
 					</select>
 				</td>
@@ -126,7 +134,7 @@
 		
 			<tr>
 				<td>
-					<select id="caseProperty" name="caseProperty" size="5" ondblclick="insertInfo(this);" style="width:15em; height:14.5em" >
+					<select id="caseProperty" name="caseProperty" size="8" ondblclick="insertInfo(this);" style="width:15em; height:16.5em" >
 						<option value="[CP:gender]">$i18n.getString( "gender" )</option>
 						<option value="[CP:dobType]">$i18n.getString( "dobType" )</option>
 					</select>
@@ -141,7 +149,7 @@
 			<table>
 			<tr>
 				<td>
-					<select id="caseAttribute" name="caseAttribute" size="5" ondblclick="insertInfo(this);" style="width:15em; height:14.5em" >
+					<select id="caseAttribute" name="caseAttribute" size="8" ondblclick="insertInfo(this);" style="width:15em; height:16.5em" >
 					#foreach( $patientAttribute in $patientAttributes )
 						<option value="[CA:$patientAttribute.id]">$encoder.htmlEncode( $patientAttribute.name )</option>
 					#end                            
@@ -160,8 +168,10 @@
 		
 			<tr>
 				<td>
-					<select id="caseProperty" name="caseProperty" size="5" ondblclick="insertInfo(this);" style="width:15em; height:14.5em" >
+					<select id="caseProperty" name="caseProperty" size="8" ondblclick="insertInfo(this);" style="width:15em; height:16.5em" >
 						<option value="[PP:enrollmentdate - dateofincident]">$i18n.getString( "enrolldate_minus_incidentdate" )</option>
+						<option value="[PP:enrollmentdate]">$i18n.getString( "date_of_enrollment" )</option>
+						<option value="[PP:incidentdate]">$i18n.getString( "date_of_incident" )</option>
 					</select>
 				</td>
 			</tr>
@@ -194,11 +204,18 @@
 		<td colspan='4'>
 			<fieldset style="border: 1px solid #3f5d8e; ">
 				<legend>$i18n.getString( "condition" )</legend>
-				<textarea id="aggregationCondition" name="aggregationCondition" style="width:72.5em; height:10em" class="{validate:{required:true}}" ></textarea>
-			</fieldset>
-		</td>
-	</tr>
-	
+				<textarea id="aggregationCondition" name="aggregationCondition" style="width:72.5em; height:10em" class="{validate:{required:true}}" onkeyup='getConditionDescription();'></textarea>
+			</fieldset>
+		</td>
+	</tr>
+	<tr>
+		<td colspan='4'>
+			<fieldset style="border: 1px solid #3f5d8e; ">
+				<legend>$i18n.getString( "description" )</legend>
+				<div id='aggregationDescription'></div>
+			</fieldset>
+		</td>
+	</tr>
 	
 	<tr>
 		<td colspan='3'>
@@ -213,5 +230,5 @@
 <script>
 	byId('description').focus();
 	getAggDataElements();
-	getProgramStages()
+	getProgramStages();
 </script>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/caseaggregation.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/caseaggregation.js	2010-11-25 22:22:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/caseaggregation.js	2011-01-12 02:42:54 +0000
@@ -2,6 +2,7 @@
 //------------------------------------------------------------------------------
 // Get Aggregated Dataelements
 //------------------------------------------------------------------------------
+
 function getAggDataElements( )
 {
   var dataElementGroup = document.getElementById( 'dataElementGroup' );
@@ -25,7 +26,7 @@
   var de = document.getElementById( 'aggregationDataElementId' );
   
   clearList( de );
-  	
+  
   var dataElementList = dataelementElement.getElementsByTagName( 'dataelement' );
   
   for ( var i = 0; i < dataElementList.length; i++ )
@@ -48,6 +49,36 @@
 // Get Program Stages
 //------------------------------------------------------------------------------
 
+function filterDE( event, value )
+{
+  var dataElementList = document.getElementById( 'programstageDE' );
+  
+  for ( var index = 0; index < dataElementList.options.length; index++ )
+    {
+		var option = dataElementList.options[index];
+		
+		if(value.length == 0 )
+		{
+			option.style.display = "block";
+		}
+		else
+		{
+			if (option.text.toLowerCase().indexOf( value.toLowerCase() ) != -1 )
+			{
+				option.style.display = "block";
+			}
+			else
+			{
+				option.style.display = "none";
+			}
+		}
+    }	    
+}
+
+//------------------------------------------------------------------------------
+// Get Program Stages
+//------------------------------------------------------------------------------
+
 function getProgramStages()
 {
   var program = document.getElementById( 'program' );
@@ -150,12 +181,14 @@
 function insertInfo( element )
 {
 	byId('aggregationCondition').value += " " + element.options[element.selectedIndex].value + " ";
+	getConditionDescription();
 }
 
 
 function insertOperator( value )
 {
 	byId('aggregationCondition').value += " " + value + " ";
+	getConditionDescription();
 }
 
 // -----------------------------------------------------------------------------
@@ -189,4 +222,20 @@
     setInnerHTML( 'aggregationExpressionField', getElementValue( caseAggregationElement, 'aggregationExpression' ) );
     
     showDetails();
+}
+
+// -----------------------------------------------------------------------------
+// View details
+// -----------------------------------------------------------------------------
+
+function getConditionDescription()
+{
+	$.post("getCaseAggregationDescription.action",
+		{
+			condition: getFieldValue('aggregationCondition')
+		},
+		function (data)
+		{
+			byId('aggregationDescription').innerHTML = data;
+		},'html');
 }
\ No newline at end of file

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/responseCaseAggDescription.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/responseCaseAggDescription.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/responseCaseAggDescription.vm	2011-01-12 02:42:54 +0000
@@ -0,0 +1,1 @@
+$encoder.xmlEncode( $!description )
\ No newline at end of file