=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/SaveBeneficiaryAction.java' --- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/SaveBeneficiaryAction.java 2012-09-21 14:54:46 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/SaveBeneficiaryAction.java 2012-09-22 05:51:25 +0000 @@ -321,6 +321,14 @@ patientIdentifierTypes = patientIdentifierTypeService.getAllPatientIdentifierTypes(); patientAttributes = patientAttributeService.getAllPatientAttributes(); + Collection programs = programService.getAllPrograms(); + + for ( Program program : programs ) + { + patientIdentifierTypes.removeAll( program.getPatientIdentifierTypes() ); + patientAttributes.removeAll( program.getPatientAttributes() ); + } + patient.setOrganisationUnit( organisationUnitService.getOrganisationUnit( orgUnitId ) ); if ( this.patientFullName.trim().length() < 7 ) @@ -404,7 +412,7 @@ Collection patientIdentifierTypes = patientIdentifierTypeService .getAllPatientIdentifierTypes(); Collection patientAttributes = patientAttributeService.getAllPatientAttributes(); - Collection programs = programService.getAllPrograms(); + for ( Program program : programs ) {