=== added directory 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation' === added directory 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action' === added file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/AddAggregationQueryAction.java' --- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/AddAggregationQueryAction.java 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/AddAggregationQueryAction.java 2014-02-05 10:49:02 +0000 @@ -0,0 +1,256 @@ +package org.hisp.dhis.pbf.aggregation.action; + +import org.hisp.dhis.caseaggregation.CaseAggregationCondition; +import org.hisp.dhis.caseaggregation.CaseAggregationConditionService; +import org.hisp.dhis.dataelement.DataElement; +import org.hisp.dhis.dataelement.DataElementCategoryService; +import org.hisp.dhis.dataelement.DataElementService; +import org.hisp.dhis.dataset.DataSet; +import org.hisp.dhis.dataset.DataSetService; +import org.hisp.dhis.pbf.api.Lookup; +import org.hisp.dhis.pbf.api.LookupService; + +import com.opensymphony.xwork2.Action; + +public class AddAggregationQueryAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private CaseAggregationConditionService aggregationConditionService; + + public void setAggregationConditionService( CaseAggregationConditionService aggregationConditionService ) + { + this.aggregationConditionService = aggregationConditionService; + } + + private DataElementService dataElementService; + + public void setDataElementService( DataElementService dataElementService ) + { + this.dataElementService = dataElementService; + } + + private LookupService lookupService; + + public void setLookupService( LookupService lookupService ) + { + this.lookupService = lookupService; + } + + /* private CCEIAggregationService cceiAggregationService; + + public void setCceiAggregationService( CCEIAggregationService cceiAggregationService ) + { + this.cceiAggregationService = cceiAggregationService; + } +*/ + private DataElementCategoryService dataElementCategoryService; + + public void setDataElementCategoryService( DataElementCategoryService dataElementCategoryService ) + { + this.dataElementCategoryService = dataElementCategoryService; + } + + private DataSetService dataSetService; + + public void setDataSetService( DataSetService dataSetService ) + { + this.dataSetService = dataSetService; + } + + // ------------------------------------------------------------------------- + // Input/ Output + // ------------------------------------------------------------------------- + + private String name; + + private String aggType; + + private Integer dataElementId; + + + private Integer pbfDataSetId; + + public void setName( String name ) + { + this.name = name; + } + + public void setAggType( String aggType ) + { + this.aggType = aggType; + } + + public void setDataElementId( Integer dataElementId ) + { + this.dataElementId = dataElementId; + } + + public void setPbfDataSetId( Integer pbfDataSetId ) + { + this.pbfDataSetId = pbfDataSetId; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + public String execute() + throws Exception + { + DataElement dataElement = dataElementService.getDataElement( dataElementId ); + + /* + if( name == null && name.equalsIgnoreCase( "" )) + { + name = dataElement.getName(); + } + + */ + + /** + * TODO support for category option combo + */ + if( aggType.equals( Lookup.PBF_AGG_TYPE_OVERALL_QUALITY_SCORE ) || aggType.equals( Lookup.PBF_AGG_TYPE_OVERALL_UNADJUSTED_PBF_AMOUNT ) ) + { + String query = ""+pbfDataSetId; + + CaseAggregationCondition condition = new CaseAggregationCondition( dataElement.getName(), aggType, query, dataElement, dataElementCategoryService.getDefaultDataElementCategoryOptionCombo() ); + + aggregationConditionService.addCaseAggregationCondition( condition ); + } + + /*if ( aggType.equals( Lookup.CCEI_AGG_TYPE_STORAGE_CAPACITY ) ) + { + //CaseAggregationCondition condition = new CaseAggregationCondition( name, aggType, "NONE", dataElement, dataElementCategoryService.getDefaultDataElementCategoryOptionCombo() ); + + CaseAggregationCondition condition = new CaseAggregationCondition( dataElement.getName(), aggType, "NONE", dataElement, dataElementCategoryService.getDefaultDataElementCategoryOptionCombo() ); + + aggregationConditionService.addCaseAggregationCondition( condition ); + } + else if ( aggType.equals( Lookup.CCEI_AGG_TYPE_REF_WORKING_STATUS_BY_MODEL ) ) + { + HttpServletRequest request = ServletActionContext.getRequest(); + + Lookup lookup = lookupService.getLookupByName( Lookup.CCEI_WORKING_STATUS_OPTIONSET ); + + String[] workingStatusValues = request.getParameterValues( lookup.getName() ); + String workingStatus = ""; + for( String workingStatusValue : workingStatusValues ) + { + workingStatus += "'" + workingStatusValue + "',"; + } + + lookup = lookupService.getLookupByName( Lookup.CCEI_MODEL_MODELTYPEATTRIBUTE ); + + String modelName = request.getParameter( lookup.getName() ); + modelName = "'" + modelName + "'"; + Integer modelTypeAttributeId = Integer.parseInt( lookup.getValue() ); + + workingStatus = workingStatus.substring( 0, workingStatus.length()-1 ); + + lookup = lookupService.getLookupByName( Lookup.CCEI_REF_EQUIPMENTTYPE_ID ); + + Integer equipmentTypeId = Integer.parseInt( lookup.getValue() ); + + String query = cceiAggregationService.getQueryForRefrigeratorWorkingStatus( equipmentTypeId, modelTypeAttributeId, modelName, workingStatus ); + + //CaseAggregationCondition condition = new CaseAggregationCondition( name, aggType, query, dataElement, dataElementCategoryService.getDefaultDataElementCategoryOptionCombo() ); + + CaseAggregationCondition condition = new CaseAggregationCondition( dataElement.getName(), aggType, query, dataElement, dataElementCategoryService.getDefaultDataElementCategoryOptionCombo() ); + + aggregationConditionService.addCaseAggregationCondition( condition ); + } + else if ( aggType.equals( Lookup.CCEI_AGG_TYPE_REF_UTILIZATION ) ) + { + HttpServletRequest request = ServletActionContext.getRequest(); + + Lookup lookup = lookupService.getLookupByName( Lookup.CCEI_UTILIZATION_OPTIONSET ); + String utilization = request.getParameter( lookup.getName() ); + utilization = "'" + utilization + "'"; + + lookup = lookupService.getLookupByName( Lookup.CCEI_MODEL_MODELTYPEATTRIBUTE ); + String modelName = request.getParameter( lookup.getName() ); + modelName = "'" + modelName + "'"; + Integer modelTypeAttributeId = Integer.parseInt( lookup.getValue() ); + + lookup = lookupService.getLookupByName( Lookup.CCEI_REF_EQUIPMENTTYPE_ID ); + Integer equipmentTypeId = Integer.parseInt( lookup.getValue() ); + + String query = cceiAggregationService.getQueryForRefrigeratorUtilization( equipmentTypeId, modelTypeAttributeId, modelName, utilization ); + + //CaseAggregationCondition condition = new CaseAggregationCondition( name, aggType, query, dataElement, dataElementCategoryService.getDefaultDataElementCategoryOptionCombo() ); + + CaseAggregationCondition condition = new CaseAggregationCondition( dataElement.getName(), aggType, query, dataElement, dataElementCategoryService.getDefaultDataElementCategoryOptionCombo() ); + + aggregationConditionService.addCaseAggregationCondition( condition ); + } + else if ( aggType.equals( Lookup.CCEI_AGG_TYPE_REF_WORKING_STATUS_BY_TYPE ) ) + { + HttpServletRequest request = ServletActionContext.getRequest(); + + Lookup lookup = lookupService.getLookupByName( Lookup.CCEI_WORKING_STATUS_OPTIONSET ); + + String[] workingStatusValues = request.getParameterValues( lookup.getName() ); + String workingStatus = ""; + for( String workingStatusValue : workingStatusValues ) + { + workingStatus += "'" + workingStatusValue + "',"; + } + + lookup = lookupService.getLookupByName( Lookup.CCEI_EQUIPMENTTYPE_MODELTYPEATTRIBUTE ); + + String modelName = request.getParameter( lookup.getName() ); + modelName = "'" + modelName + "'"; + Integer modelTypeAttributeId = Integer.parseInt( lookup.getValue() ); + + workingStatus = workingStatus.substring( 0, workingStatus.length()-1 ); + + lookup = lookupService.getLookupByName( Lookup.CCEI_REF_EQUIPMENTTYPE_ID ); + + Integer equipmentTypeId = Integer.parseInt( lookup.getValue() ); + + String query = cceiAggregationService.getQueryForRefrigeratorWorkingStatus( equipmentTypeId, modelTypeAttributeId, modelName, workingStatus ); + + //CaseAggregationCondition condition = new CaseAggregationCondition( name, aggType, query, dataElement, dataElementCategoryService.getDefaultDataElementCategoryOptionCombo() ); + + CaseAggregationCondition condition = new CaseAggregationCondition( dataElement.getName(), aggType, query, dataElement, dataElementCategoryService.getDefaultDataElementCategoryOptionCombo() ); + + aggregationConditionService.addCaseAggregationCondition( condition ); + } + else if( aggType.equals( Lookup.CCEI_AGG_TYPE_REF_TEMP_ALARMS ) ) + { + HttpServletRequest request = ServletActionContext.getRequest(); + + String refTempAlarm = request.getParameter( Lookup.CCEI_AGG_TYPE_REF_TEMP_ALARMS ); + + Lookup lookup = lookupService.getLookupByName( Lookup.CCEI_REF_EQUIPMENTTYPE_ID ); + + Integer equipmentTypeId = Integer.parseInt( lookup.getValue() ); + + lookup = lookupService.getLookupByName( refTempAlarm ); + + if( lookup.getName().equals( Lookup.CCEI_NO_OF_REF_WITH_HIGHTEMP_ALARM) || lookup.getName().equals( Lookup.CCEI_NO_OF_REF_WITH_LOWTEMP_ALARM) ) + { + String query = cceiAggregationService.getQueryForRefrigeratorCountByTemperatureAlarm( equipmentTypeId, Integer.parseInt(lookup.getValue() ) ); + + CaseAggregationCondition condition = new CaseAggregationCondition( dataElement.getName(), lookup.getName(), query, dataElement, dataElementCategoryService.getDefaultDataElementCategoryOptionCombo() ); + + aggregationConditionService.addCaseAggregationCondition( condition ); + } + else if( lookup.getName().equals( Lookup.CCEI_FACILITY_WITH_HIGHTEMP_ALARM) || lookup.getName().equals( Lookup.CCEI_FACILITY_WITH_LOWTEMP_ALARM ) || lookup.getName().equals( Lookup.CCEI_FACILITY_WITH_TEMP_ALARM ) ) + { + String query = cceiAggregationService.getQueryForRefrigeratorTemperatureAlarmByFacilty( equipmentTypeId, lookup.getValue() ); + + CaseAggregationCondition condition = new CaseAggregationCondition( dataElement.getName(), lookup.getName(), query, dataElement, dataElementCategoryService.getDefaultDataElementCategoryOptionCombo() ); + + aggregationConditionService.addCaseAggregationCondition( condition ); + } + } +*/ + return SUCCESS; + } + +} === added file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/AddAggregationQueryFormAction.java' --- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/AddAggregationQueryFormAction.java 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/AddAggregationQueryFormAction.java 2014-02-05 10:49:02 +0000 @@ -0,0 +1,85 @@ +package org.hisp.dhis.pbf.aggregation.action; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import org.hisp.dhis.attribute.AttributeValue; +import org.hisp.dhis.dataelement.DataElement; +import org.hisp.dhis.dataelement.DataElementService; +import org.hisp.dhis.pbf.api.Lookup; +import org.hisp.dhis.pbf.api.LookupService; + +import com.opensymphony.xwork2.Action; + +public class AddAggregationQueryFormAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + private LookupService lookupService; + + public void setLookupService( LookupService lookupService ) + { + this.lookupService = lookupService; + } + + private DataElementService dataElementService; + + public void setDataElementService( DataElementService dataElementService ) + { + this.dataElementService = dataElementService; + } + + // ------------------------------------------------------------------------- + // Input/ Output + // ------------------------------------------------------------------------- + List lookups; + + public List getLookups() + { + return lookups; + } + + List dataElementList; + + public List getDataElementList() + { + return dataElementList; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + public String execute() + throws Exception + { + lookups = new ArrayList( lookupService.getAllLookupsByType( Lookup.PBF_AGG_TYPE ) ); + + dataElementList = new ArrayList( dataElementService.getAllActiveDataElements() ); + +/* Lookup lookup = lookupService.getLookupByName( "IS_PBF_AGGREGATED_DE_ATTRIBUTE_ID" ); + Iterator iterator = dataElementList.iterator(); + while( iterator.hasNext() ) + { + DataElement dataElement = iterator.next(); + + Set dataElementAttributeValues = dataElement.getAttributeValues(); + if( dataElementAttributeValues != null && dataElementAttributeValues.size() > 0 ) + { + for( AttributeValue deAttributeValue : dataElementAttributeValues ) + { + if( deAttributeValue.getAttribute().getId() == Integer.parseInt( lookup.getValue() ) && !deAttributeValue.getValue().equalsIgnoreCase( "true" ) ) + { + iterator.remove(); + } + } + } + } +*/ + + return SUCCESS; + } +} === added file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/AggregationQueryListAction.java' --- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/AggregationQueryListAction.java 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/AggregationQueryListAction.java 2014-02-05 10:49:02 +0000 @@ -0,0 +1,45 @@ +package org.hisp.dhis.pbf.aggregation.action; + +import java.util.Collection; + +import org.hisp.dhis.caseaggregation.CaseAggregationCondition; +import org.hisp.dhis.caseaggregation.CaseAggregationConditionService; + +import com.opensymphony.xwork2.Action; + +public class AggregationQueryListAction implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private CaseAggregationConditionService aggregationConditionService; + + public void setAggregationConditionService( CaseAggregationConditionService aggregationConditionService ) + { + this.aggregationConditionService = aggregationConditionService; + } + + // ------------------------------------------------------------------------- + // Input/ Output + // ------------------------------------------------------------------------- + + private Collection aggregationConditions; + + public Collection getAggregationConditions() + { + return aggregationConditions; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + public String execute() + throws Exception + { + aggregationConditions = aggregationConditionService.getAllCaseAggregationCondition(); + + return SUCCESS; + } + +} === added file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/GetAggregationParameterAction.java' --- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/GetAggregationParameterAction.java 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/GetAggregationParameterAction.java 2014-02-05 10:49:02 +0000 @@ -0,0 +1,86 @@ +package org.hisp.dhis.pbf.aggregation.action; + +import java.util.ArrayList; +import java.util.List; + +import org.hisp.dhis.dataset.DataSet; +import org.hisp.dhis.dataset.DataSetService; +import org.hisp.dhis.pbf.api.Lookup; +import org.hisp.dhis.pbf.api.LookupService; + +import com.opensymphony.xwork2.Action; + +public class GetAggregationParameterAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + private LookupService lookupService; + + public void setLookupService( LookupService lookupService ) + { + this.lookupService = lookupService; + } + + private DataSetService dataSetService; + + public void setDataSetService( DataSetService dataSetService ) + { + this.dataSetService = dataSetService; + } + + // ------------------------------------------------------------------------- + // Input/ Output + // ------------------------------------------------------------------------- + private String aggTypeId; + + public void setAggTypeId( String aggTypeId ) + { + this.aggTypeId = aggTypeId; + } + + public String getAggTypeId() + { + return aggTypeId; + } + + private List pbfTypeDataSets = new ArrayList(); + + public List getPbfTypeDataSets() + { + return pbfTypeDataSets; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + public String execute() + throws Exception + { + if ( aggTypeId.equals( Lookup.PBF_AGG_TYPE_OVERALL_QUALITY_SCORE ) ) + { + List lookups = new ArrayList( lookupService.getAllLookupsByType( Lookup.DS_QUALITY_TYPE ) ); + + for( Lookup lookup : lookups ) + { + DataSet dataSet = dataSetService.getDataSet( Integer.parseInt( lookup.getValue() ) ); + + pbfTypeDataSets.add( dataSet ); + } + } + else if ( aggTypeId.equals( Lookup.PBF_AGG_TYPE_OVERALL_UNADJUSTED_PBF_AMOUNT ) ) + { + List lookups = new ArrayList( lookupService.getAllLookupsByType( Lookup.DS_PBF_TYPE ) ); + + for( Lookup lookup : lookups ) + { + DataSet dataSet = dataSetService.getDataSet( Integer.parseInt( lookup.getValue() ) ); + + pbfTypeDataSets.add( dataSet ); + } + } + + return SUCCESS; + } +} === added file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/RunAggregationQueryAction.java' --- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/RunAggregationQueryAction.java 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/RunAggregationQueryAction.java 2014-02-05 10:49:02 +0000 @@ -0,0 +1,261 @@ +package org.hisp.dhis.pbf.aggregation.action; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.hisp.dhis.caseaggregation.CaseAggregationCondition; +import org.hisp.dhis.caseaggregation.CaseAggregationConditionService; +import org.hisp.dhis.constant.Constant; +import org.hisp.dhis.constant.ConstantService; +import org.hisp.dhis.dataelement.DataElement; +import org.hisp.dhis.dataset.DataSet; +import org.hisp.dhis.dataset.DataSetService; +import org.hisp.dhis.organisationunit.OrganisationUnit; +import org.hisp.dhis.organisationunit.OrganisationUnitGroup; +import org.hisp.dhis.organisationunit.OrganisationUnitGroupService; +import org.hisp.dhis.organisationunit.OrganisationUnitService; +import org.hisp.dhis.oust.manager.SelectionTreeManager; +import org.hisp.dhis.pbf.api.Lookup; +import org.hisp.dhis.pbf.impl.DefaultPBFAggregationService; +import org.hisp.dhis.period.MonthlyPeriodType; +import org.hisp.dhis.period.Period; +import org.hisp.dhis.period.PeriodService; +import org.hisp.dhis.period.PeriodType; +import org.hisp.dhis.period.YearlyPeriodType; + +import com.opensymphony.xwork2.Action; + +public class RunAggregationQueryAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private SelectionTreeManager selectionTreeManager; + + public void setSelectionTreeManager( SelectionTreeManager selectionTreeManager ) + { + this.selectionTreeManager = selectionTreeManager; + } + + private OrganisationUnitService organisationUnitService; + + public void setOrganisationUnitService( OrganisationUnitService organisationUnitService ) + { + this.organisationUnitService = organisationUnitService; + } + + private OrganisationUnitGroupService organisationUnitGroupService; + + public void setOrganisationUnitGroupService( OrganisationUnitGroupService organisationUnitGroupService ) + { + this.organisationUnitGroupService = organisationUnitGroupService; + } + + private CaseAggregationConditionService aggregationConditionService; + + public void setAggregationConditionService( CaseAggregationConditionService aggregationConditionService ) + { + this.aggregationConditionService = aggregationConditionService; + } + + private DefaultPBFAggregationService defaultPBFAggregationService; + + public void setDefaultPBFAggregationService( DefaultPBFAggregationService defaultPBFAggregationService ) + { + this.defaultPBFAggregationService = defaultPBFAggregationService; + } + + /*private CCEIAggregationService cceiAggregationService; + + public void setCceiAggregationService( CCEIAggregationService cceiAggregationService ) + { + this.cceiAggregationService = cceiAggregationService; + } +*/ + private PeriodService periodService; + + public void setPeriodService( PeriodService periodService ) + { + this.periodService = periodService; + } + + private DataSetService dataSetService; + + public void setDataSetService( DataSetService dataSetService ) + { + this.dataSetService = dataSetService; + } + + private ConstantService constantService; + + public void setConstantService( ConstantService constantService ) + { + this.constantService = constantService; + } + + // ------------------------------------------------------------------------- + // Input & Output + // ------------------------------------------------------------------------- + private List dataElements = new ArrayList(); + + public List getDataElements() + { + return dataElements; + } + + private String importStatus = ""; + + public String getImportStatus() + { + return importStatus; + } + + // ------------------------------------------------------------------------- + // Action + // ------------------------------------------------------------------------- + + public String execute() + throws Exception + { + Map aggregationResultMap = new HashMap(); + + Set orgUnitList = new HashSet( selectionTreeManager.getReloadedSelectedOrganisationUnits() ); + + //Set orgUnitGroups = new HashSet( organisationUnitGroupService.getAllOrganisationUnitGroups() ); + + /*List ouGroups = new ArrayList( organisationUnitGroupService.getOrganisationUnitGroupByName( EquipmentAttributeValue.HEALTHFACILITY ) ); + + OrganisationUnitGroup ouGroup = ouGroups.get( 0 ); + + if ( ouGroup != null ) + { + orgUnitList.retainAll( ouGroup.getMembers() ); + }*/ + + /* + SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "yyyyMM" ); + String curMonth = simpleDateFormat.format( new Date() ); + Period period = PeriodType.getPeriodFromIsoString( curMonth ); + period = periodService.reloadPeriod( period ); + + List periods = new ArrayList(); + periods.add( period ); +*/ + + Constant tariff_authority = constantService.getConstantByName( "TARIFF_SETTING_AUTHORITY" ); + int tariff_setting_authority = 0; + if ( tariff_authority == null ) + { + tariff_setting_authority = 3; + } + else + { + tariff_setting_authority = (int) tariff_authority.getValue(); + } + + Set conditions = new HashSet( aggregationConditionService.getAllCaseAggregationCondition() ); + for ( CaseAggregationCondition condition : conditions ) + { + DataElement dataElement = condition.getAggregationDataElement(); + + if ( condition.getOperator().equals( Lookup.PBF_AGG_TYPE_OVERALL_QUALITY_SCORE ) ) + { + Integer dataSetId = Integer.parseInt( condition.getAggregationExpression() ); + + DataSet dataSet = dataSetService.getDataSet( dataSetId ); + + Set orgUnits = new HashSet( dataSet.getSources() ); + + orgUnits.retainAll( orgUnitList ); + + List periods = new ArrayList(); + + periods.add( getCurrentPeriod( dataSet.getPeriodType(), new Date() ) ); + + aggregationResultMap.putAll( defaultPBFAggregationService.calculateOverallQualityScore( periods, dataElement, orgUnits, dataSetId, tariff_setting_authority ) ); + } + else if( condition.getOperator().equals( Lookup.PBF_AGG_TYPE_OVERALL_UNADJUSTED_PBF_AMOUNT ) ) + { + Integer dataSetId = Integer.parseInt( condition.getAggregationExpression() ); + + DataSet dataSet = dataSetService.getDataSet( dataSetId ); + + Set orgUnits = new HashSet( dataSet.getSources() ); + + orgUnits.retainAll( orgUnitList ); + + List periods = new ArrayList(); + + periods.add( getCurrentPeriod( dataSet.getPeriodType(), new Date() ) ); + + aggregationResultMap.putAll( defaultPBFAggregationService.calculateOverallUnadjustedPBFAmount( periods, dataElement, orgUnits, dataSetId ) ); + } + + dataElements.add( dataElement ); + } + + for( String key : aggregationResultMap.keySet() ) + { + System.out.println( key + " -- " + aggregationResultMap.get( key ) ); + } + + importStatus = defaultPBFAggregationService.importData( aggregationResultMap ); + + return SUCCESS; + } + + + public Period getCurrentPeriod( PeriodType periodType, Date currentDate ) + { + Period period = new Period(); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime( currentDate ); + + int currentMonth = calendar.get( Calendar.MONTH ); + + if ( periodType.getName().equalsIgnoreCase( "quarterly" ) ) + { + if ( currentMonth >= 0 && currentMonth <= 2 ) + { + period = PeriodType.getPeriodFromIsoString( calendar.get( Calendar.YEAR ) + "Q1" ); + } + else if ( currentMonth >= 3 && currentMonth <= 5 ) + { + period = PeriodType.getPeriodFromIsoString( calendar.get( Calendar.YEAR ) + "Q2" ); + } + else if ( currentMonth >= 6 && currentMonth <= 8 ) + { + period = PeriodType.getPeriodFromIsoString( calendar.get( Calendar.YEAR ) + "Q3" ); + } + else + { + period = PeriodType.getPeriodFromIsoString( calendar.get( Calendar.YEAR ) + "Q4" ); + } + } + else if ( periodType.getName().equalsIgnoreCase( "yearly" ) ) + { + period = PeriodType.getPeriodFromIsoString( calendar.get( Calendar.YEAR )+"" ); + } + else if ( periodType.getName().equalsIgnoreCase( "monthly" ) ) + { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "yyyyMM" ); + period = PeriodType.getPeriodFromIsoString( simpleDateFormat.format( currentDate ) ); + } + + period = periodService.reloadPeriod( period ); + + return period; + } + + +} === modified file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/api/Lookup.java' --- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/api/Lookup.java 2014-01-18 12:25:59 +0000 +++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/api/Lookup.java 2014-02-05 10:49:02 +0000 @@ -4,17 +4,21 @@ public class Lookup extends BaseNameableObject { - public static final String DS_PBF_TYPE = "DS_PBF_TYPE"; - + public static final String DS_PBF_TYPE = "DS_PBF_TYPE"; public static final String DS_QUALITY_TYPE = "DS_QUALITY_TYPE"; - public static final String OC_TARIFF = "OC_TARIFF"; - - public static final String QV_TARIFF = "QV_TARIFF"; - - + public static final String OC_TARIFF = "OC_TARIFF"; + public static final String QV_TARIFF = "QV_TARIFF"; + public static final String PBF_AGG_TYPE = "PBF_AGG_TYPE"; public static final String BANK = "BANK"; + public static final String PBF_AGG_TYPE_OVERALL_QUALITY_SCORE = "OVERALL QUALITY SCORE"; + public static final String PBF_AGG_TYPE_OVERALL_UNADJUSTED_PBF_AMOUNT = "OVERALL UNADJUSTED PBF AMOUNT"; + + public static final String ORGUNITID_BY_COMMA = "ORGUNITID_BY_COMMA"; + public static final String PERIODID_BY_COMMA = "PERIODID_BY_COMMA"; + + private String type; private String value; === modified file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/dataentry/LoadDataEntryFormAction.java' --- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/dataentry/LoadDataEntryFormAction.java 2014-01-18 12:25:59 +0000 +++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/dataentry/LoadDataEntryFormAction.java 2014-02-05 10:49:02 +0000 @@ -35,31 +35,31 @@ /** * @author Mithilesh Kumar Thakur */ -public class LoadDataEntryFormAction implements Action +public class LoadDataEntryFormAction + implements Action { - private final static String TARIFF_SETTING_AUTHORITY = "TARIFF_SETTING_AUTHORITY"; - + private final static String TARIFF_SETTING_AUTHORITY = "TARIFF_SETTING_AUTHORITY"; + // ------------------------------------------------------------------------- // Dependencies // ------------------------------------------------------------------------- - - - private PBFDataValueService pbfDataValueService; - - public void setPbfDataValueService(PBFDataValueService pbfDataValueService) - { - this.pbfDataValueService = pbfDataValueService; - } - - private OrganisationUnitService organisationUnitService; - + + private PBFDataValueService pbfDataValueService; + + public void setPbfDataValueService( PBFDataValueService pbfDataValueService ) + { + this.pbfDataValueService = pbfDataValueService; + } + + private OrganisationUnitService organisationUnitService; + public void setOrganisationUnitService( OrganisationUnitService organisationUnitService ) { this.organisationUnitService = organisationUnitService; } - + private DataSetService dataSetService; - + public void setDataSetService( DataSetService dataSetService ) { this.dataSetService = dataSetService; @@ -73,26 +73,26 @@ } private LookupService lookupService; - + public void setLookupService( LookupService lookupService ) { this.lookupService = lookupService; } - + private DataElementCategoryService dataElementCategoryService; - + public void setDataElementCategoryService( DataElementCategoryService dataElementCategoryService ) { this.dataElementCategoryService = dataElementCategoryService; } - + private TariffDataValueService tariffDataValueService; - + public void setTariffDataValueService( TariffDataValueService tariffDataValueService ) { this.tariffDataValueService = tariffDataValueService; } - + private CurrentUserService currentUserService; public void setCurrentUserService( CurrentUserService currentUserService ) @@ -110,276 +110,259 @@ // ------------------------------------------------------------------------- // Comparator // ------------------------------------------------------------------------- -/* - private Comparator dataElementComparator; - - public void setDataElementComparator( Comparator dataElementComparator ) - { - this.dataElementComparator = dataElementComparator; - } -*/ + /* + * private Comparator dataElementComparator; + * + * public void setDataElementComparator( Comparator + * dataElementComparator ) { this.dataElementComparator = + * dataElementComparator; } + */ // ------------------------------------------------------------------------- // Input/Output // ------------------------------------------------------------------------- private Map pbfDataValueMap; - - public Map getPbfDataValueMap() + + public Map getPbfDataValueMap() { - return pbfDataValueMap; - } - - private String orgUnitId; - + return pbfDataValueMap; + } + + private String orgUnitId; + public void setOrgUnitId( String orgUnitId ) { this.orgUnitId = orgUnitId; } - + private int dataSetId; - + public void setDataSetId( int dataSetId ) { this.dataSetId = dataSetId; } private String selectedPeriodId; - + public void setSelectedPeriodId( String selectedPeriodId ) { this.selectedPeriodId = selectedPeriodId; } private List dataElements = new ArrayList(); - + public List getDataElements() { return dataElements; } - + private OrganisationUnit organisationUnit; public OrganisationUnit getOrganisationUnit() { return organisationUnit; } - + public Map dataValueMap; - + public Map getDataValueMap() { return dataValueMap; } - + private DataSet dataSet; - + public DataSet getDataSet() { return dataSet; } - + private Period period; - + public Period getPeriod() { return period; } - + private List optionCombos = new ArrayList(); - + public List getOptionCombos() { return optionCombos; } - + private DataElementCategoryOptionCombo tariffOptCombo; - + public DataElementCategoryOptionCombo getTariffOptCombo() { return tariffOptCombo; } - + private DataElementCategoryOptionCombo qValOptCombo; - - public DataElementCategoryOptionCombo getqValOptCombo() + + public DataElementCategoryOptionCombo getqValOptCombo() { - return qValOptCombo; - } + return qValOptCombo; + } // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- - - public String execute() - { + + public String execute() + { dataValueMap = new HashMap(); - - - Lookup lookup = lookupService.getLookupByName( Lookup.OC_TARIFF ); - - Lookup lookup2 = lookupService.getLookupByName( Lookup.QV_TARIFF ); - - tariffOptCombo = dataElementCategoryService.getDataElementCategoryOptionCombo( Integer.parseInt( lookup.getValue() ) ); - - qValOptCombo = dataElementCategoryService.getDataElementCategoryOptionCombo( Integer.parseInt( lookup.getValue() ) ); - + + //Lookup lookup = lookupService.getLookupByName( Lookup.OC_TARIFF ); + + //Lookup lookup2 = lookupService.getLookupByName( Lookup.QV_TARIFF ); + + //tariffOptCombo = dataElementCategoryService.getDataElementCategoryOptionCombo( Integer.parseInt( lookup.getValue() ) ); + + //qValOptCombo = dataElementCategoryService.getDataElementCategoryOptionCombo( Integer.parseInt( lookup.getValue() ) ); + organisationUnit = organisationUnitService.getOrganisationUnit( orgUnitId ); - + dataSet = dataSetService.getDataSet( dataSetId ); - + period = PeriodType.getPeriodFromIsoString( selectedPeriodId ); - + dataElements = new ArrayList( dataSet.getDataElements() ); - - Collections.sort(dataElements); - + + Collections.sort( dataElements ); + optionCombos = new ArrayList(); - + Map tariffDataValueMap = new HashMap(); - + // find parent Constant tariff_authority = constantService.getConstantByName( TARIFF_SETTING_AUTHORITY ); int tariff_setting_authority = 0; if ( tariff_authority == null ) { tariff_setting_authority = 3; - + } else { tariff_setting_authority = (int) tariff_authority.getValue(); - + } - + OrganisationUnit parentOrgunit = findParentOrgunitforTariff( organisationUnit, tariff_setting_authority ); - - if( parentOrgunit != null ) + + if ( parentOrgunit != null ) { - tariffDataValueMap.putAll( tariffDataValueService.getTariffDataValues( parentOrgunit, dataSet, period ) ); + tariffDataValueMap.putAll( tariffDataValueService.getTariffDataValues( parentOrgunit, dataSet, period ) ); } - - + pbfDataValueMap = new HashMap(); - Set pbfDataValues = new HashSet( pbfDataValueService.getPBFDataValues(organisationUnit, dataSet, period) ); - for( PBFDataValue pbfDataValue : pbfDataValues ) + Set pbfDataValues = new HashSet( pbfDataValueService.getPBFDataValues( + organisationUnit, dataSet, period ) ); + for ( PBFDataValue pbfDataValue : pbfDataValues ) { - DataElement de = pbfDataValue.getDataElement(); - if( pbfDataValue.getTariffAmount() == null ) - { - Double tariffAmount = tariffDataValueMap.get( de.getId() ); - if( tariffAmount != null ) - { - pbfDataValue.setStoredBy( currentUserService.getCurrentUsername() ); - pbfDataValue.setTariffAmount( tariffAmount ); - pbfDataValue.setTimestamp( new Date() ); - pbfDataValueService.updatePBFDataValue( pbfDataValue ); - } - } - pbfDataValueMap.put( de, pbfDataValue ); + DataElement de = pbfDataValue.getDataElement(); + if ( pbfDataValue.getTariffAmount() == null ) + { + Double tariffAmount = tariffDataValueMap.get( de.getId() ); + if ( tariffAmount != null ) + { + pbfDataValue.setStoredBy( currentUserService.getCurrentUsername() ); + pbfDataValue.setTariffAmount( tariffAmount ); + pbfDataValue.setTimestamp( new Date() ); + pbfDataValueService.updatePBFDataValue( pbfDataValue ); + } + } + pbfDataValueMap.put( de, pbfDataValue ); } - + Set tempDes = new HashSet(); tempDes.addAll( dataElements ); - + tempDes.removeAll( pbfDataValueMap.keySet() ); - - for( DataElement de : tempDes ) + + for ( DataElement de : tempDes ) { - Double tariffAmount = tariffDataValueMap.get( de.getId() ); - if( tariffAmount != null ) - { - PBFDataValue pbfDataValue = new PBFDataValue(); - - pbfDataValue.setDataSet( dataSet ); + Double tariffAmount = tariffDataValueMap.get( de.getId() ); + if ( tariffAmount != null ) + { + PBFDataValue pbfDataValue = new PBFDataValue(); + + pbfDataValue.setDataSet( dataSet ); pbfDataValue.setDataElement( de ); pbfDataValue.setPeriod( period ); - pbfDataValue.setOrganisationUnit(organisationUnit); + pbfDataValue.setOrganisationUnit( organisationUnit ); pbfDataValue.setTariffAmount( tariffAmount ); pbfDataValue.setStoredBy( currentUserService.getCurrentUsername() ); pbfDataValue.setTimestamp( new Date() ); - + pbfDataValueService.addPBFDataValue( pbfDataValue ); pbfDataValueMap.put( de, pbfDataValue ); - } - } - - /* - for( DataElement dataElement : dataElements ) - { - //DataElementCategoryOptionCombo decoc = dataElementCategoryService.getDefaultDataElementCategoryOptionCombo(); - - DataElementCategoryCombo dataElementCategoryCombo = dataElement.getCategoryCombo(); - - optionCombos = new ArrayList( dataElementCategoryCombo.getOptionCombos() ); - - for( DataElementCategoryOptionCombo decombo : optionCombos ) - { - DataValue dataValue = new DataValue(); - - dataValue = dataValueService.getDataValue( dataElement, period, organisationUnit, decombo ); - - String value = ""; - - if ( dataValue != null ) - { - value = dataValue.getValue(); - } - else - { - if( decombo.getId() == tariffOptCombo.getId() ) - { - Double tariffValue = tariffDataValueMap.get( dataElement.getId() ); - - if( tariffValue != null ) - { - value = tariffValue+""; - - dataValue = new DataValue( ); - dataValue.setDataElement(dataElement); - dataValue.setPeriod(period); - dataValue.setSource(organisationUnit); - dataValue.setValue( value ); - dataValue.setStoredBy( currentUserService.getCurrentUsername() ); - dataValue.setTimestamp( new Date() ); - dataValue.setCategoryOptionCombo( decombo ); - - dataValueService.addDataValue( dataValue ); - } - } - } - - String key = dataElement.getId()+ ":" + decombo.getId(); - - dataValueMap.put( key, value ); } - - } - */ - - /* - for( DataElementCategoryOptionCombo decombo : optionCombos ) - { - System.out.println(" decombo ---" + decombo.getId() +" -- " + decombo.getName() ); - } - */ - - + } + + /* + * for( DataElement dataElement : dataElements ) { + * //DataElementCategoryOptionCombo decoc = + * dataElementCategoryService.getDefaultDataElementCategoryOptionCombo + * (); + * + * DataElementCategoryCombo dataElementCategoryCombo = + * dataElement.getCategoryCombo(); + * + * optionCombos = new ArrayList( + * dataElementCategoryCombo.getOptionCombos() ); + * + * for( DataElementCategoryOptionCombo decombo : optionCombos ) { + * DataValue dataValue = new DataValue(); + * + * dataValue = dataValueService.getDataValue( dataElement, period, + * organisationUnit, decombo ); + * + * String value = ""; + * + * if ( dataValue != null ) { value = dataValue.getValue(); } else { if( + * decombo.getId() == tariffOptCombo.getId() ) { Double tariffValue = + * tariffDataValueMap.get( dataElement.getId() ); + * + * if( tariffValue != null ) { value = tariffValue+""; + * + * dataValue = new DataValue( ); dataValue.setDataElement(dataElement); + * dataValue.setPeriod(period); dataValue.setSource(organisationUnit); + * dataValue.setValue( value ); dataValue.setStoredBy( + * currentUserService.getCurrentUsername() ); dataValue.setTimestamp( + * new Date() ); dataValue.setCategoryOptionCombo( decombo ); + * + * dataValueService.addDataValue( dataValue ); } } } + * + * String key = dataElement.getId()+ ":" + decombo.getId(); + * + * dataValueMap.put( key, value ); } + * + * } + */ + + /* + * for( DataElementCategoryOptionCombo decombo : optionCombos ) { + * System.out.println(" decombo ---" + decombo.getId() +" -- " + + * decombo.getName() ); } + */ + return SUCCESS; } - - public OrganisationUnit findParentOrgunitforTariff( OrganisationUnit organisationUnit, Integer tariffOULevel ) - { - Integer ouLevel = organisationUnitService.getLevelOfOrganisationUnit( organisationUnit.getId() ); - if( tariffOULevel == ouLevel ) - { - return organisationUnit; - } - else - { - return findParentOrgunitforTariff( organisationUnit.getParent(), tariffOULevel ); - } - } + + public OrganisationUnit findParentOrgunitforTariff( OrganisationUnit organisationUnit, Integer tariffOULevel ) + { + Integer ouLevel = organisationUnitService.getLevelOfOrganisationUnit( organisationUnit.getId() ); + if ( tariffOULevel == ouLevel ) + { + return organisationUnit; + } + else + { + return findParentOrgunitforTariff( organisationUnit.getParent(), tariffOULevel ); + } + } } - === added file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/DefaultPBFAggregationService.java' --- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/DefaultPBFAggregationService.java 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/DefaultPBFAggregationService.java 2014-02-05 10:49:02 +0000 @@ -0,0 +1,286 @@ +package org.hisp.dhis.pbf.impl; + +import static org.hisp.dhis.system.util.ConversionUtils.getIdentifiers; +import static org.hisp.dhis.system.util.TextUtils.getCommaDelimitedString; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.hisp.dhis.constant.ConstantService; +import org.hisp.dhis.dataelement.DataElement; +import org.hisp.dhis.dataelement.DataElementCategoryService; +import org.hisp.dhis.organisationunit.OrganisationUnit; +import org.hisp.dhis.pbf.api.Lookup; +import org.hisp.dhis.period.Period; +import org.hisp.dhis.period.PeriodService; +import org.hisp.dhis.user.CurrentUserService; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.jdbc.support.rowset.SqlRowSet; +import org.springframework.transaction.annotation.Transactional; + +@Transactional +public class DefaultPBFAggregationService +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + private ConstantService constantService; + + public void setConstantService( ConstantService constantService ) + { + this.constantService = constantService; + } + + private CurrentUserService currentUserService; + + public void setCurrentUserService( CurrentUserService currentUserService ) + { + this.currentUserService = currentUserService; + } + + private PeriodService periodService; + + public void setPeriodService( PeriodService periodService ) + { + this.periodService = periodService; + } + + private DataElementCategoryService dataElementCategoryService; + + public void setDataElementCategoryService( DataElementCategoryService dataElementCategoryService ) + { + this.dataElementCategoryService = dataElementCategoryService; + } + + private JdbcTemplate jdbcTemplate; + + public void setJdbcTemplate( JdbcTemplate jdbcTemplate ) + { + this.jdbcTemplate = jdbcTemplate; + } + + // ------------------------------------------------------------------------- + // + // ------------------------------------------------------------------------- + + public Map calculateOverallQualityScore( List periods, DataElement dataElement, Set orgUnits, Integer dataSetId, int settingLevel ) + { + Map aggregationResultMap = new HashMap(); + + SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "yyyy-MM-dd" ); + + try + { + Map maxScoreResultMap = new HashMap(); + for( Period period : periods ) + { + String query = "SELECT os.organisationunitid, qmv.organisationunitid, qmv.startdate, qmv.enddate, SUM( qmv.value ) FROM qualitymaxvalue qmv "+ + " INNER JOIN _orgunitstructure os on qmv.organisationunitid = os.idlevel"+settingLevel+" "+ + " INNER JOIN datasetmembers dsm on dsm.dataelementid = qmv.dataelementid " + + " WHERE " + + " qmv.startdate <='"+ simpleDateFormat.format( period.getStartDate() ) +"' AND "+ + " qmv.enddate >='"+ simpleDateFormat.format( period.getEndDate() ) +"' AND " + + " dsm.datasetid = " + dataSetId +" " + + " GROUP BY os.organisationunitid, qmv.organisationunitid, qmv.startdate, qmv.enddate"; + + System.out.println( query ); + + SqlRowSet rs = jdbcTemplate.queryForRowSet( query ); + while ( rs.next() ) + { + Integer orgUnitId = rs.getInt( 1 ); + //Integer deId = rs.getInt( 3 ); + Double value = rs.getDouble( 5 ); + maxScoreResultMap.put( orgUnitId+":"+period.getId(), value ); + } + } + + Collection orgUnitIds = new ArrayList( getIdentifiers( OrganisationUnit.class, orgUnits ) ); + String orgUnitIdsByComma = getCommaDelimitedString( orgUnitIds ); + + Collection periodIds = new ArrayList( getIdentifiers( Period.class, periods ) ); + String periodsByComma = getCommaDelimitedString( periodIds ); + + String query = "SELECT dv.sourceid, dv.periodid, SUM( CAST ( value AS NUMERIC ) ) FROM datavalue dv "+ + " INNER JOIN datasetmembers dsm on dsm.dataelementid = dv.dataelementid " + + " WHERE " + + " dv.periodid IN (" + periodsByComma + ") AND "+ + " dv.sourceid IN ("+ orgUnitIdsByComma +") AND " + + " dsm.datasetid = " + dataSetId +" " + + " GROUP BY dv.sourceid, dv.periodid"; + + System.out.println( query ); + + SqlRowSet rs = jdbcTemplate.queryForRowSet( query ); + while ( rs.next() ) + { + Integer orgUnitId = rs.getInt( 1 ); + Integer periodId = rs.getInt( 2 ); + Double value = rs.getDouble( 3 ); + + try + { + Double maxScore = maxScoreResultMap.get( orgUnitId+":"+periodId ); + if( maxScore != null && maxScore != 0.0 ) + { + Double overAllQualityScore = ( value / maxScore ) * 100.0; + + aggregationResultMap.put( orgUnitId+":"+dataElement.getId()+":"+periodId, overAllQualityScore ); + } + } + catch( Exception e ) + { + + } + } + } + catch( Exception e ) + { + System.out.println("Exception :"+ e.getMessage() ); + } + + return aggregationResultMap; + } + + public Map calculateOverallUnadjustedPBFAmount( List periods, DataElement dataElement, Set orgUnits, Integer dataSetId ) + { + Map aggregationResultMap = new HashMap(); + + try + { + String query = "SELECT organisationunitid, periodid, SUM( ( qtyvalidated * tariffamount ) ) FROM pbfdatavalue " + + " WHERE " + + " periodid IN ( "+ Lookup.PERIODID_BY_COMMA +" ) AND "+ + " datasetid = "+ dataSetId + " AND " + + " organisationunitid IN (" + Lookup.ORGUNITID_BY_COMMA + ") " + + " GROUP BY organisationunitid, periodid "; + + Collection orgUnitIds = new ArrayList( getIdentifiers( OrganisationUnit.class, orgUnits ) ); + String orgUnitIdsByComma = getCommaDelimitedString( orgUnitIds ); + query = query.replace( Lookup.ORGUNITID_BY_COMMA, orgUnitIdsByComma ); + + Collection periodIds = new ArrayList( getIdentifiers( Period.class, periods ) ); + String periodsByComma = getCommaDelimitedString( periodIds ); + query = query.replace( Lookup.PERIODID_BY_COMMA, periodsByComma ); + + //System.out.println( query ); + + SqlRowSet rs = jdbcTemplate.queryForRowSet( query ); + while ( rs.next() ) + { + Integer orgUnitId = rs.getInt( 1 ); + Integer periodId = rs.getInt( 2 ); + Double countValue = rs.getDouble( 3 ); + aggregationResultMap.put( orgUnitId+":"+dataElement.getId()+":"+periodId, countValue ); + } + } + catch( Exception e ) + { + System.out.println("Exception :"+ e.getMessage() ); + } + + return aggregationResultMap; + } + + + public String importData( Map aggregationResultMap ) + { + String importStatus = ""; + + Integer updateCount = 0; + Integer insertCount = 0; + + String storedBy = currentUserService.getCurrentUsername(); + if ( storedBy == null ) + { + storedBy = "[unknown]"; + } + + long t; + Date d = new Date(); + t = d.getTime(); + java.sql.Date lastUpdatedDate = new java.sql.Date( t ); + + String query = ""; + int insertFlag = 1; + String insertQuery = "INSERT INTO datavalue ( dataelementid, periodid, sourceid, categoryoptioncomboid, value, storedby, lastupdated, attributeoptioncomboid ) VALUES "; + + try + { + int count = 1; + for ( String cellKey : aggregationResultMap.keySet() ) + { + // Orgunit + String[] oneRow = cellKey.split( ":" ); + Integer orgUnitId = Integer.parseInt( oneRow[0] ); + Integer deId = Integer.parseInt( oneRow[1] ); + //Integer periodId = period.getId(); + Integer periodId = Integer.parseInt( oneRow[2] ); + + Integer deCOCId = dataElementCategoryService.getDefaultDataElementCategoryOptionCombo().getId(); + String value = aggregationResultMap.get( cellKey ) + ""; + + query = "SELECT value FROM datavalue WHERE dataelementid = " + deId + " AND categoryoptioncomboid = " + deCOCId + " AND periodid = " + periodId + " AND sourceid = " + orgUnitId; + SqlRowSet sqlResultSet1 = jdbcTemplate.queryForRowSet( query ); + if ( sqlResultSet1 != null && sqlResultSet1.next() ) + { + String updateQuery = "UPDATE datavalue SET value = '" + value + "', storedby = '" + storedBy + "',lastupdated='" + lastUpdatedDate + "' WHERE dataelementid = " + deId + " AND periodid = " + + periodId + " AND sourceid = " + orgUnitId + " AND categoryoptioncomboid = " + deCOCId; + + jdbcTemplate.update( updateQuery ); + updateCount++; + } + else + { + if ( value != null && !value.trim().equals( "" ) ) + { + insertQuery += "( " + deId + ", " + periodId + ", " + orgUnitId + ", " + deCOCId + ", '" + value + "', '" + storedBy + "', '" + lastUpdatedDate + "'," + deCOCId + "), "; + insertFlag = 2; + insertCount++; + } + } + + if ( count == 1000 ) + { + count = 1; + + if ( insertFlag != 1 ) + { + insertQuery = insertQuery.substring( 0, insertQuery.length() - 2 ); + jdbcTemplate.update( insertQuery ); + } + + insertFlag = 1; + + insertQuery = "INSERT INTO datavalue ( dataelementid, periodid, sourceid, categoryoptioncomboid, value, storedby, lastupdated, attributeoptioncomboid ) VALUES "; + } + + count++; + } + + if ( insertFlag != 1 ) + { + insertQuery = insertQuery.substring( 0, insertQuery.length() - 2 ); + jdbcTemplate.update( insertQuery ); + } + + importStatus = "Successfully populated aggregated data for the period : "; //+ period.getStartDateString(); + importStatus += "
Total new records : " + insertCount; + importStatus += "
Total updated records : " + updateCount; + + } + catch ( Exception e ) + { + importStatus = "Exception occured while import, please check log for more details" + e.getMessage(); + } + + return importStatus; + } + +} === modified file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/quality/dataentry/LoadQualityMaxDetailsAction.java' --- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/quality/dataentry/LoadQualityMaxDetailsAction.java 2014-01-22 11:29:04 +0000 +++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/quality/dataentry/LoadQualityMaxDetailsAction.java 2014-02-05 10:49:02 +0000 @@ -37,20 +37,21 @@ implements Action { - private final static String QUALITY_MAX_DATAELEMENT = "QUALITY_MAX_DATAELEMENT"; + private final static String QUALITY_MAX_DATAELEMENT = "QUALITY_MAX_DATAELEMENT"; + // ------------------------------------------------------------------------- // Dependencies // ------------------------------------------------------------------------- private QualityMaxValueService qualityMaxValueService; - - public void setQualityMaxValueService( - QualityMaxValueService qualityMaxValueService) { - this.qualityMaxValueService = qualityMaxValueService; - } + + public void setQualityMaxValueService( QualityMaxValueService qualityMaxValueService ) + { + this.qualityMaxValueService = qualityMaxValueService; + } private DataSetService dataSetService; - + public void setDataSetService( DataSetService dataSetService ) { this.dataSetService = dataSetService; @@ -62,103 +63,112 @@ { this.organisationUnitService = organisationUnitService; } - + private LookupService lookupService; - + public void setLookupService( LookupService lookupService ) { this.lookupService = lookupService; } - + private ConstantService constantService; public void setConstantService( ConstantService constantService ) { this.constantService = constantService; } - + // ------------------------------------------------------------------------- // Input / Output // ------------------------------------------------------------------------- - + private String orgUnitId; - - public void setOrgUnitId(String orgUnitId) { - this.orgUnitId = orgUnitId; - } - - private String dataSetId; - - public void setDataSetId(String dataSetId) { - this.dataSetId = dataSetId; - } - + + public void setOrgUnitId( String orgUnitId ) + { + this.orgUnitId = orgUnitId; + } + + private String dataSetId; + + public void setDataSetId( String dataSetId ) + { + this.dataSetId = dataSetId; + } + private String startDate; - - public void setStartDate(String startDate) { - this.startDate = startDate; - } - + + public void setStartDate( String startDate ) + { + this.startDate = startDate; + } + private String endDate; - - public void setEndDate(String endDate) { - this.endDate = endDate; - } - - List dataElements = new ArrayList(); - - public List getDataElements() { - return dataElements; - } - - private SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "yyyy-MM-dd" );; - - public SimpleDateFormat getSimpleDateFormat() { - return simpleDateFormat; - } - - private Map qualityMaxValueMap = new HashMap(); - - public Map getQualityMaxValueMap() { - return qualityMaxValueMap; - } - + + public void setEndDate( String endDate ) + { + this.endDate = endDate; + } + + List dataElements = new ArrayList(); + + public List getDataElements() + { + return dataElements; + } + + private SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "yyyy-MM-dd" );; + + public SimpleDateFormat getSimpleDateFormat() + { + return simpleDateFormat; + } + + private Map qualityMaxValueMap = new HashMap(); + + public Map getQualityMaxValueMap() + { + return qualityMaxValueMap; + } + // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- - public String execute() throws Exception + public String execute() + throws Exception { - SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd" ); - + SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd" ); + Date sDate = dateFormat.parse( startDate ); Date eDate = dateFormat.parse( endDate ); - Constant qualityMaxDataElement = constantService.getConstantByName( QUALITY_MAX_DATAELEMENT ); + Constant qualityMaxDataElement = constantService.getConstantByName( QUALITY_MAX_DATAELEMENT ); OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( orgUnitId ); - DataSet dataSet = dataSetService.getDataSet(Integer.parseInt(dataSetId)); - - List dataElementList = new ArrayList(dataSet.getDataElements()); - for( DataElement de : dataElementList ) + DataSet dataSet = dataSetService.getDataSet( Integer.parseInt( dataSetId ) ); + + List dataElementList = new ArrayList( dataSet.getDataElements() ); + for ( DataElement de : dataElementList ) { Set attrValueSet = new HashSet( de.getAttributeValues() ); for ( AttributeValue attValue : attrValueSet ) { - if(attValue.getAttribute().getId() == qualityMaxDataElement.getValue()) - { - dataElements.add(de); - } + if ( attValue.getAttribute().getId() == qualityMaxDataElement.getValue() ) + { + dataElements.add( de ); + } } } - for(DataElement dataElement : dataElements) + for ( DataElement dataElement : dataElements ) { - QualityMaxValue qualityMaxValue = qualityMaxValueService.getQualityMaxValue(organisationUnit, dataElement, dataSet, sDate, eDate ); - if(qualityMaxValue != null) - { - qualityMaxValueMap.put(dataElement.getId(), qualityMaxValue); - System.out.println("In Quality Data Value"); - } + QualityMaxValue qualityMaxValue = qualityMaxValueService.getQualityMaxValue( organisationUnit, dataElement, + dataSet, sDate, eDate ); + if ( qualityMaxValue != null ) + { + qualityMaxValueMap.put( dataElement.getId(), qualityMaxValue ); + System.out.println( "In Quality Data Value" ); + } } - Collections.sort(dataElements); + Collections.sort( dataElements ); return SUCCESS; } } \ No newline at end of file === modified file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/quality/dataentry/LoadQualityScoreDetailsAction.java' --- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/quality/dataentry/LoadQualityScoreDetailsAction.java 2014-01-23 12:25:55 +0000 +++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/quality/dataentry/LoadQualityScoreDetailsAction.java 2014-02-05 10:49:02 +0000 @@ -43,21 +43,23 @@ public class LoadQualityScoreDetailsAction implements Action { - private final static String TARIFF_SETTING_AUTHORITY = "TARIFF_SETTING_AUTHORITY"; - private final static String QUALITY_MAX_DATAELEMENT = "QUALITY_MAX_DATAELEMENT"; + private final static String TARIFF_SETTING_AUTHORITY = "TARIFF_SETTING_AUTHORITY"; + + private final static String QUALITY_MAX_DATAELEMENT = "QUALITY_MAX_DATAELEMENT"; + // ------------------------------------------------------------------------- // Dependencies // ------------------------------------------------------------------------- private QualityMaxValueService qualityMaxValueService; - - public void setQualityMaxValueService( - QualityMaxValueService qualityMaxValueService) { - this.qualityMaxValueService = qualityMaxValueService; - } + + public void setQualityMaxValueService( QualityMaxValueService qualityMaxValueService ) + { + this.qualityMaxValueService = qualityMaxValueService; + } private DataSetService dataSetService; - + public void setDataSetService( DataSetService dataSetService ) { this.dataSetService = dataSetService; @@ -69,159 +71,169 @@ { this.organisationUnitService = organisationUnitService; } - + private LookupService lookupService; - + public void setLookupService( LookupService lookupService ) { this.lookupService = lookupService; } - + private ConstantService constantService; public void setConstantService( ConstantService constantService ) { this.constantService = constantService; } - + private DataValueService dataValueService; - - public void setDataValueService(DataValueService dataValueService) + + public void setDataValueService( DataValueService dataValueService ) { - this.dataValueService = dataValueService; - } - + this.dataValueService = dataValueService; + } + private DataElementCategoryService categoryService; public void setCategoryService( DataElementCategoryService categoryService ) { this.categoryService = categoryService; } - + // ------------------------------------------------------------------------- // Input / Output // ------------------------------------------------------------------------- - - private String orgUnitId; - - public void setOrgUnitId(String orgUnitId) { - this.orgUnitId = orgUnitId; - } - - private String dataSetId; - - public void setDataSetId(String dataSetId) { - this.dataSetId = dataSetId; - } - - private String selectedPeriodId; - + + private String orgUnitId; + + public void setOrgUnitId( String orgUnitId ) + { + this.orgUnitId = orgUnitId; + } + + private String dataSetId; + + public void setDataSetId( String dataSetId ) + { + this.dataSetId = dataSetId; + } + + private String selectedPeriodId; + public void setSelectedPeriodId( String selectedPeriodId ) { this.selectedPeriodId = selectedPeriodId; } - - List dataElements = new ArrayList(); - - public List getDataElements() { - return dataElements; - } - - private SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "yyyy-MM-dd" );; - - public SimpleDateFormat getSimpleDateFormat() { - return simpleDateFormat; - } - - private Map qualityMaxValueMap = new HashMap(); - - public Map getQualityMaxValueMap() { - return qualityMaxValueMap; - } - - private Map dataValueMap = new HashMap(); - - public Map getDataValueMap() { - return dataValueMap; - } - + + List dataElements = new ArrayList(); + + public List getDataElements() + { + return dataElements; + } + + private SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "yyyy-MM-dd" );; + + public SimpleDateFormat getSimpleDateFormat() + { + return simpleDateFormat; + } + + private Map qualityMaxValueMap = new HashMap(); + + public Map getQualityMaxValueMap() + { + return qualityMaxValueMap; + } + + private Map dataValueMap = new HashMap(); + + public Map getDataValueMap() + { + return dataValueMap; + } + // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- - public String execute() throws Exception + public String execute() + throws Exception { - SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd" ); - - Period period = PeriodType.getPeriodFromIsoString( selectedPeriodId ); - Constant tariff_authority = constantService.getConstantByName( TARIFF_SETTING_AUTHORITY ); - int tariff_setting_authority = 0; - if ( tariff_authority == null ) - { - tariff_setting_authority = 1; - - } - else - { - tariff_setting_authority = (int) tariff_authority.getValue(); - - } - Constant qualityMaxDataElement = constantService.getConstantByName( QUALITY_MAX_DATAELEMENT ); + SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd" ); + + Period period = PeriodType.getPeriodFromIsoString( selectedPeriodId ); + Constant tariff_authority = constantService.getConstantByName( TARIFF_SETTING_AUTHORITY ); + int tariff_setting_authority = 0; + if ( tariff_authority == null ) + { + tariff_setting_authority = 1; + + } + else + { + tariff_setting_authority = (int) tariff_authority.getValue(); + + } + Constant qualityMaxDataElement = constantService.getConstantByName( QUALITY_MAX_DATAELEMENT ); OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( orgUnitId ); - DataSet dataSet = dataSetService.getDataSet(Integer.parseInt(dataSetId)); - + DataSet dataSet = dataSetService.getDataSet( Integer.parseInt( dataSetId ) ); + DataElementCategoryOptionCombo optionCombo = categoryService.getDefaultDataElementCategoryOptionCombo(); - - List dataElementList = new ArrayList(dataSet.getDataElements()); - for( DataElement de : dataElementList ) + + List dataElementList = new ArrayList( dataSet.getDataElements() ); + for ( DataElement de : dataElementList ) { - Set attrValueSet = new HashSet( de.getAttributeValues() ); + Set attrValueSet = new HashSet( de.getAttributeValues() ); for ( AttributeValue attValue : attrValueSet ) { - if(attValue.getAttribute().getId() == qualityMaxDataElement.getValue()) - { - dataElements.add(de); - } + if ( attValue.getAttribute().getId() == qualityMaxDataElement.getValue() ) + { + dataElements.add( de ); + } } } - for(DataElement dataElement : dataElements) + for ( DataElement dataElement : dataElements ) { - List qualityMaxValues = new ArrayList(); - OrganisationUnit parentOrgunit = findParentOrgunitforTariff( organisationUnit, tariff_setting_authority ); - if( parentOrgunit != null ) - { - qualityMaxValues = new ArrayList(qualityMaxValueService.getQuanlityMaxValues(parentOrgunit, dataElement)) ; - } - DataValue dataValue = dataValueService.getDataValue(dataElement, period, organisationUnit, optionCombo); - for (QualityMaxValue qualityMaxValue : qualityMaxValues) - { - - if(qualityMaxValue.getStartDate().getTime() <= period.getStartDate().getTime() && period.getEndDate().getTime() <= qualityMaxValue.getEndDate().getTime() ) - { - qualityMaxValueMap.put(dataElement.getId(), qualityMaxValue); - if(dataValue != null) - { - dataValueMap.put(dataElement.getId(), dataValue ); - } - - System.out.println("In Quality Data Value"); - break; - } - } + List qualityMaxValues = new ArrayList(); + OrganisationUnit parentOrgunit = findParentOrgunitforTariff( organisationUnit, tariff_setting_authority ); + if ( parentOrgunit != null ) + { + qualityMaxValues = new ArrayList( qualityMaxValueService.getQuanlityMaxValues( + parentOrgunit, dataElement ) ); + } + DataValue dataValue = dataValueService.getDataValue( dataElement, period, organisationUnit, optionCombo ); + for ( QualityMaxValue qualityMaxValue : qualityMaxValues ) + { + + if ( qualityMaxValue.getStartDate().getTime() <= period.getStartDate().getTime() + && period.getEndDate().getTime() <= qualityMaxValue.getEndDate().getTime() ) + { + qualityMaxValueMap.put( dataElement.getId(), qualityMaxValue ); + if ( dataValue != null ) + { + dataValueMap.put( dataElement.getId(), dataValue ); + } + + System.out.println( "In Quality Data Value" ); + break; + } + } } - Collections.sort(dataElements); + Collections.sort( dataElements ); return SUCCESS; } - public OrganisationUnit findParentOrgunitforTariff( OrganisationUnit organisationUnit, Integer tariffOULevel ) - { - Integer ouLevel = organisationUnitService.getLevelOfOrganisationUnit( organisationUnit.getId() ); - if( tariffOULevel == ouLevel ) - { - return organisationUnit; - } - else - { - return findParentOrgunitforTariff( organisationUnit.getParent(), tariffOULevel ); - } - } + + public OrganisationUnit findParentOrgunitforTariff( OrganisationUnit organisationUnit, Integer tariffOULevel ) + { + Integer ouLevel = organisationUnitService.getLevelOfOrganisationUnit( organisationUnit.getId() ); + if ( tariffOULevel == ouLevel ) + { + return organisationUnit; + } + else + { + return findParentOrgunitforTariff( organisationUnit.getParent(), tariffOULevel ); + } + } } \ No newline at end of file === modified file 'local/in/dhis-web-maintenance-pbf/src/main/resources/META-INF/dhis/beans.xml' --- local/in/dhis-web-maintenance-pbf/src/main/resources/META-INF/dhis/beans.xml 2014-01-23 12:25:55 +0000 +++ local/in/dhis-web-maintenance-pbf/src/main/resources/META-INF/dhis/beans.xml 2014-02-05 10:49:02 +0000 @@ -235,7 +235,7 @@ - + @@ -247,5 +247,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file === modified file 'local/in/dhis-web-maintenance-pbf/src/main/resources/struts.xml' --- local/in/dhis-web-maintenance-pbf/src/main/resources/struts.xml 2014-01-23 12:25:55 +0000 +++ local/in/dhis-web-maintenance-pbf/src/main/resources/struts.xml 2014-02-05 10:49:02 +0000 @@ -171,6 +171,43 @@ /dhis-web-maintenance-pbf/status.vm plainTextError + + + + /main.vm + /dhis-web-maintenance-pbf/aggregationQueryList.vm + /dhis-web-maintenance-pbf/menu.vm + javascript/aggregationEngine.js + + + + /main.vm + /dhis-web-maintenance-pbf/addAggregationQuery.vm + /dhis-web-maintenance-pbf/menu.vm + javascript/aggregationEngine.js + + + + /content.vm + /dhis-web-maintenance-pbf/addAggregationParam.vm + + + + aggregationQueryList.action + + + + /main.vm + /dhis-web-maintenance-pbf/runAggregationQueryForm.vm + /dhis-web-maintenance-pbf/menu.vm + + + + /main.vm + /dhis-web-maintenance-pbf/runAggregationQueryResult.vm + /dhis-web-maintenance-pbf/menu.vm + + \ No newline at end of file === added file 'local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/addAggregationParam.vm' --- local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/addAggregationParam.vm 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/addAggregationParam.vm 2014-02-05 10:49:02 +0000 @@ -0,0 +1,33 @@ + + +#if( $aggTypeId == "OVERALL UNADJUSTED PBF AMOUNT" ) + + + + + + +
PBFType - Tariff + +
+ +#elseif( $aggTypeId == "OVERALL QUALITY SCORE" ) + + + + + + +
PBFType - Quality + +
+ +#end === added file 'local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/addAggregationQuery.vm' --- local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/addAggregationQuery.vm 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/addAggregationQuery.vm 2014-02-05 10:49:02 +0000 @@ -0,0 +1,64 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
$i18n.getString( "aggregation_query_builder_detail" )
+ +
+ +
+
+
+ +

+ + +

+ +
=== added file 'local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/aggregationQueryList.vm' --- local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/aggregationQueryList.vm 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/aggregationQueryList.vm 2014-02-05 10:49:02 +0000 @@ -0,0 +1,67 @@ + + + +

$i18n.getString( 'ccei_aggregation_query_builder_management' ) #openHelp( "patient_aggregation_query_builder" )

+ + + + + + + + + +
+ + + + +
+ +
+ + + + + + + + + #foreach( $aggregationCondition in $aggregationConditions ) + + + + #end + +
$i18n.getString( "name" )
$encoder.htmlEncode( $!aggregationCondition.displayName )
+
+
+
+ $i18n.getString( 'hide_details' ) +
+


+


+


+


+


+


+
+
=== added file 'local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/javascript/aggregationEngine.js' --- local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/javascript/aggregationEngine.js 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/javascript/aggregationEngine.js 2014-02-05 10:49:02 +0000 @@ -0,0 +1,7 @@ + + +function showAddAggregationForm() +{ + window.location.href = 'addAggregationQueryForm.action'; +} + === modified file 'local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/javascript/pbfDataEntry.js' --- local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/javascript/pbfDataEntry.js 2014-01-18 12:25:59 +0000 +++ local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/javascript/pbfDataEntry.js 2014-02-05 10:49:02 +0000 @@ -195,7 +195,7 @@ { var code = json.c; - alert(code) + //alert(code) if ( code == '0' || code == 0) // Value successfully saved on server { markValue( fieldId, COLOR_GREEN ); === modified file 'local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/menu.vm' --- local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/menu.vm 2014-01-22 11:29:04 +0000 +++ local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/menu.vm 2014-02-05 10:49:02 +0000 @@ -11,3 +11,9 @@
  • $i18n.getString( "bank_details_management" )
  • + +

    $i18n.getString( "aggregation_builder" )

    + === added file 'local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/runAggregationQueryForm.vm' --- local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/runAggregationQueryForm.vm 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/runAggregationQueryForm.vm 2014-02-05 10:49:02 +0000 @@ -0,0 +1,18 @@ +

    $i18n.getString( "manual_aggregation" )

    + +
    + + + + + + + + +
    + #organisationUnitSelectionTree( false, true, false ) +
    + +
    + +
    === added file 'local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/runAggregationQueryResult.vm' --- local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/runAggregationQueryResult.vm 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/runAggregationQueryResult.vm 2014-02-05 10:49:02 +0000 @@ -0,0 +1,2 @@ + +$importStatus \ No newline at end of file