dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #12242
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3720: Added null Report Status in DataEntry Status in Data Analyser
------------------------------------------------------------
revno: 3720
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-05-24 13:55:51 +0530
message:
Added null Report Status in DataEntry Status in Data Analyser
added:
local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateNullReportResultAction.java
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/nullReportDataEntryStatusResult.vm
modified:
local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/ExportToExcelAction.java
local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateDataStatusResultAction.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/dataStatusDataSetWiseResult.vm
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dataStatusResult.vm
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/ds.js
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/ExportToExcelAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/ExportToExcelAction.java 2010-12-08 07:24:10 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/ExportToExcelAction.java 2011-05-24 08:25:51 +0000
@@ -22,7 +22,7 @@
{
return inputStream;
}
-
+
/*
private String contentType;
@@ -32,6 +32,8 @@
}
*/
+
+
private String fileName;
public String getFileName()
@@ -54,6 +56,13 @@
{
this.htmlCode = htmlCode;
}
+
+ private String htmlCode1;
+
+ public void setHtmlCode1( String htmlCode1 )
+ {
+ this.htmlCode1 = htmlCode1;
+ }
/*
private StringBuffer htmlCode;
@@ -67,13 +76,24 @@
// Action implementation
// -------------------------------------------------------------------------
+
+
public String execute() throws Exception
{
-
+ System.out.println( "Inside Excel Import Action" );
fileName = "dataStatusResult.xls";
-
- inputStream = new BufferedInputStream( new ByteArrayInputStream( htmlCode.getBytes("UTF-8") ) );
-
+
+ if( htmlCode != null )
+ {
+ inputStream = new BufferedInputStream( new ByteArrayInputStream( htmlCode.getBytes("UTF-8") ) );
+ }
+
+ else
+ {
+ inputStream = new BufferedInputStream( new ByteArrayInputStream( htmlCode1.getBytes("UTF-8") ) );
+ }
+
+ // System.out.println( "HTML CODE IS : " + htmlCode1 );
return SUCCESS;
}
=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateDataStatusResultAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateDataStatusResultAction.java 2011-04-27 17:15:13 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateDataStatusResultAction.java 2011-05-24 08:25:51 +0000
@@ -5,11 +5,9 @@
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import java.util.UUID;
import org.hibernate.SessionFactory;
@@ -434,7 +432,8 @@
}
}
- Set<OrganisationUnit> dSetSource = selDataSet.getSources();
+ //Set<OrganisationUnit> dSetSource = selDataSet.getSources();
+ List<OrganisationUnit> dSetSource = new ArrayList<OrganisationUnit>( selDataSet.getSources());
orgUnitInfo = "-1";
Iterator<OrganisationUnit> ouIt = orgUnitList.iterator();
while ( ouIt.hasNext() )
@@ -494,9 +493,10 @@
Iterator<OrganisationUnit> orgUnitListIterator = orgUnitList.iterator();
OrganisationUnit o;
- Set<OrganisationUnit> dso = new HashSet<OrganisationUnit>();
+ //Set<OrganisationUnit> dso = new HashSet<OrganisationUnit>();
+ List<OrganisationUnit> dso = new ArrayList<OrganisationUnit>( selDataSet.getSources());
Iterator<Period> periodIterator;
- dso = selDataSet.getSources();
+ //dso = selDataSet.getSources();
while ( orgUnitListIterator.hasNext() )
{
@@ -508,7 +508,15 @@
if ( minOULevel > organisationUnitService.getLevelOfOrganisationUnit( o ) )
minOULevel = organisationUnitService.getLevelOfOrganisationUnit( o );
-
+/*
+ List<OrganisationUnit> childOrgUnits = new ArrayList<OrganisationUnit>();
+
+ if ( !dso.contains( o ) )
+ {
+ childOrgUnits = filterChildOrgUnitsByDataSet( o, dso );
+ }
+ System.out.println( "Size of Child OrgUnit: " + childOrgUnits.size() );
+*/
periodIterator = periodList.iterator();
Period p;
@@ -531,51 +539,63 @@
}
else if ( !dso.contains( o ) )
{
- orgUnitInfo = "-1";
- orgUnitCount = 0;
- getOrgUnitInfo( o, dso );
-
- if ( includeZeros == null )
- {
- query = "SELECT COUNT(*) FROM " + dataViewName + " WHERE dataelementid IN (" + deInfo
- + ") AND sourceid IN (" + orgUnitInfo + ") AND periodid IN (" + periodInfo
- + ") and value <> 0";
-
- }
- else
- {
- query = "SELECT COUNT(*) FROM " + dataViewName + " WHERE dataelementid IN (" + deInfo
- + ") AND sourceid IN (" + orgUnitInfo + ") AND periodid IN (" + periodInfo + ")";
- }
-
- System.out.println("Used Query is :::::::" + query );
- SqlRowSet sqlResultSet = jdbcTemplate.queryForRowSet( query );
-
- if ( sqlResultSet.next() )
- {
- try
+ System.out.println("Dataset : " + selDataSet.getName() + " not assign to " + o.getName() );
+ /*
+ if( childOrgUnits == null || childOrgUnits.size() <= 0 )
+ {
+ dsResults.add( -2 );
+ continue;
+ }
+
+ else*/
+ //{
+ /*orgUnitInfo = "-1";
+ orgUnitCount = 0;
+ getOrgUnitInfo( o, dso );
+
+ if ( includeZeros == null )
{
- //System.out.println( "Result is : \t" + sqlResultSet.getLong( 1 ) );
- dataStatusPercentatge = ((double) sqlResultSet.getInt( 1 ) / (double) (dataSetMemberCount1 * orgUnitCount)) * 100.0;
+ query = "SELECT COUNT(*) FROM " + dataViewName + " WHERE dataelementid IN (" + deInfo
+ + ") AND sourceid IN (" + orgUnitInfo + ") AND periodid IN (" + periodInfo
+ + ") and value <> 0";
}
- catch ( Exception e )
- {
+ else
+ {
+ query = "SELECT COUNT(*) FROM " + dataViewName + " WHERE dataelementid IN (" + deInfo
+ + ") AND sourceid IN (" + orgUnitInfo + ") AND periodid IN (" + periodInfo + ")";
+ }
+
+ System.out.println("Used Query is :::::::" + query );
+ SqlRowSet sqlResultSet = jdbcTemplate.queryForRowSet( query );
+
+ if ( sqlResultSet.next() )
+ {
+ try
+ {
+ //System.out.println( "Result is : \t" + sqlResultSet.getLong( 1 ) );
+ dataStatusPercentatge = ((double) sqlResultSet.getInt( 1 ) / (double) (dataSetMemberCount1 * orgUnitCount)) * 100.0;
+
+ }
+ catch ( Exception e )
+ {
+ dataStatusPercentatge = 0.0;
+ }
+ }
+ else
dataStatusPercentatge = 0.0;
- }
- }
- else
- dataStatusPercentatge = 0.0;
-
- if ( dataStatusPercentatge > 100.0 )
- dataStatusPercentatge = 100;
-
- dataStatusPercentatge = Math.round( dataStatusPercentatge * Math.pow( 10, 0 ) ) / Math.pow( 10, 0 );
-
- dsResults.add( (int) dataStatusPercentatge );
- //dataElementCount = sqlResultSet.getInt( 1 );
- deCounts.add( -1 );
- continue;
+
+ if ( dataStatusPercentatge > 100.0 )
+ dataStatusPercentatge = 100;
+
+ dataStatusPercentatge = Math.round( dataStatusPercentatge * Math.pow( 10, 0 ) ) / Math.pow( 10, 0 );
+ */
+ //dsResults.add( (int) dataStatusPercentatge );
+ dsResults.add( -1 );
+ //dataElementCount = sqlResultSet.getInt( 1 );
+ deCounts.add( -1 );
+ continue;
+ //}
}
orgUnitInfo = "" + o.getId();
@@ -669,7 +689,7 @@
return SUCCESS;
}
- public void getDataSetAssignedOrgUnitCount( OrganisationUnit organisationUnit, Set<OrganisationUnit> dso )
+ public void getDataSetAssignedOrgUnitCount( OrganisationUnit organisationUnit, List<OrganisationUnit> dso )
{
Collection<OrganisationUnit> children = organisationUnit.getChildren();
@@ -696,7 +716,7 @@
try
{
@SuppressWarnings("unused")
- int sqlResult = jdbcTemplate.update( query );
+ int sqlResult = jdbcTemplate.update( query );
System.out.println( "View " + dataViewName + " dropped Successfully (if exists) " );
@@ -787,8 +807,8 @@
getOrgUnitInfo( child );
}
}
-
- private void getOrgUnitInfo( OrganisationUnit organisationUnit, Set<OrganisationUnit> dso )
+/*
+ private void getOrgUnitInfo( OrganisationUnit organisationUnit, List<OrganisationUnit> dso )
{
Collection<OrganisationUnit> children = organisationUnit.getChildren();
@@ -805,7 +825,7 @@
getOrgUnitInfo( child, dso );
}
}
-
+*/
private String getDEInfo( Collection<DataElement> dataElements )
{
StringBuffer deInfo = new StringBuffer( "-1" );
@@ -816,5 +836,12 @@
}
return deInfo.toString();
}
-
+/*
+ private List<OrganisationUnit> filterChildOrgUnitsByDataSet( OrganisationUnit selectedOrganisationUnit, List<OrganisationUnit> dso )
+ {
+ List<OrganisationUnit> filteredOrganisationUnits = new ArrayList<OrganisationUnit>( organisationUnitService.getOrganisationUnitWithChildren( selectedOrganisationUnit.getId() ) );
+ filteredOrganisationUnits.retainAll( dso );
+ return filteredOrganisationUnits;
+ }
+*/
}// class end
=== added file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateNullReportResultAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateNullReportResultAction.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateNullReportResultAction.java 2011-05-24 08:25:51 +0000
@@ -0,0 +1,370 @@
+package org.hisp.dhis.dataanalyser.ds.action;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.hibernate.SessionFactory;
+import org.hisp.dhis.dataelement.DataElement;
+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.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.hisp.dhis.period.Period;
+import org.hisp.dhis.period.PeriodService;
+import org.hisp.dhis.period.PeriodType;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.support.rowset.SqlRowSet;
+
+import com.opensymphony.xwork2.Action;
+
+public class GenerateNullReportResultAction implements Action
+{
+
+ // ---------------------------------------------------------------
+ // Dependencies
+ // ---------------------------------------------------------------
+
+ private PeriodService periodService;
+
+ public void setPeriodService( PeriodService periodService )
+ {
+ this.periodService = periodService;
+ }
+
+ private OrganisationUnitService organisationUnitService;
+
+ public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
+ {
+ this.organisationUnitService = organisationUnitService;
+ }
+
+ private DataSetService dataSetService;
+
+ public void setDataSetService( DataSetService dataSetService )
+ {
+ this.dataSetService = dataSetService;
+ }
+
+ private DataElementService dataElementService;
+
+ public void setDataElementService( DataElementService dataElementService )
+ {
+ this.dataElementService = dataElementService;
+ }
+
+ private JdbcTemplate jdbcTemplate;
+
+ public void setJdbcTemplate( JdbcTemplate jdbcTemplate )
+ {
+ this.jdbcTemplate = jdbcTemplate;
+ }
+
+ @SuppressWarnings( "unused" )
+ private SessionFactory sessionFactory;
+
+ public void setSessionFactory( SessionFactory sessionFactory )
+ {
+ this.sessionFactory = sessionFactory;
+ }
+ // ---------------------------------------------------------------
+ // Input Parameters
+ // ---------------------------------------------------------------
+
+ private String dsId;
+
+ public void setDsId( String dsId )
+ {
+ this.dsId = dsId;
+ }
+
+ private String includeZeros;
+
+ public void setIncludeZeros( String includeZeros )
+ {
+ this.includeZeros = includeZeros;
+ }
+
+ public String getIncludeZeros()
+ {
+ return includeZeros;
+ }
+
+ private int periodId;
+
+ public void setPeriodId( int periodId )
+ {
+ this.periodId = periodId;
+ }
+
+ private String ouId;
+
+ public void setOuId( String ouId )
+ {
+ this.ouId = ouId;
+ }
+
+ String dataElementInfo;
+
+ private Map<String, String> deMapForName;
+
+
+ public Map<String, String> getDeMapForName()
+ {
+ return deMapForName;
+ }
+
+ private Map<String, String> deMapForValue;
+
+ public Map<String, String> getDeMapForValue()
+ {
+ return deMapForValue;
+ }
+
+ private List<String> deFinalList;
+
+ public List<String> getDeFinalList()
+ {
+ return deFinalList;
+ }
+
+ private String dataSetName;
+
+ public String getDataSetName()
+ {
+ return dataSetName;
+ }
+
+ private int dataElementCount;
+
+ public int getDataElementCount()
+ {
+ return dataElementCount;
+ }
+
+ private int nullValuDeCount;
+
+ public int getNullValuDeCount()
+ {
+ return nullValuDeCount;
+ }
+
+ private int zeroValueDeCount;
+
+ public int getZeroValueDeCount()
+ {
+ return zeroValueDeCount;
+ }
+
+ private int notZeroValueDeCount;
+
+ public int getNotZeroValueDeCount()
+ {
+ return notZeroValueDeCount;
+ }
+
+ private String orgUnitName;
+
+ public String getOrgUnitName()
+ {
+ return orgUnitName;
+ }
+
+ private String periodName;
+
+ public String getPeriodName()
+ {
+ return periodName;
+ }
+
+ // ---------------------------------------------------------------
+ // Action Implementation
+ // ---------------------------------------------------------------
+
+
+
+ public String execute() throws Exception
+ {
+
+ deMapForName = new HashMap<String, String>();
+ deMapForValue = new HashMap<String, String>();
+ deFinalList = new ArrayList<String>();
+
+ // Period Related Info
+ Period period = periodService.getPeriod( periodId );
+
+ // orgUnit Related Info
+ OrganisationUnit orgUnit = organisationUnitService.getOrganisationUnit( Integer.parseInt( ouId ) );
+ orgUnitName = orgUnit.getName();
+
+ // DataSet Related Info
+ DataSet dataSet = dataSetService.getDataSet( Integer.parseInt( dsId ) );
+ dataSetName = dataSet.getName();
+
+ PeriodType dataSetPeriodType = dataSet.getPeriodType();
+
+ periodName = getPeriodNameByPeriodType( dataSetPeriodType , period );
+
+ List<DataElement> dataElementList = new ArrayList<DataElement>( dataSet.getDataElements() );
+
+
+ System.out.println( "Period : " + periodName + ", OrgUnit Name : " + orgUnit.getName() + ", Data Set Name: " + dataSet.getName() );
+
+ System.out.println( "dataSet Period Type : " + dataSetPeriodType.getName() + ", OrgUnit Name : " + orgUnit.getName() + ", dataElement List : " + dataElementList.size() );
+
+ // dataElement related Information
+
+ dataElementInfo = "-1";
+ List<DataElement> deList = new ArrayList<DataElement>();
+ for ( DataElement dataElement : dataElementList )
+ {
+ DataElement de1 = dataElementService.getDataElement( dataElement.getId() );
+ deList.add( de1 );
+
+ dataElementInfo += "," + de1.getId();
+ //StringBuffer deInfo = new StringBuffer( "-1" );
+ //deInfo.append( "," ).append( dataElement.getId() );
+ //deInfo.toString();
+ }
+
+ //String query = "SELECT datavalue.value ,dataelement.name ,dataelementcategoryoption.name FROM datavalue ,dataelement,dataelementcategoryoption where datavalue.dataelementid = " + dataElement.getId() + " AND datavalue.periodid = " + period.getId() + " AND datavalue.sourceid = " + orgUnit.getId() + " AND datavalue.dataelementid = dataelement.dataelementid AND datavalue.categoryoptioncomboid = dataelementcategoryoption.categoryoptionid";
+
+ String query = "SELECT datavalue.value, datavalue.dataelementid ,dataelement.name , categoryoptioncomboid from datavalue INNER JOIN dataelement ON datavalue.dataelementid = dataelement.dataelementid where datavalue.dataelementid in (" + dataElementInfo + ") and datavalue.periodid = " + period.getId() + " and datavalue.sourceid = " + orgUnit.getId();
+
+
+ SqlRowSet rs = jdbcTemplate.queryForRowSet( query );
+
+ //List<String> tempList = new ArrayList<String>();
+
+ List<String> zeroValueDeList = new ArrayList<String>();
+ List<String> notZeroValueDeList = new ArrayList<String>();
+ List<String> nullValueDeList = new ArrayList<String>();
+ int count1 = 0;
+ int count2 = 0;
+ while ( rs.next() )
+ {
+ String deValue = rs.getString( 1 );
+ //Double deValue = rs.getDouble( 1 );
+ Integer dataElementId = rs.getInt( 2 );
+ //String dataElementName = rs.getString( 3 );
+ Integer categoryoptioncomboid = rs.getInt( 4 );
+
+ String deAndOptionCombo = "";
+
+ if( deValue.equals("0") )
+ {
+ //DataElement tempDE = dataElementService.getDataElement( dataElementId );
+ //DataElementCategoryCombo dataElementCategoryCombo = tempDE.getCategoryCombo();
+ deAndOptionCombo = dataElementId + ":" + categoryoptioncomboid;
+ zeroValueDeList.add( deAndOptionCombo );
+ deMapForValue.put( deAndOptionCombo, deValue );
+ count1++;
+ }
+ else
+ {
+ deAndOptionCombo = dataElementId + ":" + categoryoptioncomboid;
+ notZeroValueDeList.add( deAndOptionCombo );
+ //deMapForName.put( deAndOptionCombo, dataElementName );
+ //deMapForValue.put( deAndOptionCombo, deValue.toString() );
+ deMapForValue.put( deAndOptionCombo, deValue );
+ count2++;
+ }
+
+ //deMapForValue.put( deAndOptionCombo, deValue );
+
+ }
+ System.out.println( "Zero Loop count: " + count1 + ", Not Zero loop count : " + count2 );
+ for( DataElement dataElement : dataElementList )
+ {
+ List<DataElementCategoryOptionCombo> decocList = new ArrayList<DataElementCategoryOptionCombo>(dataElement.getCategoryCombo().getOptionCombos() );
+ String deAndOptionCombo = "";
+ for( DataElementCategoryOptionCombo deCom : decocList )
+ {
+ if( !(zeroValueDeList.contains( dataElement.getId() + ":" + deCom.getId()) || notZeroValueDeList.contains( dataElement.getId() + ":" + deCom.getId())) )
+ {
+ deAndOptionCombo = dataElement.getId() + ":" + deCom.getId();
+ nullValueDeList.add( deAndOptionCombo );
+ }
+
+ deMapForName.put( dataElement.getId() + ":" + deCom.getId(), dataElement.getName()+ " - " + deCom.getName() );
+ }
+
+ /*
+ if( !(zeroValueDeList.contains( dataElement) || notZeroValueDeList.contains( dataElement )) )
+ {
+ DataElementCategoryCombo dataElementCategoryCombo = dataElement.getCategoryCombo();
+ String deAndOptionCombo = dataElement.getId() + ":" + dataElementCategoryCombo.getId();
+ nullValueDeList.add( deAndOptionCombo );
+ }
+ //deMapForName.put( deAndOptionCombo, dataElement.getName() );
+ */
+
+ }
+ deFinalList.addAll( nullValueDeList );
+ deFinalList.addAll( zeroValueDeList );
+ deFinalList.addAll( notZeroValueDeList );
+
+ dataElementCount = deFinalList.size();
+ nullValuDeCount = nullValueDeList.size();
+ zeroValueDeCount = zeroValueDeList.size();
+ notZeroValueDeCount = notZeroValueDeList.size();
+
+ System.out.println( "Null value dataElement List : " + nullValueDeList.size() + ",Zero Value dataElement List : " + zeroValueDeList.size() + ", Valued dataElement List : " + notZeroValueDeList.size() );
+ System.out.println( "Final dataElement List : " + deFinalList.size() );
+ return SUCCESS;
+ }
+
+ // Method for getting perion name when periodType is known
+ public String getPeriodNameByPeriodType( PeriodType periodType, Period period )
+ {
+ SimpleDateFormat simpleDateFormat1;
+
+ SimpleDateFormat simpleDateFormat2;
+
+ String periodName = "";
+
+ if ( periodType.getName().equalsIgnoreCase( "monthly" ) )
+ {
+ simpleDateFormat1 = new SimpleDateFormat( "MMM-yyyy" );
+ periodName = simpleDateFormat1.format( period.getStartDate() ) ;
+ }
+ else if ( periodType.getName().equalsIgnoreCase( "quarterly" ) )
+ {
+ simpleDateFormat1 = new SimpleDateFormat( "MMM" );
+ simpleDateFormat2 = new SimpleDateFormat( "MMM-yyyy" );
+
+ periodName = simpleDateFormat1.format( period.getStartDate() ) + " - " + simpleDateFormat2.format( period.getEndDate() );
+ }
+ else if ( periodType.getName().equalsIgnoreCase( "yearly" ) )
+ {
+ simpleDateFormat1 = new SimpleDateFormat( "yyyy" );
+ int year;
+
+ year = Integer.parseInt( simpleDateFormat1.format( period.getStartDate() ) ) + 1;
+
+ periodName = simpleDateFormat1.format( period.getStartDate() ) + "-" + year ;
+
+ }
+ else if( periodType.getName().equalsIgnoreCase( "daily" ) )
+ {
+ simpleDateFormat1 = new SimpleDateFormat( "yyyy-MM-dd" );
+
+ periodName = simpleDateFormat1.format( period.getStartDate() );
+
+ }
+ else
+ {
+ simpleDateFormat1 = new SimpleDateFormat( "yyyy-MM-dd" );
+
+ periodName = simpleDateFormat1.format( period.getStartDate() ) + " - " + simpleDateFormat1.format( period.getEndDate() );
+ }
+
+ return periodName;
+ }
+
+
+}
=== 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-05-18 11:12:17 +0000
+++ local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml 2011-05-24 08:25:51 +0000
@@ -587,6 +587,30 @@
<property name="jdbcTemplate" ref="jdbcTemplate"/>
</bean>
+ <!-- Null report for DataEntry Status -->
+ <bean id="org.hisp.dhis.dataanalyser.ds.action.GenerateNullReportResultAction"
+ class="org.hisp.dhis.dataanalyser.ds.action.GenerateNullReportResultAction"
+ scope="prototype">
+ <property name="periodService">
+ <ref bean="org.hisp.dhis.period.PeriodService"/>
+ </property>
+ <property name="organisationUnitService">
+ <ref bean="org.hisp.dhis.organisationunit.OrganisationUnitService"/>
+ </property>
+ <property name="dataSetService">
+ <ref bean="org.hisp.dhis.dataset.DataSetService"/>
+ </property>
+ <property name="dataElementService">
+ <ref bean="org.hisp.dhis.dataelement.DataElementService"/>
+ </property>
+ <property name="sessionFactory" ref="sessionFactory"/>
+ <property name="jdbcTemplate" ref="jdbcTemplate"/>
+ </bean>
+
+
+
+
+
<!-- DataStatus Data Set Wise -->
<bean id="org.hisp.dhis.dataanalyser.ds.action.GenerateDataStatusDataSetWiseFormAction"
class="org.hisp.dhis.dataanalyser.ds.action.GenerateDataStatusDataSetWiseFormAction"
=== modified file 'local/in/dhis-web-dashboard/src/main/resources/struts.xml'
--- local/in/dhis-web-dashboard/src/main/resources/struts.xml 2011-05-18 11:12:17 +0000
+++ local/in/dhis-web-dashboard/src/main/resources/struts.xml 2011-05-24 08:25:51 +0000
@@ -357,21 +357,31 @@
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-dashboard/dataStatusFront.vm</param>
<param name="menu">/dhis-web-dashboard/menuWithTreeForDS.vm</param>
- <param name="javascripts">
- ../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/lists/lists.js,javascript/ds.js,javascript/db.js,javascript/date.js,javascript/hashtable.js</param>
+ <param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/lists/lists.js,javascript/ds.js,javascript/db.js,javascript/date.js,javascript/hashtable.js</param>
<param name="stylesheets">css/StylesForTags.css</param>
<interceptor-ref name="organisationUnitTreeStack"/>
</action>
<action name="dataStatusResult"
class="org.hisp.dhis.dataanalyser.ds.action.GenerateDataStatusResultAction">
+ <result name="success" type="velocity">/popup.vm</result>
+ <param name="page">/dhis-web-dashboard/dataStatusResult.vm</param>
+ <param name="javascripts">javascript/ds.js,javascript/hashtable.js</param>
+ <param name="stylesheets">css/StylesForTags.css</param>
+ </action>
+
+ <!-- Null report for DataEntry Status -->
+ <action name="nullReportResult"
+ class="org.hisp.dhis.dataanalyser.ds.action.GenerateNullReportResultAction">
+ <result name="success" type="velocity">/content.vm</result>
+ <param name="page">/dhis-web-dashboard/nullReportDataEntryStatusResult.vm</param>
+ <param name="javascripts">javascript/ds.js,javascript/hashtable.js</param>
+ <param name="stylesheets">css/StylesForTags.css</param>
+ </action>
- <result name="success" type="velocity">
- /dhis-web-dashboard/dataStatusResult.vm</result>
- <param name="javascripts">
- javascript/ds.js,javascript/hashtable.js</param>
- <param name="stylesheets">css/StylesForTags.css</param>
- </action>
+
+
+
<!-- DataStatus Data Set Wise -->
<action name="dataStatusDataSetWiseForm"
=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dataStatusDataSetWiseResult.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dataStatusDataSetWiseResult.vm 2011-05-18 11:12:17 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dataStatusDataSetWiseResult.vm 2011-05-24 08:25:51 +0000
@@ -77,7 +77,7 @@
<td bgcolor="#C0C0C0"><strong>$periodname</strong></td>
#end
#end
- </tr>
+ </tr>
#foreach($chiildorgUnit in $orgUnitList)
#set( $count1 = $minOULevel )
#set( $curOrgUnitLevel = $organisationUnitService.getLevelOfOrganisationUnit( $chiildorgUnit ) )
@@ -118,7 +118,7 @@
</tr>
#end
</table>
- </div>
+ </div>
</div>
</form>
</body>
=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dataStatusResult.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dataStatusResult.vm 2011-04-15 11:35:33 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dataStatusResult.vm 2011-05-24 08:25:51 +0000
@@ -1,9 +1,10 @@
<html>
<head>
- <title>DataStatus Result</title>
- <link type="text/css" rel="stylesheet" media="screen" href="css/StylesForTags.css">
- <script>
+ <title>DataStatus Result</title>
+ <link type="text/css" rel="stylesheet" media="screen" href="css/StylesForTags.css">
+ </link>
+ <script>
var startDate = "$sDateLB";
var endDate = "$eDateLB";
var dsType = "$selectedButton";
@@ -20,13 +21,28 @@
evt.target.href = "dataStatusResult.action?immChildOption="+immChildOption+"&dsId="+dsId+"&sDateLB="+startDate+"&eDateLB="+endDate+"&ouId="+selOrgUnit+"&selectedButton="+dsType;
}
}
-
function exportDataStatusResultToWorkBook()
{
document.getElementById('htmlCode').value = document.getElementById('formResult').innerHTML;
return true;
}
- </script>
+
+ function getNullReportInfo( dsId, periodId, selOrgUnit )
+ {
+ var url = "nullReportResult.action?dsId="+dsId+"&periodId="+periodId+"&ouId="+selOrgUnit;
+ $('#contentDataRecord').dialog('destroy').remove();
+ $('<div id="contentDataRecord">' ).load(url).dialog({
+ title: 'Null Report',
+ maximize: true,
+ closable: true,
+ modal:true,
+ overlay:{background:'#000000', opacity:0.1},
+ width: 800,
+ height: 600
+ });
+ }
+
+ </script>
</head>
<body>
@@ -61,6 +77,10 @@
<td bgcolor="#ff0000"> </td>
<td align="left"> Not Entered ( 0 ) %</td>
</tr>
+ <tr class="TableDataCellStyles">
+ <td bgcolor="white"> </td>
+ <td align="left"> Not Assigned</td>
+ </tr>
</table>
</div>
@@ -92,19 +112,21 @@
#set( $dsresultList = $ouMapDataStatusResult.get( $chiildorgUnit ) )
#set( $dataElementCounts = $ouMapDataElementCount.get( $chiildorgUnit ) )
+ #set( $periodCounts = $periodList )
#set( $count2 = 0 )
#foreach( $result in $dsresultList )
#set( $deCount = $dataElementCounts.get( $count2 ) )
+ #set( $periodCount = $periodCounts.get( $count2 ) )
#if( $result < 0 )
<td bgcolor="white"> </td>
#elseif( $result == 0 )
- <td align="center" bgcolor="#ff0000"><font color="#ffffff">$result% #if( $deCount != -1 ) ( $deCount ) #end</font></td>
+ <td align="center" bgcolor="#ff0000"><font color="#ffffff"><a href="javascript:getNullReportInfo('$selDataSet.id','$periodCount.id','$chiildorgUnit.id')">$result% #if( $deCount != -1 ) ( $deCount ) #end</a></font></td>
#elseif( $result > 75 )
- <td align="center" bgcolor="#a0c0a0"><font color="#ffffff">$result% #if( $deCount != -1 ) ( $deCount ) #end</font></td>
+ <td align="center" bgcolor="#a0c0a0"><font color="#ffffff"><a href="javascript:getNullReportInfo('$selDataSet.id','$periodCount.id','$chiildorgUnit.id')">$result% #if( $deCount != -1 ) ( $deCount ) #end</a></font></td>
#elseif( $result > 40 && $result <= 75 )
- <td align="center" bgcolor="#a0a0ff"><font color="#ffffff">$result% #if( $deCount != -1 ) ( $deCount ) #end</font></td>
+ <td align="center" bgcolor="#a0a0ff"><font color="#ffffff"><a href="javascript:getNullReportInfo('$selDataSet.id','$periodCount.id','$chiildorgUnit.id')">$result% #if( $deCount != -1 ) ( $deCount ) #end</a></font></td>
#else
- <td align="center" bgcolor="#905090"><font color="#ffffff">$result% #if( $deCount != -1 ) ( $deCount ) #end</font></td>
+ <td align="center" bgcolor="#905090"><font color="#ffffff"><a href="javascript:getNullReportInfo('$selDataSet.id','$periodCount.id','$chiildorgUnit.id')">$result% #if( $deCount != -1 ) ( $deCount ) #end</a></font></td>
#end
#set( $count2 = $count2 + 1 )
#end
=== 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-05-18 11:12:17 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/ds.js 2011-05-24 08:25:51 +0000
@@ -527,4 +527,22 @@
});
}
+// Null Report for Data Entry Status
+
+//function getNullReportInfo( dsId, periodId, selOrgUnit )
+//{
+ //alert("jjjjjjjjjjjj");
+/*var url = "nullReportResult.action?dsId="+dsId+"&periodId="+periodId+"&ouId="+selOrgUnit;
+ $('#contentDataRecord').dialog('destroy').remove();
+ $('<div id="contentDataRecord">' ).load(url).dialog({
+ title: 'Null Report',
+ maximize: true,
+ closable: true,
+ modal:true,
+ overlay:{background:'#000000', opacity:0.1},
+ width: 800,
+ height: 400
+ });*/
+//}
+ //evt.target.href = "nullReportResult.action?dsId="+dsId+"&periodId="+periodId+"&ouId="+selOrgUnit;
=== added file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/nullReportDataEntryStatusResult.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/nullReportDataEntryStatusResult.vm 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/nullReportDataEntryStatusResult.vm 2011-05-24 08:25:51 +0000
@@ -0,0 +1,68 @@
+
+<script type="text/javascript">
+ function exportDataStatusNullReportResultToWorkBook()
+ {
+ //alert( document.getElementById('formResult1').innerHTML );
+ document.getElementById('htmlCode1').value = document.getElementById('formResult1').innerHTML;
+ //alert( document.getElementById('htmlCode1').value );
+ return true;
+ }
+</script>
+
+ <form id="form2" name="form2" action="exportDataStatusToExcel.action" method="post" onsubmit="return exportDataStatusNullReportResultToWorkBook()" target="_newtab">
+ <input type="hidden" name="htmlCode1" id="htmlCode1" />
+ <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="formResult1">
+ <div align="center" class="NormalB">Data Entry Status</div>
+ <div align="right">
+ <table width="30%">
+ <tr class="TableDataCellStyles">
+ <td bgcolor="#ff0000"> </td>
+ <td align="left"> Value Not Entered</td>
+ </tr>
+ <tr class="TableDataCellStyles">
+ <td bgcolor="#a0c0a0"> </td>
+ <td align="left"> Zero value Entered</td>
+ </tr>
+ <tr class="TableDataCellStyles" >
+ <td bgcolor="a0a0ff"> </td>
+ <td align="left"> Value Entered</td>
+ </tr>
+ </table>
+ </div>
+
+ <br>
+ <div align="left" class="NormalB">DataSet Name : $dataSetName ( Total DataElement : $dataElementCount ,Null : $nullValuDeCount , Fill with Zero : $zeroValueDeCount , Fill with some Value: $notZeroValueDeCount )</div>
+ <hr style="clear:both">
+ <div align="left" class="NormalB">OrganisationUnit Name : $orgUnitName For the Period : $periodName </div>
+ <hr style="clear:both">
+ <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%">
+ <tr class="TableHeadingCellStyles" align="center">
+ <td class="TableHeadingCellStyles" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Sl.No</strong></td>
+ <td class="TableHeadingCellStyles" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Data Element Names</strong></td>
+ <td class="TableHeadingCellStyles" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Value</strong></td>
+
+ </tr>
+ #set( $count1 = 1 )
+ #foreach( $dataElement in $deFinalList )
+ #set( $dataElementName = $deMapForName.get( $dataElement ) )
+ #set( $dataElementValue = $deMapForValue.get( $dataElement ) )
+
+ <tr class="TableHeadingCellStyles">
+ <td align="center">$count1</td>
+ <td align="left">$dataElementName</td>
+ #if( !$dataElementValue )
+ <td align="center" bgcolor="#ff0000"><font color="#ffffff"> </font></td>
+ #elseif( $dataElementValue == "0" )
+ <td align="center" bgcolor="#a0c0a0"><font color="#ffffff">$dataElementValue</font></td>
+ #else
+ <td align="center" bgcolor="a0a0ff"><font color="#ffffff">$dataElementValue</font></td>
+ #end
+ #set( $count1 = $count1 + 1 )
+ </tr>
+ #end
+ </table>
+ </div>
+ </form>