dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #21125
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9917: Add filter values for identifiers/attributes tab.
------------------------------------------------------------
revno: 9917
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-02-28 11:34:35 +0700
message:
Add filter values for identifiers/attributes tab.
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/SaveAggregateReportAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/SaveTabularReportAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/i18n.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonPatientProperties.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReport.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/report/SaveAggregateReportAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/SaveAggregateReportAction.java 2013-02-22 13:29:25 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/SaveAggregateReportAction.java 2013-02-28 04:34:35 +0000
@@ -230,7 +230,7 @@
throws Exception
{
userOrganisationUnit = (userOrganisationUnit == null) ? false : userOrganisationUnit;
- userOrganisationUnitChildren = (userOrganisationUnitChildren = null) ? false : userOrganisationUnitChildren;
+ userOrganisationUnitChildren = (userOrganisationUnitChildren == null) ? false : userOrganisationUnitChildren;
PatientAggregateReport aggregateReport = new PatientAggregateReport();
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/SaveTabularReportAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/SaveTabularReportAction.java 2013-02-22 13:29:25 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/SaveTabularReportAction.java 2013-02-28 04:34:35 +0000
@@ -233,7 +233,7 @@
throws Exception
{
userOrganisationUnit = (userOrganisationUnit == null) ? false : userOrganisationUnit;
- userOrganisationUnitChildren = (userOrganisationUnitChildren = null) ? false : userOrganisationUnitChildren;
+ userOrganisationUnitChildren = (userOrganisationUnitChildren == null) ? false : userOrganisationUnitChildren;
Set<OrganisationUnit> orgunits = new HashSet<OrganisationUnit>(
organisationUnitService.getOrganisationUnits( orgunitIds ) );
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js 2013-02-27 14:39:27 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js 2013-02-28 04:34:35 +0000
@@ -511,20 +511,42 @@
else if( xtype == 'combobox' )
{
var deId = id.split('_')[1];
+ var fixedId = id.substring(0, id.lastIndexOf('_') );
params.typeAhead = true;
params.forceSelection = true;
- if( valueType == 'bool')
+ if( valueType == 'bool' || fixedId=='fixedAttr_gender' || fixedId=='fixedAttr_dobType')
{
params.queryMode = 'local';
params.valueField = 'value';
params.displayField = 'name';
params.editable = false;
params.value = 'true';
- params.store = new Ext.data.ArrayStore({
- fields: ['value', 'name'],
- data: [['true', TR.i18n.yes],
- ['false', TR.i18n.no]]
- });
+ if( fixedId=='fixedAttr_gender')
+ {
+ params.store = new Ext.data.ArrayStore({
+ fields: ['value', 'name'],
+ data: [['M', TR.i18n.male],
+ ['F', TR.i18n.female],
+ ['T', TR.i18n.transgender]]
+ });
+ }
+ else if( fixedId=='fixedAttr_dobType')
+ {
+ params.store = new Ext.data.ArrayStore({
+ fields: ['value', 'name'],
+ data: [['V', TR.i18n.verified],
+ ['D', TR.i18n.declared],
+ ['A', TR.i18n.approximated]]
+ });
+ }
+ else if (valueType == 'bool')
+ {
+ params.store = new Ext.data.ArrayStore({
+ fields: ['value', 'name'],
+ data: [['true', TR.i18n.yes],
+ ['false', TR.i18n.no]]
+ });
+ }
}
else if( valueType == 'trueOnly')
{
@@ -1036,25 +1058,29 @@
}
// Patient properties
+ Ext.getCmp('filterPropPanel').removeAll();
+ Ext.getCmp('filterPropPanel').doLayout();
TR.store.patientProperty.selected.removeAll();
// programs with registration
+ TR.cmp.params.patientProperty.objects = [];
if (f.patientProperties && f.type != "3" ) {
- for (var i = 0; i < f.patientProperties.length; i++) {
- TR.cmp.params.patientProperty.objects.push({id: f.patientProperties[i].id, name: TR.util.string.getEncodedString(f.patientProperties[i].name)});
- }
- TR.store.patientProperty.selected.add(TR.cmp.params.patientProperty.objects);
-
- var storePatientProperty = TR.store.patientProperty.available;
- storePatientProperty.parent = f.programId;
- if (TR.util.store.containsParent(storePatientProperty)) {
- TR.util.store.loadFromStorage(storePatientProperty);
- TR.util.multiselect.filterAvailable(TR.cmp.params.patientProperty.available, TR.cmp.params.patientProperty.selected);
- }
- else {
- storePatientProperty.load({params: {programId: f.programId}});
- }
-
+ for (var i = 0; i < f.patientProperties.length; i++) {
+ var name = TR.util.string.getEncodedString(f.patientProperties[i].name);
+ TR.cmp.params.patientProperty.objects.push({id: f.patientProperties[i].id, name: name});
+ TR.util.multiselect.addFilterField( 'filterPropPanel', f.patientProperties[i].id, name, f.patientProperties[i].valueType );
+ }
+ TR.store.patientProperty.selected.add(TR.cmp.params.patientProperty.objects);
+
+ var storePatientProperty = TR.store.patientProperty.available;
+ storePatientProperty.parent = f.programId;
+ if (TR.util.store.containsParent(storePatientProperty)) {
+ TR.util.store.loadFromStorage(storePatientProperty);
+ TR.util.multiselect.filterAvailable(TR.cmp.params.patientProperty.available, TR.cmp.params.patientProperty.selected);
+ }
+ else {
+ storePatientProperty.load({params: {programId: f.programId}});
+ }
}
// Data element
@@ -1654,9 +1680,8 @@
p.searchingValues = [];
// Patient properties
+
TR.cmp.params.patientProperty.selected.store.each( function(r) {
- //p.searchingValues.push( r.data.id + '_false_' );
-
var propId = r.data.id;
var valueType = r.data.valueType;
var length = Ext.getCmp('p_' + propId).items.length/4;
@@ -1666,8 +1691,12 @@
{
var id = propId + '_' + idx;
var filterValue = Ext.getCmp('filter_' + id).rawValue;
+ if( valueType == 'bool' || propId=='fixedAttr_gender' || propId=='fixedAttr_dobType')
+ {
+ filterValue = Ext.getCmp('filter_' + id).getValue();
+ }
var filter = propId + '_' + hidden
- if( filterValue!=''){
+ if( filterValue!=null && filterValue!=''){
var filterOpt = Ext.getCmp('filter_opt_' + id).rawValue;
filter += '_' + filterOpt + ' ';
if( filterOpt == 'IN' )
@@ -1745,8 +1774,46 @@
}
// Get searching values
+
var searchingValues = document.getElementById('searchingValues');
TR.util.list.clearList(searchingValues);
+
+
+ // Patient properties
+
+ TR.cmp.params.patientProperty.selected.store.each( function(r) {
+ var propId = r.data.id;
+ var valueType = r.data.valueType;
+ var length = Ext.getCmp('p_' + propId).items.length/4;
+ var hidden = TR.state.caseBasedReport.isColHidden(propId);
+
+ for(var idx=0;idx<length;idx++)
+ {
+ var id = propId + '_' + idx;
+ var filterValue = Ext.getCmp('filter_' + id).rawValue;
+ var filter = propId + '_' + hidden
+ if( filterValue!=''){
+ var filterOpt = Ext.getCmp('filter_opt_' + id).rawValue;
+ filter += '_' + filterOpt + ' ';
+ if( filterOpt == 'IN' )
+ {
+ var filterValues = filterValue.split(";");
+ filter +="(";
+ for(var i=0;i<filterValues.length;i++)
+ {
+ filter += "'"+ filterValues[i] +"',";
+ }
+ filter = filter.substr(0,filter.length - 1) + ")";
+ }
+ else
+ {
+ filter += "'" + filterValue + "'";
+ }
+ }
+ TR.util.list.addOptionToList(searchingValues, filter, '');
+ }
+ });
+
TR.cmp.params.dataelement.selected.store.each( function(r) {
var valueType = r.data.valueType;
var deId = r.data.id;
@@ -1999,11 +2066,6 @@
p.deGroupBy = Ext.getCmp('dataElementGroupByCbx').getValue().split('_')[1];
}
- // Filter values for patient-properties
- TR.cmp.params.patientProperty.selected.store.each( function(r) {
- p.searchingValues.push( r.data.id + '_false_' );
- });
-
// Filter values for data-elements
p.deFilters = [];
@@ -2800,6 +2862,7 @@
Ext.getCmp('levelCombobox').setVisible(true);
Ext.getCmp('dateRangeDiv').setVisible(true);
+ Ext.getCmp('patientPropertiesDiv').setVisible(true);
Ext.getCmp('btnSortBy').setVisible(true);
Ext.getCmp('relativePeriodsDiv').setVisible(false);
Ext.getCmp('fixedPeriodsDiv').setVisible(false);
@@ -2831,6 +2894,7 @@
Ext.getCmp('levelCombobox').setVisible(false);
Ext.getCmp('caseBasedFavoriteBtn').setVisible(false);
Ext.getCmp('btnSortBy').setVisible(false);
+ Ext.getCmp('patientPropertiesDiv').setVisible(false);
Ext.getCmp('datePeriodRangeDiv').setVisible(true);
Ext.getCmp('fixedPeriodsDiv').setVisible(true);
@@ -3839,9 +3903,9 @@
},
// IDENTIFIER TYPE AND PATIENT-ATTRIBUTE
-
{
title: '<div style="height:17px;background-image:url(images/data.png); background-repeat:no-repeat; padding-left:20px">' + TR.i18n.identifiers_and_attributes + '</div>',
+ id:'patientPropertiesDiv',
hideCollapseTool: true,
items: [
{
@@ -5807,6 +5871,7 @@
Ext.getCmp('datePeriodRangeDiv').setVisible(false);
Ext.getCmp('caseBasedFavoriteBtn').setVisible(true);
Ext.getCmp('levelCombobox').setVisible(true);
+ Ext.getCmp('patientPropertiesDiv').setVisible(true);
Ext.getCmp('dateRangeDiv').setVisible(true);
Ext.getCmp('relativePeriodsDiv').setVisible(false);
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/i18n.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/i18n.vm 2013-02-25 03:05:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/i18n.vm 2013-02-28 04:34:35 +0000
@@ -163,5 +163,11 @@
multiple_periods_selected_as_filter: '$encoder.jsEscape($i18n.getString( 'multiple_periods_selected_as_filter' ) , "'")',
multiple_orgunits_selected_as_filter: '$encoder.jsEscape($i18n.getString( 'multiple_orgunits_selected_as_filter' ) , "'")',
please_select_one_position_for_row: '$encoder.jsEscape($i18n.getString( 'please_select_one_position_for_row' ) , "'")',
-please_select_one_position_for_filter: '$encoder.jsEscape($i18n.getString( 'please_select_one_position_for_filter' ) , "'")'
+please_select_one_position_for_filter: '$encoder.jsEscape($i18n.getString( 'please_select_one_position_for_filter' ) , "'")',
+male: '$encoder.jsEscape($i18n.getString( 'male' ) , "'")',
+female: '$encoder.jsEscape($i18n.getString( 'female' ) , "'")',
+transgender: '$encoder.jsEscape($i18n.getString( 'transgender' ) , "'")',
+verified: '$encoder.jsEscape($i18n.getString( 'verified' ) , "'")',
+declared: '$encoder.jsEscape($i18n.getString( 'declared' ) , "'")',
+approximated: '$encoder.jsEscape($i18n.getString( 'approximated' ) , "'")'
};
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonPatientProperties.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonPatientProperties.vm 2013-02-27 14:39:27 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonPatientProperties.vm 2013-02-28 04:34:35 +0000
@@ -17,7 +17,7 @@
{
"id": "fixedAttr_gender",
"name": "$i18n.getString('gender')",
- "valueType": "string"
+ "valueType": "list"
},
{
"id": "fixedAttr_birthDate",
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReport.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReport.vm 2013-02-22 04:49:30 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReport.vm 2013-02-28 04:34:35 +0000
@@ -62,14 +62,6 @@
#if( $velocityCount < $size ),#end
#end
],
- "fixedAttributes": [
- #set( $size = ${tabularReport.fixedAttributes.size()} )
- #set( $fixedAttributes = ${tabularReport.fixedAttributes} )
- #foreach( ${fixedAttribute} in $!{fixedAttributes} )
- "fixedAttr_${fixedAttribute}"
- #if( $velocityCount < $size ),#end
- #end
- ],
"dataElements": [
#set( $size = ${tabularReport.programStageDataElements.size()} )
#set( $programStageDataElements = ${tabularReport.programStageDataElements} )