=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/ShowAddProgramFormAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/ShowAddProgramFormAction.java 2013-10-25 05:00:41 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/ShowAddProgramFormAction.java 2013-12-27 04:01:23 +0000 @@ -143,22 +143,15 @@ programs = new ArrayList( programService.getAllPrograms() ); programs.removeAll( programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) ); Collections.sort( programs, IdentifiableObjectNameComparator.INSTANCE ); - - + availableAttributes = patientAttributeService.getAllPatientAttributes(); - availableIdentifierTypes = patientIdentifierTypeService.getAllPatientIdentifierTypes(); - for ( Program p : programs ) - { - availableIdentifierTypes - .removeAll( new HashSet( p.getPatientIdentifierTypes() ) ); - } - + userGroups = new ArrayList( userGroupService.getAllUserGroups() ); - - relationshipTypes = new ArrayList(relationshipTypeService.getAllRelationshipTypes()); + + relationshipTypes = new ArrayList( relationshipTypeService.getAllRelationshipTypes() ); Collections.sort( relationshipTypes, IdentifiableObjectNameComparator.INSTANCE ); - + return SUCCESS; } } === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/ShowUpdateProgramFormAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/ShowUpdateProgramFormAction.java 2013-10-25 05:00:41 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/ShowUpdateProgramFormAction.java 2013-12-27 04:01:23 +0000 @@ -202,24 +202,18 @@ program = programService.getProgram( id ); availableIdentifierTypes = patientIdentifierTypeService.getAllPatientIdentifierTypes(); + availableIdentifierTypes.removeAll( new HashSet( program.getPatientIdentifierTypes() ) ); availableAttributes = patientAttributeService.getAllPatientAttributes(); availableAttributes.removeAll( new HashSet( program.getPatientAttributes() ) ); - + programs = new ArrayList( programService.getAllPrograms() ); programs.removeAll( programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) ); - - for ( Program p : programs ) - { - availableIdentifierTypes - .removeAll( new HashSet( p.getPatientIdentifierTypes() ) ); - } - - userGroups = new ArrayList( userGroupService.getAllUserGroups() ); - programs.remove( program ); Collections.sort( programs, IdentifiableObjectNameComparator.INSTANCE ); + userGroups = new ArrayList( userGroupService.getAllUserGroups() ); + relationshipTypes = new ArrayList( relationshipTypeService.getAllRelationshipTypes() ); Collections.sort( relationshipTypes, IdentifiableObjectNameComparator.INSTANCE );