← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7207: local/in add IDSP Outbreak in dhis-web-alert

 

------------------------------------------------------------
revno: 7207
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-06-06 15:25:27 +0530
message:
  local/in add IDSP Outbreak in dhis-web-alert
removed:
  local/in/dhis-web-alert/src/main/webapp/dhis-web-alert/javascript/db.js
added:
  local/in/dhis-web-alert/src/main/java/org/hisp/dhis/alert/idsp/
  local/in/dhis-web-alert/src/main/java/org/hisp/dhis/alert/idsp/action/
  local/in/dhis-web-alert/src/main/java/org/hisp/dhis/alert/idsp/action/IDSPOutbreakAction.java
  local/in/dhis-web-alert/src/main/webapp/dhis-web-alert/javascript/tracker_db.js
modified:
  local/in/dhis-web-alert/src/main/java/org/hisp/dhis/alert/action/HomePageAction.java
  local/in/dhis-web-alert/src/main/java/org/hisp/dhis/alert/util/AlertUtility.java
  local/in/dhis-web-alert/src/main/resources/META-INF/dhis/beans.xml
  local/in/dhis-web-alert/src/main/resources/struts.xml


--
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-alert/src/main/java/org/hisp/dhis/alert/action/HomePageAction.java'
--- local/in/dhis-web-alert/src/main/java/org/hisp/dhis/alert/action/HomePageAction.java	2012-06-02 08:49:58 +0000
+++ local/in/dhis-web-alert/src/main/java/org/hisp/dhis/alert/action/HomePageAction.java	2012-06-06 09:55:27 +0000
@@ -38,7 +38,9 @@
 public class HomePageAction
     implements Action
 {
+    private static final String DASHBOARD_PAGE = "dashboardpage";
     private static final String TRACKER_DASHBOARD_PAGE = "trackerdashboardpage";
+    private static final String IDSP_OUTBREAK ="idspoutbreak";
 
     String drillDownOrgUnitId;
 
@@ -53,8 +55,8 @@
 
     public String execute()
         throws Exception
-    {
-        return TRACKER_DASHBOARD_PAGE;
+    {        
+        return IDSP_OUTBREAK;
 
     }
 }

=== added directory 'local/in/dhis-web-alert/src/main/java/org/hisp/dhis/alert/idsp'
=== added directory 'local/in/dhis-web-alert/src/main/java/org/hisp/dhis/alert/idsp/action'
=== added file 'local/in/dhis-web-alert/src/main/java/org/hisp/dhis/alert/idsp/action/IDSPOutbreakAction.java'
--- local/in/dhis-web-alert/src/main/java/org/hisp/dhis/alert/idsp/action/IDSPOutbreakAction.java	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-alert/src/main/java/org/hisp/dhis/alert/idsp/action/IDSPOutbreakAction.java	2012-06-06 09:55:27 +0000
@@ -0,0 +1,504 @@
+package org.hisp.dhis.alert.idsp.action;
+
+/*
+ * Copyright (c) 2004-2007, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import static org.hisp.dhis.system.util.ConversionUtils.getIdentifiers;
+import static org.hisp.dhis.system.util.TextUtils.getCommaDelimitedString;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.amplecode.quick.StatementManager;
+import org.hisp.dhis.alert.util.AlertUtility;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
+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.program.Program;
+import org.hisp.dhis.user.CurrentUserService;
+import org.hisp.dhis.user.UserAuthorityGroup;
+import org.hisp.dhis.user.UserCredentials;
+import org.hisp.dhis.user.UserService;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Samta Bajpai
+ * 
+ * @version IDSPOutbreakAction.java Jun 5, 2012 12:43:10 PM
+ */
+
+public class IDSPOutbreakAction
+    implements Action
+{
+
+    // ---------------------------------------------------------------
+    // Dependencies
+    // ---------------------------------------------------------------
+
+    private StatementManager statementManager;
+
+    public void setStatementManager( StatementManager statementManager )
+    {
+        this.statementManager = statementManager;
+    }
+
+    private OrganisationUnitService organisationUnitService;
+
+    public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
+    {
+        this.organisationUnitService = organisationUnitService;
+    }
+
+    private OrganisationUnitGroupService orgUnitGroupService;
+
+    public void setOrgUnitGroupService( OrganisationUnitGroupService orgUnitGroupService )
+    {
+        this.orgUnitGroupService = orgUnitGroupService;
+    }
+
+    private CurrentUserService currentUserService;
+
+    public void setCurrentUserService( CurrentUserService currentUserService )
+    {
+        this.currentUserService = currentUserService;
+    }
+
+    private AlertUtility alertUtility;
+
+    public void setAlertUtility( AlertUtility alertUtility )
+    {
+        this.alertUtility = alertUtility;
+    }
+
+    private UserService userService;
+
+    public void setUserService( UserService userService )
+    {
+        this.userService = userService;
+    }
+
+    // ---------------------------------------------------------------
+    // Input & Output
+    // ---------------------------------------------------------------
+
+    private String resultString;
+
+    public String getResultString()
+    {
+        return resultString;
+    }
+
+    List<OrganisationUnit> immChildrenList;
+
+    public List<OrganisationUnit> getImmChildrenList()
+    {
+        return immChildrenList;
+    }
+
+    Map<String, Integer> orgUnit_ProgramMap;
+
+    public Map<String, Integer> getOrgUnit_ProgramMap()
+    {
+        return orgUnit_ProgramMap;
+    }
+
+    Map<String, String> outBreakAlertMap;
+
+    public Map<String, String> getOutBreakAlertMap()
+    {
+        return outBreakAlertMap;
+    }
+
+    Map<String, String> outBreakAlertColorMap;
+
+    public Map<String, String> getOutBreakAlertColorMap()
+    {
+        return outBreakAlertColorMap;
+    }
+
+    Map<String, Integer> totalEnrollCountForSelDateMap;
+
+    public Map<String, Integer> getTotalEnrollCountForSelDateMap()
+    {
+        return totalEnrollCountForSelDateMap;
+    }
+
+    Integer totalRegCountForSelDate = 0;
+
+    public Integer getTotalRegCountForSelDate()
+    {
+        return totalRegCountForSelDate;
+    }
+
+    Integer totalRegCount = 0;
+
+    public Integer getTotalRegCount()
+    {
+        return totalRegCount;
+    }
+
+    List<Integer> totalRegCountList;
+
+    public List<Integer> getTotalRegCountList()
+    {
+        return totalRegCountList;
+    }
+
+    List<Integer> totalRegCountListForSelDate;
+
+    public List<Integer> getTotalRegCountListForSelDate()
+    {
+        return totalRegCountListForSelDate;
+    }
+
+    List<Program> programList;
+
+    public List<Program> getProgramList()
+    {
+        return programList;
+    }
+
+    String rootOrgUnitName;
+
+    public String getRootOrgUnitName()
+    {
+        return rootOrgUnitName;
+    }
+
+    List<Integer> rootOrgUnitEnrollCountList;
+
+    public List<Integer> getRootOrgUnitEnrollCountList()
+    {
+        return rootOrgUnitEnrollCountList;
+    }
+
+    String drillDownOrgUnitId;
+
+    public void setDrillDownOrgUnitId( String drillDownOrgUnitId )
+    {
+        this.drillDownOrgUnitId = drillDownOrgUnitId;
+    }
+
+    String navigationString;
+
+    public String getNavigationString()
+    {
+        return navigationString;
+    }
+
+    private String toDaysDate;
+
+    public String getToDaysDate()
+    {
+        return toDaysDate;
+    }
+
+    List<String> normInfo;
+
+    public List<String> getNormInfo()
+    {
+        return normInfo;
+    }
+
+    List<String> normNames;
+
+    public List<String> getNormNames()
+    {
+        return normNames;
+    }
+
+    private String populationDeId;
+
+    private Integer orgUnitGroupId;
+
+    private String dataSetId;
+
+    // ---------------------------------------------------------------
+    // Action Implementation
+    // ---------------------------------------------------------------
+
+    public String execute()
+        throws Exception
+    {
+        //statementManager.initialise();
+        int idspFlag = 0;
+        if ( currentUserService.getCurrentUser().getId() != 0 )
+        {
+            UserCredentials userCredentials = userService.getUserCredentialsByUsername( currentUserService
+                .getCurrentUsername() );
+
+            for ( UserAuthorityGroup userAuthorityGroup : userCredentials.getUserAuthorityGroups() )
+            {
+                if ( userAuthorityGroup.getAuthorities().contains( ("F_REPORT_IDSP") ) )
+                {
+                    idspFlag = 1;
+                    break;
+                }
+            }
+        }
+
+        if ( idspFlag == 0 )
+        {
+            return "standard";
+        }
+
+        normInfo = new ArrayList<String>();
+        normNames = new ArrayList<String>();
+        immChildrenList = new ArrayList<OrganisationUnit>();
+        programList = new ArrayList<Program>();
+        rootOrgUnitEnrollCountList = new ArrayList<Integer>();
+        totalRegCountList = new ArrayList<Integer>();
+        totalRegCountListForSelDate = new ArrayList<Integer>();
+        totalEnrollCountForSelDateMap = new HashMap<String, Integer>();
+        orgUnit_ProgramMap = new HashMap<String, Integer>();
+        outBreakAlertMap = new HashMap<String, String>();
+        outBreakAlertColorMap = new HashMap<String, String>();
+
+        resultString = "";
+
+        navigationString = "IDSP Outbreak";
+
+        String periodIdString = alertUtility.getPeriodIdForIDSPOutBreak();
+        String periodId = periodIdString.split( "::" )[0];
+        navigationString += " ( " + periodIdString.split( "::" )[1] + " )";
+
+        String populationPeriodId = alertUtility.getPeriodIdForIDSPPopulation();
+
+        normInfo = getNormInfoFromXML();
+
+        if ( normInfo != null && normInfo.size() > 0 )
+        {
+            List<OrganisationUnit> rootOrgUnitList = new ArrayList<OrganisationUnit>();
+            OrganisationUnitGroup orgUnitGroup = orgUnitGroupService.getOrganisationUnitGroup( orgUnitGroupId );
+
+            if ( drillDownOrgUnitId != null )
+            {
+                rootOrgUnitList.add( organisationUnitService
+                    .getOrganisationUnit( Integer.parseInt( drillDownOrgUnitId ) ) );
+                List<OrganisationUnit> orgUnitBrach = new ArrayList<OrganisationUnit>( organisationUnitService
+                    .getOrganisationUnitBranch( Integer.parseInt( drillDownOrgUnitId ) ) );
+                int flag = 1;
+                for ( OrganisationUnit orgUnit : orgUnitBrach )
+                {
+                    if ( currentUserService.getCurrentUser().getOrganisationUnits().contains( orgUnit ) )
+                    {
+                        flag = 2;
+                    }
+                    if ( flag == 2 )
+                    {
+                        navigationString += " -> <a href=\"idspoutbreak.action?drillDownOrgUnitId=" + orgUnit.getId()
+                            + "\">" + orgUnit.getName() + "</a>";
+                    }
+                }
+            }
+            else
+            {
+                rootOrgUnitList.addAll( currentUserService.getCurrentUser().getOrganisationUnits() );
+            }
+
+            for ( OrganisationUnit orgUnit : rootOrgUnitList )
+            {
+                rootOrgUnitName = orgUnit.getName() + ", ";
+                List<OrganisationUnit> tempOuList = new ArrayList<OrganisationUnit>( orgUnit.getChildren() );
+                Collections.sort( tempOuList, new IdentifiableObjectNameComparator() );
+
+                immChildrenList.addAll( tempOuList );
+
+                for ( OrganisationUnit ou : tempOuList )
+                {
+                    List<OrganisationUnit> childTree = new ArrayList<OrganisationUnit>( organisationUnitService
+                        .getOrganisationUnitWithChildren( ou.getId() ) );
+                    String orgUnitIdsByComma1 = getCommaDelimitedString( getIdentifiers( OrganisationUnit.class,
+                        childTree ) );
+                    List<OrganisationUnit> orgUnitGroupMembers = new ArrayList<OrganisationUnit>( orgUnitGroup
+                        .getMembers() );
+                    childTree.retainAll( orgUnitGroupMembers );
+                    String orgUnitIdsByComma = getCommaDelimitedString( getIdentifiers( OrganisationUnit.class,
+                        childTree ) );
+
+                    int populationData = alertUtility.getAggregatedData( orgUnitIdsByComma1, populationDeId,
+                        populationPeriodId );
+
+                    int confirmedCount = alertUtility.getConfirmedCount( orgUnitIdsByComma, dataSetId, periodId );
+                    int totalSubcentreCount = childTree.size();
+                    // System.out.println(confirmedCount + " : " +
+                    // totalSubcentreCount );
+
+                    for ( String norm : normInfo )
+                    {
+                        String normId = norm.split( "@:@" )[0];
+                        String caseId = norm.split( "@:@" )[1];
+                        String deathId = norm.split( "@:@" )[2];
+                        String normName = norm.split( "@:@" )[3];
+
+                        int caseData = alertUtility.getAggregatedData( orgUnitIdsByComma, caseId, periodId );
+
+                        int deathData = alertUtility.getAggregatedData( orgUnitIdsByComma, deathId, periodId );
+
+                        if ( deathData >= 1 )
+                        {
+                            outBreakAlertMap.put( normName + ":" + ou.getId(), deathData + " Deaths" );
+
+                            if ( confirmedCount != totalSubcentreCount )
+                            {
+                                outBreakAlertColorMap.put( normName + ":" + ou.getId(), "PINK" );
+                            }
+                            else
+                            {
+                                outBreakAlertColorMap.put( normName + ":" + ou.getId(), "RED" );
+                            }
+                        }
+                        else
+                        {
+                            long minLimit = Math.round( populationData / 1000.0 );
+                            long maxLimit = Math.round( (populationData / 1000.0) * 5 );
+                            outBreakAlertMap.put( normName + ":" + ou.getId(), caseData + " Cases" );
+
+                            if ( confirmedCount != totalSubcentreCount )
+                            {
+                                outBreakAlertColorMap.put( normName + ":" + ou.getId(), "PINK" );
+                                continue;
+                            }
+
+                            if ( minLimit == 0 || maxLimit == 0 )
+                            {
+                                outBreakAlertColorMap.put( normName + ":" + ou.getId(), "WHITE" );
+                                continue;
+                            }
+
+                            if ( caseData >= maxLimit )
+                            {
+                                outBreakAlertColorMap.put( normName + ":" + ou.getId(), "RED" );
+                            }
+                            else if ( caseData <= minLimit )
+                            {
+                                outBreakAlertColorMap.put( normName + ":" + ou.getId(), "GREEN" );
+                            }
+                            else
+                            {
+                                outBreakAlertColorMap.put( normName + ":" + ou.getId(), "YELLOW" );
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        //statementManager.destroy();
+
+        return SUCCESS;
+    }
+
+    public List<String> getNormInfoFromXML()
+    {
+        List<String> normInfo = new ArrayList<String>();
+        String raFolderName = alertUtility.getRAFolderName();
+
+        String newpath = "";
+        try
+        {
+            newpath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "OutBreaks.xml";
+        }
+        catch ( NullPointerException npe )
+        {
+            System.out.println( "DHIS_HOME is not set" );
+            return null;
+        }
+
+        try
+        {
+            DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
+            DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
+            Document doc = docBuilder.parse( new File( newpath ) );
+            if ( doc == null )
+            {
+
+                return null;
+            }
+
+            populationDeId = doc.getElementsByTagName( "population" ).item( 0 ).getFirstChild().getNodeValue();
+
+            dataSetId = doc.getElementsByTagName( "dataset" ).item( 0 ).getFirstChild().getNodeValue();
+
+            orgUnitGroupId = Integer.parseInt( doc.getElementsByTagName( "orgunitgroup" ).item( 0 ).getFirstChild()
+                .getNodeValue() );
+
+            NodeList listOfNorms = doc.getElementsByTagName( "norm" );
+            int totalNorms = listOfNorms.getLength();
+
+            for ( int s = 0; s < totalNorms; s++ )
+            {
+                Element element = (Element) listOfNorms.item( s );
+                String normId = element.getAttribute( "id" );
+                String caseId = element.getAttribute( "caseid" );
+                String deathId = element.getAttribute( "deathid" );
+                String lableName = element.getAttribute( "name" );
+
+                if ( normId != null && caseId != null && deathId != null && lableName != null )
+                {
+                    normInfo.add( normId + "@:@" + caseId + "@:@" + deathId + "@:@" + lableName );
+                    normNames.add( lableName );
+                }
+            }// end of for loop with s var
+        }// try block end
+        catch ( SAXParseException err )
+        {
+            System.out.println( "** Parsing error" + ", line " + err.getLineNumber() + ", uri " + err.getSystemId() );
+            System.out.println( " " + err.getMessage() );
+            return null;
+        }
+        catch ( SAXException e )
+        {
+            Exception x = e.getException();
+            ((x == null) ? e : x).printStackTrace();
+            return null;
+        }
+        catch ( Throwable t )
+        {
+            t.printStackTrace();
+            return null;
+        }
+
+        return normInfo;
+    }
+
+}

=== modified file 'local/in/dhis-web-alert/src/main/java/org/hisp/dhis/alert/util/AlertUtility.java'
--- local/in/dhis-web-alert/src/main/java/org/hisp/dhis/alert/util/AlertUtility.java	2012-06-02 08:49:58 +0000
+++ local/in/dhis-web-alert/src/main/java/org/hisp/dhis/alert/util/AlertUtility.java	2012-06-06 09:55:27 +0000
@@ -34,8 +34,11 @@
 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.Calendar;
 import java.util.Collection;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -61,16 +64,19 @@
 public class AlertUtility
 {
     private static final String NULL_REPLACEMENT = "";
+
     private static final String SEPARATOR = ".";
-    
+
     public static final String GENERATEAGGDATA = "generateaggdata";
+
     public static final String USEEXISTINGAGGDATA = "useexistingaggdata";
+
     public static final String USECAPTUREDDATA = "usecaptureddata";
 
     // ---------------------------------------------------------------
     // Dependencies
-    // ---------------------------------------------------------------  
-    
+    // ---------------------------------------------------------------
+
     private ReportService reportService;
 
     public void setReportService( ReportService reportService )
@@ -84,6 +90,7 @@
     {
         this.organisationUnitService = organisationUnitService;
     }
+
     private JdbcTemplate jdbcTemplate;
 
     public void setJdbcTemplate( JdbcTemplate jdbcTemplate )
@@ -91,21 +98,23 @@
         this.jdbcTemplate = jdbcTemplate;
     }
 
-
     // ---------------------------------------------------------------
     // Supporting Methods
     // ---------------------------------------------------------------
     public String getCustomDataSetReport( DataSet dataSet, OrganisationUnit unit, String periodIdsByComma,
         String aggOption, I18nFormat format )
     {
-        //Map<String, String> aggregatedDataValueMap = getAggregatedValueMap( dataSet, unit, period, selectedUnitOnly,
-        //    format );
+        // Map<String, String> aggregatedDataValueMap = getAggregatedValueMap(
+        // dataSet, unit, period, selectedUnitOnly,
+        // format );
 
         Map<String, String> aggregatedDataValueMap = getAggregatedValueMap( dataSet, unit, periodIdsByComma, aggOption );
-        
-        //Map<Integer, String> aggregatedIndicatorMap = getAggregatedIndicatorValueMap( dataSet, unit, period, format );
-        
-        Map<Integer, String> aggregatedIndicatorMap = getAggregatedIndicatorValueMap( dataSet, unit, periodIdsByComma, aggOption );
+
+        // Map<Integer, String> aggregatedIndicatorMap =
+        // getAggregatedIndicatorValueMap( dataSet, unit, period, format );
+
+        Map<Integer, String> aggregatedIndicatorMap = getAggregatedIndicatorValueMap( dataSet, unit, periodIdsByComma,
+            aggOption );
 
         return prepareReportContent( dataSet.getDataEntryForm(), aggregatedDataValueMap, aggregatedIndicatorMap );
     }
@@ -151,7 +160,7 @@
             else if ( dataElementTotalMatcher.find() && dataElementTotalMatcher.groupCount() > 0 )
             {
                 Integer dataElementId = Integer.parseInt( dataElementTotalMatcher.group( 1 ) );
-                
+
                 String dataValue = dataValues.get( String.valueOf( dataElementId ) );
 
                 dataValue = dataValue != null ? dataValue : NULL_REPLACEMENT;
@@ -175,120 +184,131 @@
         return buffer.toString();
     }
 
-
-   
-    
-    private Map<Integer, String> getAggregatedIndicatorValueMap( DataSet dataSet, OrganisationUnit unit, String periodIdsByComma, String aggOption )
+    private Map<Integer, String> getAggregatedIndicatorValueMap( DataSet dataSet, OrganisationUnit unit,
+        String periodIdsByComma, String aggOption )
     {
         Map<Integer, String> aggMap = new HashMap<Integer, String>();
-        
+
         List<Indicator> indicatorList = new ArrayList<Indicator>( dataSet.getIndicators() );
         String dataElmentIdsByComma = reportService.getDataelementIdsAsString( indicatorList );
-        
+
         Map<String, String> aggDeMap = new HashMap<String, String>();
-        if( aggOption.equalsIgnoreCase( USEEXISTINGAGGDATA ) )
+        if ( aggOption.equalsIgnoreCase( USEEXISTINGAGGDATA ) )
         {
-            aggDeMap.putAll( reportService.getResultDataValueFromAggregateTable( unit.getId(), dataElmentIdsByComma, periodIdsByComma ) );
+            aggDeMap.putAll( reportService.getResultDataValueFromAggregateTable( unit.getId(), dataElmentIdsByComma,
+                periodIdsByComma ) );
         }
-        else if( aggOption.equalsIgnoreCase( GENERATEAGGDATA ) )
+        else if ( aggOption.equalsIgnoreCase( GENERATEAGGDATA ) )
         {
-            List<OrganisationUnit> childOrgUnitTree = new ArrayList<OrganisationUnit>( organisationUnitService.getOrganisationUnitWithChildren( unit.getId() ) );
-            List<Integer> childOrgUnitTreeIds = new ArrayList<Integer>( getIdentifiers( OrganisationUnit.class, childOrgUnitTree ) );
+            List<OrganisationUnit> childOrgUnitTree = new ArrayList<OrganisationUnit>( organisationUnitService
+                .getOrganisationUnitWithChildren( unit.getId() ) );
+            List<Integer> childOrgUnitTreeIds = new ArrayList<Integer>( getIdentifiers( OrganisationUnit.class,
+                childOrgUnitTree ) );
             String childOrgUnitsByComma = getCommaDelimitedString( childOrgUnitTreeIds );
 
-            aggDeMap.putAll( reportService.getAggDataFromDataValueTable( childOrgUnitsByComma, dataElmentIdsByComma, periodIdsByComma ) );
+            aggDeMap.putAll( reportService.getAggDataFromDataValueTable( childOrgUnitsByComma, dataElmentIdsByComma,
+                periodIdsByComma ) );
         }
-        else if( aggOption.equalsIgnoreCase( USECAPTUREDDATA ) )
+        else if ( aggOption.equalsIgnoreCase( USECAPTUREDDATA ) )
         {
-            aggDeMap.putAll( reportService.getAggDataFromDataValueTable( ""+unit.getId(), dataElmentIdsByComma, periodIdsByComma ) );
+            aggDeMap.putAll( reportService.getAggDataFromDataValueTable( "" + unit.getId(), dataElmentIdsByComma,
+                periodIdsByComma ) );
         }
-        
+
         for ( Indicator indicator : indicatorList )
         {
             Double numValue = 0.0;
             Double denValue = 0.0;
             Double indValue = 0.0;
-            
+
             try
             {
                 numValue = Double.parseDouble( reportService.getAggVal( indicator.getNumerator(), aggDeMap ) );
             }
-            catch( Exception e )
+            catch ( Exception e )
             {
                 numValue = 0.0;
             }
-            
+
             try
             {
-                denValue = Double.parseDouble( reportService.getAggVal( indicator.getDenominator(), aggDeMap ) );    
+                denValue = Double.parseDouble( reportService.getAggVal( indicator.getDenominator(), aggDeMap ) );
             }
-            catch( Exception e )
+            catch ( Exception e )
             {
                 denValue = 0.0;
             }
 
             try
             {
-                if( denValue != 0.0 )
+                if ( denValue != 0.0 )
                 {
-                    indValue = ( numValue / denValue ) * indicator.getIndicatorType().getFactor();
+                    indValue = (numValue / denValue) * indicator.getIndicatorType().getFactor();
                 }
                 else
                 {
                     indValue = 0.0;
                 }
             }
-            catch( Exception e )
+            catch ( Exception e )
             {
                 indValue = 0.0;
             }
-            
+
             indValue = Math.round( indValue * Math.pow( 10, 1 ) ) / Math.pow( 10, 1 );
-            
+
             aggMap.put( indicator.getId(), indValue.toString() );
         }
-        
+
         return aggMap;
     }
-    
-    private  Map<String, String> getAggregatedValueMap( DataSet dataSet, OrganisationUnit unit, String periodIdsByComma, String aggOption )
+
+    private Map<String, String> getAggregatedValueMap( DataSet dataSet, OrganisationUnit unit, String periodIdsByComma,
+        String aggOption )
     {
         Map<String, String> aggDeMap = new HashMap<String, String>();
-        
+
         List<DataElement> dataElementList = new ArrayList<DataElement>( dataSet.getDataElements() );
-        Collection<Integer> dataElementIds = new ArrayList<Integer>( getIdentifiers(DataElement.class, dataElementList ) );
+        Collection<Integer> dataElementIds = new ArrayList<Integer>(
+            getIdentifiers( DataElement.class, dataElementList ) );
         String dataElmentIdsByComma = getCommaDelimitedString( dataElementIds );
-        
-        if( aggOption.equalsIgnoreCase( USEEXISTINGAGGDATA ) )
+
+        if ( aggOption.equalsIgnoreCase( USEEXISTINGAGGDATA ) )
         {
-            aggDeMap.putAll( reportService.getResultDataValueFromAggregateTable( unit.getId(), dataElmentIdsByComma, periodIdsByComma ) );
+            aggDeMap.putAll( reportService.getResultDataValueFromAggregateTable( unit.getId(), dataElmentIdsByComma,
+                periodIdsByComma ) );
         }
-        else if( aggOption.equalsIgnoreCase( GENERATEAGGDATA ) )
+        else if ( aggOption.equalsIgnoreCase( GENERATEAGGDATA ) )
         {
-            List<OrganisationUnit> childOrgUnitTree = new ArrayList<OrganisationUnit>( organisationUnitService.getOrganisationUnitWithChildren( unit.getId() ) );
-            List<Integer> childOrgUnitTreeIds = new ArrayList<Integer>( getIdentifiers( OrganisationUnit.class, childOrgUnitTree ) );
+            List<OrganisationUnit> childOrgUnitTree = new ArrayList<OrganisationUnit>( organisationUnitService
+                .getOrganisationUnitWithChildren( unit.getId() ) );
+            List<Integer> childOrgUnitTreeIds = new ArrayList<Integer>( getIdentifiers( OrganisationUnit.class,
+                childOrgUnitTree ) );
             String childOrgUnitsByComma = getCommaDelimitedString( childOrgUnitTreeIds );
 
-            aggDeMap.putAll( reportService.getAggDataFromDataValueTable( childOrgUnitsByComma, dataElmentIdsByComma, periodIdsByComma ) );
+            aggDeMap.putAll( reportService.getAggDataFromDataValueTable( childOrgUnitsByComma, dataElmentIdsByComma,
+                periodIdsByComma ) );
         }
-        else if( aggOption.equalsIgnoreCase( USECAPTUREDDATA ) )
+        else if ( aggOption.equalsIgnoreCase( USECAPTUREDDATA ) )
         {
-            aggDeMap.putAll( reportService.getAggDataFromDataValueTable( ""+unit.getId(), dataElmentIdsByComma, periodIdsByComma ) );
+            aggDeMap.putAll( reportService.getAggDataFromDataValueTable( "" + unit.getId(), dataElmentIdsByComma,
+                periodIdsByComma ) );
         }
-        
+
         return aggDeMap;
     }
+
     public Map<Integer, Integer> getTotalEnrolledNumber( String orgUnitIdsByComma )
     {
         Map<Integer, Integer> aggDeMap = new HashMap<Integer, Integer>();
         try
         {
-            String query = "SELECT programinstance.programid, COUNT(*) FROM programinstance INNER JOIN patient " +
-                                        " ON programinstance.patientid = patient.patientid " +
-                                        " WHERE patient.organisationunitid IN ("+ orgUnitIdsByComma +") GROUP BY programid";
+            String query = "SELECT programinstance.programid, COUNT(*) FROM programinstance INNER JOIN patient "
+                + " ON programinstance.patientid = patient.patientid " + " WHERE patient.organisationunitid IN ("
+                + orgUnitIdsByComma + ") GROUP BY programid";
 
             SqlRowSet rs = jdbcTemplate.queryForRowSet( query );
-            
+
             while ( rs.next() )
             {
                 Integer programId = rs.getInt( 1 );
@@ -297,10 +317,10 @@
                     aggDeMap.put( programId, totalCount );
                 }
             }
-            
+
             return aggDeMap;
         }
-        catch( Exception e )
+        catch ( Exception e )
         {
             throw new RuntimeException( e );
         }
@@ -311,13 +331,13 @@
         Map<Integer, Integer> aggDeMap = new HashMap<Integer, Integer>();
         try
         {
-            String query = "SELECT programinstance.programid, COUNT(*) FROM programinstance INNER JOIN patient " +
-                                        " ON programinstance.patientid = patient.patientid " +
-                                        " WHERE patient.organisationunitid IN ("+ orgUnitIdsByComma +") AND " +
-                                        " patient.registrationdate LIKE '"+ toDaysDate+"%' GROUP BY programid";
+            String query = "SELECT programinstance.programid, COUNT(*) FROM programinstance INNER JOIN patient "
+                + " ON programinstance.patientid = patient.patientid " + " WHERE patient.organisationunitid IN ("
+                + orgUnitIdsByComma + ") AND " + " patient.registrationdate LIKE '" + toDaysDate
+                + "%' GROUP BY programid";
 
             SqlRowSet rs = jdbcTemplate.queryForRowSet( query );
-            
+
             while ( rs.next() )
             {
                 Integer programId = rs.getInt( 1 );
@@ -326,10 +346,10 @@
                     aggDeMap.put( programId, totalCount );
                 }
             }
-            
+
             return aggDeMap;
         }
-        catch( Exception e )
+        catch ( Exception e )
         {
             throw new RuntimeException( e );
         }
@@ -340,18 +360,18 @@
         Integer totalRegCount = 0;
         try
         {
-            String query = "SELECT COUNT(*) FROM patient " +    " WHERE organisationunitid IN ("+ orgUnitIdsByComma+")";
+            String query = "SELECT COUNT(*) FROM patient " + " WHERE organisationunitid IN (" + orgUnitIdsByComma + ")";
 
             SqlRowSet rs = jdbcTemplate.queryForRowSet( query );
-            
+
             if ( rs != null && rs.next() )
             {
                 totalRegCount = rs.getInt( 1 );
             }
-            
+
             return totalRegCount;
         }
-        catch( Exception e )
+        catch ( Exception e )
         {
             throw new RuntimeException( e );
         }
@@ -362,22 +382,183 @@
         Integer totalRegCount = 0;
         try
         {
-            String query = "SELECT COUNT(*) FROM patient " +
-                               " WHERE organisationunitid IN ("+ orgUnitIdsByComma +") AND " +
-                                " registrationdate LIKE '"+ selDate+"%'";
+            String query = "SELECT COUNT(*) FROM patient " + " WHERE organisationunitid IN (" + orgUnitIdsByComma
+                + ") AND " + " registrationdate LIKE '" + selDate + "%'";
 
             SqlRowSet rs = jdbcTemplate.queryForRowSet( query );
-            
+
             if ( rs != null && rs.next() )
             {
                 totalRegCount = rs.getInt( 1 );
             }
-            
+
             return totalRegCount;
         }
-        catch( Exception e )
-        {
-            throw new RuntimeException( e );
-        }
+        catch ( Exception e )
+        {
+            throw new RuntimeException( e );
+        }
+    }
+
+    // methods for IDSP OUTBREAK
+    public String getPeriodIdForIDSPOutBreak()
+    {
+        String periodIdResult = "-1";
+        String startDate = " ";
+        String endDate = " ";
+        try
+        {
+            Date toDay = new Date();
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "yyyy-MM-dd" );
+            String toDaysDate = simpleDateFormat.format( toDay );
+
+            int periodId = -1;
+
+            String query = "SELECT periodid, startdate, enddate FROM period WHERE periodtypeid = 2 AND "
+                + " startdate <= '" + toDaysDate + "' AND enddate >= '" + toDaysDate + "'";
+
+            SqlRowSet rs1 = jdbcTemplate.queryForRowSet( query );
+            if ( rs1 != null && rs1.next() )
+            {
+                periodId = rs1.getInt( 1 );
+                startDate = rs1.getString( 2 );
+                endDate = rs1.getString( 3 );
+
+                // System.out.println( periodId + " : " + startDate + " : " +
+                // endDate + " : " + toDaysDate );
+
+                if ( !endDate.equalsIgnoreCase( toDaysDate ) )
+                {
+                    Calendar cal = Calendar.getInstance();
+                    cal.setTime( toDay );
+                    cal.add( Calendar.DATE, -7 );
+                    toDaysDate = simpleDateFormat.format( cal.getTime() );
+
+                    query = "SELECT periodid, startdate, enddate FROM period WHERE periodtypeid = 2 AND "
+                        + " startdate <= '" + toDaysDate + "' AND enddate >= '" + toDaysDate + "'";
+                    SqlRowSet rs2 = jdbcTemplate.queryForRowSet( query );
+                    if ( rs2 != null && rs2.next() )
+                    {
+                        periodId = rs2.getInt( 1 );
+                        startDate = rs2.getString( 2 );
+                        endDate = rs2.getString( 3 );
+                    }
+                    // System.out.println( periodId + " : " + toDaysDate );
+                }
+
+                periodIdResult = "" + periodId + "::" + startDate + " TO " + endDate;
+            }
+            else
+            {
+                Calendar cal = Calendar.getInstance();
+                cal.setTime( toDay );
+                cal.add( Calendar.DATE, -7 );
+                toDaysDate = simpleDateFormat.format( cal.getTime() );
+
+                query = "SELECT periodid, startdate, enddate FROM period WHERE periodtypeid = 2 AND "
+                    + " startdate <= '" + toDaysDate + "' AND enddate >= '" + toDaysDate + "'";
+                SqlRowSet rs2 = jdbcTemplate.queryForRowSet( query );
+                if ( rs2 != null && rs2.next() )
+                {
+                    periodId = rs2.getInt( 1 );
+                    startDate = rs2.getString( 2 );
+                    endDate = rs2.getString( 3 );
+                }
+                periodIdResult = "" + periodId + "::" + startDate + " TO " + endDate;
+            }
+        }
+        catch ( Exception e )
+        {
+            throw new RuntimeException( e );
+        }
+
+        // System.out.println( "PeriodId : " +periodIdResult );
+        return periodIdResult;
+    }
+
+    public String getPeriodIdForIDSPPopulation()
+    {
+        String periodIdResult = "-1";
+
+        try
+        {
+            Date toDay = new Date();
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "yyyy-MM-dd" );
+            String toDaysDate = simpleDateFormat.format( toDay );
+
+            String query = "SELECT periodid FROM period WHERE periodtypeid = 6 AND " + " startdate <= '" + toDaysDate
+                + "' AND enddate >= '" + toDaysDate + "'";
+
+            SqlRowSet rs1 = jdbcTemplate.queryForRowSet( query );
+            if ( rs1 != null && rs1.next() )
+            {
+                periodIdResult = "" + rs1.getInt( 1 );
+            }
+        }
+        catch ( Exception e )
+        {
+            throw new RuntimeException( e );
+        }
+
+        // System.out.println( "PeriodId : " +periodIdResult );
+        return periodIdResult;
+
+    }
+
+    public Integer getAggregatedData( String orgUnitIdsByComma, String deIdsByComma, String periodId )
+    {
+        Integer aggData = 0;
+
+        try
+        {
+            String query = "SELECT SUM(value) FROM datavalue " + " WHERE sourceid IN (" + orgUnitIdsByComma + ") AND "
+                + " dataelementid IN (" + deIdsByComma + ") AND " + " periodid = " + periodId;
+
+            SqlRowSet rs1 = jdbcTemplate.queryForRowSet( query );
+
+            if ( rs1 != null && rs1.next() )
+            {
+                double temp = rs1.getDouble( 1 );
+
+                aggData = (int) temp;
+            }
+        }
+        catch ( Exception e )
+        {
+            throw new RuntimeException( e );
+        }
+
+        return aggData;
+    }
+
+    public Integer getConfirmedCount( String orgUnitIdsByComma, String dataSetId, String periodId )
+    {
+        Integer confirmedCount = 0;
+
+        try
+        {
+            String query = "SELECT COUNT(*) FROM completedatasetregistration " + " WHERE sourceid IN ("
+                + orgUnitIdsByComma + ") AND " + " datasetid = " + dataSetId + " AND " + " periodid = " + periodId;
+
+            SqlRowSet rs1 = jdbcTemplate.queryForRowSet( query );
+
+            if ( rs1 != null && rs1.next() )
+            {
+                double temp = rs1.getDouble( 1 );
+
+                confirmedCount = (int) temp;
+            }
+        }
+        catch ( Exception e )
+        {
+            throw new RuntimeException( e );
+        }
+
+        return confirmedCount;
+    }
+
+    public String getRAFolderName()
+    {
+        return reportService.getRAFolderName();
     }
 }

=== modified file 'local/in/dhis-web-alert/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-web-alert/src/main/resources/META-INF/dhis/beans.xml	2012-06-02 08:49:58 +0000
+++ local/in/dhis-web-alert/src/main/resources/META-INF/dhis/beans.xml	2012-06-06 09:55:27 +0000
@@ -7,13 +7,13 @@
 	<!-- Service  -->
 	
 	<bean id="org.hisp.dhis.alert.util.AlertUtility"
-        class="org.hisp.dhis.alert.util.AlertUtility"
-        scope="prototype">
-        <property name="reportService" ref="org.hisp.dhis.reports.ReportService" />
-        <property name="jdbcTemplate" ref="jdbcTemplate" />
-        <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
-        
-    </bean>
+		class="org.hisp.dhis.alert.util.AlertUtility" scope="prototype">
+		<property name="reportService" ref="org.hisp.dhis.reports.ReportService"/>
+		<property name="jdbcTemplate" ref="jdbcTemplate"/>
+		<property name="organisationUnitService"
+			ref="org.hisp.dhis.organisationunit.OrganisationUnitService"/>
+		
+	</bean>
 	
 	<!-- Common Action  -->
 	
@@ -72,4 +72,19 @@
 		<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
 		<property name="patientAttributeValueService" ref="org.hisp.dhis.patientattributevalue.PatientAttributeValueService" />
   </bean>
+	
+	<!-- IDSP Outbreak Action  -->
+	
+	<bean id="org.hisp.dhis.alert.idsp.action.IDSPOutbreakAction"
+        class="org.hisp.dhis.alert.idsp.action.IDSPOutbreakAction"
+        scope="prototype">       
+        <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
+        <property name="userService" ref="org.hisp.dhis.user.UserService" /> 
+        <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+        <property name="alertUtility" ref="org.hisp.dhis.alert.util.AlertUtility" />        
+        <!--<property name="statementManager" ref="statementManager"/>-->
+        <property name="orgUnitGroupService" ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
+    </bean>	
+	
+	
 </beans>
\ No newline at end of file

=== modified file 'local/in/dhis-web-alert/src/main/resources/struts.xml'
--- local/in/dhis-web-alert/src/main/resources/struts.xml	2012-06-02 08:49:58 +0000
+++ local/in/dhis-web-alert/src/main/resources/struts.xml	2012-06-06 09:55:27 +0000
@@ -9,51 +9,70 @@
 		namespace="/dhis-web-alert">
 		
 		<!-- Index action -->
-        <action name="index"
-            class="org.hisp.dhis.alert.action.HomePageAction">
-			<result name="trackerdashboardpage" type="redirect">trackerDashboardPage.action</result>
-        </action>
+		<action name="index" class="org.hisp.dhis.alert.action.HomePageAction">
+			<result name="dashboardpage" type="redirect">
+				dashboardPage.action</result>
+			<result name="trackerdashboardpage" type="redirect">
+				trackerDashboardPage.action</result>
+			<result name="idspoutbreak" type="redirect">
+				idspoutbreak.action</result>
+		</action>
 		
 		<!-- Tracker Dashboard -->
 		<action name="trackerDashboardPage"
-            class="org.hisp.dhis.alert.tdb.action.TrackerDashBoardAction">
-            <result name="success" type="velocity">/main.vm</result>
-			<param name="page">/dhis-web-alert/welcome.vm</param>            
-            <param name="javascripts">javascript/ext-all.js,javascript/db.js</param>
-            <param name="stylesheets">css/ext-all.css,example.css</param>
-        </action>
-		
-		<action name="getPatientDataRecords" class="org.hisp.dhis.alert.tdb.action.GetPatientDataRecordsAction">
-		  <result name="success" type="velocity">/content.vm</result>
-		  <param name="page">/dhis-web-alert/viewPatientDataRecords.vm</param>
-		  <param name="stylesheets">../dhis-web-commons/paging/paging.css</param>
-		</action>
-
-		<action name="getPatientDetails" class="org.hisp.dhis.alert.tdb.action.GetPatientDetailsAction">
-		  <result name="success" type="velocity-xml">/dhis-web-alert/responsePatient.vm</result>
-		  <param name="onExceptionReturn">plainTextError</param>
-		</action>               
+			class="org.hisp.dhis.alert.tdb.action.TrackerDashBoardAction">
+			<result name="success" type="velocity">/main.vm</result>
+			<param name="page">/dhis-web-alert/welcome.vm</param>
+			<param name="javascripts">
+				javascript/ext-all.js,javascript/tracker_db.js</param>
+			<param name="stylesheets">css/ext-all.css,example.css</param>
+		</action>
+		
+		<action name="getPatientDataRecords"
+			class="org.hisp.dhis.alert.tdb.action.GetPatientDataRecordsAction">
+			<result name="success" type="velocity">/content.vm</result>
+			<param name="page">/dhis-web-alert/viewPatientDataRecords.vm</param>
+			<param name="stylesheets">
+				../dhis-web-commons/paging/paging.css</param>
+		</action>
+		
+		<action name="getPatientDetails"
+			class="org.hisp.dhis.alert.tdb.action.GetPatientDetailsAction">
+			<result name="success" type="velocity-xml">
+				/dhis-web-alert/responsePatient.vm</result>
+			<param name="onExceptionReturn">plainTextError</param>
+		</action>
 		
 		<!-- Dashboard Page based on Dataentry screen design -->
-        <action name="dashboardPage"
-            class="org.hisp.dhis.alert.db.action.DashBoardAction">
-            <result name="success" type="velocity">/main.vm</result>
-            <param name="page">/dhis-web-alert/dashboardPage.vm</param>
-            <param name="menu">/dhis-web-alert/menu.vm</param>
-        </action>
-
+		<action name="dashboardPage"
+			class="org.hisp.dhis.alert.db.action.DashBoardAction">
+			<result name="success" type="velocity">/main.vm</result>
+			<param name="page">/dhis-web-alert/dashboardPage.vm</param>
+			<param name="menu">/dhis-web-alert/menu.vm</param>
+		</action>
+		
+		<!-- IDSP Outbreak Actions -->
+		<action name="idspoutbreak"
+			class="org.hisp.dhis.alert.idsp.action.IDSPOutbreakAction">
+			<result name="standard" type="redirect">index.action</result>
+			<result name="success" type="velocity">/main.vm</result>
+			<param name="page">/dhis-web-alert/idspOutBreak.vm</param>
+			<param name="stylesheets">css/ext-all.css,example.css</param>
+			<param name="requiredAuthorities">F_IDSP_OUTBREAK</param>
+		</action>
+		
 		<!-- Common Actions -->
-        <action name="exportToExcel"
-            class="org.hisp.dhis.alert.action.ExportToExcelAction">
-            <result name="success" type="stream">
-                <param name="contentType">application/vnd.ms-excel</param>
-                <param name="inputName">inputStream</param>
-                <param name="contentDisposition">
-                    attachment;filename="${fileName}"</param>
-                <param name="bufferSize">1024</param>
-            </result>
-        </action>
+		<action name="exportToExcel"
+			class="org.hisp.dhis.alert.action.ExportToExcelAction">
+			<result name="success" type="stream">
+				<param name="contentType">application/vnd.ms-excel</param>
+				<param name="inputName">inputStream</param>
+				<param name="contentDisposition">
+					attachment;filename="${fileName}"</param>
+				<param name="bufferSize">1024</param>
+			</result>
+		</action>
 		
 	</package>
-
+	
 </struts>
\ No newline at end of file

=== removed file 'local/in/dhis-web-alert/src/main/webapp/dhis-web-alert/javascript/db.js'
--- local/in/dhis-web-alert/src/main/webapp/dhis-web-alert/javascript/db.js	2012-06-02 08:51:09 +0000
+++ local/in/dhis-web-alert/src/main/webapp/dhis-web-alert/javascript/db.js	1970-01-01 00:00:00 +0000
@@ -1,111 +0,0 @@
-function viewPatientDataRecords( programId, orgUnitId, viewStatus ) 
-{
-	var url = 'getPatientDataRecords.action?orgUnitId=' + orgUnitId + "&programId=" + programId + "&viewStatus=" +viewStatus;
-	$('#contentDataRecord').dialog('destroy').remove();
-    $('<div id="contentDataRecord">' ).load(url).dialog({
-        title: 'Benificiarywise ProgramStage Summary',
-		maximize: true, 
-		closable: true,
-		modal:true,
-		overlay:{background:'#000000', opacity:0.1},
-		width: 1000,
-        height: 550
-    });
-}
-function showPatientDetails( patientId )
-{	
-	$.post("getPatientDetails.action",
-			{
-				id : patientId
-			},
-			function (data)
-			{
-				patientReceived(data);
-			},'xml');
-
-}
-
-function patientReceived( patientElement )
-{   
-	// ----------------------------------------------------------------------------
-	// Get common-information
-    // ----------------------------------------------------------------------------
-	var patientInfo = "";
-	
-	var id = patientElement.getElementsByTagName( "id" )[0].firstChild.nodeValue;
-	var fullName = patientElement.getElementsByTagName( "fullName" )[0].firstChild.nodeValue;   
-	var gender = patientElement.getElementsByTagName( "gender" )[0].firstChild.nodeValue;   
-	var dobType = patientElement.getElementsByTagName( "dobType" )[0].firstChild.nodeValue;   
-	var birthDate = patientElement.getElementsByTagName( "dateOfBirth" )[0].firstChild.nodeValue;   
-	var bloodGroup= patientElement.getElementsByTagName( "bloodGroup" )[0].firstChild.nodeValue;   
-    
-	var commonInfo =  '<strong>id :</strong> ' + id + "<br>" 
-					+ '<strong>name :</strong> ' + fullName + "<br>" 
-					+ '<strong>Gender :</strong> ' + gender+ "<br>" 
-					+ '<strong>DOB Type :</strong> ' + dobType+ "<br>" 
-					+ '<strong>DOB :</strong> ' + birthDate+ "<br>" 
-					+ '<strong>Blood Group :</strong> ' + bloodGroup;
-	
-	setInnerHTML( 'commonInfoField', commonInfo );
-
-	patientInfo += 'id : ' + id + "\n" + 'name : ' + fullName + "\n" + 'Gender : ' + gender+ "\n" 
-					+ 'DOB Type : ' + dobType+ "\n" + 'DOB : ' + birthDate+ "\n" + 'Blood Group : ' + bloodGroup;
-
-	patientInfo += "\nIdentifier :";
-	// ----------------------------------------------------------------------------
-	// Get identifier
-    // ----------------------------------------------------------------------------
-	
-	var identifiers = patientElement.getElementsByTagName( "identifier" );   
-    
-    var identifierText = '';
-	
-	for ( var i = 0; i < identifiers.length; i++ )
-	{		
-		identifierText = identifierText + identifiers[ i ].getElementsByTagName( "identifierText" )[0].firstChild.nodeValue + '<br>';
-		patientInfo += "\n" + identifiers[ i ].getElementsByTagName( "identifierText" )[0].firstChild.nodeValue;
-	}
-	
-	setInnerHTML( 'identifierField', identifierText );
-	
-	// ----------------------------------------------------------------------------
-	// Get attribute
-    // ----------------------------------------------------------------------------
-	patientInfo += "\nAttribute:";
-	var attributes = patientElement.getElementsByTagName( "attribute" );   
-    
-    var attributeValues = '';
-	
-	for ( var i = 0; i < attributes.length; i++ )
-	{	
-		attributeValues = attributeValues + '<strong>' + attributes[ i ].getElementsByTagName( "name" )[0].firstChild.nodeValue  + ':  </strong>' + attributes[ i ].getElementsByTagName( "value" )[0].firstChild.nodeValue + '<br>';
-		patientInfo += "\n" + attributes[ i ].getElementsByTagName( "name" )[0].firstChild.nodeValue  + ': ' + attributes[ i ].getElementsByTagName( "value" )[0].firstChild.nodeValue;
-	}
-	attributeValues = ( attributeValues.length == 0 ) ? i18n_none : attributeValues;
-	setInnerHTML( 'attributeField', attributeValues );
-    
-	// ----------------------------------------------------------------------------
-	// Get programs
-    // ----------------------------------------------------------------------------
-	patientInfo += "\nProgram :";
-    var programs = patientElement.getElementsByTagName( "program" );   
-    
-    var programName = '';
-	
-	for ( var i = 0; i < programs.length; i++ )
-	{		
-		programName = programName + programs[ i ].getElementsByTagName( "name" )[0].firstChild.nodeValue + '<br>';
-		patientInfo += "\n" +programs[ i ].getElementsByTagName( "name" )[0].firstChild.nodeValue;
-	}
-	
-	alert( patientInfo );
-	
-	//programName = ( programName.length == 0 ) ? i18n_none : programName;
-	//setInnerHTML( 'programField', programName );
-   
-	// ----------------------------------------------------------------------------
-	// Show details
-    // ----------------------------------------------------------------------------
-	
-    //showDetails();
-}
\ No newline at end of file

=== added file 'local/in/dhis-web-alert/src/main/webapp/dhis-web-alert/javascript/tracker_db.js'
--- local/in/dhis-web-alert/src/main/webapp/dhis-web-alert/javascript/tracker_db.js	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-alert/src/main/webapp/dhis-web-alert/javascript/tracker_db.js	2012-06-06 09:55:27 +0000
@@ -0,0 +1,111 @@
+function viewPatientDataRecords( programId, orgUnitId, viewStatus ) 
+{
+	var url = 'getPatientDataRecords.action?orgUnitId=' + orgUnitId + "&programId=" + programId + "&viewStatus=" +viewStatus;
+	$('#contentDataRecord').dialog('destroy').remove();
+    $('<div id="contentDataRecord">' ).load(url).dialog({
+        title: 'Benificiarywise ProgramStage Summary',
+		maximize: true, 
+		closable: true,
+		modal:true,
+		overlay:{background:'#000000', opacity:0.1},
+		width: 1000,
+        height: 550
+    });
+}
+function showPatientDetails( patientId )
+{	
+	$.post("getPatientDetails.action",
+			{
+				id : patientId
+			},
+			function (data)
+			{
+				patientReceived(data);
+			},'xml');
+
+}
+
+function patientReceived( patientElement )
+{   
+	// ----------------------------------------------------------------------------
+	// Get common-information
+    // ----------------------------------------------------------------------------
+	var patientInfo = "";
+	
+	var id = patientElement.getElementsByTagName( "id" )[0].firstChild.nodeValue;
+	var fullName = patientElement.getElementsByTagName( "fullName" )[0].firstChild.nodeValue;   
+	var gender = patientElement.getElementsByTagName( "gender" )[0].firstChild.nodeValue;   
+	var dobType = patientElement.getElementsByTagName( "dobType" )[0].firstChild.nodeValue;   
+	var birthDate = patientElement.getElementsByTagName( "dateOfBirth" )[0].firstChild.nodeValue;   
+	var bloodGroup= patientElement.getElementsByTagName( "bloodGroup" )[0].firstChild.nodeValue;   
+    
+	var commonInfo =  '<strong>id :</strong> ' + id + "<br>" 
+					+ '<strong>name :</strong> ' + fullName + "<br>" 
+					+ '<strong>Gender :</strong> ' + gender+ "<br>" 
+					+ '<strong>DOB Type :</strong> ' + dobType+ "<br>" 
+					+ '<strong>DOB :</strong> ' + birthDate+ "<br>" 
+					+ '<strong>Blood Group :</strong> ' + bloodGroup;
+	
+	setInnerHTML( 'commonInfoField', commonInfo );
+
+	patientInfo += 'id : ' + id + "\n" + 'name : ' + fullName + "\n" + 'Gender : ' + gender+ "\n" 
+					+ 'DOB Type : ' + dobType+ "\n" + 'DOB : ' + birthDate+ "\n" + 'Blood Group : ' + bloodGroup;
+
+	patientInfo += "\nIdentifier :";
+	// ----------------------------------------------------------------------------
+	// Get identifier
+    // ----------------------------------------------------------------------------
+	
+	var identifiers = patientElement.getElementsByTagName( "identifier" );   
+    
+    var identifierText = '';
+	
+	for ( var i = 0; i < identifiers.length; i++ )
+	{		
+		identifierText = identifierText + identifiers[ i ].getElementsByTagName( "identifierText" )[0].firstChild.nodeValue + '<br>';
+		patientInfo += "\n" + identifiers[ i ].getElementsByTagName( "identifierText" )[0].firstChild.nodeValue;
+	}
+	
+	setInnerHTML( 'identifierField', identifierText );
+	
+	// ----------------------------------------------------------------------------
+	// Get attribute
+    // ----------------------------------------------------------------------------
+	patientInfo += "\nAttribute:";
+	var attributes = patientElement.getElementsByTagName( "attribute" );   
+    
+    var attributeValues = '';
+	
+	for ( var i = 0; i < attributes.length; i++ )
+	{	
+		attributeValues = attributeValues + '<strong>' + attributes[ i ].getElementsByTagName( "name" )[0].firstChild.nodeValue  + ':  </strong>' + attributes[ i ].getElementsByTagName( "value" )[0].firstChild.nodeValue + '<br>';
+		patientInfo += "\n" + attributes[ i ].getElementsByTagName( "name" )[0].firstChild.nodeValue  + ': ' + attributes[ i ].getElementsByTagName( "value" )[0].firstChild.nodeValue;
+	}
+	attributeValues = ( attributeValues.length == 0 ) ? i18n_none : attributeValues;
+	setInnerHTML( 'attributeField', attributeValues );
+    
+	// ----------------------------------------------------------------------------
+	// Get programs
+    // ----------------------------------------------------------------------------
+	patientInfo += "\nProgram :";
+    var programs = patientElement.getElementsByTagName( "program" );   
+    
+    var programName = '';
+	
+	for ( var i = 0; i < programs.length; i++ )
+	{		
+		programName = programName + programs[ i ].getElementsByTagName( "name" )[0].firstChild.nodeValue + '<br>';
+		patientInfo += "\n" +programs[ i ].getElementsByTagName( "name" )[0].firstChild.nodeValue;
+	}
+	
+	alert( patientInfo );
+	
+	//programName = ( programName.length == 0 ) ? i18n_none : programName;
+	//setInnerHTML( 'programField', programName );
+   
+	// ----------------------------------------------------------------------------
+	// Show details
+    // ----------------------------------------------------------------------------
+	
+    //showDetails();
+}
\ No newline at end of file