=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java 2012-05-28 10:17:04 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java 2012-05-29 07:37:37 +0000 @@ -31,6 +31,7 @@ import static org.hisp.dhis.patientreport.PatientTabularReport.PREFIX_IDENTIFIER_TYPE; import static org.hisp.dhis.patientreport.PatientTabularReport.PREFIX_META_DATA; import static org.hisp.dhis.patientreport.PatientTabularReport.PREFIX_PATIENT_ATTRIBUTE; +import static org.hisp.dhis.patientreport.PatientTabularReport.PREFIX_FIXED_ATTRIBUTE; import static org.hisp.dhis.patientreport.PatientTabularReport.VALUE_TYPE_OPTION_SET; import java.util.ArrayList; @@ -347,8 +348,6 @@ null, null ); } - System.out.println(); - System.out.println(grid); return type == null ? SUCCESS : type; } @@ -373,14 +372,19 @@ { String[] infor = searchingValue.split( "_" ); String objectType = infor[0]; - int objectId = Integer.parseInt( infor[1] ); - + if ( objectType.equals( PREFIX_META_DATA ) ) { hiddenCols.add( Boolean.parseBoolean( infor[2] ) ); } + else if ( objectType.equals( PREFIX_FIXED_ATTRIBUTE ) ) + { + fixedAttributes.add( infor[1] ); + hiddenCols.add( Boolean.parseBoolean( infor[2] ) ); + } else if ( objectType.equals( PREFIX_IDENTIFIER_TYPE ) ) { + int objectId = Integer.parseInt( infor[1] ); PatientIdentifierType identifierType = identifierTypeService.getPatientIdentifierType( objectId ); identifierTypes.add( identifierType ); @@ -402,6 +406,7 @@ } else if ( objectType.equals( PREFIX_PATIENT_ATTRIBUTE ) ) { + int objectId = Integer.parseInt( infor[1] ); PatientAttribute attribute = patientAttributeService.getPatientAttribute( objectId ); patientAttributes.add( attribute ); @@ -429,6 +434,7 @@ } else if ( objectType.equals( PREFIX_DATA_ELEMENT ) ) { + int objectId = Integer.parseInt( infor[1] ); DataElement dataElement = dataElementService.getDataElement( objectId ); dataElements.add( dataElement ); === 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 2012-05-10 01:21:56 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/SaveTabularReportAction.java 2012-05-29 07:37:37 +0000 @@ -28,6 +28,7 @@ package org.hisp.dhis.caseentry.action.report; import static org.hisp.dhis.patientreport.PatientTabularReport.PREFIX_DATA_ELEMENT; +import static org.hisp.dhis.patientreport.PatientTabularReport.PREFIX_FIXED_ATTRIBUTE; import static org.hisp.dhis.patientreport.PatientTabularReport.PREFIX_IDENTIFIER_TYPE; import static org.hisp.dhis.patientreport.PatientTabularReport.PREFIX_PATIENT_ATTRIBUTE; @@ -131,8 +132,6 @@ private Integer programStageId; - private List fixedAttributes = new ArrayList(); - private List searchingValues = new ArrayList(); private Integer orgunitId; @@ -172,11 +171,6 @@ this.orderByOrgunitAsc = orderByOrgunitAsc; } - public void setFixedAttributes( List fixedAttributes ) - { - this.fixedAttributes = fixedAttributes; - } - public void setEndDate( String endDate ) { this.endDate = endDate; @@ -231,23 +225,30 @@ List attributes = new ArrayList(); List dataElements = new ArrayList(); - + List fixedAttributes = new ArrayList(); + for ( String searchingValue : searchingValues ) { String[] infor = searchingValue.split( "_" ); String objectType = infor[0]; - int objectId = Integer.parseInt( infor[1] ); if ( objectType.equals( PREFIX_IDENTIFIER_TYPE ) ) { + int objectId = Integer.parseInt( infor[1] ); identifiers.add( identifierTypeService.getPatientIdentifierType( objectId ) ); } + else if ( objectType.equals( PREFIX_FIXED_ATTRIBUTE ) ) + { + fixedAttributes.add( infor[1] ); + } else if ( objectType.equals( PREFIX_PATIENT_ATTRIBUTE ) ) { + int objectId = Integer.parseInt( infor[1] ); attributes.add( patientAttributeService.getPatientAttribute( objectId ) ); } else if ( objectType.equals( PREFIX_DATA_ELEMENT ) ) { + int objectId = Integer.parseInt( infor[1] ); DataElement dataElement = dataElementService.getDataElement( objectId ); dataElements.add( dataElement ); } === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2012-05-24 05:13:57 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2012-05-29 07:37:37 +0000 @@ -834,6 +834,16 @@ ref="org.hisp.dhis.patient.PatientIdentifierTypeService" /> + + + + + + === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2012-05-28 16:54:25 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2012-05-29 07:37:37 +0000 @@ -261,7 +261,6 @@ false = No data = Data get_report_as_xls=Download as Excel -get_report_as_pdf =Download as PDF set_complete_status = Set complete status orgunit_provided_service = Organisation unit provided service how_to_search_tabular_report = Quotes (") match phrases. Text values support %%, %=, =% and =. Numeric values support >=, >, <=, <, = and != operators. @@ -309,7 +308,6 @@ attribute = Attribute download = Download xls = XLS -pdf = PDF show_hide_settings = Show/hide settings page = Page et_no_data = No data returned from server @@ -342,4 +340,7 @@ loading = Loading save_favorite = Save favorite search_by_selected_unit = Search by selected unit -identifiers_and_attributes = Identifiers and Attributes \ No newline at end of file +identifiers_and_attributes = Identifiers and Attributes +first_name = First name +middle_name = Middle name +last_name = Last name \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2012-05-24 14:30:38 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2012-05-29 07:37:37 +0000 @@ -666,6 +666,12 @@ /dhis-web-caseentry/jsonIdentifierTypes.vm + + + /dhis-web-caseentry/jsonPatientProperties.vm + + /dhis-web-caseentry/responseProgramStages.vm === 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 2012-05-28 16:54:25 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js 2012-05-29 07:37:37 +0000 @@ -37,8 +37,7 @@ path_images: 'images/', initialize: 'tabularInitialize.action', program_get: 'getReportPrograms.action', - identifiertypes_get: 'loadReportIdentifierTypes.action', - patientattributes_get: 'loadReportAttributes.action', + patientproperties_get: 'loadPatientProperties.action', programstages_get: 'loadReportProgramStages.action', dataelements_get: 'loadDataElements.action', organisationunitchildren_get: 'getOrganisationUnitChildren.action', @@ -69,13 +68,9 @@ filter: TR.i18n.wm_multiple_filter_orgunit } }, - identifierType: { - value: 'identifierType', - rawvalue: TR.i18n.identifiers - }, - patientAttribute: { - value: 'patientAttribute', - rawvalue: TR.i18n.attributes + patientProperties: { + value: 'patientProperties', + rawvalue: TR.i18n.patientProperties }, programStage: { value: 'programStage', @@ -147,14 +142,10 @@ settings: {}, params: { program:{}, - identifierType: {}, - patientAttribute: {}, + patientProperty: {}, programStage: {}, dataelement: {}, - organisationunit: {}, - fixedAttributes:{ - checkbox: [] - } + organisationunit: {} }, options: {}, toolbar: { @@ -199,7 +190,7 @@ return ((screen.height/2)-((cmp.height/2)-100)); }, resizeParams: function() { - var a = [TR.cmp.params.identifierType.panel, TR.cmp.params.dataelement.panel, + var a = [TR.cmp.params.patientProperty.panel, TR.cmp.params.dataelement.panel, TR.cmp.params.organisationunit.treepanel]; for (var i = 0; i < a.length; i++) { if (!a[i].collapsed) { @@ -266,7 +257,6 @@ }); return filter; }); - a.store.sort('name', 'ASC'); }, filterSelector: function(selectors, queryString) { var elements = selectors.boundList.all.elements; @@ -285,7 +275,7 @@ }, setHeight: function(ms, panel, fill) { for (var i = 0; i < ms.length; i++) { - ms[i].setHeight(panel.getHeight() - 250); + ms[i].setHeight(panel.getHeight() - 49); } } }, @@ -409,33 +399,6 @@ return value; }, - setEnabledFixedAttr: function() - { - var fixedAttributes = TR.cmp.params.fixedAttributes.checkbox; - Ext.Array.each(fixedAttributes, function(item) { - item.enable(); - }); - }, - setDisabledFixedAttr: function() - { - var fixedAttributes = TR.cmp.params.fixedAttributes.checkbox; - Ext.Array.each(fixedAttributes, function(item) { - item.setValue(false); - item.disable(); - }); - }, - getSelectedFixedAttr: function() - { - var p = []; - var fixedAttributes = TR.cmp.params.fixedAttributes.checkbox; - Ext.Array.each(fixedAttributes, function(item) { - if( item.value ) - { - p.push( item.paramName ); - } - }); - return p; - }, crud: { favorite: { create: function(fn, isupdate) { @@ -521,76 +484,37 @@ Ext.getCmp('levelCombobox').setValue( f.level ); TR.state.orgunitId = f.organisationUnitId; - TR.cmp.params.identifierType.objects = []; - TR.cmp.params.patientAttribute.objects = []; - TR.cmp.params.fixedAttributes.objects = []; + TR.cmp.params.patientProperty.objects = []; TR.cmp.params.dataelement.objects = []; - // IDENTIFIER TYPE - TR.store.identifierType.selected.removeAll(); - if (f.identifiers && f.type != "3" ) { - for (var i = 0; i < f.identifiers.length; i++) { - TR.cmp.params.identifierType.objects.push({id: f.identifiers[i].id, name: TR.util.string.getEncodedString(f.identifiers[i].name)}); - } - TR.store.identifierType.selected.add(TR.cmp.params.identifierType.objects); - - var storeIdentifierType = TR.store.identifierType.available; - storeIdentifierType.parent = f.programId; - if (TR.util.store.containsParent(storeIdentifierType)) { - TR.util.store.loadFromStorage(storeIdentifierType); - TR.util.multiselect.filterAvailable(TR.cmp.params.identifierType.available, TR.cmp.params.identifierType.selected); - } - else { - storeIdentifierType.load({params: {programId: f.programId}}); - } - } - - // PATIENT ATTRIBUTE - TR.store.patientAttribute.selected.removeAll(); - if (f.attributes && f.type != "3") { - for (var i = 0; i < f.attributes.length; i++) { - TR.cmp.params.patientAttribute.objects.push({id: f.attributes[i].id, name: TR.util.string.getEncodedString(f.attributes[i].name)}); - } - TR.store.patientAttribute.selected.add(TR.cmp.params.patientAttribute.objects); - - var storePatientAttribute = TR.store.patientAttribute.available; - storePatientAttribute.parent = f.programId; - if (TR.util.store.containsParent(storePatientAttribute)) { - TR.util.store.loadFromStorage(storePatientAttribute); - TR.util.multiselect.filterAvailable(TR.cmp.params.patientAttribute.available, TR.cmp.params.patientAttribute.selected); - } - else { - storePatientAttribute.load({params: {programId: f.programId}}); - } - } - - // FIXED ATTRIBUTES - TR.util.setEnabledFixedAttr(); - if (f.fixedAttributes && f.type != "3") { - var fixedAttributes = TR.cmp.params.fixedAttributes.checkbox; - Ext.Array.each(fixedAttributes, function(item) { - for (var i = 0; i < f.fixedAttributes.length; i++) { - var flag = false; - if( item.paramName == f.fixedAttributes[i] ) - { - item.setValue( true ); - flag = true; - break; - } - } - if( !flag ){ - item.setValue( false ); - } - }); - } - - // PROGRAM-STAGE + // Patient properties + TR.store.patientProperty.selected.removeAll(); + + // programs with registration + 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}}); + } + } + + // Program stage var storeProgramStage = TR.store.programStage; storeProgramStage.parent = f.programStageId; storeProgramStage.load({params: {programId: f.programId}}); Ext.getCmp('programStageCombobox').setValue( f.programStageId ); - // DATAELEMENT + // Data element TR.store.dataelement.selected.removeAll(); if (f.dataElements) { for (var i = 0; i < f.dataElements.length; i++) { @@ -623,50 +547,24 @@ fields: ['id', 'name', 'type'], data:TR.init.system.program }), - identifierType: { - available: Ext.create('Ext.data.Store', { - fields: ['id', 'name'], - proxy: { - type: 'ajax', - url: TR.conf.finals.ajax.path_commons + TR.conf.finals.ajax.identifiertypes_get, - reader: { - type: 'json', - root: 'identifierTypes' - } - }, - isloaded: false, - storage: {}, - listeners: { - load: function(s) { - this.isloaded = true; - TR.util.store.addToStorage(s); - TR.util.multiselect.filterAvailable(TR.cmp.params.identifierType.available, TR.cmp.params.identifierType.selected); - } - } - }), - selected: Ext.create('Ext.data.Store', { - fields: ['id', 'name'], - data: [] - }) - }, - patientAttribute: { - available: Ext.create('Ext.data.Store', { - fields: ['id', 'name'], - proxy: { - type: 'ajax', - url: TR.conf.finals.ajax.path_commons + TR.conf.finals.ajax.patientattributes_get, - reader: { - type: 'json', - root: 'patientAttributes' - } - }, - isloaded: false, - storage: {}, - listeners: { - load: function(s) { - this.isloaded = true; - TR.util.store.addToStorage(s); - TR.util.multiselect.filterAvailable(TR.cmp.params.patientAttribute.available, TR.cmp.params.patientAttribute.selected); + patientProperty: { + available: Ext.create('Ext.data.Store', { + fields: ['id', 'name'], + proxy: { + type: 'ajax', + url: TR.conf.finals.ajax.path_commons + TR.conf.finals.ajax.patientproperties_get, + reader: { + type: 'json', + root: 'patientProperties' + } + }, + isloaded: false, + storage: {}, + listeners: { + load: function(s) { + this.isloaded = true; + TR.util.store.addToStorage(s); + TR.util.multiselect.filterAvailable(TR.cmp.params.patientProperty.available, TR.cmp.params.patientProperty.selected); } } }), @@ -802,7 +700,7 @@ } // Get url var url = TR.conf.finals.ajax.path_root + TR.conf.finals.ajax.generatetabularreport_get; - // Export to XLS or PDF + // Export to XLS if( type) { window.location.href = url + "?" + this.getURLParams(type); @@ -868,54 +766,41 @@ p.programStageId = TR.cmp.params.programStage.getValue(); p.currentPage = this.currentPage; - // Get fixed attributes - p.fixedAttributes = TR.util.getSelectedFixedAttr(); - // Get searching values p.searchingValues = []; if( !TR.state.paramChanged() ) { - var grid = TR.datatable.datatable; - var cols = grid.columns; - var editor = grid.getStore().getAt(0); - var colLen = cols.length; - for( var i=0; i