=== 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 2013-04-17 07:58:14 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/PatientDashboardAction.java 2013-05-29 14:28:47 +0000 @@ -32,6 +32,7 @@ import java.util.Date; import java.util.HashMap; import java.util.HashSet; +import java.util.Iterator; import java.util.Map; import java.util.Set; @@ -40,6 +41,7 @@ import org.hisp.dhis.patient.PatientAudit; import org.hisp.dhis.patient.PatientAuditService; import org.hisp.dhis.patient.PatientIdentifier; +import org.hisp.dhis.patient.PatientIdentifierType; import org.hisp.dhis.patient.PatientService; import org.hisp.dhis.patientattributevalue.PatientAttributeValue; import org.hisp.dhis.patientattributevalue.PatientAttributeValueService; @@ -211,18 +213,50 @@ { patient = patientService.getPatient( patientId ); + Collection programs = programService + .getProgramsByCurrentUser( Program.MULTIPLE_EVENTS_WITH_REGISTRATION ); + programs.addAll( programService.getProgramsByCurrentUser( Program.SINGLE_EVENT_WITH_REGISTRATION ) ); + // --------------------------------------------------------------------- // Get patient-attribute-values // --------------------------------------------------------------------- attributeValues = patientAttributeValueService.getPatientAttributeValues( patient ); + Iterator iterAttribute = attributeValues.iterator(); + + for ( Program program : programs ) + { + Collection atttributes = program.getPatientAttributes(); + while ( iterAttribute.hasNext() ) + { + PatientAttributeValue attributeValue = iterAttribute.next(); + if ( !atttributes.contains( attributeValue.getPatientAttribute() ) ) + { + iterAttribute.remove(); + } + } + } // --------------------------------------------------------------------- // Get patient-identifiers // --------------------------------------------------------------------- identifiers = patient.getIdentifiers(); - + Iterator iterIdentifier = identifiers.iterator(); + + for ( Program program : programs ) + { + Collection identifierTypes = program.getPatientIdentifierTypes(); + while ( iterIdentifier.hasNext() ) + { + PatientIdentifier identifier = iterIdentifier.next(); + if ( !identifierTypes.contains( identifier.getIdentifierType() ) ) + { + iterIdentifier.remove(); + } + } + } + // --------------------------------------------------------------------- // Get relationship // --------------------------------------------------------------------- @@ -235,8 +269,6 @@ // Get program enrollment // --------------------------------------------------------------------- - Collection programs = programService.getProgramsByCurrentUser(); - activeProgramInstances = new HashSet(); completedProgramInstances = new HashSet(); @@ -259,10 +291,6 @@ } // --------------------------------------------------------------------- - // Get program-indicators - // --------------------------------------------------------------------- - - // --------------------------------------------------------------------- // Patient-Audit // --------------------------------------------------------------------- === 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 2013-05-29 10:19:47 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/colorHelp.vm 2013-05-29 14:28:47 +0000 @@ -12,8 +12,8 @@ #end $i18n.getString('toggle_risk_status') - - + + === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2013-05-29 08:36:29 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2013-05-29 14:28:47 +0000 @@ -2071,14 +2071,14 @@ { if( followup ) { - showById('imgMarkFollowup'); - hideById('imgUnmarkFollowup'); + jQuery('[name=imgMarkFollowup]').show(); + jQuery('[name=imgUnmarkFollowup]').hide(); showById("followup_" + programInstanceId); } else { - hideById('imgMarkFollowup'); - showById('imgUnmarkFollowup'); + jQuery('[name=imgMarkFollowup]').hide(); + jQuery('[name=imgUnmarkFollowup]').show(); hideById("followup_" + programInstanceId); } }); === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/reportDataEntryForm.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/reportDataEntryForm.vm 2013-05-29 08:36:29 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/reportDataEntryForm.vm 2013-05-29 14:28:47 +0000 @@ -16,8 +16,8 @@ $i18n.getString('program'): $program.displayName - - + + === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitSchedule.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitSchedule.vm 2013-05-29 08:36:29 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitSchedule.vm 2013-05-29 14:28:47 +0000 @@ -32,8 +32,8 @@ #else #set($followup='false') #end - - + +