=== removed 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 2012-06-02 08:49:58 +0000 +++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/DashBoardHomePageAction.java 1970-01-01 00:00:00 +0000 @@ -1,508 +0,0 @@ -package org.hisp.dhis.dataanalyser.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.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.amplecode.quick.StatementManager; -import org.hisp.dhis.aggregation.AggregationService; -import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator; -import org.hisp.dhis.dataanalyser.util.DashBoardService; -import org.hisp.dhis.indicator.Indicator; -import org.hisp.dhis.indicator.IndicatorService; -import org.hisp.dhis.organisationunit.OrganisationUnit; -import org.hisp.dhis.organisationunit.OrganisationUnitService; -import org.hisp.dhis.period.MonthlyPeriodType; -import org.hisp.dhis.period.Period; -import org.hisp.dhis.period.PeriodService; -import org.hisp.dhis.period.PeriodType; -import org.hisp.dhis.program.Program; -import org.hisp.dhis.program.ProgramService; -import org.hisp.dhis.user.CurrentUserService; -import org.hisp.dhis.user.User; - -import com.opensymphony.xwork2.Action; - -public class DashBoardHomePageAction - 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 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; - } - - // --------------------------------------------------------------- - // Input & Output - // --------------------------------------------------------------- - - private String resultString; - - public String getResultString() - { - return resultString; - } - - List immChildrenList; - - public List getImmChildrenList() - { - return immChildrenList; - } - - Map orgUnit_ProgramMap; - - public Map getOrgUnit_ProgramMap() - { - return orgUnit_ProgramMap; - } - - Map totalEnrollCountMap; - - public Map getTotalEnrollCountMap() - { - return totalEnrollCountMap; - } - - Map totalEnrollCountForSelDateMap; - - public Map getTotalEnrollCountForSelDateMap() - { - return totalEnrollCountForSelDateMap; - } - - Integer totalRegCountForSelDate = 0; - - public Integer getTotalRegCountForSelDate() - { - return totalRegCountForSelDate; - } - - Integer totalRegCount = 0; - - public Integer getTotalRegCount() - { - return totalRegCount; - } - - List totalRegCountList; - - public List getTotalRegCountList() - { - return totalRegCountList; - } - - List totalRegCountListForSelDate; - - public List getTotalRegCountListForSelDate() - { - return totalRegCountListForSelDate; - } - - List programList; - - public List getProgramList() - { - return programList; - } - - String rootOrgUnitName; - - public String getRootOrgUnitName() - { - return rootOrgUnitName; - } - - List rootOrgUnitEnrollCountList; - - public List 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; - } - - // --------------------------------------------------------------- - // Action Implementation - // --------------------------------------------------------------- - - public String execute() - throws Exception - { - //statementManager.initialise(); - - immChildrenList = new ArrayList(); - totalEnrollCountMap = new HashMap(); - programList = new ArrayList(); - rootOrgUnitEnrollCountList = new ArrayList(); - totalRegCountList = new ArrayList(); - totalRegCountListForSelDate = new ArrayList(); - totalEnrollCountForSelDateMap = new HashMap(); - orgUnit_ProgramMap = new HashMap(); - - resultString = ""; - - navigationString = "Tracker Dashboard"; - - Date toDay = new Date(); - Calendar cal = Calendar.getInstance(); - cal.setTime( toDay ); - //cal.roll( Calendar.DATE, false ); - cal.add( Calendar.DATE, -1 ); - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); - toDaysDate = simpleDateFormat.format( cal.getTime() ); - - // getIndicatorValues(); - - programList.addAll( programService.getAllPrograms() ); - - if( programList != null && programList.size() > 0 ) - { - Iterator progIterator = programList.iterator(); - while( progIterator.hasNext() ) - { - Program prg = progIterator.next(); - - if( prg.getOrganisationUnits() == null || prg.getOrganisationUnits().size() <= 0 || prg.getType() == Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) - { - progIterator.remove(); - } - } - - List rootOrgUnitList = new ArrayList( ); - if( drillDownOrgUnitId != null ) - { - rootOrgUnitList.add( organisationUnitService.getOrganisationUnit( Integer.parseInt( drillDownOrgUnitId ) ) ); - List orgUnitBrach = new ArrayList( organisationUnitService.getOrganisationUnitBranch( Integer.parseInt( drillDownOrgUnitId ) ) ); - int flag = 1; - for( OrganisationUnit orgUnit : orgUnitBrach ) - { - if( currentUserService.getCurrentUser().getOrganisationUnits().contains( orgUnit) ) - { - flag = 2; - } - if( flag == 2) - { - navigationString += " -> " + orgUnit.getName() +""; - } - } - } - else - { - rootOrgUnitList.addAll( currentUserService.getCurrentUser().getOrganisationUnits() ); - } - - for( OrganisationUnit orgUnit : rootOrgUnitList ) - { - rootOrgUnitName = orgUnit.getName() + ", "; - List tempOuList = new ArrayList( orgUnit.getChildren() ); - Collections.sort( tempOuList, new IdentifiableObjectNameComparator() ); - - immChildrenList.addAll( tempOuList ); - - for( OrganisationUnit ou : tempOuList ) - { - List childTree = new ArrayList( organisationUnitService.getOrganisationUnitWithChildren( ou.getId() ) ); - String orgUnitIdsByComma = getCommaDelimitedString( getIdentifiers( OrganisationUnit.class, childTree ) ); - - Map enrollCountMap = dashBoardService.getTotalEnrolledNumber( orgUnitIdsByComma ); - - Map enrollCountForSelDateMap = dashBoardService.getTotalEnrolledNumberForSelectedDate( orgUnitIdsByComma, toDaysDate ); - if ( enrollCountMap != null ) - { - 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 ) - { - tempResult = 0; - } - totalEnrollCountMap.put( program.getId()+":"+ou.getId(), tempResult ); - Integer tempInteger = totalEnrollCountMap.get( rootOrgUnitName+":"+program.getId() ); - if( tempInteger != null ) - { - totalEnrollCountMap.put( rootOrgUnitName+":"+program.getId(), tempResult+tempInteger ); - } - else - { - totalEnrollCountMap.put( rootOrgUnitName+":"+program.getId(), tempResult ); - } - - Integer tempResult1 = enrollCountForSelDateMap.get( program.getId() ); - if( tempResult1 == null ) - { - tempResult1 = 0; - } - totalEnrollCountForSelDateMap.put( program.getId()+":"+ou.getId(), tempResult1 ); - Integer tempInteger1 = totalEnrollCountForSelDateMap.get( rootOrgUnitName+":"+program.getId() ); - if( tempInteger1 != null ) - { - totalEnrollCountForSelDateMap.put( rootOrgUnitName+":"+program.getId(), tempResult1+tempInteger1 ); - } - else - { - totalEnrollCountForSelDateMap.put( rootOrgUnitName+":"+program.getId(), tempResult1 ); - } - } - } - - Integer regCount = dashBoardService.getTotalRegisteredCount( orgUnitIdsByComma ); - - totalRegCountList.add( regCount ); - - totalRegCount += regCount; - - Integer regCountForSelDate = dashBoardService.getTotalRegisteredCountForSelDate( orgUnitIdsByComma, toDaysDate ); - - totalRegCountListForSelDate.add( regCountForSelDate ); - - totalRegCountForSelDate += regCountForSelDate; - } - } - } - - //statementManager.destroy(); - - return SUCCESS; - } - - - @SuppressWarnings( "unused" ) - private void getIndicatorValues() - { - // OrgUnit Info - User curUser = currentUserService.getCurrentUser(); - Collection ouList = curUser.getOrganisationUnits(); - OrganisationUnit orgUnit; - if ( ouList == null || ouList.isEmpty() ) - { - ouList = organisationUnitService.getOrganisationUnitsAtLevel( 1 ); - if ( ouList == null || ouList.isEmpty() ) - { - System.out.println( " There are no OrgUnits " ); - resultString = "There are no OrgUnits"; - return; - } - else - { - orgUnit = ouList.iterator().next(); - } - } - else - { - orgUnit = ouList.iterator().next(); - } - - // Indicator Info - Collection indicatorList = indicatorService.getAllIndicators(); - - if ( indicatorList == null || indicatorList.isEmpty() ) - { - System.out.println( " There are no Indicators " ); - resultString = "There are no Indicators"; - return; - } - - // Period Info - Date sysDate = new Date(); - Period selPeriod = getPreviousPeriod( sysDate ); - - if ( selPeriod == null ) - { - System.out.println( " There are no Period " ); - resultString = "There are no Period"; - return; - } - - for ( Indicator ind : indicatorList ) - { - double aggVal = aggregationService.getAggregatedIndicatorValue( ind, selPeriod.getStartDate(), selPeriod - .getEndDate(), orgUnit ); - - if ( aggVal == -1 ) - aggVal = 0.0; - - aggVal = Math.round( aggVal * Math.pow( 10, 1 ) ) / Math.pow( 10, 1 ); - - if ( aggVal > 0 ) - resultString += "** " + ind.getName() + " ( " + aggVal + " ) "; - } - - if ( resultString.trim().equals( "" ) ) - resultString = "NONE"; - - // System.out.println("RESULT : "+ resultString ); - - } - - public Period getPreviousPeriod( Date sDate ) - { - Period period = new Period(); - Calendar tempDate = Calendar.getInstance(); - tempDate.setTime( sDate ); - if ( tempDate.get( Calendar.MONTH ) == Calendar.JANUARY ) - { - tempDate.set( Calendar.MONTH, Calendar.DECEMBER ); - tempDate.roll( Calendar.YEAR, -1 ); - } - else - { - tempDate.roll( Calendar.MONTH, -1 ); - } - PeriodType monthlyPeriodType = new MonthlyPeriodType(); - period = getPeriodByMonth( tempDate.get( Calendar.MONTH ), tempDate.get( Calendar.YEAR ), monthlyPeriodType ); - - return period; - } - - public Period getPeriodByMonth( int month, int year, PeriodType periodType ) - { - int monthDays[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; - - Calendar cal = Calendar.getInstance(); - cal.set( year, month, 1, 0, 0, 0 ); - Date firstDay = new Date( cal.getTimeInMillis() ); - - if ( periodType.getName().equals( "Monthly" ) ) - { - cal.set( year, month, 1, 0, 0, 0 ); - if ( year % 4 == 0 ) - { - cal.set( Calendar.DAY_OF_MONTH, monthDays[month] + 1 ); - } - else - { - cal.set( Calendar.DAY_OF_MONTH, monthDays[month] ); - } - } - else if ( periodType.getName().equals( "Yearly" ) ) - { - cal.set( year, Calendar.DECEMBER, 31 ); - } - Date lastDay = new Date( cal.getTimeInMillis() ); - // System.out.println( lastDay.toString() ); - Period newPeriod = new Period(); - newPeriod = periodService.getPeriod( firstDay, lastDay, periodType ); - return newPeriod; - } -} === removed 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 2011-11-03 06:07:39 +0000 +++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetPatientDataRecordsAction.java 1970-01-01 00:00:00 +0000 @@ -1,282 +0,0 @@ -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 -{ - // ------------------------------------------------------------------------- - // 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 programInstances = new ArrayList(); - - public Collection getProgramInstances() - { - return programInstances; - } - - private Map> programStageInstanceMap = new HashMap>(); - - public Map> getProgramStageInstanceMap() - { - return programStageInstanceMap; - } - - private Map colorMap = new HashMap(); - - public Map getColorMap() - { - return colorMap; - } - - private Map programInstanceMap = new HashMap(); - - public Map getProgramInstanceMap() - { - return programInstanceMap; - } - - private Map patinetAttributeValueMap = new HashMap(); - - public Map getPatinetAttributeValueMap() - { - return patinetAttributeValueMap; - } - - Collection patientListByOrgUnit; - - public Collection 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 programStageInstances = new ArrayList(); - - total = patientService.countGetPatientsByOrgUnitProgram( organisationUnit, program ); - - this.paging = createPaging( total ); - - //patientListByOrgUnit = new ArrayList( patientService.getPatients( organisationUnit, program, paging - // .getStartPos(), paging.getPageSize() ) ); - - patientListByOrgUnit = new ArrayList( patientService.getPatients( organisationUnit, program, paging.getStartPos(), total ) ); - - if( viewStatus != null && !viewStatus.equals( "ALL" ) ) - { - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); - - Iterator patientIterator = patientListByOrgUnit.iterator(); - while( patientIterator.hasNext() ) - { - Patient p = patientIterator.next(); - - if( !viewStatus.equals( simpleDateFormat.format( p.getRegistrationDate() ) ) ) - { - patientIterator.remove(); - } - } - } - - for ( Patient patient : patientListByOrgUnit ) - { - Collection _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 programStageInstanceList = new ArrayList( - 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; - } - -} === removed 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 2011-11-03 06:07:39 +0000 +++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetPatientDetailsAction.java 1970-01-01 00:00:00 +0000 @@ -1,120 +0,0 @@ -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 programs; - - public Collection getPrograms() - { - return programs; - } - - private Map patientAttributeValueMap = new HashMap(); - - public Map 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 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/NoAction.java' --- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/NoAction.java 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/NoAction.java 2012-06-05 08:26:29 +0000 @@ -0,0 +1,18 @@ +package org.hisp.dhis.dataanalyser.action; + +import com.opensymphony.xwork2.Action; + + +/** + * @author Mithilesh Kumar Thakur + * + * @version NoAction.java June 02, 2012 11:47:12 AM + */ + +public class NoAction implements Action +{ + public String execute() + { + return SUCCESS; + } +} \ No newline at end of file === 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 2012-04-16 11:29:53 +0000 +++ local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml 2012-06-05 08:26:29 +0000 @@ -3,7 +3,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"> - + + + + + === modified file 'local/in/dhis-web-dashboard/src/main/resources/struts.xml' --- local/in/dhis-web-dashboard/src/main/resources/struts.xml 2012-03-19 06:07:21 +0000 +++ local/in/dhis-web-dashboard/src/main/resources/struts.xml 2012-06-05 08:26:29 +0000 @@ -7,7 +7,7 @@ - + + + + /main.vm + /dhis-web-dashboard/welcome.vm + /dhis-web-dashboard/menu.vm + + + index1.action @@ -782,8 +790,7 @@ /dhis-web-dashboard/tabularAnalysisFront.vm /dhis-web-dashboard/menuWithTreeForTA.vm - - ../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/lists/lists.js,javascript/ta.js,javascript/hashtable.js + ../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/javascripts/lists.js,javascript/ta.js,javascript/hashtable.js css/StylesForTags.css === modified 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 2011-11-03 06:07:39 +0000 +++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/idspOutBreak.vm 2012-06-05 08:26:29 +0000 @@ -18,7 +18,7 @@ #set( $count1 = 0 ) #foreach( $orgUnit in $immChildrenList ) - $orgUnit.shortName + $orgUnit.shortName #foreach( $normName in $normNames ) $outBreakAlertMap.get( "$normName:$orgUnit.id" ) #end === 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 2012-03-19 06:07:21 +0000 +++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/db.js 2012-06-05 08:26:29 +0000 @@ -534,124 +534,3 @@ } } - - -function viewPatientDataRecords( programId, orgUnitId, viewStatus ) -{ - var url = 'getPatientDataRecords.action?orgUnitId=' + orgUnitId + "&programId=" + programId + "&viewStatus=" +viewStatus; - $('#contentDataRecord').dialog('destroy').remove(); - $('
' ).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 ); - */ - $.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 = 'id : ' + id + "
" - + 'name : ' + fullName + "
" - + 'Gender : ' + gender+ "
" - + 'DOB Type : ' + dobType+ "
" - + 'DOB : ' + birthDate+ "
" - + 'Blood Group : ' + 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 + '
'; - 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 + '' + attributes[ i ].getElementsByTagName( "name" )[0].firstChild.nodeValue + ': ' + attributes[ i ].getElementsByTagName( "value" )[0].firstChild.nodeValue + '
'; - 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 + '
'; - patientInfo += "\n" +programs[ i ].getElementsByTagName( "name" )[0].firstChild.nodeValue; - } - - alert( patientInfo ); - - //programName = ( programName.length == 0 ) ? i18n_none : programName; - //setInnerHTML( 'programField', programName ); - - // ---------------------------------------------------------------------------- - // Show details - // ---------------------------------------------------------------------------- - - //showDetails(); -} === removed 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 2011-11-03 06:07:39 +0000 +++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/responsePatient.vm 1970-01-01 00:00:00 +0000 @@ -1,28 +0,0 @@ - - - $patient.id - $encoder.xmlEncode( $patient.getFullName() ) - $encoder.xmlEncode( $patient.gender ) - #if($!patient.dobType)$!patient.dobType#else $i18n.getString('none') #end - $format.formatDate( $!patient.birthDate ) - $encoder.xmlEncode( $patient.getAge() ) - #if($!patient.bloodGroup) $patient.bloodGroup #else $i18n.getString('none') #end - #foreach( $patientIdentifier in $patient.identifiers ) - - $encoder.xmlEncode( $patientIdentifier.identifier ) - - #end - #foreach( $attribute in $patient.attributes ) - #set( $attributeValue = false ) - #set( $attributeValue = $patientAttributeValueMap.get( $attribute.id ) ) - - $encoder.xmlEncode( $attribute.name ) - $encoder.xmlEncode( $attributeValue ) - - #end - #foreach( $program in $patient.programs ) - - $encoder.xmlEncode( $program.name ) - - #end - === removed 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 2011-11-03 06:07:39 +0000 +++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/viewPatientDataRecords.vm 1970-01-01 00:00:00 +0000 @@ -1,68 +0,0 @@ - - - - -
- - - #if( $sortPatientAttribute ) - - #end - #foreach( $programStage in $program.programStages ) - - #end - - - #if( $sortPatientAttribute ) - - #end - - #foreach( $programStage in $program.programStages ) - - #end - - - - #set( $mark = false ) - #set( $count1 = 0 ) - #foreach( $patient in $patientListByOrgUnit ) - #set( $programInstance = $programInstanceMap.get( $patient ) ) - #set( $count1 = $count1 + 1 ) - - - #if( $sortPatientAttribute ) - #set( $patientAttributeValue = $patinetAttributeValueMap.get( $patient ) ) - - #end - - #foreach( $programStageInstance in $programStageInstanceMap.get( $programInstance ) ) - #if( $programStageInstance.executionDate ) - - #else - - #end - #end - - #if( $mark ) - #set( $mark = false ) - #else - #set( $mark = true ) - #end - #end - -
Sl. No.$encoder.htmlEncode( $sortPatientAttribute.name )$i18n.getString( "full_name" )$encoder.htmlEncode( $programStage.name )
$count1$!patientAttributeValue.value$patient.getFullName()$format.formatDate( $programStageInstance.executionDate )$format.formatDate( $programStageInstance.dueDate )
-
- -
- ##parse( "/dhis-web-commons/paging/paging.vm" ) -
- - === modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/welcome.vm' --- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/welcome.vm 2011-09-03 09:46:15 +0000 +++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/welcome.vm 2012-06-05 08:26:29 +0000 @@ -1,13 +1,4 @@ - +

$i18n.getString( "dataanalyser" )

+

$i18n.getString( "dataanalyser_intro" )

-#if( $programList.size() <= 0 ) -

$i18n.getString( "dataanalyser" )

-

$i18n.getString( "dataanalyser_intro" )

-#else - #parse( "/dhis-web-dashboard/welcomeTracker.vm" ) -#end \ No newline at end of file === removed 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-11-03 06:07:39 +0000 +++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/welcomeTracker.vm 1970-01-01 00:00:00 +0000 @@ -1,176 +0,0 @@ - -
$navigationString
- - - -#set( $mark = 0 ) - - - - - - #foreach( $program in $programList ) - - #end - - - - - #foreach( $program in $programList ) - - - #end - - - #set( $count1 = 0 ) - #foreach( $orgUnit in $immChildrenList ) - - - - - #foreach( $program in $programList ) - #if( $orgUnit_ProgramMap.get( "$program.id:$orgUnit.id" ) == 1 ) - - - #else - - - #end - #end - - #set( $count1 = $count1 + 1 ) - #if( $mark == 1 ) - #set( $mark = 0 ) - #else - #set( $mark = 1 ) - #end - #end - - - - - #foreach( $program in $programList ) - - - #end - -
$rootOrgUnitNameRegistered$program.name
Total$toDaysDateTotal$toDaysDate
$orgUnit.shortName$totalRegCountList.get( $count1 )$totalRegCountListForSelDate.get( $count1 )$totalEnrollCountMap.get( "$program.id:$orgUnit.id" )$totalEnrollCountForSelDateMap.get( "$program.id:$orgUnit.id" )$totalEnrollCountMap.get( "$program.id:$orgUnit.id" )$totalEnrollCountForSelDateMap.get( "$program.id:$orgUnit.id" )
Total :$totalRegCount$totalRegCountForSelDate$!totalEnrollCountMap.get( "$rootOrgUnitName:$program.id" )$!totalEnrollCountForSelDateMap.get( "$rootOrgUnitName:$program.id" )
- -
-
- -