← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13680: More program patient cleanup

 

------------------------------------------------------------
revno: 13680
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-01-09 17:45:15 +0100
message:
  More program patient cleanup
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetAttributesByProgramAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientAction.java
  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/ProgramEnrollmentAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SaveIdentifierAndAttributeAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SearchPatientAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ShowAddPatientFormAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetAggregateReportAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetTabularReportAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadDataElementsAction.java
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/GetProgramEnrollmentFormAction.java
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/SaveMobileProgramEnrollmentAction.java
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/RegisterBeneficiaryAction.java
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/SaveBeneficiaryAction.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java	2014-01-07 15:02:45 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java	2014-01-09 16:45:15 +0000
@@ -51,13 +51,10 @@
 import org.hisp.dhis.patient.comparator.PatientAttributeGroupSortOrderComparator;
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.program.ProgramDataEntryService;
-import org.hisp.dhis.program.ProgramPatientAttributeService;
-import org.hisp.dhis.program.ProgramPatientIdentifierTypeService;
 import org.hisp.dhis.program.ProgramService;
 import org.hisp.dhis.program.ProgramStage;
 import org.hisp.dhis.program.ProgramStageDataElement;
 import org.hisp.dhis.user.User;
-import org.springframework.beans.factory.annotation.Autowired;
 
 import com.opensymphony.xwork2.Action;
 
@@ -120,12 +117,6 @@
         this.attributeGroupService = attributeGroupService;
     }
 
-    @Autowired
-    private ProgramPatientAttributeService programPatientAttributeService;
-
-    @Autowired
-    private ProgramPatientIdentifierTypeService programPatientIdentifierTypeService;
-
     private I18n i18n;
 
     public void setI18n( I18n i18n )
@@ -196,8 +187,8 @@
             programs.remove( program );
             for ( Program p : programs )
             {
-                identifierTypes.removeAll( programPatientIdentifierTypeService.getListPatientIdentifierType( p ) );
-                patientAttributesInProgram.addAll( programPatientAttributeService.getListPatientAttribute( p ) );
+                identifierTypes.removeAll( p.getIdentifierTypes() );
+                patientAttributesInProgram.addAll( p.getAttributes() );
             }
 
             attributeGroups = new ArrayList<PatientAttributeGroup>(

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetAttributesByProgramAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetAttributesByProgramAction.java	2014-01-08 16:13:32 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetAttributesByProgramAction.java	2014-01-09 16:45:15 +0000
@@ -33,7 +33,6 @@
 import org.hisp.dhis.patient.PatientAttribute;
 import org.hisp.dhis.patient.PatientAttributeService;
 import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramPatientAttributeService;
 import org.hisp.dhis.program.ProgramService;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -55,9 +54,6 @@
     private ProgramService programService;
 
     @Autowired
-    private ProgramPatientAttributeService programPatientAttributeService;
-
-    @Autowired
     private PatientAttributeService patientAttributeService;
 
     // -------------------------------------------------------------------------
@@ -89,8 +85,7 @@
         if ( id != null )
         {
             Program program = programService.getProgram( id );
-            attributes = new ArrayList<PatientAttribute>(
-                programPatientAttributeService.getListPatientAttribute( program ) );
+            attributes = program.getAttributes();
         }
         else
         {

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientAction.java	2014-01-08 11:18:13 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientAction.java	2014-01-09 16:45:15 +0000
@@ -54,15 +54,12 @@
 import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
 import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
 import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramPatientAttributeService;
-import org.hisp.dhis.program.ProgramPatientIdentifierTypeService;
 import org.hisp.dhis.program.ProgramService;
 import org.hisp.dhis.relationship.Relationship;
 import org.hisp.dhis.relationship.RelationshipService;
 import org.hisp.dhis.relationship.RelationshipType;
 import org.hisp.dhis.relationship.RelationshipTypeService;
 import org.hisp.dhis.user.User;
-import org.springframework.beans.factory.annotation.Autowired;
 
 import com.opensymphony.xwork2.Action;
 
@@ -95,12 +92,6 @@
 
     private PatientAttributeService attributeService;
 
-    @Autowired
-    private ProgramPatientAttributeService programPatientAttributeService;
-
-    @Autowired
-    private ProgramPatientIdentifierTypeService programPatientIdentifierTypeService;
-
     private I18n i18n;
 
     private I18nFormat format;
@@ -247,15 +238,14 @@
                 Collection<Program> programs = programService.getAllPrograms();
                 for ( Program p : programs )
                 {
-                    identifierTypes.removeAll( programPatientIdentifierTypeService.getListPatientIdentifierType( p ) );
-                    attributes.removeAll( programPatientAttributeService.getListPatientAttribute( p ) );
+                    identifierTypes.removeAll( p.getIdentifierTypes() );
+                    attributes.removeAll( p.getAttributes() );
                 }
             }
             else
             {
-                identifierTypes = programPatientIdentifierTypeService.getListPatientIdentifierType( program );
-                attributes = new ArrayList<PatientAttribute>(
-                    programPatientAttributeService.getListPatientAttribute( program ) );
+                identifierTypes = program.getIdentifierTypes();
+                attributes = program.getAttributes();
             }
 
             for ( PatientAttribute attribute : attributes )

=== 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	2014-01-07 15:02:45 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/PatientDashboardAction.java	2014-01-09 16:45:15 +0000
@@ -49,13 +49,10 @@
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.program.ProgramIndicatorService;
 import org.hisp.dhis.program.ProgramInstance;
-import org.hisp.dhis.program.ProgramPatientAttributeService;
-import org.hisp.dhis.program.ProgramPatientIdentifierTypeService;
 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.springframework.beans.factory.annotation.Autowired;
 
 import com.opensymphony.xwork2.Action;
 
@@ -85,12 +82,6 @@
 
     private PatientAttributeValueService patientAttributeValueService;
 
-    @Autowired
-    private ProgramPatientAttributeService programPatientAttributeService;
-
-    @Autowired
-    private ProgramPatientIdentifierTypeService programPatientIdentifierTypeService;
-
     // -------------------------------------------------------------------------
     // Input && Output
     // -------------------------------------------------------------------------
@@ -236,7 +227,7 @@
 
         for ( Program program : programs )
         {
-            Collection<PatientAttribute> atttributes = programPatientAttributeService.getListPatientAttribute( program );
+            Collection<PatientAttribute> atttributes = program.getAttributes();
             for ( PatientAttributeValue attributeValue : _attributeValues )
             {
                 if ( atttributes.contains( attributeValue.getPatientAttribute() ) )
@@ -255,8 +246,7 @@
 
         for ( Program program : programs )
         {
-            Collection<PatientIdentifierType> identifierTypes = programPatientIdentifierTypeService
-                .getListPatientIdentifierType( program );
+            Collection<PatientIdentifierType> identifierTypes = program.getIdentifierTypes();
             for ( PatientIdentifier identifier : _identifiers )
             {
                 if ( !identifierTypes.contains( identifier.getIdentifierType() ) )

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ProgramEnrollmentAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ProgramEnrollmentAction.java	2014-01-08 11:18:13 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ProgramEnrollmentAction.java	2014-01-09 16:45:15 +0000
@@ -46,11 +46,8 @@
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.program.ProgramInstance;
 import org.hisp.dhis.program.ProgramInstanceService;
-import org.hisp.dhis.program.ProgramPatientAttributeService;
-import org.hisp.dhis.program.ProgramPatientIdentifierTypeService;
 import org.hisp.dhis.program.ProgramStageInstance;
 import org.hisp.dhis.program.comparator.ProgramStageInstanceVisitDateComparator;
-import org.springframework.beans.factory.annotation.Autowired;
 
 import com.opensymphony.xwork2.Action;
 
@@ -68,12 +65,6 @@
 
     private OrganisationUnitSelectionManager selectionManager;
 
-    @Autowired
-    private ProgramPatientAttributeService programPatientAttributeService;
-
-    @Autowired
-    private ProgramPatientIdentifierTypeService programPatientIdentifierTypeService;
-
     // -------------------------------------------------------------------------
     // Input/Output
     // -------------------------------------------------------------------------
@@ -199,8 +190,7 @@
         // Load identifier types of the selected program
         // ---------------------------------------------------------------------
 
-        identifierTypes = new ArrayList<PatientIdentifierType>(
-            programPatientIdentifierTypeService.getListPatientIdentifierType( programInstance.getProgram() ) );
+        identifierTypes = new ArrayList<PatientIdentifierType>( programInstance.getProgram().getIdentifierTypes() );
         identiferMap = new HashMap<Integer, String>();
 
         if ( identifierTypes != null && identifierTypes.size() > 0 )
@@ -223,8 +213,7 @@
         // Load patient-attributes of the selected program
         // ---------------------------------------------------------------------
 
-        patientAttributes = new ArrayList<PatientAttribute>(
-            programPatientAttributeService.getListPatientAttribute( programInstance.getProgram() ) );
+        patientAttributes = new ArrayList<PatientAttribute>( programInstance.getProgram().getAttributes() );
 
         if ( patientAttributes != null )
         {

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SaveIdentifierAndAttributeAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SaveIdentifierAndAttributeAction.java	2014-01-07 15:02:45 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SaveIdentifierAndAttributeAction.java	2014-01-09 16:45:15 +0000
@@ -48,9 +48,7 @@
 import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
 import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
 import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramPatientIdentifierTypeService;
 import org.hisp.dhis.program.ProgramService;
-import org.springframework.beans.factory.annotation.Autowired;
 
 import com.opensymphony.xwork2.Action;
 
@@ -78,9 +76,6 @@
 
     private ProgramService programService;
 
-    @Autowired
-    private ProgramPatientIdentifierTypeService programPatientIdentifierTypeService;
-
     private I18nFormat format;
 
     // -------------------------------------------------------------------------
@@ -186,8 +181,7 @@
 
         String value = null;
 
-        Collection<PatientIdentifierType> identifierTypes = programPatientIdentifierTypeService
-            .getListPatientIdentifierType( program );
+        Collection<PatientIdentifierType> identifierTypes = program.getIdentifierTypes();
 
         PatientIdentifier identifier = null;
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SearchPatientAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SearchPatientAction.java	2014-01-08 16:13:32 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SearchPatientAction.java	2014-01-09 16:45:15 +0000
@@ -49,8 +49,6 @@
 import org.hisp.dhis.patient.comparator.PatientAttributeSortOrderInListNoProgramComparator;
 import org.hisp.dhis.patient.comparator.PatientIdentifierTypeSortOrderInListNoProgramComparator;
 import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramPatientAttributeService;
-import org.hisp.dhis.program.ProgramPatientIdentifierTypeService;
 import org.hisp.dhis.program.ProgramService;
 import org.hisp.dhis.user.CurrentUserService;
 import org.hisp.dhis.user.User;
@@ -91,12 +89,6 @@
     @Autowired
     private PatientIdentifierTypeService patientIdentifierTypeService;
 
-    @Autowired
-    private ProgramPatientAttributeService programPatientAttributeService;
-
-    @Autowired
-    private ProgramPatientIdentifierTypeService programPatientIdentifierTypeService;
-
     // -------------------------------------------------------------------------
     // Input/output
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ShowAddPatientFormAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ShowAddPatientFormAction.java	2014-01-07 15:02:45 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ShowAddPatientFormAction.java	2014-01-09 16:45:15 +0000
@@ -49,13 +49,10 @@
 import org.hisp.dhis.patient.PatientRegistrationFormService;
 import org.hisp.dhis.patient.comparator.PatientAttributeGroupSortOrderComparator;
 import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramPatientAttributeService;
-import org.hisp.dhis.program.ProgramPatientIdentifierTypeService;
 import org.hisp.dhis.program.ProgramService;
 import org.hisp.dhis.relationship.RelationshipType;
 import org.hisp.dhis.relationship.RelationshipTypeService;
 import org.hisp.dhis.user.User;
-import org.springframework.beans.factory.annotation.Autowired;
 
 import com.opensymphony.xwork2.Action;
 
@@ -119,12 +116,6 @@
         this.relationshipTypeService = relationshipTypeService;
     }
 
-    @Autowired
-    private ProgramPatientAttributeService programPatientAttributeService;
-
-    @Autowired
-    private ProgramPatientIdentifierTypeService programPatientIdentifierTypeService;
-
     private I18n i18n;
 
     public void setI18n( I18n i18n )
@@ -323,17 +314,17 @@
                 identifierTypes = patientIdentifierTypeService.getAllPatientIdentifierTypes();
                 attributes = new ArrayList<PatientAttribute>( attributeService.getAllPatientAttributes() );
                 Collection<Program> programs = programService.getAllPrograms();
+                
                 for ( Program p : programs )
                 {
-                    identifierTypes.removeAll( programPatientIdentifierTypeService.getListPatientIdentifierType( p ));
-                    attributes.removeAll( programPatientAttributeService.getListPatientAttribute( p ) );
+                    identifierTypes.removeAll( p.getIdentifierTypes() );
+                    attributes.removeAll( p.getAttributes() );
                 }
             }
             else
             {
-                identifierTypes = programPatientIdentifierTypeService.getListPatientIdentifierType( program );
-                attributes = new ArrayList<PatientAttribute>(
-                    programPatientAttributeService.getListPatientAttribute( program ) );
+                identifierTypes = program.getIdentifierTypes();
+                attributes = program.getAttributes();
             }
 
             for ( PatientAttribute attribute : attributes )

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetAggregateReportAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetAggregateReportAction.java	2014-01-07 15:02:45 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetAggregateReportAction.java	2014-01-09 16:45:15 +0000
@@ -50,10 +50,7 @@
 import org.hisp.dhis.patientreport.PatientAggregateReport;
 import org.hisp.dhis.patientreport.PatientAggregateReportService;
 import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramPatientAttributeService;
-import org.hisp.dhis.program.ProgramPatientIdentifierTypeService;
 import org.hisp.dhis.program.ProgramStage;
-import org.springframework.beans.factory.annotation.Autowired;
 
 import com.opensymphony.xwork2.Action;
 
@@ -104,12 +101,6 @@
         this.organisationUnitService = organisationUnitService;
     }
 
-    @Autowired
-    private ProgramPatientAttributeService programPatientAttributeService;
-
-    @Autowired
-    private ProgramPatientIdentifierTypeService programPatientIdentifierTypeService;
-
     // -------------------------------------------------------------------------
     // Input && Output
     // -------------------------------------------------------------------------
@@ -269,14 +260,14 @@
             {
                 PatientIdentifierType it = patientIdentifierTypeService.getPatientIdentifierType( dimensionId );
 
-                if ( it != null && programPatientIdentifierTypeService.getListPatientIdentifierType( program ).contains( it ) )
+                if ( it != null && program.getIdentifierTypes().contains( it ) )
                 {
                     dimensionIdentifierTypes.add( it );
                 }
 
                 PatientAttribute at = patientAttributeService.getPatientAttribute( dimensionId );
 
-                if ( at != null && programPatientAttributeService.getListPatientAttribute( program ).contains( at ) )
+                if ( at != null && program.getAttributes().contains( at ) )
                 {
                     dimensionAttributes.add( at );
                 }
@@ -306,14 +297,14 @@
 
             PatientIdentifierType it = patientIdentifierTypeService.getPatientIdentifierType( filterId );
 
-            if ( it != null && programPatientIdentifierTypeService.getListPatientIdentifierType( program ).contains( it ) )
+            if ( it != null && program.getIdentifierTypes().contains( it ) )
             {
                 filterIdentifierTypes.add( it );
             }
 
             PatientAttribute at = patientAttributeService.getPatientAttribute( filterId );
 
-            if ( at != null && programPatientAttributeService.getListPatientAttribute( program ).contains( at ) )
+            if ( at != null && program.getAttributes().contains( at ) )
             {
                 filterAttributes.add( at );
             }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetTabularReportAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetTabularReportAction.java	2014-01-07 15:02:45 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetTabularReportAction.java	2014-01-09 16:45:15 +0000
@@ -49,10 +49,7 @@
 import org.hisp.dhis.patientreport.PatientTabularReport;
 import org.hisp.dhis.patientreport.PatientTabularReportService;
 import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramPatientAttributeService;
-import org.hisp.dhis.program.ProgramPatientIdentifierTypeService;
 import org.hisp.dhis.program.ProgramStage;
-import org.springframework.beans.factory.annotation.Autowired;
 
 import com.opensymphony.xwork2.Action;
 
@@ -103,12 +100,6 @@
         this.organisationUnitService = organisationUnitService;
     }
 
-    @Autowired
-    private ProgramPatientAttributeService programPatientAttributeService;
-
-    @Autowired
-    private ProgramPatientIdentifierTypeService programPatientIdentifierTypeService;
-
     // -------------------------------------------------------------------------
     // Input
     // -------------------------------------------------------------------------
@@ -248,14 +239,14 @@
             {
                 PatientIdentifierType it = patientIdentifierTypeService.getPatientIdentifierType( dimensionId );
 
-                if ( it != null && programPatientIdentifierTypeService.getListPatientIdentifierType( program ).contains( it ) )
+                if ( it != null && program.getIdentifierTypes().contains( it ) )
                 {
                     dimensionIdentifierTypes.add( it );
                 }
 
                 PatientAttribute at = patientAttributeService.getPatientAttribute( dimensionId );
 
-                if ( at != null && programPatientAttributeService.getListPatientAttribute( program ).contains( at ) )
+                if ( at != null && program.getAttributes().contains( at ) )
                 {
                     dimensionAttributes.add( at );
                 }
@@ -285,14 +276,14 @@
 
             PatientIdentifierType it = patientIdentifierTypeService.getPatientIdentifierType( filterId );
 
-            if ( it != null && programPatientIdentifierTypeService.getListPatientIdentifierType( program ).contains( it ) )
+            if ( it != null && program.getIdentifierTypes().contains( it ) )
             {
                 filterIdentifierTypes.add( it );
             }
 
             PatientAttribute at = patientAttributeService.getPatientAttribute( filterId );
 
-            if ( at != null && programPatientAttributeService.getListPatientAttribute( program ).contains( at ) )
+            if ( at != null && program.getAttributes().contains( at ) )
             {
                 filterAttributes.add( at );
             }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadDataElementsAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadDataElementsAction.java	2014-01-07 15:02:45 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadDataElementsAction.java	2014-01-09 16:45:15 +0000
@@ -34,14 +34,11 @@
 import org.hisp.dhis.patient.PatientAttribute;
 import org.hisp.dhis.patient.PatientIdentifierType;
 import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramPatientAttributeService;
-import org.hisp.dhis.program.ProgramPatientIdentifierTypeService;
 import org.hisp.dhis.program.ProgramStage;
 import org.hisp.dhis.program.ProgramStageDataElement;
 import org.hisp.dhis.program.ProgramStageSection;
 import org.hisp.dhis.program.ProgramStageSectionService;
 import org.hisp.dhis.program.ProgramStageService;
-import org.springframework.beans.factory.annotation.Autowired;
 
 import com.opensymphony.xwork2.Action;
 
@@ -71,12 +68,6 @@
         this.programStageSectionService = programStageSectionService;
     }
 
-    @Autowired
-    private ProgramPatientAttributeService programPatientAttributeService;
-
-    @Autowired
-    private ProgramPatientIdentifierTypeService programPatientIdentifierTypeService;
-
     // -------------------------------------------------------------------------
     // Input/output
     // -------------------------------------------------------------------------
@@ -141,10 +132,8 @@
 
         if ( program != null && program.isRegistration() )
         {
-            identifierTypes = new ArrayList<PatientIdentifierType>(
-                programPatientIdentifierTypeService.getListPatientIdentifierType( program ) );
-            patientAttributes = new ArrayList<PatientAttribute>(
-                programPatientAttributeService.getListPatientAttribute( program ) );
+            identifierTypes = program.getIdentifierTypes();
+            patientAttributes = program.getAttributes();
         }
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/GetProgramEnrollmentFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/GetProgramEnrollmentFormAction.java	2014-01-07 15:02:45 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/GetProgramEnrollmentFormAction.java	2014-01-09 16:45:15 +0000
@@ -37,10 +37,7 @@
 import org.hisp.dhis.patient.PatientIdentifierType;
 import org.hisp.dhis.patient.PatientService;
 import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramPatientAttributeService;
-import org.hisp.dhis.program.ProgramPatientIdentifierTypeService;
 import org.hisp.dhis.program.ProgramService;
-import org.springframework.beans.factory.annotation.Autowired;
 
 import com.opensymphony.xwork2.Action;
 
@@ -65,12 +62,6 @@
         this.programService = programService;
     }
 
-    @Autowired
-    private ProgramPatientAttributeService programPatientAttributeService;
-
-    @Autowired
-    private ProgramPatientIdentifierTypeService programPatientIdentifierTypeService;
-
     // -------------------------------------------------------------------------
     // Input & Output
     // -------------------------------------------------------------------------
@@ -173,8 +164,8 @@
             return REDIRECT;
         }
 
-        patientAttributes = programPatientAttributeService.getListPatientAttribute( program );
-        patientIdentifierTypes = programPatientIdentifierTypeService.getListPatientIdentifierType( program );
+        patientAttributes = program.getAttributes();
+        patientIdentifierTypes = program.getIdentifierTypes();
         now = new SimpleDateFormat( "yyyy-MM-dd" ).format( new Date() );
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/SaveMobileProgramEnrollmentAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/SaveMobileProgramEnrollmentAction.java	2014-01-07 15:02:45 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/SaveMobileProgramEnrollmentAction.java	2014-01-09 16:45:15 +0000
@@ -56,8 +56,6 @@
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.program.ProgramInstance;
 import org.hisp.dhis.program.ProgramInstanceService;
-import org.hisp.dhis.program.ProgramPatientAttributeService;
-import org.hisp.dhis.program.ProgramPatientIdentifierTypeService;
 import org.hisp.dhis.program.ProgramService;
 import org.hisp.dhis.program.ProgramStage;
 import org.hisp.dhis.program.ProgramStageInstance;
@@ -67,7 +65,6 @@
 import org.hisp.dhis.util.ContextUtils;
 import org.joda.time.format.DateTimeFormatter;
 import org.joda.time.format.ISODateTimeFormat;
-import org.springframework.beans.factory.annotation.Autowired;
 
 import com.opensymphony.xwork2.Action;
 import com.opensymphony.xwork2.ActionContext;
@@ -108,12 +105,6 @@
         this.programStageInstanceService = programStageInstanceService;
     }
 
-    @Autowired
-    private ProgramPatientAttributeService programPatientAttributeService;
-
-    @Autowired
-    private ProgramPatientIdentifierTypeService programPatientIdentifierTypeService;
-
     private FormUtils formUtils;
 
     public FormUtils getFormUtils()
@@ -312,8 +303,8 @@
     {
         patient = patientService.getPatient( patientId );
         program = programService.getProgram( programId );
-        patientAttributes = programPatientAttributeService.getListPatientAttribute( program );
-        patientIdentifierTypes = programPatientIdentifierTypeService.getListPatientIdentifierType( program );
+        patientAttributes = program.getAttributes();
+        patientIdentifierTypes = program.getIdentifierTypes();
 
         List<PatientAttributeValue> patientAttributeValues = new ArrayList<PatientAttributeValue>();
 

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/RegisterBeneficiaryAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/RegisterBeneficiaryAction.java	2014-01-07 15:02:45 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/RegisterBeneficiaryAction.java	2014-01-09 16:45:15 +0000
@@ -35,11 +35,8 @@
 import org.hisp.dhis.patient.PatientIdentifierType;
 import org.hisp.dhis.patient.PatientIdentifierTypeService;
 import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramPatientAttributeService;
-import org.hisp.dhis.program.ProgramPatientIdentifierTypeService;
 import org.hisp.dhis.program.ProgramService;
 import org.hisp.dhis.setting.SystemSettingManager;
-import org.springframework.beans.factory.annotation.Autowired;
 
 import com.opensymphony.xwork2.Action;
 
@@ -88,12 +85,6 @@
         this.systemSettingManager = systemSettingManager;
     }
 
-    @Autowired
-    private ProgramPatientAttributeService programPatientAttributeService;
-
-    @Autowired
-    private ProgramPatientIdentifierTypeService programPatientIdentifierTypeService;
-
     // -------------------------------------------------------------------------
     // Input & Output
     // -------------------------------------------------------------------------
@@ -190,9 +181,8 @@
 
         for ( Program program : programs )
         {
-            patientIdentifierTypes.removeAll( programPatientIdentifierTypeService
-                .getListPatientIdentifierType( program ) );
-            patientAttributes.removeAll( programPatientAttributeService.getListPatientAttribute( program ) );
+            patientIdentifierTypes.removeAll( program.getIdentifierTypes() );
+            patientAttributes.removeAll( program.getAttributes() );
         }
         return SUCCESS;
     }

=== 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	2014-01-07 15:02:45 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/SaveBeneficiaryAction.java	2014-01-09 16:45:15 +0000
@@ -52,12 +52,9 @@
 import org.hisp.dhis.patient.PatientService;
 import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
 import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramPatientAttributeService;
-import org.hisp.dhis.program.ProgramPatientIdentifierTypeService;
 import org.hisp.dhis.program.ProgramService;
 import org.hisp.dhis.system.util.MathUtils;
 import org.hisp.dhis.util.ContextUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 
 import com.opensymphony.xwork2.Action;
 import com.opensymphony.xwork2.ActionContext;
@@ -153,12 +150,6 @@
         this.programService = programService;
     }
 
-    @Autowired
-    private ProgramPatientAttributeService programPatientAttributeService;
-
-    @Autowired
-    private ProgramPatientIdentifierTypeService programPatientIdentifierTypeService;
-
     // -------------------------------------------------------------------------
     // Input & Output
     // -------------------------------------------------------------------------
@@ -348,8 +339,8 @@
 
         for ( Program program : programs )
         {
-            patientIdentifierTypes.removeAll(programPatientIdentifierTypeService.getListPatientIdentifierType( program ) );
-            patientAttributes.removeAll( programPatientAttributeService.getListPatientAttribute( program ) );
+            patientIdentifierTypes.removeAll( program.getIdentifierTypes() );
+            patientAttributes.removeAll( program.getAttributes() );
         }
 
         patient.setOrganisationUnit( organisationUnitService.getOrganisationUnit( orgUnitId ) );
@@ -373,8 +364,8 @@
 
         for ( Program program : programs )
         {
-            patientIdentifierTypes.removeAll(programPatientIdentifierTypeService.getListPatientIdentifierType( program ) );
-            patientAttributes.removeAll( programPatientAttributeService.getListPatientAttribute( program ) );
+            patientIdentifierTypes.removeAll( program.getIdentifierTypes() );
+            patientAttributes.removeAll( program.getAttributes() );
         }
 
         for ( PatientIdentifierType patientIdentifierType : patientIdentifierTypes )