dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #15927
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5889: Add Beneficiary Query Builder formula for calculating number of patients by report-date of progra...
------------------------------------------------------------
revno: 5889
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-02-08 19:47:59 +0700
message:
Add Beneficiary Query Builder formula for calculating number of patients by report-date of program-stages-instance (finished)
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
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateCaseAggregation.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/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 2012-02-06 03:59:06 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addCaseAggregation.vm 2012-02-08 12:47:59 +0000
@@ -100,7 +100,7 @@
</tr>
<tr>
<td>
- <select id="programStage" name="programStage" style="width:20em" onChange="getPrgramStageDataElements();">
+ <select id="programStage" name="programStage" style="width:20em" onClick="getPrgramStageDataElements();" ondblclick="insertProgramStage(this);">
</select>
</td>
</tr>
@@ -167,9 +167,39 @@
</tr>
</table>
</td>
+
+ <td>
+ <fieldset style="border: 1px solid #3f5d8e; ">
+ <legend>$i18n.getString( "program_stage" )</legend>
+ <table>
+ <tr>
+ <td>
+ <select id="programFormula" name="programFormula" style="width:20em" onChange="getProgramStagesForFormula();">
+ <option value="0">[$i18n.getString('please_select')]</option>
+ #foreach( $program in $programs )
+ <option value="$program.id" title='$program.name'>$encoder.htmlEncode( $program.name )</option>
+ #end
+ </select>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ <label for="programStageFormula">$i18n.getString( "program_stage" )</label>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <select multiple id="programStageFormula" name="programStageFormula" style="width:20em; height:12.5em" ondblclick="insertInfo(this);">
+ </select>
+ </td>
+ </tr>
+ </table>
+ </td>
+
</tr>
<tr>
- <td colspan='3'>
+ <td colspan='4'>
<img src="../images/less.png" alt="$i18n.getString( 'less' )" onclick='insertOperator( "<" );' style="cursor:pointer;">
<img src="../images/less_or_equal.png" alt="$i18n.getString( 'less_or_equal' )" onclick='insertOperator( "<=" );' style="cursor:pointer;">
<img src="../images/greater.png" alt="$i18n.getString( 'greater' )" onclick='insertOperator( ">" );' style="cursor:pointer;">
@@ -196,7 +226,7 @@
</tbody>
<tr>
- <td colspan='3'>
+ <td colspan='4'>
<fieldset style="border: 1px solid #3f5d8e;">
<legend>$i18n.getString( "condition" )</legend>
<textarea id="aggregationCondition" name="aggregationCondition" style="width:62.5em; height:10em" class="{validate:{required:true}}" onkeyup='getConditionDescription();'></textarea>
@@ -204,7 +234,7 @@
</td>
</tr>
<tr>
- <td colspan='3'>
+ <td colspan='4'>
<fieldset style="border: 1px solid #3f5d8e; ">
<legend>$i18n.getString( "description" )</legend>
<div id='aggregationDescription'></div>
@@ -213,7 +243,7 @@
</tr>
<tr>
- <td colspan='3'>
+ <td colspan='4'>
<input type="submit" value="$i18n.getString( 'add' )" style="width:10em"/>
<input type="button" value="$i18n.getString( 'test_condition' )" style="width:10em" onclick='testCaseAggregationCondition();'/>
<input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='caseAggregation.action'" style="width:10em"/>
=== 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 2012-01-11 07:42:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/caseaggregation.js 2012-02-08 12:47:59 +0000
@@ -80,6 +80,44 @@
}
}
+
+function getProgramStagesForFormula()
+{
+ clearListById( 'programStageFormula' );
+
+ var program = document.getElementById( 'programFormula' );
+ var programId = program.options[ program.selectedIndex ].value;
+ if( programId == '0' ){
+ return;
+ }
+
+ $.post( 'getProgramStages.action', { programId:programId }, getProgramStagesFomulaCompleted );
+}
+
+function getProgramStagesFomulaCompleted( programstageElement )
+{
+ var programstage = document.getElementById( 'programStageFormula' );
+ var programstageList = $(programstageElement).find( 'programstage' );
+
+ $( programstageList ).each( function( i, item )
+ {
+ var id = $( item ).find("id").text();
+ var name = $( item ).find("name").text();
+
+ var option = document.createElement("option");
+ option.value = "[PS:" + id + "]";
+ option.text = name;
+ option.title = name;
+
+ programstage.add(option, null);
+ });
+
+ if( programstage.options.length > 0 )
+ {
+ programstage.options[0].selected = true;
+ }
+}
+
//------------------------------------------------------------------------------
// Get DataElements of Program-Stage
//------------------------------------------------------------------------------
@@ -124,7 +162,6 @@
getConditionDescription();
}
-
function insertOperator( value )
{
insertTextCommon('aggregationCondition', ' ' + value + ' ' );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateCaseAggregation.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateCaseAggregation.vm 2012-02-06 03:59:06 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateCaseAggregation.vm 2012-02-08 12:47:59 +0000
@@ -68,7 +68,7 @@
<table>
<thead>
<tr>
- <th colspan="3">$i18n.getString( "condition_detail" )</th>
+ <th colspan="4">$i18n.getString( "condition_detail" )</th>
</tr>
</thead>
@@ -102,7 +102,7 @@
</tr>
<tr>
<td>
- <select id="programStage" name="programStage" style="min-width:20em" onChange="getPrgramStageDataElements();">
+ <select id="programStage" name="programStage" style="min-width:20em" onClick="getPrgramStageDataElements();" ondblclick="insertProgramStage(this);">
</select>
</td>
</tr>
@@ -129,7 +129,7 @@
<table>
<tr>
<td>
- <select id="caseProperty" name="caseProperty" size="5" ondblclick="insertInfo(this);" style="width:20em; height:14.5em" >
+ <select id="caseProperty" name="caseProperty" size="10" ondblclick="insertInfo(this);" style="width:20em; height:16.5em" >
<option value="[PT:count]">$i18n.getString( "patients_registered" )</option>
<option value="[CP:gender]">$i18n.getString( "gender" )</option>
<option value="[CP:dobType]">$i18n.getString( "dob_type" )</option>
@@ -162,9 +162,39 @@
</tr>
</table>
</td>
+
+ <td>
+ <fieldset style="border: 1px solid #3f5d8e; ">
+ <legend>$i18n.getString( "program_stage" )</legend>
+ <table>
+ <tr>
+ <td>
+ <select id="programFormula" name="programFormula" style="width:20em" onChange="getProgramStagesForFormula();">
+ <option value="0">[$i18n.getString('please_select')]</option>
+ #foreach( $program in $programs )
+ <option value="$program.id" title='$program.name'>$encoder.htmlEncode( $program.name )</option>
+ #end
+ </select>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ <label for="programStageFormula">$i18n.getString( "program_stage" )</label>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <select multiple id="programStageFormula" name="programStageFormula" style="width:20em; height:12.5em" ondblclick="insertInfo(this);">
+ </select>
+ </td>
+ </tr>
+ </table>
+ </td>
+
</tr>
<tr>
- <td colspan='3'>
+ <td colspan='4'>
<img src="../images/less.png" alt="$i18n.getString( 'less' )" onclick='insertOperator( "<" );' style="cursor:pointer;">
<img src="../images/less_or_equal.png" alt="$i18n.getString( 'less_or_equal' )" onclick='insertOperator( "<=" );' style="cursor:pointer;">
<img src="../images/greater.png" alt="$i18n.getString( 'greater' )" onclick='insertOperator( ">" );' style="cursor:pointer;">
@@ -190,7 +220,7 @@
</tbody>
<tr>
- <td colspan='3'>
+ <td colspan='4'>
<fieldset style="border: 1px solid #3f5d8e; ">
<legend>$i18n.getString( "condition" )</legend>
<textarea id="aggregationCondition" name="aggregationCondition" style="width:62.5em; height:10em" class="{validate:{required:true}}" onkeyup='getConditionDescription();'>$caseAggregation.aggregationExpression</textarea>
@@ -199,7 +229,7 @@
</tr>
<tr>
- <td colspan='3'>
+ <td colspan='4'>
<fieldset style="border: 1px solid #3f5d8e; ">
<legend>$i18n.getString( "description" )</legend>
<div id='aggregationDescription'>$!description</div>