=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientService.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientService.java 2012-09-27 06:54:00 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientService.java 2012-09-27 08:00:40 +0000 @@ -31,6 +31,8 @@ import java.util.Date; import java.util.List; +import org.hisp.dhis.common.Grid; +import org.hisp.dhis.i18n.I18n; import org.hisp.dhis.i18n.I18nFormat; import org.hisp.dhis.organisationunit.OrganisationUnit; import org.hisp.dhis.patientattributevalue.PatientAttributeValue; @@ -210,5 +212,7 @@ Collection getPatientPhoneNumbers( List searchKeys, OrganisationUnit orgunit, Integer min, Integer max ); Collection getProgramStageInstances( List searchKeys, OrganisationUnit orgunit, Integer min, Integer max ); + + Grid getScheduledEventsReport( List searchKeys, OrganisationUnit orgunit, I18n i18n ); } === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientStore.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientStore.java 2012-09-27 06:54:00 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientStore.java 2012-09-27 08:00:40 +0000 @@ -32,6 +32,7 @@ import java.util.List; import org.hisp.dhis.common.GenericStore; +import org.hisp.dhis.common.Grid; import org.hisp.dhis.organisationunit.OrganisationUnit; import org.hisp.dhis.program.Program; @@ -74,4 +75,7 @@ Collection getProgramStageInstances( List searchKeys, OrganisationUnit orgunit, Integer min, Integer max ); + + Grid getPatientEventReport( Grid grid, List searchKeys, OrganisationUnit orgunit ); + } === modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java' --- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java 2012-09-27 06:54:00 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java 2012-09-27 08:00:40 +0000 @@ -27,7 +27,18 @@ package org.hisp.dhis.patient; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + import org.apache.commons.lang.StringUtils; +import org.hisp.dhis.common.Grid; +import org.hisp.dhis.common.GridHeader; +import org.hisp.dhis.i18n.I18n; import org.hisp.dhis.i18n.I18nFormat; import org.hisp.dhis.organisationunit.OrganisationUnit; import org.hisp.dhis.patientattributevalue.PatientAttributeValue; @@ -37,11 +48,9 @@ import org.hisp.dhis.relationship.RelationshipService; import org.hisp.dhis.relationship.RelationshipType; import org.hisp.dhis.relationship.RelationshipTypeService; +import org.hisp.dhis.system.grid.ListGrid; import org.springframework.transaction.annotation.Transactional; -import java.lang.reflect.Type; -import java.util.*; - /** * @author Abyot Asalefew Gizaw * @version $Id$ @@ -115,7 +124,7 @@ @Override public int createPatient( Patient patient, Integer representativeId, Integer relationshipTypeId, - List patientAttributeValues ) + List patientAttributeValues ) { int patientid = savePatient( patient ); @@ -183,7 +192,7 @@ @Override public Collection getPatients( String firstName, String middleName, String lastName, Date birthdate, - String gender ) + String gender ) { return patientStore.get( firstName, middleName, lastName, birthdate, gender ); } @@ -248,7 +257,8 @@ patients.addAll( patientIdentifierService.getPatientsByIdentifier( searchText, 0, Integer.MAX_VALUE ) ); patients.addAll( getPatientsByNames( searchText, 0, Integer.MAX_VALUE ) ); - // if an orgunit has been selected, filter out every patient that has a different ou + // if an orgunit has been selected, filter out every patient that has a + // different ou if ( orgUnitId != 0 ) { Set toRemoveList = new HashSet(); @@ -275,7 +285,7 @@ @Override public Collection getPatients( OrganisationUnit organisationUnit, PatientAttribute patientAttribute, - Integer min, Integer max ) + Integer min, Integer max ) { List patientList = new ArrayList( patientStore.getByOrgUnit( organisationUnit, min, max ) ); @@ -291,7 +301,7 @@ @Override public Collection getPatients( OrganisationUnit organisationUnit, String searchText, Integer min, - Integer max ) + Integer max ) { Collection patients = new ArrayList(); @@ -402,8 +412,8 @@ @Override public void updatePatient( Patient patient, Integer representativeId, Integer relationshipTypeId, - List valuesForSave, List valuesForUpdate, - Collection valuesForDelete ) + List valuesForSave, List valuesForUpdate, + Collection valuesForDelete ) { patientStore.update( patient ); @@ -496,7 +506,8 @@ } return value; - } catch ( Exception ex ) + } + catch ( Exception ex ) { ex.printStackTrace(); } @@ -514,7 +525,8 @@ patientStore.removeErollmentPrograms( program ); } - public Collection searchPatients( List searchKeys, OrganisationUnit orgunit, Integer min, Integer max ) + public Collection searchPatients( List searchKeys, OrganisationUnit orgunit, Integer min, + Integer max ) { return patientStore.search( searchKeys, orgunit, min, max ); } @@ -523,16 +535,52 @@ { return patientStore.countSearch( searchKeys, orgunit ); } - - public Collection getPatientPhoneNumbers( List searchKeys, OrganisationUnit orgunit, Integer min, Integer max ) + + public Collection getPatientPhoneNumbers( List searchKeys, OrganisationUnit orgunit, Integer min, + Integer max ) { return patientStore.getPatientPhoneNumbers( searchKeys, orgunit, min, max ); } - - public Collection getProgramStageInstances( List searchKeys, OrganisationUnit orgunit, Integer min, Integer max ) + + public Collection getProgramStageInstances( List searchKeys, OrganisationUnit orgunit, + Integer min, Integer max ) { return patientStore.getProgramStageInstances( searchKeys, orgunit, min, max ); } - + + public Grid getScheduledEventsReport( List searchKeys, OrganisationUnit orgunit, I18n i18n ) + { + String startDate = ""; + String endDate = ""; + for ( String searchKey : searchKeys ) + { + String[] keys = searchKey.split( "_" ); + if ( keys[0].equals( Patient.PREFIX_PROGRAM_EVENT_BY_STATUS ) ) + { + startDate = keys[2]; + endDate = keys[3]; + } + } + + Grid grid = new ListGrid(); + grid.setTitle( i18n.getString( "activity_plan" ) ); + if ( !startDate.isEmpty() && !endDate.isEmpty() ) + { + grid.setSubtitle( i18n.getString( "from" ) + " " + startDate + " " + i18n.getString( "to" ) + endDate ); + } + + grid.addHeader( new GridHeader( "patientid", true, true ) ); + grid.addHeader( new GridHeader( i18n.getString( "first_name" ), false, true ) ); + grid.addHeader( new GridHeader( i18n.getString( "middle_name" ), false, true ) ); + grid.addHeader( new GridHeader( i18n.getString( "last_name" ), false, true ) ); + grid.addHeader( new GridHeader( i18n.getString( "gender" ), false, true ) ); + grid.addHeader( new GridHeader( i18n.getString( "phone_number" ), false, true ) ); + grid.addHeader( new GridHeader( "orgunitid", true, true ) ); + grid.addHeader( new GridHeader( "programstageinstanceid", true, true ) ); + grid.addHeader( new GridHeader( i18n.getString( "program_stage" ), false, true ) ); + grid.addHeader( new GridHeader( i18n.getString( "due_date" ), false, true ) ); + + return patientStore.getPatientEventReport( grid, searchKeys, orgunit ); + } } === modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java' --- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java 2012-09-27 06:54:00 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java 2012-09-27 08:00:40 +0000 @@ -42,6 +42,7 @@ import org.hibernate.criterion.Order; import org.hibernate.criterion.Projections; import org.hibernate.criterion.Restrictions; +import org.hisp.dhis.common.Grid; import org.hisp.dhis.hibernate.HibernateGenericStore; import org.hisp.dhis.jdbc.StatementBuilder; import org.hisp.dhis.organisationunit.OrganisationUnit; @@ -49,8 +50,10 @@ import org.hisp.dhis.patient.PatientStore; import org.hisp.dhis.program.Program; import org.hisp.dhis.program.ProgramStageInstance; +import org.hisp.dhis.system.grid.GridUtils; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.RowMapper; +import org.springframework.jdbc.support.rowset.SqlRowSet; import org.springframework.transaction.annotation.Transactional; /** @@ -323,6 +326,22 @@ return jdbcTemplate.queryForInt( sql ); } + + @Override + public Grid getPatientEventReport( Grid grid, List searchKeys, OrganisationUnit orgunit ) + { + // --------------------------------------------------------------------- + // Get SQL and build grid + // --------------------------------------------------------------------- + + String sql = searchPatientSql( false, searchKeys, orgunit, null, null ); + + SqlRowSet rowSet = jdbcTemplate.queryForRowSet( sql ); + + GridUtils.addRows( grid, rowSet ); + + return grid; + } // ------------------------------------------------------------------------- // Supportive methods @@ -333,12 +352,11 @@ { String selector = count ? "count(*) " : "* "; - String sql = "select " - + selector - + " from ( select distinct p.patientid, p.firstname, p.middlename, p.lastname, p.gender, p.phonenumber, p.birthdate, p.deathdate,"; + String sql = "select " + selector + + " from ( select distinct p.patientid, p.firstname, p.middlename, p.lastname, p.gender, p.phonenumber,"; String patientWhere = ""; String patientOperator = " where "; - String patientGroupBy = " GROUP BY p.patientid, p.firstname, p.middlename, p.lastname, p.gender, p.phonenumber, p.birthdate, p.deathdate "; + String patientGroupBy = " GROUP BY p.patientid, p.firstname, p.middlename, p.lastname, p.gender, p.phonenumber "; String otherWhere = ""; String operator = " where "; String orderBy = ""; @@ -404,10 +422,9 @@ } else if ( keys[0].equals( Patient.PREFIX_PROGRAM_EVENT_BY_STATUS ) ) { - patientGroupBy += ",pgi.programid "; isSearchEvent = true; patientWhere += patientOperator + "pgi.patientid=p.patientid and "; - patientWhere += "programid=" + id + " and "; + patientWhere += "pgi.programid=" + id + " and "; patientWhere += "psi.duedate>='" + keys[2] + "' and psi.duedate<='" + keys[3] + "' and "; patientWhere += "pgi.completed = false "; @@ -433,16 +450,20 @@ condition = ""; continue; case ProgramStageInstance.FUTURE_VISIT_STATUS: - patientWhere += condition + operatorStatus + "(" - + " psi.status is null and psi.executiondate is null and psi.duedate >= now() and p.organisationunitid=" + keys[4] - + ")"; + patientWhere += condition + + operatorStatus + + "(" + + " psi.status is null and psi.executiondate is null and psi.duedate >= now() and p.organisationunitid=" + + keys[4] + ")"; operatorStatus = " OR "; condition = ""; continue; case ProgramStageInstance.LATE_VISIT_STATUS: - patientWhere += condition + operatorStatus + "(" - + " psi.status is null and psi.executiondate is null and psi.duedate < now() and p.organisationunitid=" + keys[4] - + ")"; + patientWhere += condition + + operatorStatus + + "(" + + " psi.status is null and psi.executiondate is null and psi.duedate < now() and p.organisationunitid=" + + keys[4] + ")"; operatorStatus = " OR "; condition = ""; continue; @@ -501,9 +522,10 @@ String from = " from patient p "; if ( isSearchEvent ) { - String subSQL = " ,MIN( psi.programstageinstanceid ) as programstageinstanceid,min(psi.duedate) as duedate "; - sql = sql + subSQL + from + " left join programinstance pgi on " + " (pgi.patientid=p.patientid) " - + " left join programstageinstance psi on " + " (psi.programinstanceid=pgi.programinstanceid) "; + String subSQL = " ,MIN( psi.programstageinstanceid ) as programstageinstanceid, min(pgs.name) as programstagename, min(psi.duedate) as duedate "; + sql = sql + subSQL + from + " inner join programinstance pgi on " + " (pgi.patientid=p.patientid) " + + " inner join programstageinstance psi on " + " (psi.programinstanceid=pgi.programinstanceid) " + + " inner join programstage pgs on (pgs.programstageid=psi.programstageid)"; orderBy = " ORDER BY duedate DESC "; from = " "; } @@ -527,8 +549,7 @@ { sql += statementBuilder.limitRecord( min, max ); } - + return sql; } - } === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java 2012-09-12 13:36:55 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java 2012-09-27 08:00:40 +0000 @@ -29,12 +29,13 @@ import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import org.hisp.dhis.caseentry.state.SelectedStateManager; +import org.hisp.dhis.common.Grid; +import org.hisp.dhis.i18n.I18n; import org.hisp.dhis.organisationunit.OrganisationUnit; import org.hisp.dhis.paging.ActionPagingSupport; import org.hisp.dhis.patient.Patient; @@ -43,9 +44,6 @@ 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.ProgramStageInstanceDueDateComparator; public class GetDataRecordsAction extends ActionPagingSupport @@ -82,11 +80,11 @@ this.programInstanceService = programInstanceService; } - private ProgramStageInstanceService programStageInstanceService; + private I18n i18n; - public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService ) + public void setI18n( I18n i18n ) { - this.programStageInstanceService = programStageInstanceService; + this.i18n = i18n; } // ------------------------------------------------------------------------- @@ -121,6 +119,13 @@ this.searchTexts = searchTexts; } + private String type; + + public void setType( String type ) + { + this.type = type; + } + private Integer total; public Integer getTotal() @@ -128,27 +133,6 @@ return total; } - private Collection programInstances = new ArrayList(); - - public Collection getProgramInstances() - { - return programInstances; - } - - private Map> programStageInstanceMap = new HashMap>(); - - public Map> getProgramStageInstanceMap() - { - return programStageInstanceMap; - } - - private Map statusMap = new HashMap(); - - public Map getStatusMap() - { - return statusMap; - } - private Map programInstanceMap = new HashMap(); public Map getProgramInstanceMap() @@ -163,13 +147,6 @@ return patients; } - private Collection programStageInstanceIds; - - public Collection getProgramStageInstanceIds() - { - return programStageInstanceIds; - } - private Program program; public Program getProgram() @@ -177,6 +154,13 @@ return program; } + private Grid grid; + + public Grid getGrid() + { + return grid; + } + // ------------------------------------------------------------------------- // Implementation Action // ------------------------------------------------------------------------- @@ -191,68 +175,52 @@ // --------------------------------------------------------------------- // Program instances for the selected program // --------------------------------------------------------------------- - - // List all patients - if ( listAll ) - { - if ( program == null ) - { - total = patientService.countGetPatientsByOrgUnit( orgunit ); - } - else - { - total = patientService.countGetPatientsByOrgUnitProgram( orgunit, program ); - } - - this.paging = createPaging( total ); - - patients = new ArrayList( patientService.getPatients( orgunit, program, paging.getStartPos(), - paging.getPageSize() ) ); - - } - // search patients - else if ( searchTexts.size() > 0 ) - { - orgunit = (searchBySelectedOrgunit) ? orgunit : null; - - total = patientService.countSearchPatients( searchTexts, orgunit ); - this.paging = createPaging( total ); - patients = patientService.searchPatients( searchTexts, orgunit, paging.getStartPos(), paging.getPageSize() ); - - programStageInstanceIds = patientService.getProgramStageInstances( searchTexts, orgunit, - paging.getStartPos(), paging.getPageSize() ); - } - - Collection programStageInstances = new ArrayList(); - - for ( Patient patient : patients ) - { - 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 ); - - List programStageInstanceList = new ArrayList( - programInstance.getProgramStageInstances() ); - Collections.sort( programStageInstanceList, new ProgramStageInstanceDueDateComparator() ); - - programStageInstanceMap.put( programInstance, programStageInstanceList ); - programStageInstances.addAll( programStageInstanceList ); - } - } - } - - statusMap = programStageInstanceService.statusProgramStageInstances( programStageInstances ); - - return SUCCESS; + if ( type == null ) // Tabular report + { + // List all patients + if ( listAll ) + { + total = (program == null) ? patientService.countGetPatientsByOrgUnit( orgunit ) : patientService + .countGetPatientsByOrgUnitProgram( orgunit, program ); + + this.paging = createPaging( total ); + + patients = new ArrayList( patientService.getPatients( orgunit, program, paging.getStartPos(), + paging.getPageSize() ) ); + + } + // search patients + else if ( searchTexts.size() > 0 ) + { + orgunit = (searchBySelectedOrgunit) ? orgunit : null; + + total = patientService.countSearchPatients( searchTexts, orgunit ); + this.paging = createPaging( total ); + patients = patientService.searchPatients( searchTexts, orgunit, paging.getStartPos(), + paging.getPageSize() ); + } + + for ( Patient patient : patients ) + { + Collection programInstances = programInstanceService.getProgramInstances( patient, + program, false ); + + if ( programInstances == null || programInstances.size() == 0 ) + { + programInstanceMap.put( patient, null ); + } + else + { + programInstanceMap.put( patient, programInstances.iterator().next() ); + } + } + } + else + // Download as Excel + { + grid = patientService.getScheduledEventsReport( searchTexts, orgunit, i18n ); + } + + return type == null ? SUCCESS : type; } } === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2012-09-26 05:19:53 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2012-09-27 08:00:40 +0000 @@ -170,8 +170,6 @@ - /dhis-web-caseentry/activityPlanRecords.vm style/style.css + + + + + === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanRecords.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanRecords.vm 2012-09-21 01:10:53 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanRecords.vm 2012-09-27 08:00:40 +0000 @@ -47,8 +47,7 @@ » - #if($!programStageInstanceMap.get($programInstance)) - #set($programStageInstances = $programStageInstanceMap.get($programInstance) ) + #set( $programStageInstances = $programInstance.programStageInstances ) @@ -71,18 +70,11 @@ #set( $index = $index + 1 ) #end #end - #foreach( $sms in $programStageInstance.outboundSms) - #if( $index < 5) - #set( $title= $title + "$format.formatDate( $sms.date ) - $sms.message ") - #set( $index = $index + 1) - #end - #end - #set($valueDate=$format.formatDate( $programStageInstance.dueDate )) #if($!programStageInstance.executionDate) #set($valueDate=$format.formatDate( $programStageInstance.executionDate )) #end - - + #end
@@ -112,8 +104,7 @@ - #end - + #if( $mark ) #set( $mark = false ) #else === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanSelect.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanSelect.vm 2012-09-26 09:39:48 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanSelect.vm 2012-09-27 08:00:40 +0000 @@ -90,6 +90,7 @@ + === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/colorHelp.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/colorHelp.vm 2012-09-20 07:20:37 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/colorHelp.vm 2012-09-27 08:00:40 +0000 @@ -24,7 +24,7 @@ - $i18n.getString('stages_skipped') + $i18n.getString('stage_skipped') \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataentryRecords.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataentryRecords.vm 2012-09-21 01:10:53 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataentryRecords.vm 2012-09-27 08:00:40 +0000 @@ -44,12 +44,10 @@ - #if($!programStageInstanceMap.get($programInstance)) - #set($programStageInstances = $programStageInstanceMap.get($programInstance) ) - - #parse( "/dhis-web-caseentry/programStageInstanceFlow.vm" ) - - #end + #set( $programStageInstances = $programInstance.programStageInstances ) + + #parse( "/dhis-web-caseentry/programStageInstanceFlow.vm" ) + #if( $mark ) #set( $mark = false ) === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js 2012-09-26 09:39:48 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js 2012-09-27 08:00:40 +0000 @@ -47,7 +47,6 @@ hideById('listPatientDiv'); contentDiv = 'listPatientDiv'; $('#contentDataRecord').html(''); - var searchBySelectedOrgunit = false; var programId = getFieldValue('programIdAddPatient'); var searchTexts = "stat_" + programId + "_" + getFieldValue('startDueDate') @@ -60,7 +59,7 @@ { programId:programId, listAll:false, - searchBySelectedOrgunit: searchBySelectedOrgunit, + searchBySelectedOrgunit: false, searchTexts: searchTexts }, function() @@ -72,6 +71,25 @@ }); } +function exportActitityList( type ) +{ + var programId = getFieldValue('programIdAddPatient'); + var searchTexts = "stat_" + programId + + "_" + getFieldValue('startDueDate') + + "_" + getFieldValue('endDueDate') + + "_" + getFieldValue('orgunitId') + + "_" + getFieldValue('statusEvent'); + var params = "searchTexts=" + searchTexts; + params += "&listAll=fase"; + params += "&type=" + type; + params += "&programId=" + getFieldValue('programIdAddPatient'); + params += "&searchBySelectedOrgunit=false"; + + var url = "exportActitityList.action?" + params; + window.location.href = url; +} + + function eventFlowToggle( programInstanceId ) { jQuery("#tb_" + programInstanceId + " .stage-object").each( function(){ === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageInstances.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageInstances.vm 2012-08-15 02:57:56 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageInstances.vm 2012-09-27 08:00:40 +0000 @@ -7,7 +7,7 @@ "programStageId": "$programStageInstance.programStage.id", "programStageName": "$programStageInstance.programStage.name", "dueDate": "$format.formatDate( $programStageInstance.dueDate )", - "status": "$statusMap.get( $programStageInstance.id )" + "status": "$programStageInstance.getEventStatus()" }#if( $velocityCount < $size ),#end #end] } \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm 2012-09-26 08:42:25 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm 2012-09-27 08:00:40 +0000 @@ -95,7 +95,7 @@ #set($flag = 'false') #foreach( $programStageInstance in $programInstance.programStageInstances ) - #set( $status = $statusMap.get( $programStageInstance.id ) ) + #set( $status = $programStageInstance.getEventStatus() ) #if( $status!=1 && $status!=5 && $flag=='false') » - #if($!programStageInstanceMap.get($programInstance)) - #set($programStageInstances = $programStageInstanceMap.get($programInstance) ) + #set( $programStageInstances = $programInstance.programStageInstances ) @@ -71,12 +70,6 @@ #set( $index = $index + 1 ) #end #end - #foreach( $sms in $programStageInstance.outboundSms) - #if( $index < 5) - #set( $title= $title + "$format.formatDate( $sms.date ) - $sms.message ") - #set( $index = $index + 1) - #end - #end #set($valueDate=$format.formatDate( $programStageInstance.dueDate )) #if($!programStageInstance.executionDate) @@ -88,12 +81,12 @@ programStageId='$programStageInstance.programStage.id' programInstanceId='$programInstance.id' dueDate='$format.formatDate( $programStageInstance.dueDate )' - status='$statusMap.get( $programStageInstance.id )' + status='$programStageInstance.getEventStatus()' class='stage-object' value='$programStageInstance.programStage.name $valueDate' title="$title" onclick='javascript:programTrackingList( $programStageInstance.id, false );'> @@ -109,7 +102,6 @@
- #end #if( $mark ) #set( $mark = false )