← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5090: Merge Data Analyser from 2.3 to trunk

 

------------------------------------------------------------
revno: 5090
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-11-03 11:37:39 +0530
message:
  Merge Data Analyser from 2.3 to trunk
added:
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetPatientDataRecordsAction.java
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetPatientDetailsAction.java
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/IDSPOutbreakAction.java
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/sms/action/GenerateDueDatesFormAction.java
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/sms/action/SendDueDatesFormAction.java
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dueDatesForm.vm
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/idspOutBreak.vm
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menuWithTreeForSms.vm
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/responsePatient.vm
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/viewPatientDataRecords.vm
modified:
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/DashBoardHomePageAction.java
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/util/BulkSMSHttpInterface.java
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/util/DashBoardService.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/dataStatusDataSetWiseFront.vm
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/db.js
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menu.vm
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menuWithTreeForDSDataSetWise.vm
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/welcomeTracker.vm


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/DashBoardHomePageAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/DashBoardHomePageAction.java	2011-10-14 12:26:01 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/DashBoardHomePageAction.java	2011-11-03 06:07:39 +0000
@@ -142,6 +142,13 @@
         return immChildrenList;
     }
 
+    Map<String, Integer> orgUnit_ProgramMap;
+    
+    public Map<String, Integer> getOrgUnit_ProgramMap()
+    {
+        return orgUnit_ProgramMap;
+    }
+
     Map<String, Integer> totalEnrollCountMap;
 
     public Map<String, Integer> getTotalEnrollCountMap()
@@ -242,6 +249,7 @@
         totalRegCountList = new ArrayList<Integer>();
         totalRegCountListForSelDate = new ArrayList<Integer>();
         totalEnrollCountForSelDateMap = new HashMap<String, Integer>();
+        orgUnit_ProgramMap = new HashMap<String, Integer>();
         
         resultString = "";
         
@@ -314,6 +322,15 @@
                     {
                         for ( Program program : programList )
                         {
+                            if( program.getOrganisationUnits().contains( ou ) )
+                            {
+                                orgUnit_ProgramMap.put( program.getId()+":"+ou.getId(), 1 );
+                            }
+                            else
+                            {
+                                orgUnit_ProgramMap.put( program.getId()+":"+ou.getId(), 0 );
+                            }
+                            
                             Integer tempResult = enrollCountMap.get( program.getId() );
                             if ( tempResult == null )
                             {

=== added file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetPatientDataRecordsAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetPatientDataRecordsAction.java	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetPatientDataRecordsAction.java	2011-11-03 06:07:39 +0000
@@ -0,0 +1,282 @@
+package org.hisp.dhis.dataanalyser.action;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.hisp.dhis.paging.ActionPagingSupport;
+import org.hisp.dhis.patient.Patient;
+import org.hisp.dhis.patient.PatientAttribute;
+import org.hisp.dhis.patient.PatientAttributeService;
+import org.hisp.dhis.patient.PatientService;
+import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
+import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
+import org.hisp.dhis.program.Program;
+import org.hisp.dhis.program.ProgramInstance;
+import org.hisp.dhis.program.ProgramInstanceService;
+import org.hisp.dhis.program.ProgramService;
+import org.hisp.dhis.program.ProgramStageInstance;
+import org.hisp.dhis.program.ProgramStageInstanceService;
+import org.hisp.dhis.program.comparator.ProgramStageInstanceComparator;
+
+public class GetPatientDataRecordsAction extends ActionPagingSupport<Patient>
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private OrganisationUnitService organisationUnitService;
+    
+    public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
+    {
+        this.organisationUnitService = organisationUnitService;
+    }
+
+    private PatientService patientService;
+
+    public void setPatientService( PatientService patientService )
+    {
+        this.patientService = patientService;
+    }
+
+    private ProgramService programService;
+
+    public void setProgramService( ProgramService programService )
+    {
+        this.programService = programService;
+    }
+
+    private ProgramInstanceService programInstanceService;
+
+    public void setProgramInstanceService( ProgramInstanceService programInstanceService )
+    {
+        this.programInstanceService = programInstanceService;
+    }
+
+    private ProgramStageInstanceService programStageInstanceService;
+
+    public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService )
+    {
+        this.programStageInstanceService = programStageInstanceService;
+    }
+
+    private PatientAttributeService patientAttributeService;
+
+    public void setPatientAttributeService( PatientAttributeService patientAttributeService )
+    {
+        this.patientAttributeService = patientAttributeService;
+    }
+
+    private PatientAttributeValueService patientAttributeValueService;
+
+    public void setPatientAttributeValueService( PatientAttributeValueService patientAttributeValueService )
+    {
+        this.patientAttributeValueService = patientAttributeValueService;
+    }
+
+    // -------------------------------------------------------------------------
+    // Input/output
+    // -------------------------------------------------------------------------
+
+    private Integer sortPatientAttributeId;
+
+    public void setSortPatientAttributeId( Integer sortPatientAttributeId )
+    {
+        this.sortPatientAttributeId = sortPatientAttributeId;
+    }
+
+    public Integer getSortPatientAttributeId()
+    {
+        return sortPatientAttributeId;
+    }
+
+    private Integer orgUnitId;
+    
+    public void setOrgUnitId( Integer orgUnitId )
+    {
+        this.orgUnitId = orgUnitId;
+    }
+
+    private Integer programId;
+
+    public void setProgramId( Integer programId )
+    {
+        this.programId = programId;
+    }
+
+    public Integer getProgramId()
+    {
+        return programId;
+    }
+
+    private String viewStatus;
+    
+    public void setViewStatus( String viewStatus )
+    {
+        this.viewStatus = viewStatus;
+    }
+
+    private Integer total;
+
+    public Integer getTotal()
+    {
+        return total;
+    }
+
+    private Collection<ProgramInstance> programInstances = new ArrayList<ProgramInstance>();
+
+    public Collection<ProgramInstance> getProgramInstances()
+    {
+        return programInstances;
+    }
+
+    private Map<ProgramInstance, List<ProgramStageInstance>> programStageInstanceMap = new HashMap<ProgramInstance, List<ProgramStageInstance>>();
+
+    public Map<ProgramInstance, List<ProgramStageInstance>> getProgramStageInstanceMap()
+    {
+        return programStageInstanceMap;
+    }
+
+    private Map<Integer, String> colorMap = new HashMap<Integer, String>();
+
+    public Map<Integer, String> getColorMap()
+    {
+        return colorMap;
+    }
+
+    private Map<Patient, ProgramInstance> programInstanceMap = new HashMap<Patient, ProgramInstance>();
+
+    public Map<Patient, ProgramInstance> getProgramInstanceMap()
+    {
+        return programInstanceMap;
+    }
+
+    private Map<Patient, PatientAttributeValue> patinetAttributeValueMap = new HashMap<Patient, PatientAttributeValue>();
+
+    public Map<Patient, PatientAttributeValue> getPatinetAttributeValueMap()
+    {
+        return patinetAttributeValueMap;
+    }
+
+    Collection<Patient> patientListByOrgUnit;
+
+    public Collection<Patient> getPatientListByOrgUnit()
+    {
+        return patientListByOrgUnit;
+    }
+
+    private PatientAttribute sortPatientAttribute;
+
+    public PatientAttribute getSortPatientAttribute()
+    {
+        return sortPatientAttribute;
+    }
+
+    private Program program;
+
+    public Program getProgram()
+    {
+        return program;
+    }
+
+    // -------------------------------------------------------------------------
+    // Implementation Action
+    // -------------------------------------------------------------------------
+
+    public String execute()
+        throws Exception
+    {
+        
+        OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit(  orgUnitId  );
+
+        program = programService.getProgram( programId );
+
+        //sortPatientAttribute = patientAttributeService.getPatientAttribute( sortPatientAttributeId );
+
+        // ---------------------------------------------------------------------
+        // Program instances for the selected program
+        // ---------------------------------------------------------------------
+
+        Collection<ProgramStageInstance> programStageInstances = new ArrayList<ProgramStageInstance>();
+
+        total = patientService.countGetPatientsByOrgUnitProgram( organisationUnit, program );
+
+        this.paging = createPaging( total );
+
+        //patientListByOrgUnit = new ArrayList<Patient>( patientService.getPatients( organisationUnit, program, paging
+        //    .getStartPos(), paging.getPageSize() ) );
+
+        patientListByOrgUnit = new ArrayList<Patient>( patientService.getPatients( organisationUnit, program, paging.getStartPos(), total ) );
+        
+        if( viewStatus != null && !viewStatus.equals( "ALL" ) )
+        {
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+            
+            Iterator<Patient> patientIterator = patientListByOrgUnit.iterator();            
+            while( patientIterator.hasNext() )
+            {
+                Patient p = patientIterator.next();
+                
+                if( !viewStatus.equals( simpleDateFormat.format( p.getRegistrationDate() ) ) )
+                {
+                    patientIterator.remove();
+                }                
+            }
+        }
+        
+        for ( Patient patient : patientListByOrgUnit )
+        {
+            Collection<ProgramInstance> _programInstances = programInstanceService.getProgramInstances( patient,
+                program, false );
+
+            if ( _programInstances == null || _programInstances.size() == 0 )
+            {
+                programInstanceMap.put( patient, null );
+            }
+            else
+            {
+                for ( ProgramInstance programInstance : _programInstances )
+                {
+                    programInstanceMap.put( patient, programInstance );
+
+                    programInstances.add( programInstance );
+
+                    PatientAttributeValue patientAttributeValue = patientAttributeValueService
+                        .getPatientAttributeValue( patient, sortPatientAttribute );
+
+                    patinetAttributeValueMap.put( patient, patientAttributeValue );
+
+                    List<ProgramStageInstance> programStageInstanceList = new ArrayList<ProgramStageInstance>(
+                        programInstance.getProgramStageInstances() );
+                    Collections.sort( programStageInstanceList, new ProgramStageInstanceComparator() );
+
+                    programStageInstanceMap.put( programInstance, programStageInstanceList );
+                    programStageInstances.addAll( programStageInstanceList );
+                }
+            }
+        }
+
+        // ---------------------------------------------------------------------
+        // Sorting PatientList by selected Patient Attribute
+        // ---------------------------------------------------------------------
+
+        /*
+        if ( sortPatientAttributeId != null )
+        {
+            patientListByOrgUnit = patientService.sortPatientsByAttribute( patientListByOrgUnit, sortPatientAttribute );
+        }
+         */
+        
+        colorMap = programStageInstanceService.colorProgramStageInstances( programStageInstances );
+
+        return SUCCESS;
+    }
+
+}

=== added file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetPatientDetailsAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetPatientDetailsAction.java	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetPatientDetailsAction.java	2011-11-03 06:07:39 +0000
@@ -0,0 +1,120 @@
+package org.hisp.dhis.dataanalyser.action;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.hisp.dhis.patient.Patient;
+import org.hisp.dhis.patient.PatientAttribute;
+import org.hisp.dhis.patient.PatientIdentifier;
+import org.hisp.dhis.patient.PatientIdentifierService;
+import org.hisp.dhis.patient.PatientService;
+import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
+import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
+import org.hisp.dhis.program.Program;
+import org.hisp.dhis.program.ProgramService;
+
+import com.opensymphony.xwork2.Action;
+
+public class GetPatientDetailsAction implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private PatientService patientService;
+
+    public void setPatientService( PatientService patientService )
+    {
+        this.patientService = patientService;
+    }
+
+    private PatientIdentifierService patientIdentifierService;
+
+    public void setPatientIdentifierService( PatientIdentifierService patientIdentifierService )
+    {
+        this.patientIdentifierService = patientIdentifierService;
+    }
+
+    private ProgramService programService;
+
+    public void setProgramService( ProgramService programService )
+    {
+        this.programService = programService;
+    }
+    
+    private PatientAttributeValueService patientAttributeValueService;
+
+    public void setPatientAttributeValueService( PatientAttributeValueService patientAttributeValueService )
+    {
+        this.patientAttributeValueService = patientAttributeValueService;
+    }
+
+    // -------------------------------------------------------------------------
+    // Input/Output
+    // -------------------------------------------------------------------------
+
+    private int id;
+
+    public void setId( int id )
+    {
+        this.id = id;
+    }
+
+    private Patient patient;
+
+    public Patient getPatient()
+    {
+        return patient;
+    }   
+
+    private PatientIdentifier patientIdentifier;
+
+    public PatientIdentifier getPatientIdentifier()
+    {
+        return patientIdentifier;
+    }
+
+    private Collection<Program> programs;
+
+    public Collection<Program> getPrograms()
+    {
+        return programs;
+    }
+    
+    private Map<Integer, String> patientAttributeValueMap = new HashMap<Integer, String>();
+
+    public Map<Integer, String> getPatientAttributeValueMap()
+    {
+        return patientAttributeValueMap;
+    }
+
+    // -------------------------------------------------------------------------
+    // Implementation Action
+    // -------------------------------------------------------------------------
+
+    public String execute()
+        throws Exception
+    {
+        patient = patientService.getPatient( id );       
+
+        patientIdentifier = patientIdentifierService.getPatientIdentifier( patient );        
+        
+        for( PatientAttribute patientAttribute : patient.getAttributes() )
+        {
+            patientAttributeValueMap.put( patientAttribute.getId(), PatientAttributeValue.UNKNOWN );
+        }
+
+        Collection<PatientAttributeValue> patientAttributeValues = patientAttributeValueService
+            .getPatientAttributeValues( patient );       
+
+        for ( PatientAttributeValue patientAttributeValue : patientAttributeValues )
+        {
+            patientAttributeValueMap.put( patientAttributeValue.getPatientAttribute().getId(), patientAttributeValue.getValue() );
+        }
+
+        programs = programService.getAllPrograms();
+
+        return SUCCESS;
+    }
+}
\ No newline at end of file

=== added file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/IDSPOutbreakAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/IDSPOutbreakAction.java	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/IDSPOutbreakAction.java	2011-11-03 06:07:39 +0000
@@ -0,0 +1,477 @@
+package org.hisp.dhis.dataanalyser.action;
+
+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.Calendar;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.amplecode.quick.StatementManager;
+import org.hisp.dhis.aggregation.AggregationService;
+import org.hisp.dhis.dataanalyser.util.DashBoardService;
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.indicator.IndicatorService;
+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.organisationunit.comparator.OrganisationUnitNameComparator;
+import org.hisp.dhis.period.Period;
+import org.hisp.dhis.period.PeriodService;
+import org.hisp.dhis.period.WeeklyPeriodType;
+import org.hisp.dhis.program.Program;
+import org.hisp.dhis.program.ProgramService;
+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;
+
+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 IndicatorService indicatorService;
+
+    public void setIndicatorService( IndicatorService indicatorService )
+    {
+        this.indicatorService = indicatorService;
+    }
+
+    private AggregationService aggregationService;
+
+    public void setAggregationService( AggregationService aggregationService )
+    {
+        this.aggregationService = aggregationService;
+    }
+
+    private PeriodService periodService;
+
+    public void setPeriodService( PeriodService periodService )
+    {
+        this.periodService = periodService;
+    }
+
+    private CurrentUserService currentUserService;
+
+    public void setCurrentUserService( CurrentUserService currentUserService )
+    {
+        this.currentUserService = currentUserService;
+    }
+
+    private DashBoardService dashBoardService;
+
+    public void setDashBoardService( DashBoardService dashBoardService )
+    {
+        this.dashBoardService = dashBoardService;
+    }
+
+    private ProgramService programService;
+
+    public void setProgramService( ProgramService programService )
+    {
+        this.programService = programService;
+    }
+
+    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;
+    // ---------------------------------------------------------------
+    // Action Implementation
+    // ---------------------------------------------------------------
+
+    public String execute()
+        throws Exception
+    {
+        statementManager.initialise();
+
+        
+        int idspFlag = 0;
+        if ( currentUserService.getCurrentUser() != null )
+        {
+            UserCredentials userCredentials = userService.getUserCredentials( currentUserService.getCurrentUser() );
+
+            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 = dashBoardService.getPeriodIdForIDSPOutBreak();
+        String periodId = periodIdString.split( "::" )[0];
+        navigationString += " ( "+ periodIdString.split( "::" )[1] +" )";
+        
+        String populationPeriodId = dashBoardService.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=\"index.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 OrganisationUnitNameComparator() );
+    
+                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 = dashBoardService.getAggregatedData( orgUnitIdsByComma1, populationDeId, populationPeriodId );
+                    
+                    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 = dashBoardService.getAggregatedData( orgUnitIdsByComma, caseId, periodId );
+                        
+                        int deathData = dashBoardService.getAggregatedData( orgUnitIdsByComma, deathId, periodId );
+                        
+                        if( deathData >= 1 )
+                        {
+                            outBreakAlertMap.put( normName+":"+ou.getId(), deathData + " Deaths" );
+                            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( 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 = dashBoardService.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 )
+            {
+                System.out.println( "There is no MAP XML file in the DHIS2 Home" );
+                return null;
+            }
+
+            populationDeId = doc.getElementsByTagName( "population" ).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;
+    }
+    
+}

=== added file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/sms/action/GenerateDueDatesFormAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/sms/action/GenerateDueDatesFormAction.java	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/sms/action/GenerateDueDatesFormAction.java	2011-11-03 06:07:39 +0000
@@ -0,0 +1,220 @@
+package org.hisp.dhis.dataanalyser.sms.action;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+
+import org.hisp.dhis.period.PeriodService;
+
+import com.opensymphony.xwork2.Action;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import org.hisp.dhis.dataanalyser.util.BulkSMSHttpInterface;
+import org.hisp.dhis.dataanalyser.util.DashBoardService;
+import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.oust.manager.SelectionTreeManager;
+import org.hisp.dhis.program.Program;
+import org.hisp.dhis.program.ProgramService;
+import org.hisp.dhis.program.ProgramStage;
+import org.hisp.dhis.program.ProgramStageService;
+
+public class GenerateDueDatesFormAction implements Action
+{
+    
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------    
+    
+    private PeriodService periodService;
+
+    private int orgId;
+
+    public void setPeriodService( PeriodService periodService )
+    {
+        this.periodService = periodService;
+    }
+    
+    private DataSetService dataSetService;
+
+    public void setDataSetService( DataSetService dataSetService )
+    {
+        this.dataSetService = dataSetService;
+    }
+
+    public SelectionTreeManager selectionTreeManager;
+
+    public void setSelectionTreeManager( SelectionTreeManager selectionTreeManager )
+    {
+        this.selectionTreeManager = selectionTreeManager;
+    }
+    private ProgramService programService;
+
+    public void setProgramService( ProgramService programService )
+    {
+        this.programService = programService;
+    }
+private Collection<Program> allPrograms;
+
+    public Collection<Program> getAllPrograms()
+    {
+        return allPrograms;
+    }
+   private String result="";
+
+    public String getResult()
+    {
+        return result;
+    }
+
+   
+private String selectDates;
+
+    public void setSelectDates( String selectDates )
+    {
+        this.selectDates = selectDates;
+    }
+    private String programName;
+
+    public void setProgramName( String programName )
+    {
+        this.programName = programName;
+    }
+    
+    private DashBoardService dashBoardService;
+
+    public void setDashBoardService( DashBoardService dashBoardService )
+    {
+        this.dashBoardService = dashBoardService;
+    }
+    
+    private ProgramStageService programStageService;
+
+    public void setProgramStageService( ProgramStageService programStageService )
+    {
+        this.programStageService = programStageService;
+    }
+    
+    public String execute() throws Exception
+    {
+       
+        Collection<Collection<String>> messgs=new ArrayList<Collection<String>>();
+      System.out.println("date="+selectDates+"prg name="+programName);
+        
+      if (programName==null){
+      programName="1";
+      }  
+      if (selectDates==null){
+      selectDates="today";
+      }
+        allPrograms = programService.getAllPrograms();
+        
+        Collection<HashMap> dueDates = null;
+       String str,phoneNumber,startDate,endDate="2011-03-29";
+       Calendar cal=Calendar.getInstance();
+      SimpleDateFormat dateFormat=new SimpleDateFormat( "yy-MM-dd"); 
+       startDate=dateFormat.format( cal.getTime());
+       
+       if (selectDates.equalsIgnoreCase( "today") ){
+       endDate=startDate;
+       System.out.println("1start date="+startDate+"end="+endDate);
+       }else if (selectDates.equalsIgnoreCase( "tomorrow") ){
+       cal.add( Calendar.DAY_OF_MONTH, 1);
+       endDate=dateFormat.format( cal.getTime());
+      System.out.println("2start date="+startDate+"end="+endDate);
+       }else if (selectDates.equalsIgnoreCase( "nweek") ){
+       cal.add( Calendar.DAY_OF_MONTH, 7);
+       endDate=dateFormat.format( cal.getTime());
+     System.out.println("3start date="+startDate+"end="+endDate);  }
+       else if (selectDates.equalsIgnoreCase( "nmonth") ){
+       cal.add( Calendar.MONTH, 1);
+       endDate=dateFormat.format( cal.getTime());
+       System.out.println("4start date="+startDate+"end="+endDate);}
+       
+       System.out.println("start date="+startDate+"end="+endDate);
+       
+       
+       OrganisationUnit next;
+       Collection<OrganisationUnit> selectedOrganisationUnits = selectionTreeManager.getSelectedOrganisationUnits();
+        Iterator<OrganisationUnit> iterator = selectedOrganisationUnits.iterator();
+      
+        while(iterator.hasNext()){
+            next = iterator.next();
+       orgId=next.getId();
+            phoneNumber = next.getPhoneNumber();
+      // System.out.println("orgid="+orgId);
+          
+            
+       dueDates=dashBoardService.getDueDates( Integer.parseInt( programName), orgId, startDate,endDate);
+      if (!dueDates.isEmpty()){
+          Collection<String> dDatesForOrg = new ArrayList<String>();  
+          dDatesForOrg.add( ""+orgId);
+          dDatesForOrg.add( phoneNumber);
+          Iterator<HashMap> iteratorDueD = dueDates.iterator();
+          while(iteratorDueD.hasNext()){
+                    HashMap dueD = iteratorDueD.next();
+                    int programStageId=Integer.parseInt( dueD.get( "id").toString());
+                    ProgramStage programStageTemp = programStageService.getProgramStage( programStageId);
+                    String prgmStageNameTemp = programStageTemp.getName();
+                    str=dueD.get( "name")+","+dueD.get( "date") +","+prgmStageNameTemp;
+       
+              dDatesForOrg.add( str );
+       //System.out.println(str);
+          }
+                messgs.add( dDatesForOrg );                        
+          
+       }
+     
+       }
+       
+        sendSms(messgs);
+        
+        
+       result="";
+        return SUCCESS;
+    }
+
+    private void sendSms( Collection<Collection<String>> messgs ) throws IOException
+    {
+        String phoneNumber,orgId,message = "",res;
+        int countNoOfMesg=0;
+        BulkSMSHttpInterface bulkSmsHttpInterface =new BulkSMSHttpInterface();
+        
+        
+        Iterator<Collection<String>> iterator = messgs.iterator();
+   while(iterator.hasNext()){
+            Collection<String> messgForAnOrgUnit = iterator.next();
+            Iterator<String> iteratorMsgOrg = messgForAnOrgUnit.iterator();
+            orgId=iteratorMsgOrg.next();
+            phoneNumber=iteratorMsgOrg.next();
+            System.out.println("messages for orgunit="+orgId+"with phone="+phoneNumber);
+            countNoOfMesg=0;
+            while(iteratorMsgOrg.hasNext()){
+                String next = iteratorMsgOrg.next();
+                if (message.length()+next.length()>=160 ){
+                countNoOfMesg++;
+                System.out.println("message"+countNoOfMesg+"="+message);
+            res = bulkSmsHttpInterface.sendMessage( message, phoneNumber );
+            System.out.println(res);
+            
+                message=next;
+                }else{
+                message+=";"+next;
+                }
+            }
+            countNoOfMesg++;
+            System.out.println("message"+countNoOfMesg+"="+message);
+            res = bulkSmsHttpInterface.sendMessage( message, phoneNumber );
+            System.out.println(res);
+           
+            System.out.println("--------------------------");
+            message="";
+   }
+    
+    
+    }
+
+    
+}

=== added file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/sms/action/SendDueDatesFormAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/sms/action/SendDueDatesFormAction.java	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/sms/action/SendDueDatesFormAction.java	2011-11-03 06:07:39 +0000
@@ -0,0 +1,88 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.hisp.dhis.dataanalyser.sms.action;
+
+
+import com.opensymphony.xwork2.Action;
+import java.util.Collection;
+import java.util.Iterator;
+import org.hisp.dhis.dataanalyser.util.DashBoardService;
+import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.oust.manager.SelectionTreeManager;
+import org.hisp.dhis.period.PeriodService;
+import org.hisp.dhis.program.Program;
+import org.hisp.dhis.program.ProgramService;
+
+/**
+ *
+ * @author harsh
+ */
+public class SendDueDatesFormAction implements Action
+{
+
+    private PeriodService periodService;
+
+    public void setPeriodService( PeriodService periodService )
+    {
+        this.periodService = periodService;
+    }
+    
+    private DataSetService dataSetService;
+
+    public void setDataSetService( DataSetService dataSetService )
+    {
+        this.dataSetService = dataSetService;
+    }
+
+    public SelectionTreeManager selectionTreeManager;
+
+    public void setSelectionTreeManager( SelectionTreeManager selectionTreeManager )
+    {
+        this.selectionTreeManager = selectionTreeManager;
+    }
+    private ProgramService programService;
+
+    public void setProgramService( ProgramService programService )
+    {
+        this.programService = programService;
+    }
+
+    private DashBoardService dashBoardService;
+
+    public void setDashBoardService( DashBoardService dashBoardService )
+    {
+        this.dashBoardService = dashBoardService;
+    }
+
+    private String result="";
+
+    public String getResult()
+    {
+        return result;
+    }
+
+   private String selectDates;
+
+    public void setSelectDates( String selectDates )
+    {
+        this.selectDates = selectDates;
+    }
+    
+    @Override
+    public String execute() throws Exception
+    {
+        Collection<OrganisationUnit> selectedOrganisationUnits = selectionTreeManager.getSelectedOrganisationUnits();
+        Iterator<OrganisationUnit> iterator = selectedOrganisationUnits.iterator();
+       while(iterator.hasNext())
+        System.out.print("sel->"+iterator.next());
+        System.out.println("sele"+selectDates);
+       // dashBoardService.getDueDates( 1, organisationUnitId, null );
+        
+       result="module in progress....";    
+        return SUCCESS;
+    }
+    
+}

=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/util/BulkSMSHttpInterface.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/util/BulkSMSHttpInterface.java	2011-10-13 09:49:44 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/util/BulkSMSHttpInterface.java	2011-11-03 06:07:39 +0000
@@ -61,6 +61,12 @@
 
     public String sendMessage( String message, String phoneNo ) throws MalformedURLException, IOException
     {
+        if (message==null || phoneNo==null){
+        return "either message or phone no null";
+        }else if (message.equalsIgnoreCase( "")||phoneNo.equalsIgnoreCase( "") ){
+        return "either message or phone no empty";
+        
+        }
         //Populating the data according to the api link
         data = "username=" + username + "&password=" + password + "&sendername=" + senderName + "&mobileno=" + phoneNo + "&message=" + message;
 

=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/util/DashBoardService.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/util/DashBoardService.java	2011-10-14 12:26:01 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/util/DashBoardService.java	2011-11-03 06:07:39 +0000
@@ -57,6 +57,7 @@
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.period.PeriodService;
 import org.hisp.dhis.period.PeriodType;
+import org.hisp.dhis.period.WeeklyPeriodType;
 import org.hisp.dhis.reports.ReportService;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.jdbc.support.rowset.SqlRowSet;
@@ -118,7 +119,143 @@
         this.jdbcTemplate = jdbcTemplate;
     }
 
-    
+
+    public String getRAFolderName()
+    {
+        return reportservice.getRAFolderName();
+    }
+    
+
+    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 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 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 String getProgramwiseSummarySMS( OrganisationUnit orgUnit )
     {
@@ -225,8 +362,7 @@
         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 );
             
@@ -268,6 +404,45 @@
     }
 
     
+    public  Collection<HashMap> getDueDates(int programInstance,int organisationUnitId,String startDate,String endDate)
+    {
+        String name=null;
+        Date date=null;
+        int instId;
+        Collection<HashMap> data=new ArrayList<HashMap>();
+        try
+        {
+            String query = "select patient.firstname,patient.organisationunitid, programstageinstance.duedate,programstageinstance.programstageid from programstageinstance inner join programinstance on programinstance.programinstanceid = programstageinstance.programinstanceid inner join patient on patient.patientid = programinstance.patientid  where" +" "+
+                               " programinstance.programid ='"+programInstance+"' and patient.organisationunitid = '"+organisationUnitId+"' and duedate >= '"+startDate+"' and duedate <= '"+endDate+"' and programinstance.completed = false ";
+
+            SqlRowSet rs = jdbcTemplate.queryForRowSet( query );
+         //  System.out.println(rs.toString());
+            while (    rs.next() )
+            {
+                  name= rs.getString( 1);
+                  int temp=rs.getInt( 2);
+                  date=rs.getDate( 3);
+                  instId=rs.getInt( 4);
+        HashMap aggDeMap = new HashMap();
+         
+            
+                    aggDeMap.put( "name", name);
+                    aggDeMap.put( "date", date);
+                    aggDeMap.put( "id", instId);
+            data.add( aggDeMap );
+            
+            }
+            
+         return  data;
+        }
+        catch( Exception e )
+        {
+            e.printStackTrace();
+            throw new RuntimeException( e );
+        }
+    }
+
+    
     public List<Period> getMonthlyPeriods( Date start, Date end )
     {
         PeriodType monthlyPeriodType = PeriodType.getByNameIgnoreCase( "monthly" );

=== 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-10-13 09:49:44 +0000
+++ local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml	2011-11-03 06:07:39 +0000
@@ -17,6 +17,41 @@
         <property name="statementManager" ref="statementManager"/>
     </bean>
 	
+  <bean id="org.hisp.dhis.dataanalyser.action.GetPatientDataRecordsAction" class="org.hisp.dhis.dataanalyser.action.GetPatientDataRecordsAction"
+    scope="prototype">
+    <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+    <property name="programService" ref="org.hisp.dhis.program.ProgramService" />
+    <property name="programInstanceService" ref="org.hisp.dhis.program.ProgramInstanceService" />
+    <property name="programStageInstanceService" ref="org.hisp.dhis.program.ProgramStageInstanceService" />
+    <property name="patientService" ref="org.hisp.dhis.patient.PatientService" />
+    <property name="patientAttributeService" ref="org.hisp.dhis.patient.PatientAttributeService" />
+    <property name="patientAttributeValueService" ref="org.hisp.dhis.patientattributevalue.PatientAttributeValueService" />
+  </bean>
+	
+  <bean id="org.hisp.dhis.dataanalyser.action.GetPatientDetailsAction" class="org.hisp.dhis.dataanalyser.action.GetPatientDetailsAction"
+    scope="prototype">
+    <property name="patientService" ref="org.hisp.dhis.patient.PatientService" />
+    <property name="patientIdentifierService" ref="org.hisp.dhis.patient.PatientIdentifierService" />
+    <property name="programService" ref="org.hisp.dhis.program.ProgramService" />
+    <property name="patientAttributeValueService" ref="org.hisp.dhis.patientattributevalue.PatientAttributeValueService" />
+  </bean>
+
+    <bean id="org.hisp.dhis.dataanalyser.action.IDSPOutbreakAction"
+        class="org.hisp.dhis.dataanalyser.action.IDSPOutbreakAction"
+        scope="prototype">
+        <property name="aggregationService" ref="org.hisp.dhis.aggregation.AggregationService" />
+        <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
+		<property name="userService" ref="org.hisp.dhis.user.UserService" />
+        <property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService" />
+        <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
+        <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+        <property name="dashBoardService" ref="org.hisp.dhis.dataanalyser.util.DashBoardService" />
+        <property name="programService" ref="org.hisp.dhis.program.ProgramService" />
+        <property name="statementManager" ref="statementManager"/>
+		<property name="orgUnitGroupService" ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
+    </bean>
+
+	
 <!-- Graphical Analyser DataElements -->
 	 <bean id="org.hisp.dhis.dataanalyser.ga.action.GenerateGraphicalAnalyserDataElementsFormAction"
         class="org.hisp.dhis.dataanalyser.ga.action.GenerateGraphicalAnalyserDataElementsFormAction"
@@ -517,7 +552,7 @@
     </bean> 
 	
 	<!-- View Comment Related Stuff -->
-	
+<!--	
 	<bean id="org.hisp.dhis.dataanalyser.vc.action.ViewCommentFormAction"
     	class="org.hisp.dhis.dataanalyser.vc.action.ViewCommentFormAction" 
 		scope="prototype">
@@ -539,9 +574,7 @@
 		  <ref bean="org.hisp.dhis.oust.manager.SelectionTreeManager"/>
 	    </property>
 	</bean>
-	
-	
-		
+-->			
 	
 	<!-- DataStatus -->
 	
@@ -1388,7 +1421,30 @@
         <property name="jdbcTemplate" ref="jdbcTemplate"/>
 	</bean>		
 
-    <!-- BULK SMS -->
+    <!-- BULK SMS due dates -->
+    
+    <bean id="org.hisp.dhis.dataanalyser.sms.action.GenerateDueDatesFormAction"
+		class="org.hisp.dhis.dataanalyser.sms.action.GenerateDueDatesFormAction"
+		scope="prototype">
+       <property name="selectionTreeManager" ref="org.hisp.dhis.oust.manager.SelectionTreeManager" />
+         <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
+        <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />    
+         <property name="programService" ref="org.hisp.dhis.program.ProgramService" />
+		<property name="dashBoardService" ref="org.hisp.dhis.dataanalyser.util.DashBoardService" />
+		 <property name="programStageService" ref="org.hisp.dhis.program.ProgramStageService" />
+		
+        </bean>			
+	
+    <bean id="org.hisp.dhis.dataanalyser.sms.action.SendDueDatesFormAction"
+		class="org.hisp.dhis.dataanalyser.sms.action.SendDueDatesFormAction"
+		scope="prototype">
+       <property name="selectionTreeManager" ref="org.hisp.dhis.oust.manager.SelectionTreeManager" />
+         <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
+        <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />    
+         <property name="programService" ref="org.hisp.dhis.program.ProgramService" />
+		<property name="dashBoardService" ref="org.hisp.dhis.dataanalyser.util.DashBoardService" />
+		 </bean>			
+	
     <!-- BULK SMS: Programwise Summary -->
     <bean id="org.hisp.dhis.dataanalyser.sms.action.BulkSMSForProgSummaryFormAction"
         class="org.hisp.dhis.dataanalyser.sms.action.BulkSMSForProgSummaryFormAction"
@@ -1400,6 +1456,8 @@
         scope="prototype">
         <property name="userGroupService" ref="org.hisp.dhis.user.UserGroupService" />
 		<property name="dashBoardService" ref="org.hisp.dhis.dataanalyser.util.DashBoardService" />
+    <property name="programService" ref="org.hisp.dhis.program.ProgramService" />
+		
     </bean>     
 		
 </beans>
\ No newline at end of file

=== modified file 'local/in/dhis-web-dashboard/src/main/resources/struts.xml'
--- local/in/dhis-web-dashboard/src/main/resources/struts.xml	2011-10-13 09:49:44 +0000
+++ local/in/dhis-web-dashboard/src/main/resources/struts.xml	2011-11-03 06:07:39 +0000
@@ -8,15 +8,40 @@
 	<package name="dhis-web-dashboard" extends="dhis-web-commons"
 		namespace="/dhis-web-dashboard">
 		
-		<action name="index"
+		
+		<action name="index1"
 			class="org.hisp.dhis.dataanalyser.action.DashBoardHomePageAction">
 			<result name="success" type="velocity">/main.vm</result>
 			<param name="page">/dhis-web-dashboard/welcome.vm</param>
 			<param name="menu">/dhis-web-dashboard/menu.vm</param>
-			<param name="javascripts">javascript/ext-all.js</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.dataanalyser.action.GetPatientDataRecordsAction">
+      <result name="success" type="velocity">/content.vm</result>
+      <param name="page">/dhis-web-dashboard/viewPatientDataRecords.vm</param>
+      <param name="stylesheets">../dhis-web-commons/paging/paging.css</param>
+    </action>
+		
+    <action name="getPatientDetails" class="org.hisp.dhis.dataanalyser.action.GetPatientDetailsAction">
+      <result name="success" type="velocity-xml">/dhis-web-dashboard/responsePatient.vm</result>
+      <param name="onExceptionReturn">plainTextError</param>
+    </action>    
+
+	<action name="index"
+		class="org.hisp.dhis.dataanalyser.action.IDSPOutbreakAction">
+		<result name="standard" type="redirect">index1.action</result>
+		<result name="success" type="velocity">/main.vm</result>
+		<param name="page">/dhis-web-dashboard/idspOutBreak.vm</param>
+		<param name="menu">/dhis-web-dashboard/menu.vm</param>
+		<param name="javascripts">javascript/ext-all.js,javascript/db.js</param>
+		<param name="stylesheets">css/ext-all.css,example.css</param>
+		<!--<param name="requiredAuthorities">F_IDSP_OUTBREAK</param>-->
+	</action>
+
+		
 		<!-- GraphicalAnalyser  DataElements -->
 		<action name="graphicalAnalyserDataElement"
 			class="org.hisp.dhis.dataanalyser.ga.action.GenerateGraphicalAnalyserDataElementsFormAction">
@@ -965,10 +990,26 @@
 			<param name="page">/dhis-web-dashboard/dataEntrySummaryStatusResult.vm</param>
 			<param name="javascripts">javascript/ds.js,javascript/hashtable.js</param>
 			<param name="stylesheets">css/StylesForTags.css</param>
+
 		</action>
 
-	<!-- BULK SMS -->
-	<!-- BULK SMS: Programwise Summary -->
+	<!-- BULK SMS due dates-->
+	 <action name="dueDates"
+			class="org.hisp.dhis.dataanalyser.sms.action.GenerateDueDatesFormAction">
+			<result name="success" type="velocity">/main.vm</result>
+			<param name="menu">/dhis-web-dashboard/menuWithTreeForSms.vm</param>
+			<param name="page">/dhis-web-dashboard/dueDatesForm.vm</param>
+        
+		</action>					
+     <action name="sendDueDates"
+			class="org.hisp.dhis.dataanalyser.sms.action.SendDueDatesFormAction">
+			<result name="success" type="velocity">/main.vm</result>
+			<param name="menu">/dhis-web-dashboard/menuWithTreeForSms.vm</param>
+			<param name="page">/dhis-web-dashboard/dueDatesForm.vm</param>
+        
+		</action>					
+	
+    <!-- BULK SMS: Programwise Summary -->
         <action name="prgwiseSummaryBulkSMSForm"
             class="org.hisp.dhis.dataanalyser.sms.action.BulkSMSForProgSummaryFormAction">
             <result name="success" type="velocity">/main.vm</result>
@@ -982,6 +1023,6 @@
             <param name="menu">/dhis-web-dashboard/menu.vm</param>
         </action>
 
-
 	</package>
+
 </struts>
\ No newline at end of file

=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dataStatusDataSetWiseFront.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dataStatusDataSetWiseFront.vm	2011-05-18 11:12:17 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dataStatusDataSetWiseFront.vm	2011-11-03 06:07:39 +0000
@@ -1,62 +1,1 @@
-<style type='text/css'>
-    .hidden{ display: none; }
-</style>
-
-<script>
-    // Global Variables
-    var selCategory = "";
-    var selFacility = "";
-    var ouName = "";
-    var dsName = "";
-    var sDateIndex = 0;
-    var eDateIndex = 0;
-    var sDate = "";
-    var eDate = "";
-    var curPeriodType = "";
-</script>
-
-<h3>$i18n.getString( "dsform_datasetwise" )</h3>
-<hr />
-
-<form id="ChartGenerationDataSetWiseForm" name="ChartGenerationDataSetWiseForm" action="dataStatusDataSetWiseResult.action"  onsubmit="return formValidationsDataStatusDataSetWise()" method="get" target="chartWindow1">
-    <table align="center" style="border-collapse: collapse; margin-top: 0;" cellpadding="0" cellspacing="0" width="80%" border="0">
-        <tr>
-            <td class="NormalB">
-				1. $i18n.getString( "ds_periodtype" ) : <br/>
-				<select id="periodTypeId" name="periodTypeId" onchange="getPeriodsForDataSetWise()" style="width:200px">
-					<option value="NA">[ $i18n.getString( "select_periodtype" ) ]</option>
-					#foreach ( $periodType in $periodTypes )
-						<option value='$periodType.name' title='$periodType.name'>$periodType.name</option>
-					#end
-				</select>
-				<br/><br/>
-				2. $i18n.getString( "ga_from" )<br />
-				<select id="sDateLB" name="sDateLB" style="width:200px"></select>
-				<br/><br/>
-				3. $i18n.getString( "ga_to" )<br />
-				<select id="eDateLB" name="eDateLB" style="width:200px"></select>
-				<br/><br/>
-				4. $i18n.getString( "ga_facilityby" )<br/>
-				<select id="facilityLB" name="facilityLB" onchange="facilityChangeDataSetWiseFunction(event)" style="width:200px">
-                    <option value="random" >Selected</option>
-                    <option value="immChildren" selected>Immediate Children</option>
-                    <option value="children" >Child Tree</option>
-                </select>				
-			</td>
-			<td class="NormalB">
-				<input type="checkbox" name="includeZeros" id="includeZeros" checked> Include Zero
-				<br/><br/>
-				5. $i18n.getString( "ga_orgunit" )<br />
-				<select name="orgUnitListCB" id="orgUnitListCB" multiple style="width:200px;height:100px" ondblclick="remOUDataSetWiseFunction()">
-                </select>
-                <br/><br/>
-                <input type="submit" name="ViewSummary" value="View DataSummary" style="width:200px" />			
-			</td>
-		</tr>
-    </table>
-    <input type="hidden" name="selectedButton" id="selectedButton"/>
-</form>
-
-<script>
-	//getdSetPeriods();
-</script>
\ No newline at end of file
+<h3>vbskvfbskdfb</h3>
\ No newline at end of file

=== added file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dueDatesForm.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dueDatesForm.vm	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dueDatesForm.vm	2011-11-03 06:07:39 +0000
@@ -0,0 +1,45 @@
+
+<style type="text/css">
+    .statusBar{
+        color: white;
+        padding: 5px 5px;
+        margin: -16px 0 20px -20px;
+        font-weight: bold;
+        background-color: #8FABC7;
+    }
+</style>
+
+<form id="formDueDate" name="formDueDate" method="post">
+<h3>Sending Due Dates</h3>
+<div>
+
+Program
+<select size="1" name="programName" id="programName">
+#foreach($program in $allPrograms)
+<option value=$program.id>$program.name</option>
+#end
+</select>
+
+Period
+<select type="multiple" id="selectDates" name="selectDates">
+<option value="today">Today</option>
+<option value="tomorrow">Tomorrow</option>
+<option value="nweek">Next week</option>
+<option value="nmonth">Next month</option>
+</select>
+</div>
+<br><br>
+<div>
+<tr>
+	#parse( "/dhis-web-commons/oust/selectionTreeMultipleSelect.vm" )
+</tr>
+<div>
+
+<button type="submit" name="send" >send messages</button>
+</form
+<br>
+<p>
+<span id="result" style="#if($result.trim().equals("")) none#else background-color:yellow;
+border:3px; padding:.3em;#end">  $result
+</span>
+</p>
\ No newline at end of file

=== added file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/idspOutBreak.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/idspOutBreak.vm	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/idspOutBreak.vm	2011-11-03 06:07:39 +0000
@@ -0,0 +1,33 @@
+
+<div>$navigationString</div>
+
+<script>
+    leftBar.hideAnimated();
+</script>
+
+#set( $mark = 0 )
+
+<table valign="top" width="95%" border="1" cellspacing="0" cellpadding="5" >
+    <tr bgcolor="#c0c0c0" style="height:23px">
+        <td align="center"><strong>$rootOrgUnitName</strong></td>
+        #foreach( $normName in $normNames )
+        <td align="center" ><strong>$normName</strong></td>
+        #end
+    </tr>
+
+    #set( $count1 = 0 )
+    #foreach( $orgUnit in $immChildrenList )
+		<tr style="#if( $mark == 1 )background-color:#e0e0e0;#end height:23px" >
+			<td><a href="index.action?drillDownOrgUnitId=$orgUnit.id">$orgUnit.shortName</a></td>
+			#foreach( $normName in $normNames )
+				<td align="center" style='background-color:$outBreakAlertColorMap.get("$normName:$orgUnit.id");'>$outBreakAlertMap.get( "$normName:$orgUnit.id" )</td>
+			#end
+		</tr>
+		#set( $count1 = $count1 + 1 )
+		#if( $mark == 1 )
+			#set( $mark = 0 )
+		#else
+			#set( $mark = 1 )
+		#end    
+    #end
+</table>

=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/db.js'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/db.js	2011-09-03 09:46:15 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/db.js	2011-11-03 06:07:39 +0000
@@ -437,4 +437,117 @@
                 orgUnitListObj.options[i].selected = false;
         }
     }
-}
\ No newline at end of file
+}
+
+
+
+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 )
+{
+
+	var request = new Request();
+    request.setResponseTypeXML( 'patient' );
+    request.setCallbackSuccess( patientReceived );
+    request.send( 'getPatientDetails.action?id=' + patientId );
+
+}
+
+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();
+}

=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menu.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menu.vm	2011-10-13 09:49:44 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menu.vm	2011-11-03 06:07:39 +0000
@@ -26,7 +26,8 @@
 		   	</ul>
 		<li>$i18n.getString( "bulk_sms" )</li>
 			<ul>
-				<li><a href="#">$i18n.getString( "Due Dates" )</a></li>
+
+				<li><a href="dueDates.action">$i18n.getString( "Due Dates" )</a></li>
 				<li><a href="prgwiseSummaryBulkSMSForm.action">$i18n.getString( "Programwise Summary" )</a></li>
 			</ul>
 	</ul>
\ No newline at end of file

=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menuWithTreeForDSDataSetWise.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menuWithTreeForDSDataSetWise.vm	2011-05-18 11:12:17 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menuWithTreeForDSDataSetWise.vm	2011-11-03 06:07:39 +0000
@@ -6,7 +6,6 @@
 		<li>$i18n.getString( "ds_dataset_wise" )</li>
 	 </ul>
 </ul>
-
 #parse( "/dhis-web-commons/ouwt/orgunittreesearch.vm" )
 
 <script type="text/javascript">
@@ -19,7 +18,7 @@
 		}
 		if( orgUnitIds != null )
 		{
-			getOUDeatilsForDataStatusDataSetWise( orgUnitIds );
+			getOUDeatilsForDataStatus( orgUnitIds );
 		}
 	}
 

=== added file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menuWithTreeForSms.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menuWithTreeForSms.vm	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menuWithTreeForSms.vm	2011-11-03 06:07:39 +0000
@@ -0,0 +1,10 @@
+
+<a href="index.action"><h2>$i18n.getString( "dataanalyser" )</h2></a>
+
+<ul>
+	<li>$i18n.getString( "ds_sms" )</li>
+	<ul>
+		<li>$i18n.getString( "due dates" )</li>
+	 </ul>
+</ul>
+	
\ No newline at end of file

=== added file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/responsePatient.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/responsePatient.vm	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/responsePatient.vm	2011-11-03 06:07:39 +0000
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<patient>
+  <id>$patient.id</id>  
+  <fullName>$encoder.xmlEncode( $patient.getFullName() )</fullName>
+  <gender>$encoder.xmlEncode( $patient.gender )</gender>
+  <dobType>#if($!patient.dobType)$!patient.dobType#else $i18n.getString('none') #end</dobType>
+  <dateOfBirth>$format.formatDate( $!patient.birthDate )</dateOfBirth>
+  <age>$encoder.xmlEncode( $patient.getAge() )</age>
+  <bloodGroup>#if($!patient.bloodGroup) $patient.bloodGroup #else $i18n.getString('none') #end</bloodGroup>
+  #foreach( $patientIdentifier in $patient.identifiers )
+    <identifier>        
+        <identifierText>$encoder.xmlEncode( $patientIdentifier.identifier )</identifierText>
+     </identifier>
+  #end
+  #foreach( $attribute in $patient.attributes )
+    #set( $attributeValue = false )
+    #set( $attributeValue = $patientAttributeValueMap.get( $attribute.id ) )             
+    <attribute>
+        <name>$encoder.xmlEncode( $attribute.name )</name>
+        <value>$encoder.xmlEncode( $attributeValue )</value>
+    </attribute> 
+  #end  
+  #foreach( $program in $patient.programs )
+    <program>
+        <name>$encoder.xmlEncode( $program.name )</name>
+    </program> 
+  #end         
+</patient>

=== added file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/viewPatientDataRecords.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/viewPatientDataRecords.vm	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/viewPatientDataRecords.vm	2011-11-03 06:07:39 +0000
@@ -0,0 +1,68 @@
+<table class="mainPageTable">
+    <tr>
+        <td style="vertical-align:top">    
+        <table class="listTable">
+				<col>
+            #if( $sortPatientAttribute )
+                <col>
+            #end
+            #foreach( $programStage in $program.programStages )
+                <col>
+            #end       
+            <tr>
+				<th style="text-align:center">Sl. No.</th>
+                #if( $sortPatientAttribute )
+                    <th style="text-align:center">$encoder.htmlEncode( $sortPatientAttribute.name )</th>
+                #end
+                <th style="text-align:center">$i18n.getString( "full_name" )</th>
+                #foreach( $programStage in $program.programStages )
+                    <th style="text-align:center">$encoder.htmlEncode( $programStage.name )</th>
+                #end                
+            </tr>
+          
+            <tbody id="list">
+                #set( $mark = false )
+				#set( $count1 = 0 )                 
+                #foreach( $patient in $patientListByOrgUnit )
+                    #set( $programInstance = $programInstanceMap.get( $patient ) )
+					#set( $count1 = $count1 + 1 )
+                    <tr #alternate( $mark )>
+						<td>$count1</td>
+                        #if( $sortPatientAttribute )
+                            #set( $patientAttributeValue = $patinetAttributeValueMap.get( $patient ) )
+                            <td>$!patientAttributeValue.value</td>
+                        #end
+                        <td><a href="javascript:showPatientDetails( $programInstance.patient.id )" title="$i18n.getString( "show_details" )">$patient.getFullName()</a></td>                    
+                        #foreach( $programStageInstance in $programStageInstanceMap.get( $programInstance ) )
+                            #if( $programStageInstance.executionDate )
+                                <td style="text-align:center" bgcolor="$colorMap.get( $programStageInstance.id )">$format.formatDate( $programStageInstance.executionDate )</td>
+                            #else
+                                <td style="text-align:center" bgcolor="$colorMap.get( $programStageInstance.id )">$format.formatDate( $programStageInstance.dueDate )</td>
+                            #end
+                        #end
+                    </tr>
+                    #if( $mark )
+                        #set( $mark = false )
+                    #else
+                        #set( $mark = true )
+                    #end 
+                #end    
+            </tbody>
+        </table>
+        </td>
+    </tr>
+</table>
+
+<div class="paging-container">
+    ##parse( "/dhis-web-commons/paging/paging.vm" )
+</div>
+
+<div id="detailsArea" style="display:none;overflow:auto;height:250px;width:250px">
+    <div style="float:right">
+        <a href="javascript:hideDetails()" title="$i18n.getString( "hide_details" )"><img src="../images/close.png" alt="$i18n.getString( "hide_details" )"></a>
+    </div>
+    <p><label>$i18n.getString( "common_info" ):</label><br><span id="commonInfoField"></span></p>   
+    <p><label>$i18n.getString( "identifier" ):</label><br><span id="identifierField"></span></p>
+    <p><label>$i18n.getString( "attributes" ):</label><br><span id="attributeField"></span></p>
+    <p><label>$i18n.getString( "enrolled_in_program" ):</label><br><span id="programField"></span></p>
+</div>

=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/welcomeTracker.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/welcomeTracker.vm	2011-10-14 12:26:01 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/welcomeTracker.vm	2011-11-03 06:07:39 +0000
@@ -31,8 +31,13 @@
 		<td align="center">$totalRegCountList.get( $count1 )</td>
 		<td align="center">$totalRegCountListForSelDate.get( $count1 )</td>
 		#foreach( $program in $programList )
-		<td align="center">$totalEnrollCountMap.get( "$program.id:$orgUnit.id" )</td>
-		<td align="center">$totalEnrollCountForSelDateMap.get( "$program.id:$orgUnit.id" )</td>
+			#if( $orgUnit_ProgramMap.get( "$program.id:$orgUnit.id" ) == 1 )
+				<td align="center"><a href="javascript:viewPatientDataRecords( $program.id, $orgUnit.id, 'ALL' )">$totalEnrollCountMap.get( "$program.id:$orgUnit.id" )</a></td>
+				<td align="center"><a href="javascript:viewPatientDataRecords( $program.id, $orgUnit.id, '$toDaysDate' )">$totalEnrollCountForSelDateMap.get( "$program.id:$orgUnit.id" )</a></td>
+			#else
+                <td align="center">$totalEnrollCountMap.get( "$program.id:$orgUnit.id" )</td>
+                <td align="center">$totalEnrollCountForSelDateMap.get( "$program.id:$orgUnit.id" )</td>
+			#end	
 		#end
 	</tr>
 	#set( $count1 = $count1 + 1 )