=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/PatientDashboardAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/PatientDashboardAction.java 2012-10-19 07:08:17 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/PatientDashboardAction.java 2012-11-23 03:02:35 +0000 @@ -30,11 +30,8 @@ import java.util.Collection; import java.util.Date; import java.util.HashSet; -import java.util.Iterator; import java.util.Set; -import org.hisp.dhis.caseentry.state.SelectedStateManager; -import org.hisp.dhis.organisationunit.OrganisationUnit; import org.hisp.dhis.patient.Patient; import org.hisp.dhis.patient.PatientAudit; import org.hisp.dhis.patient.PatientAuditService; @@ -42,14 +39,11 @@ 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.relationship.Relationship; import org.hisp.dhis.relationship.RelationshipService; import org.hisp.dhis.user.CurrentUserService; -import org.hisp.dhis.validation.ValidationCriteria; import com.opensymphony.xwork2.Action; @@ -76,11 +70,7 @@ private PatientAuditService patientAuditService; private CurrentUserService currentUserService; - - private ProgramService programService; - - private SelectedStateManager selectedStateManager; - + // ------------------------------------------------------------------------- // Input && Output // ------------------------------------------------------------------------- @@ -101,8 +91,6 @@ private Collection patientAudits; - private Collection singlePrograms; - // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- @@ -112,21 +100,6 @@ this.patientAuditService = patientAuditService; } - public void setSelectedStateManager( SelectedStateManager selectedStateManager ) - { - this.selectedStateManager = selectedStateManager; - } - - public void setProgramService( ProgramService programService ) - { - this.programService = programService; - } - - public Collection getSinglePrograms() - { - return singlePrograms; - } - public void setPatientAttributeValueService( PatientAttributeValueService patientAttributeValueService ) { this.patientAttributeValueService = patientAttributeValueService; @@ -227,32 +200,11 @@ } // --------------------------------------------------------------------- - // Check single-event with registration - // --------------------------------------------------------------------- - - OrganisationUnit orgunit = selectedStateManager.getSelectedOrganisationUnit(); - - singlePrograms = programService.getPrograms( Program.SINGLE_EVENT_WITH_REGISTRATION, orgunit ); - - singlePrograms.removeAll( patient.getPrograms() ); - Iterator iter = singlePrograms.iterator(); - while( iter.hasNext() ) - { - Program program = iter.next(); - ValidationCriteria criteria = program.isValid( patient ); - - if( criteria!= null) - { - iter.remove(); - } - } - - // --------------------------------------------------------------------- // Patient-Audit // --------------------------------------------------------------------- patientAudits = patientAuditService.getPatientAudits( patient ); - + long millisInDay = 60 * 60 * 24 * 1000; long currentTime = new Date().getTime(); long dateOnly = (currentTime / millisInDay) * millisInDay; === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ProgramEnrollmentSelectAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ProgramEnrollmentSelectAction.java 2012-11-01 15:15:26 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ProgramEnrollmentSelectAction.java 2012-11-23 03:02:35 +0000 @@ -29,6 +29,8 @@ import java.util.ArrayList; import java.util.Collection; +import org.hisp.dhis.caseentry.state.SelectedStateManager; +import org.hisp.dhis.organisationunit.OrganisationUnit; import org.hisp.dhis.patient.Patient; import org.hisp.dhis.patient.PatientService; import org.hisp.dhis.program.Program; @@ -70,6 +72,13 @@ this.programInstanceService = programInstanceService; } + private SelectedStateManager selectedStateManager; + + public void setSelectedStateManager( SelectedStateManager selectedStateManager ) + { + this.selectedStateManager = selectedStateManager; + } + // ------------------------------------------------------------------------- // Input/Output // ------------------------------------------------------------------------- @@ -107,13 +116,18 @@ // Get all programs programs = programService.getPrograms( Program.MULTIPLE_EVENTS_WITH_REGISTRATION ); + // Check single-event with registration + OrganisationUnit orgunit = selectedStateManager.getSelectedOrganisationUnit(); + + programs.addAll( programService.getPrograms( Program.SINGLE_EVENT_WITH_REGISTRATION, orgunit ) ); + programs.removeAll( patient.getPrograms() ); Collection programInstances = programInstanceService.getProgramInstances( patient, false ); for ( ProgramInstance programInstance : programInstances ) { programs.remove( programInstance.getProgram() ); } - + return SUCCESS; } } === 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-11-09 03:14:42 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2012-11-23 03:02:35 +0000 @@ -555,6 +555,7 @@ + - - === 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-11-22 03:20:13 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm 2012-11-23 03:02:35 +0000 @@ -131,21 +131,6 @@ #end #end - #foreach($program in $singlePrograms) - - - - - - - - - - #end