dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #14908
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5188: Add DataElement Comment and merge from 2.3 in Data Analyser
------------------------------------------------------------
revno: 5188
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-11-22 12:50:09 +0530
message:
Add DataElement Comment and merge from 2.3 in Data Analyser
added:
local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateCommentResultAction.java
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/commentResult.vm
modified:
local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateCommentsResultAction.java
local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/nr/action/GenerateNullReporterResultAction.java
local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ta/action/GenerateTabularAnalysisResultAction.java
local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml
local/in/dhis-web-dashboard/src/main/resources/struts.xml
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/css/StylesForTags.css
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dataStatusFront.vm
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/ds.js
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menu.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
=== added file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateCommentResultAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateCommentResultAction.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateCommentResultAction.java 2011-11-22 07:20:09 +0000
@@ -0,0 +1,444 @@
+package org.hisp.dhis.dataanalyser.ds.action;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.amplecode.quick.StatementManager;
+import org.hisp.dhis.dataanalyser.util.DashBoardService;
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementCategoryCombo;
+import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
+import org.hisp.dhis.dataelement.DataElementService;
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.datavalue.DataValue;
+import org.hisp.dhis.datavalue.DataValueService;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
+import org.hisp.dhis.organisationunit.comparator.OrganisationUnitShortNameComparator;
+import org.hisp.dhis.period.Period;
+import org.hisp.dhis.period.PeriodService;
+import org.hisp.dhis.period.PeriodType;
+
+import com.opensymphony.xwork2.Action;
+
+public class GenerateCommentResultAction implements Action
+{
+ // ---------------------------------------------------------------
+ // Dependencies
+ // ---------------------------------------------------------------
+ private DataSetService dataSetService;
+
+ public void setDataSetService( DataSetService dataSetService )
+ {
+ this.dataSetService = dataSetService;
+ }
+
+ private PeriodService periodService;
+
+ public void setPeriodService( PeriodService periodService )
+ {
+ this.periodService = periodService;
+ }
+
+ private OrganisationUnitService organisationUnitService;
+
+ public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
+ {
+ this.organisationUnitService = organisationUnitService;
+ }
+
+ private DataElementService dataElementService;
+
+ public void setDataElementService( DataElementService dataElementService )
+ {
+ this.dataElementService = dataElementService;
+ }
+
+ private DataValueService dataValueService;
+
+ public void setDataValueService( DataValueService dataValueService )
+ {
+ this.dataValueService = dataValueService;
+ }
+
+ private DashBoardService dashBoardService;
+
+ public void setDashBoardService( DashBoardService dashBoardService )
+ {
+ this.dashBoardService = dashBoardService;
+ }
+
+ private StatementManager statementManager;
+
+ public void setStatementManager( StatementManager statementManager )
+ {
+ this.statementManager = statementManager;
+ }
+ // ---------------------------------------------------------------
+ // Input/Output Parameters
+ // ---------------------------------------------------------------
+
+
+
+
+
+
+
+ private String selectedDataSets;
+
+ public void setSelectedDataSets( String selectedDataSets )
+ {
+ this.selectedDataSets = selectedDataSets;
+ }
+
+ private String includeZeros;
+
+ public void setIncludeZeros( String includeZeros )
+ {
+ this.includeZeros = includeZeros;
+ }
+
+ public String getIncludeZeros()
+ {
+ return includeZeros;
+ }
+
+ private String selectedButton;
+
+ public void setselectedButton( String selectedButton )
+ {
+ this.selectedButton = selectedButton;
+ }
+
+ public String getSelectedButton()
+ {
+ return selectedButton;
+ }
+
+ private String immChildOption;
+
+ public String getImmChildOption()
+ {
+ return immChildOption;
+ }
+
+ public void setImmChildOption( String immChildOption )
+ {
+ this.immChildOption = immChildOption;
+ }
+
+ private int sDateLB;
+
+ public void setSDateLB( int dateLB )
+ {
+ sDateLB = dateLB;
+ }
+
+ public int getSDateLB()
+ {
+ return sDateLB;
+ }
+
+ private int eDateLB;
+
+ public void setEDateLB( int dateLB )
+ {
+ eDateLB = dateLB;
+ }
+
+ public int getEDateLB()
+ {
+ return eDateLB;
+ }
+
+ private String dataSetName;
+
+ public String getDataSetName()
+ {
+ return dataSetName;
+ }
+
+ private Collection<Period> periodList;
+
+ public Collection<Period> getPeriodList()
+ {
+ return periodList;
+ }
+
+ private List<OrganisationUnit> orgUnitList;
+
+ public List<OrganisationUnit> getOrgUnitList()
+ {
+ return orgUnitList;
+ }
+
+ private String facilityLB;
+
+ public void setFacilityLB( String facilityLB )
+ {
+ this.facilityLB = facilityLB;
+ }
+
+ private List<String> orgUnitListCB;
+
+ public void setOrgUnitListCB( List<String> orgUnitListCB )
+ {
+ this.orgUnitListCB = orgUnitListCB;
+ }
+
+ private List<String> periodNameList;
+
+ public List<String> getPeriodNameList()
+ {
+ return periodNameList;
+ }
+
+ private Map<OrganisationUnit, List<DataElement>> ouMapDataElement;
+
+ public Map<OrganisationUnit, List<DataElement>> getOuMapDataElement()
+ {
+ return ouMapDataElement;
+ }
+
+ private Map<OrganisationUnit, List<String>> ouMapComment;
+
+ public Map<OrganisationUnit, List<String>> getOuMapComment()
+ {
+ return ouMapComment;
+ }
+
+ private List<String> comments;
+
+ public List<String> getComments()
+ {
+ return comments;
+ }
+
+ private int dataSetMemberCount;
+
+ public int getDataSetMemberCount()
+ {
+ return dataSetMemberCount;
+ }
+ /*
+ private Map<String , List<DataElement>> ouPeriodDataElementMap;
+
+ public Map<String, List<DataElement>> getOuPeriodDataElementMap()
+ {
+ return ouPeriodDataElementMap;
+ }
+ */
+ private Map<String , List<String>> ouPeriodCommentMap;
+
+ public Map<String, List<String>> getOuPeriodCommentMap()
+ {
+ return ouPeriodCommentMap;
+ }
+
+ private Map<String , List<String>> ouPeriodDataElementOptionComboMap;
+
+ public Map<String, List<String>> getOuPeriodDataElementOptionComboMap()
+ {
+ return ouPeriodDataElementOptionComboMap;
+ }
+
+ String comment = "";
+ // ---------------------------------------------------------------
+ // Action Implementation
+ // ---------------------------------------------------------------
+ public String execute() throws Exception
+ {
+ statementManager.initialise();
+
+ ouMapDataElement = new HashMap<OrganisationUnit, List<DataElement>>();
+ ouMapComment = new HashMap<OrganisationUnit, List<String>>();
+ comments = new ArrayList<String>();
+
+ //ouPeriodDataElementMap = new HashMap<String, List<DataElement>>();
+ ouPeriodCommentMap = new HashMap<String, List<String>>();
+ ouPeriodDataElementOptionComboMap = new HashMap<String, List<String>>();
+
+
+ // DataSet Related Info
+ DataSet dataSet = dataSetService.getDataSet( Integer.parseInt( selectedDataSets ) );
+ dataSetName = dataSet.getName();
+
+ // Period Related Info
+ Period startPeriod = periodService.getPeriod( sDateLB );
+ Period endPeriod = periodService.getPeriod( eDateLB );
+
+ PeriodType dataSetPeriodType = dataSet.getPeriodType();
+ periodList = new ArrayList<Period>( periodService.getPeriodsBetweenDates( dataSetPeriodType, startPeriod.getStartDate(), endPeriod.getEndDate() ) );
+
+ periodNameList = new ArrayList<String>();
+ periodNameList = dashBoardService.getPeriodNamesByPeriodType( dataSetPeriodType, periodList );
+
+ // Collection<DataElement> dataElements = dataSet.getDataElements();
+ List<DataElement> dataElementList = new ArrayList<DataElement>( dataSet.getDataElements() );
+
+ List<DataElement> deList = new ArrayList<DataElement>();
+ List<DataElementCategoryOptionCombo> categoryOptionCombos = new ArrayList<DataElementCategoryOptionCombo>();
+ dataSetMemberCount = 0;
+ for ( DataElement dataElement : dataElementList )
+ {
+ DataElement de1 = dataElementService.getDataElement( dataElement.getId() );
+ dataSetMemberCount += de1.getCategoryCombo().getOptionCombos().size();
+
+ DataElementCategoryCombo dataElementCategoryCombo = dataElement.getCategoryCombo();
+
+ List<DataElementCategoryOptionCombo> optionCombos = new ArrayList<DataElementCategoryOptionCombo>( dataElementCategoryCombo.getOptionCombos() );
+ categoryOptionCombos.addAll( optionCombos );
+ deList.add( de1 );
+ }
+
+ // OrgUnit Related Info
+ OrganisationUnit selectedOrgUnit = new OrganisationUnit();
+ orgUnitList = new ArrayList<OrganisationUnit>();
+ if ( facilityLB.equals( "children" ) )
+ {
+ selectedOrgUnit = organisationUnitService.getOrganisationUnit( Integer.parseInt( orgUnitListCB.get( 0 ) ) );
+ orgUnitList = getChildOrgUnitTree( selectedOrgUnit );
+ }
+ else if ( facilityLB.equals( "immChildren" ) )
+ {
+ @SuppressWarnings( "unused" )
+ int number;
+
+ selectedOrgUnit = organisationUnitService.getOrganisationUnit( Integer.parseInt( orgUnitListCB.get( 0 ) ) );
+ number = selectedOrgUnit.getChildren().size();
+ orgUnitList = new ArrayList<OrganisationUnit>();
+
+ Iterator<String> orgUnitIterator = orgUnitListCB.iterator();
+ while ( orgUnitIterator.hasNext() )
+ {
+ OrganisationUnit o = organisationUnitService.getOrganisationUnit( Integer
+ .parseInt( (String) orgUnitIterator.next() ) );
+ orgUnitList.add( o );
+ List<OrganisationUnit> organisationUnits = new ArrayList<OrganisationUnit>( o.getChildren() );
+ Collections.sort( organisationUnits, new OrganisationUnitShortNameComparator() );
+ orgUnitList.addAll( organisationUnits );
+ }
+ }
+ else
+ {
+ Iterator<String> orgUnitIterator = orgUnitListCB.iterator();
+ OrganisationUnit o;
+ while ( orgUnitIterator.hasNext() )
+ {
+ o = organisationUnitService.getOrganisationUnit( Integer.parseInt( orgUnitIterator.next() ) );
+ orgUnitList.add( o );
+ Collections.sort( orgUnitList, new OrganisationUnitShortNameComparator() );
+ }
+ }
+
+ System.out.println( "---Size of OrgUnit List :-- " + orgUnitList.size() );
+ // Set<OrganisationUnit> dSetSource = selDataSet.getSources();
+ List<OrganisationUnit> dSetSource = new ArrayList<OrganisationUnit>( dataSet.getSources() );
+
+ Iterator<OrganisationUnit> ouIt = orgUnitList.iterator();
+ while ( ouIt.hasNext() )
+ {
+ OrganisationUnit ou = ouIt.next();
+
+ if ( !dSetSource.contains( ou ) )
+ {
+ ouIt.remove();
+ }
+ }
+
+ System.out.println( "--- Final Size of OrgUnit List :-- " + orgUnitList.size() );
+ // for comment start
+ for ( OrganisationUnit orgUnit : orgUnitList )
+ {
+ for ( Period period : periodList )
+ {
+ List<String> tempComment = new ArrayList<String>();
+ //List<DataElement> tempDE = new ArrayList<DataElement>();
+ List<String> tempString = new ArrayList<String>();
+
+ List<DataValue> dataValues = new ArrayList<DataValue>( dataValueService.getDataValues( orgUnit, period, deList, categoryOptionCombos ));
+
+ for( DataValue dataValue : dataValues )
+ {
+ if ( dataValue != null && dataValue.getComment() != null )
+ {
+ //dataValue.getDataElement().getName();
+ //dataValue.getOptionCombo().getName();
+ comment = dataValue.getComment();
+ tempComment.add( comment );
+ //tempDE.add( dataElement );
+ tempString.add( dataValue.getDataElement().getName() + ":" + dataValue.getOptionCombo().getName() );
+ }
+ }
+ /*
+ for ( DataElement dataElement : deList )
+ {
+ DataElementCategoryCombo dataElementCategoryCombo = dataElement.getCategoryCombo();
+
+ List<DataElementCategoryOptionCombo> tempoptionCombos = new ArrayList<DataElementCategoryOptionCombo>( dataElementCategoryCombo.getOptionCombos() );
+
+ Iterator<DataElementCategoryOptionCombo> optionComboIterator = tempoptionCombos.iterator();
+ while ( optionComboIterator.hasNext() )
+ {
+ DataElementCategoryOptionCombo deOptionCombo = (DataElementCategoryOptionCombo) optionComboIterator.next();
+
+ DataValue dataValue = dataValueService.getDataValue( orgUnit, dataElement, period, deOptionCombo );
+
+
+ //String tmpComment = dataValue.getComment();
+ if ( dataValue != null && dataValue.getComment() != null )
+ {
+ //dataValue.getDataElement().getName();
+ //dataValue.getOptionCombo().getName();
+ comment = dataValue.getComment();
+ tempComment.add( comment );
+ //tempDE.add( dataElement );
+ tempString.add( dataElement.getName() + ":" + deOptionCombo.getName() );
+
+
+ //System.out.println( "OrgUnit :-- " + orgUnit.getName() + " , Period :-- " + period + " , DataElement :---" + dataElement.getName() + " , Comment :----" + comment );
+ }
+ }
+ }
+ */
+ //ouPeriodDataElementMap.put( orgUnit.getId() + ":" + period.getId() , tempDE );
+ ouPeriodCommentMap.put( orgUnit.getId() + ":" + period.getId(), tempComment );
+ ouPeriodDataElementOptionComboMap.put( orgUnit.getId() + ":" + period.getId(), tempString );
+ }
+ System.out.println( "--- Size of Comment List :-- " + ouPeriodCommentMap.size() );
+
+ //ouMapComment.put( orgUnit, tempComment );
+ //ouMapDataElement.put( orgUnit, tempDE );
+ }
+ statementManager.destroy();
+ return SUCCESS;
+ }
+
+ // Returns the OrgUnitTree for which Root is the orgUnit
+ @SuppressWarnings( "unchecked" )
+ public List<OrganisationUnit> getChildOrgUnitTree( OrganisationUnit orgUnit )
+ {
+ List<OrganisationUnit> orgUnitTree = new ArrayList<OrganisationUnit>();
+ orgUnitTree.add( orgUnit );
+
+ List<OrganisationUnit> children = new ArrayList<OrganisationUnit>( orgUnit.getChildren() );
+ Collections.sort( children, new OrganisationUnitNameComparator() );
+
+ Iterator childIterator = children.iterator();
+ OrganisationUnit child;
+ while ( childIterator.hasNext() )
+ {
+ child = (OrganisationUnit) childIterator.next();
+ orgUnitTree.addAll( getChildOrgUnitTree( child ) );
+ }
+ return orgUnitTree;
+ }// getChildOrgUnitTree end
+
+}
=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateCommentsResultAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateCommentsResultAction.java 2011-04-27 17:15:13 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateCommentsResultAction.java 2011-11-22 07:20:09 +0000
@@ -15,7 +15,6 @@
import org.hisp.dhis.dataanalyser.util.DashBoardService;
import org.hisp.dhis.dataelement.DataElement;
-import org.hisp.dhis.dataelement.DataElementService;
import org.hisp.dhis.dataset.DataSet;
import org.hisp.dhis.dataset.DataSetService;
import org.hisp.dhis.datavalue.DataValueService;
@@ -88,14 +87,14 @@
{
this.dataValueService = dataValueService;
}
-
+/*
private DataElementService dataElementService;
public void setDataElementService( DataElementService dataElementService )
{
this.dataElementService = dataElementService;
}
-
+*/
// ---------------------------------------------------------------
// Output Parameters
// ---------------------------------------------------------------
@@ -409,7 +408,7 @@
periodIterator = periodList.iterator();
Period p;
- Collection dataValueResult;
+ //Collection dataValueResult;
double dataStatusPercentatge;
while ( periodIterator.hasNext() )
@@ -438,10 +437,10 @@
while(rs1.next())
{
- OrganisationUnit ou = organisationUnitService.getOrganisationUnit( rs1.getInt( 1 ) );
- DataElement de = dataElementService.getDataElement( rs1.getInt( 2 ));
- Period per = periodService.getPeriod( rs1.getInt(3) );
- String tempStr = ou.getShortName() + " --- " + de.getName();
+ //OrganisationUnit ou = organisationUnitService.getOrganisationUnit( rs1.getInt( 1 ) );
+ //DataElement de = dataElementService.getDataElement( rs1.getInt( 2 ));
+ //Period per = periodService.getPeriod( rs1.getInt(3) );
+ //String tempStr = ou.getShortName() + " --- " + de.getName();
}
continue;
=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/nr/action/GenerateNullReporterResultAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/nr/action/GenerateNullReporterResultAction.java 2011-05-18 11:12:17 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/nr/action/GenerateNullReporterResultAction.java 2011-11-22 07:20:09 +0000
@@ -420,8 +420,10 @@
for ( Period p : periodsColl )
{
// System.out.println(p.getStartDate() + " - "+p.getEndDate());
+
List<DataElement> resultDeList = new ArrayList<DataElement>();
-
+ // List<String> resultDeList1 = new ArrayList<String>();
+ //String comment = "";
for ( DataElement de : deList )
{
@@ -480,6 +482,7 @@
if ( aggValue < 0.0 )
{
resultDeList.add( de );
+ // resultDeList1.add( de + ":" + comment );
}
}
else
@@ -495,7 +498,7 @@
DataElementCategoryOptionCombo decoc1 = (DataElementCategoryOptionCombo) optionComboIterator.next();
DataValue dv1 = dataValueService.getDataValue( curOu, de, p, decoc1 );
-
+ //comment = dv1.getComment();
if ( dv1 != null )
{
if ( includeZeros != null )
@@ -517,6 +520,7 @@
if( flag == 0 )
{
resultDeList.add( de );
+ //resultDeList1.add( de + ":" + comment );
}
/*
=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ta/action/GenerateTabularAnalysisResultAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ta/action/GenerateTabularAnalysisResultAction.java 2011-09-03 09:46:15 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ta/action/GenerateTabularAnalysisResultAction.java 2011-11-22 07:20:09 +0000
@@ -1313,14 +1313,25 @@
}
catch( Exception e )
{
+ numValue = 0.0;
}
-
+ Double tempDenValue = 0.0;
try
{
- denValue += Double.parseDouble( getAggVal( selIndicator.getDenominator(), aggDataMap, ou.getId(), periodId ) );
+ //denValue += Double.parseDouble( getAggVal( selIndicator.getDenominator(), aggDataMap, ou.getId(), periodId ) );
+ tempDenValue = Double.parseDouble( getAggVal( selIndicator.getDenominator(), aggDataMap, ou.getId(), periodId ) );
}
catch( Exception e )
{
+ tempDenValue = 1.0;
+ }
+ if( !selIndicator.getDenominator().trim().equals( "1" ) )
+ {
+ denValue += tempDenValue;
+ }
+ else
+ {
+ denValue = 1.0;
}
}
@@ -2407,14 +2418,25 @@
}
catch( Exception e )
{
+ numValue = 0.0;
}
-
+ Double tempDenValue = 0.0;
try
{
- denValue += Double.parseDouble( getAggVal( selIndicator.getDenominator(), aggDataMap, ou.getId(), periodId ) );
+ //denValue += Double.parseDouble( getAggVal( selIndicator.getDenominator(), aggDataMap, ou.getId(), periodId ) );
+ tempDenValue = Double.parseDouble( getAggVal( selIndicator.getDenominator(), aggDataMap, ou.getId(), periodId ) );
}
catch( Exception e )
{
+ tempDenValue =1.0;
+ }
+ if( !selIndicator.getDenominator().trim().equals( "1" ) )
+ {
+ denValue += tempDenValue;
+ }
+ else
+ {
+ denValue = 1.0;
}
}
@@ -2729,13 +2751,23 @@
catch( Exception e )
{
}
-
+ Double tempDenValue = 0.0;
try
{
- denValue += Double.parseDouble( getAggVal( selIndicator.getDenominator(), aggDataMap, ou.getId(), periodId ) );
+ //denValue += Double.parseDouble( getAggVal( selIndicator.getDenominator(), aggDataMap, ou.getId(), periodId ) );
+ tempDenValue = Double.parseDouble( getAggVal( selIndicator.getDenominator(), aggDataMap, ou.getId(), periodId ) );
}
catch( Exception e )
{
+ tempDenValue = 1.0;
+ }
+ if( !selIndicator.getDenominator().trim().equals( "1" ) )
+ {
+ denValue += tempDenValue;
+ }
+ else
+ {
+ denValue = 1.0;
}
}
@@ -2983,8 +3015,24 @@
}
catch( Exception e )
{
- }
-
+ numValue = 0.0;
+ }
+ if( !selIndicator.getDenominator().trim().equals( "1" ) )
+ {
+ try
+ {
+ denValue = Double.parseDouble( getAggValByOrgUnit( selIndicator.getDenominator(), aggDataMap, ou.getId() ) );
+ }
+ catch( Exception e )
+ {
+ denValue = 1.0;
+ }
+ }
+ else
+ {
+ denValue = 1.0;
+ }
+ /*
try
{
denValue = Double.parseDouble( getAggValByOrgUnit( selIndicator.getDenominator(), aggDataMap, ou.getId() ) );
@@ -2992,7 +3040,7 @@
catch( Exception e )
{
}
-
+ */
try
{
if( denValue != 0.0 )
@@ -3184,8 +3232,24 @@
}
catch( Exception e )
{
- }
-
+ numValue = 0.0;
+ }
+ if( !selIndicator.getDenominator().trim().equals( "1" ) )
+ {
+ try
+ {
+ denValue = Double.parseDouble( reportService.getAggVal( selIndicator.getDenominator(), aggDataMap ) );
+ }
+ catch( Exception e )
+ {
+ denValue = 1.0;
+ }
+ }
+ else
+ {
+ denValue = 1.0;
+ }
+ /*
try
{
denValue = Double.parseDouble( reportService.getAggVal( selIndicator.getDenominator(), aggDataMap ) );
@@ -3193,7 +3257,7 @@
catch( Exception e )
{
}
-
+ */
try
{
if( denValue != 0.0 )
@@ -3387,7 +3451,6 @@
List<Integer> orgUnitIds = new ArrayList<Integer>( getIdentifiers(OrganisationUnit.class, ouChildList ) );
orgUnitIdsByComma = getCommaDelimitedString( orgUnitIds );
Map<String, String> aggDataMap = new HashMap<String, String>( reportService.getAggDataFromDataValueTable( orgUnitIdsByComma, dataElementIdsByComma, periodIdsByComma ) );
-
colCount = c1;
int deListCount = 0;
int indListCount = 0;
@@ -3417,8 +3480,26 @@
}
catch( Exception e )
{
- }
-
+ numValue = 0.0;
+ }
+
+ if( !selIndicator.getDenominator().trim().equals( "1" ) )
+ {
+ try
+ {
+ denValue = Double.parseDouble( reportService.getAggVal( selIndicator.getDenominator(), aggDataMap ) );
+ }
+ catch( Exception e )
+ {
+ denValue = 1.0;
+ }
+ }
+ else
+ {
+ denValue = 1.0;
+ }
+
+ /*
try
{
denValue = Double.parseDouble( reportService.getAggVal( selIndicator.getDenominator(), aggDataMap ) );
@@ -3426,7 +3507,7 @@
catch( Exception e )
{
}
-
+ */
try
{
if( denValue != 0.0 )
@@ -3645,8 +3726,24 @@
}
catch( Exception e )
{
- }
-
+ numValue = 0.0;
+ }
+ if( !selIndicator.getDenominator().trim().equals( "1" ) )
+ {
+ try
+ {
+ denValue = Double.parseDouble( reportService.getAggVal( selIndicator.getDenominator(), aggDataMap ) );
+ }
+ catch( Exception e )
+ {
+ denValue = 1.0;
+ }
+ }
+ else
+ {
+ denValue = 1.0;
+ }
+ /*
try
{
denValue = Double.parseDouble( reportService.getAggVal( selIndicator.getDenominator(), aggDataMap ) );
@@ -3654,6 +3751,7 @@
catch( Exception e )
{
}
+ */
try
{
@@ -3907,6 +4005,7 @@
Double numValue = 0.0;
Double denValue = 0.0;
Double indValue = 0.0;
+
for( Integer periodId : periodIds )
{
try
@@ -3915,14 +4014,25 @@
}
catch( Exception e )
{
+ numValue = 0.0;
}
-
+ Double tempDenValue = 0.0;
try
{
- denValue += Double.parseDouble( getAggValByPeriod( selIndicator.getDenominator(), aggDataMap, periodId ) );
+ // denValue += Double.parseDouble( getAggValByPeriod( selIndicator.getDenominator(), aggDataMap, periodId ) );
+ tempDenValue = Double.parseDouble( getAggValByPeriod( selIndicator.getDenominator(), aggDataMap, periodId ) );
}
catch( Exception e )
{
+ tempDenValue = 1.0;
+ }
+ if ( !selIndicator.getDenominator().trim().equals( "1" ) )
+ {
+ denValue += tempDenValue;
+ }
+ else
+ {
+ denValue = 1.0;
}
}
@@ -4236,14 +4346,25 @@
}
catch( Exception e )
{
+ numValue = 0.0;
}
-
+ Double tempDenValue = 0.0;
try
{
- denValue += Double.parseDouble( getAggValByPeriod( selIndicator.getDenominator(), aggDataMap, periodId ) );
+ //denValue += Double.parseDouble( getAggValByPeriod( selIndicator.getDenominator(), aggDataMap, periodId ) );
+ tempDenValue = Double.parseDouble( getAggValByPeriod( selIndicator.getDenominator(), aggDataMap, periodId ) );
}
catch( Exception e )
{
+ tempDenValue = 1.0;
+ }
+ if ( !selIndicator.getDenominator().trim().equals( "1" ) )
+ {
+ denValue += tempDenValue;
+ }
+ else
+ {
+ denValue = 1.0;
}
}
@@ -4530,14 +4651,25 @@
}
catch( Exception e )
{
+ numValue = 0.0;
}
-
+ Double tempDenValue = 0.0;
try
{
- denValue += Double.parseDouble( getAggValByPeriod( selIndicator.getDenominator(), aggDataMap, periodId ) );
+ //denValue += Double.parseDouble( getAggValByPeriod( selIndicator.getDenominator(), aggDataMap, periodId ) );
+ tempDenValue = Double.parseDouble( getAggValByPeriod( selIndicator.getDenominator(), aggDataMap, periodId ) );
}
catch( Exception e )
{
+ tempDenValue = 1.0;
+ }
+ if ( !selIndicator.getDenominator().trim().equals( "1" ) )
+ {
+ denValue += tempDenValue;
+ }
+ else
+ {
+ denValue = 1.0;
}
}
@@ -4859,14 +4991,26 @@
}
catch( Exception e )
{
+ numValue = 0.0;
}
+ Double tempDenValue = 0.0;
try
{
- denValue += Double.parseDouble( getAggVal( selIndicator.getDenominator(), aggDataMap, ou.getId(), periodId ) );
+ //denValue += Double.parseDouble( getAggVal( selIndicator.getDenominator(), aggDataMap, ou.getId(), periodId ) );
+ tempDenValue = Double.parseDouble( getAggVal( selIndicator.getDenominator(), aggDataMap, ou.getId(), periodId ) );
}
catch( Exception e )
{
+ tempDenValue = 1.0;
+ }
+ if ( !selIndicator.getDenominator().trim().equals( "1" ) )
+ {
+ denValue += tempDenValue;
+ }
+ else
+ {
+ denValue = 1.0;
}
}
@@ -5181,14 +5325,25 @@
}
catch( Exception e )
{
+ numValue = 0.0;
}
-
+ Double tempDenValue = 0.0;
try
{
- denValue += Double.parseDouble( getAggVal( selIndicator.getDenominator(), aggDataMap, ou.getId(), periodId ) );
+ //denValue += Double.parseDouble( getAggVal( selIndicator.getDenominator(), aggDataMap, ou.getId(), periodId ) );
+ tempDenValue = Double.parseDouble( getAggVal( selIndicator.getDenominator(), aggDataMap, ou.getId(), periodId ) );
}
catch( Exception e )
{
+ tempDenValue = 1.0;
+ }
+ if ( !selIndicator.getDenominator().trim().equals( "1" ) )
+ {
+ denValue += tempDenValue;
+ }
+ else
+ {
+ denValue = 1.0;
}
}
@@ -5478,14 +5633,25 @@
}
catch( Exception e )
{
+ numValue = 0.0;
}
-
+ Double tempDenValue = 0.0;
try
{
- denValue += Double.parseDouble( getAggVal( selIndicator.getDenominator(), aggDataMap, ou.getId(), periodId ) );
+ //denValue += Double.parseDouble( getAggVal( selIndicator.getDenominator(), aggDataMap, ou.getId(), periodId ) );
+ tempDenValue = Double.parseDouble( getAggVal( selIndicator.getDenominator(), aggDataMap, ou.getId(), periodId ) );
}
catch( Exception e )
{
+ tempDenValue = 1.0;
+ }
+ if( !selIndicator.getDenominator().trim().equals( "1" ) )
+ {
+ denValue += tempDenValue;
+ }
+ else
+ {
+ denValue = 1.0;
}
}
@@ -5767,8 +5933,24 @@
}
catch( Exception e )
{
- }
-
+ numValue = 0.0;
+ }
+ if( !selIndicator.getDenominator().trim().equals( "1" ) )
+ {
+ try
+ {
+ denValue = Double.parseDouble( getAggValByOrgUnit( selIndicator.getDenominator(), aggDataMap, ou.getId() ) );
+ }
+ catch( Exception e )
+ {
+ denValue = 1.0;
+ }
+ }
+ else
+ {
+ denValue = 1.0;
+ }
+ /*
try
{
denValue = Double.parseDouble( getAggValByOrgUnit( selIndicator.getDenominator(), aggDataMap, ou.getId() ) );
@@ -5776,7 +5958,7 @@
catch( Exception e )
{
}
-
+ */
try
{
if( denValue != 0.0 )
@@ -5998,8 +6180,24 @@
}
catch( Exception e )
{
- }
-
+ numValue = 0.0;
+ }
+ if( !selIndicator.getDenominator().trim().equals( "1" ) )
+ {
+ try
+ {
+ denValue = Double.parseDouble( getAggValByOrgUnit( selIndicator.getDenominator(), aggDataMap, ou.getId() ) );
+ }
+ catch( Exception e )
+ {
+ denValue = 1.0;
+ }
+ }
+ else
+ {
+ denValue = 1.0;
+ }
+ /*
try
{
denValue = Double.parseDouble( getAggValByOrgUnit( selIndicator.getDenominator(), aggDataMap, ou.getId() ) );
@@ -6007,7 +6205,7 @@
catch( Exception e )
{
}
-
+ */
try
{
if( denValue != 0.0 )
@@ -6201,8 +6399,24 @@
}
catch( Exception e )
{
- }
-
+ numValue = 0.0;
+ }
+ if( !selIndicator.getDenominator().trim().equals( "1" ) )
+ {
+ try
+ {
+ denValue = Double.parseDouble( getAggValByOrgUnit( selIndicator.getDenominator(), aggDataMap, ou.getId() ) );
+ }
+ catch( Exception e )
+ {
+ denValue = 1.0;
+ }
+ }
+ else
+ {
+ denValue = 1.0;
+ }
+ /*
try
{
denValue = Double.parseDouble( getAggValByOrgUnit( selIndicator.getDenominator(), aggDataMap, ou.getId() ) );
@@ -6210,7 +6424,7 @@
catch( Exception e )
{
}
-
+ */
try
{
if( denValue != 0.0 )
=== modified file 'local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml 2011-11-03 06:07:39 +0000
+++ local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml 2011-11-22 07:20:09 +0000
@@ -682,7 +682,23 @@
</property>
</bean>
-
+<!-- View Comment -->
+ <bean id="org.hisp.dhis.dataanalyser.ds.action.GenerateCommentResultAction"
+ class="org.hisp.dhis.dataanalyser.ds.action.GenerateCommentResultAction" scope="prototype">
+ <property name="statementManager" ref="statementManager"/>
+ <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService">
+ </property>
+ <property name="periodService" ref="org.hisp.dhis.period.PeriodService">
+ </property>
+ <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService">
+ </property>
+ <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService">
+ </property>
+ <property name="dataValueService" ref="org.hisp.dhis.datavalue.DataValueService">
+ </property>
+ <property name="dashBoardService" ref="org.hisp.dhis.dataanalyser.util.DashBoardService">
+ </property>
+ </bean>
=== modified file 'local/in/dhis-web-dashboard/src/main/resources/struts.xml'
--- local/in/dhis-web-dashboard/src/main/resources/struts.xml 2011-11-15 06:13:46 +0000
+++ local/in/dhis-web-dashboard/src/main/resources/struts.xml 2011-11-22 07:20:09 +0000
@@ -485,6 +485,15 @@
/dhis-web-dashboard/responsePeriodForDataSetWise.vm</result>
<param name="onExceptionReturn">plainTextError</param>
</action>
+
+<!-- View Comment -->
+
+ <action name="commentResult"
+ class="org.hisp.dhis.dataanalyser.ds.action.GenerateCommentResultAction">
+ <result name="success" type="velocity">/dhis-web-dashboard/commentResult.vm</result>
+ <param name="javascripts">javascript/ds.js,javascript/hashtable.js</param>
+ <param name="stylesheets">css/StylesForTags.css</param>
+ </action>
<!-- DataStatus For Mobile start-->
=== added file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/commentResult.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/commentResult.vm 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/commentResult.vm 2011-11-22 07:20:09 +0000
@@ -0,0 +1,72 @@
+<html>
+ <head>
+ <title>Data Element Comment Result</title>
+ <link type="text/css" rel="stylesheet" media="screen" href="css/StylesForTags.css"></link>
+<script>
+ function exportDataStatusResultToWorkBook()
+ {
+ document.getElementById('htmlCode').value = document.getElementById('formResult').innerHTML;
+ return true;
+ }
+</script>
+ </head>
+ <body>
+ #if( "$!ouPeriodDataElementOptionComboMap" == "" || $ouPeriodDataElementOptionComboMap.isEmpty() || $ouPeriodDataElementOptionComboMap.size() == 0 )
+ <div align="center" class="NormalB">There are no any Data Element's comment for selected options</div>
+ #else
+
+ <form id="form1" name="form1" action="exportDataStatusToExcel.action" method="post" onsubmit="return exportDataStatusResultToWorkBook()" target="_newtab">
+ <input type="hidden" name="htmlCode" id="htmlCode" />
+ <div align="right" class="NormalB">
+ <input type="submit" name="ExportToWorkBook" value="Export To WorkBook" style="width: 160; height: 25; font-family:Arial; font-weight:bold; color:#000000">
+ </div>
+<div id="formResult">
+ <br>
+ <div align="left" class="NormalB">Data Set Name : $dataSetName and DataElement Count : $dataSetMemberCount </div>
+ <table border="1" width="100%">
+ <tr>
+ <td class="TableHeadingCellStyles" align="center" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Organisation Unit Name</strong></td>
+ #foreach($periodname in $periodNameList)
+ <td class="TableHeadingCellStyles" align="center" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1"><strong>$periodname</strong></td>
+ #end
+ </tr>
+ <!--<tr>
+ #foreach($periodname in $periodNameList)
+ <td class="TableHeadingCellStyles" align="center" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>DataElement Name ---- Comment </strong></td>
+ #end
+ </tr>-->
+ #foreach( $orgUnit in $orgUnitList )
+
+ <tr class="TableHeadingCellStyles">
+ <td class="TableHeadingCellStyles" style="border-style: dotted; border-width: 1"><Strong>$orgUnit.name</strong></td>
+ #foreach( $period in $periodList )
+ #set( $dataElementList = $ouPeriodDataElementOptionComboMap.get( "$orgUnit.id:$period.id" ) )
+ #set( $commentList = $ouPeriodCommentMap.get( "$orgUnit.id:$period.id" ) )
+ ##set( $commentList = $ouMapComment.get( $orgUnit ) )
+ ##set( $dataElementList = $ouMapDataElement.get( $orgUnit ) )
+ <td valign="top" class="Normal">
+ <table width="100%" border="1">
+ #set( $count2 = 0 )
+ #foreach( $comment in $commentList )
+ #set( $dataElement = $dataElementList.get( $count2 ) )
+ #set( $periodCount = $periodCounts.get( $count2 ) )
+ <tr>
+ <td class="DefaultFontStylesNoBold" align="left">$dataElement</td>
+ <td class="DefaultFontStylesNoBold" align="left">$comment</td>
+ #set( $count2 = $count2 + 1 )
+ </tr>
+ #end
+
+ </table>
+ </td>
+ #end
+
+ </tr>
+ #end
+
+ </table>
+</div>
+ </form>
+ #end
+ </body>
+</html>
=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/css/StylesForTags.css'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/css/StylesForTags.css 2011-05-18 11:12:17 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/css/StylesForTags.css 2011-11-22 07:20:09 +0000
@@ -33,6 +33,13 @@
cursor: default;
text-align: center;
}
+.NormalA {
+ font-family: arial, georgia, tahoma;
+ font-size: 10px;
+ white-space: nowrap;
+ cursor: default;
+ text-align: left;
+}
.NormalB {
font-family: arial, georgia, tahoma;
@@ -79,7 +86,7 @@
.DefaultFontStylesNoBold {
font-family: arial, georgia, tahoma;
- font-size: 13px;
+ font-size: 8px;
white-space: nowrap;
cursor: default;
}
=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dataStatusFront.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dataStatusFront.vm 2011-09-03 09:46:15 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dataStatusFront.vm 2011-11-22 07:20:09 +0000
@@ -59,7 +59,8 @@
<input type="button" name="ViewGroupWise" value="View DataStatus - Data Element Group" style="width:250px;height:30px;font-family: Arial; font-weight: bold; color: rgb(0, 0, 0);" onclick="textvalue('GroupWiseStatus')"/><br/><br/>
<!--<input type="button" name="ViewSummary" value="View DataSummary - Data Set" style="width:250px;height:30px;font-family: Arial; font-weight: bold; color: rgb(0, 0, 0);" onclick="textvalue('SummaryStatus')"/><br/><br/>-->
<input type="button" name="LastUpdatedStatus" value="User Details" style="width:250px;height:30px;font-family: Arial; font-weight: bold; color: rgb(0, 0, 0);" onclick="textvalue('LastUpdatedStatus')"/><br/><br/>
- <input type="button" name="ValidationStatus" value="Validation Status" style="width:250px;height:30px;font-family: Arial; font-weight: bold; color: rgb(0, 0, 0);" onclick="textvalue('ValidationStatus')"/>
+ <input type="button" name="ValidationStatus" value="Validation Status" style="width:250px;height:30px;font-family: Arial; font-weight: bold; color: rgb(0, 0, 0);" onclick="textvalue('ValidationStatus')"/><br/><br/>
+ <input type="button" name="ViewComment" value="View Comments" style="width:250px;height:30px;font-family: Arial; font-weight: bold; color: rgb(0, 0, 0);" onclick="textvalue('ViewComment')"/>
</td>
</tr>
</table>
=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/ds.js'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/ds.js 2011-09-03 09:46:15 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/ds.js 2011-11-22 07:20:09 +0000
@@ -73,7 +73,7 @@
//var dataEntryStatus = document.getElementById("usingDataEntryStatus").checked;
- //alert( dataEntryStatus );
+ //alert( summary );
if(formValidationsForDataStatus())
{
@@ -94,7 +94,7 @@
}
}
- // for Mobile summary data status
+ // for Mobile summary data status
else if(summary == "SummaryMobileStatus")
{
document.ChartGenerationForm.action = "summaryMobileStatusResult.action";
@@ -131,6 +131,12 @@
document.ChartGenerationForm.action = "lastUpdatedDataSetResult.action";
document.ChartGenerationForm.submit();
}
+ //for view Comment
+ else if(summary == "ViewComment")
+ {
+ document.ChartGenerationForm.action = "commentResult.action";
+ document.ChartGenerationForm.submit();
+ }
// for Mobile Last Updated Status
else if(summary == "LastUpdatedMobileStatus")
{
@@ -175,7 +181,6 @@
}
-
// DataStatus Form Validations
function formValidationsForDataStatus()
{
=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menu.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menu.vm 2011-11-15 09:05:27 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menu.vm 2011-11-22 07:20:09 +0000
@@ -12,7 +12,7 @@
<!-- <li><a href="motionChartForm.action">MotionChart</a></li> -->
</ul>
<li><a href="tabularAnalysisForm.action">$i18n.getString( "ta" )</a></li>
- <li><a href="viewCommentForm.action">$i18n.getString( "vc" )</a></li>
+ <!--<li><a href="viewCommentForm.action">$i18n.getString( "vc" )</a></li>-->
<li>$i18n.getString( "ds_datastatus" )</li>
<ul>
<li><a href="dataStatusMartForm.action">$i18n.getString( "ds_mart" )</a></li>