← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10973: Allow to configure which person attributes that are added to the vsit schedule.This is very usefu...

 

------------------------------------------------------------
revno: 10973
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-05-24 16:10:42 +0700
message:
  Allow to configure which person attributes that are added to the vsit schedule.This is very useful when the list is printed and used for tracking in the community.
added:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/SavePatientAttributeVisitScheduleAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/ShowPatientAttributeVisitScheduleFormAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttributeVisitSchedule.vm
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttribute.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttributeService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttributeStore.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientStore.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientAttributeService.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientAttributeStore.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java
  dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientAttribute.hbm.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.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/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanRecords.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanSelect.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/AddPatientAttributeAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/index.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/menu.vm


--
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-api/src/main/java/org/hisp/dhis/patient/PatientAttribute.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttribute.java	2013-05-17 03:29:07 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttribute.java	2013-05-24 09:10:42 +0000
@@ -78,6 +78,8 @@
     private Set<PatientAttributeOption> attributeOptions;
 
     private String expression;
+    
+    private Boolean displayOnVisitSchedule;
 
     // -------------------------------------------------------------------------
     // Constructors
@@ -235,4 +237,17 @@
         this.expression = expression;
     }
 
+    @JsonProperty
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    public Boolean getDisplayOnVisitSchedule()
+    {
+        return displayOnVisitSchedule;
+    }
+
+    public void setDisplayOnVisitSchedule( Boolean displayOnVisitSchedule )
+    {
+        this.displayOnVisitSchedule = displayOnVisitSchedule;
+    }
+
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttributeService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttributeService.java	2013-04-03 08:06:46 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttributeService.java	2013-05-24 09:10:42 +0000
@@ -59,5 +59,7 @@
     PatientAttribute getPatientAttributeByGroupBy( boolean groupBy );
 
     Collection<PatientAttribute> getPatientAttributesWithoutGroup();
+    
+    Collection<PatientAttribute> getPatientAttributesByDisplayOnVisitSchedule( boolean displayOnVisitSchedule );
 
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttributeStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttributeStore.java	2012-09-05 14:30:23 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttributeStore.java	2013-05-24 09:10:42 +0000
@@ -49,4 +49,7 @@
     Collection<PatientAttribute> getWithoutGroup();
 
     PatientAttribute getByGroupBy( boolean groupBy );
+    
+    Collection<PatientAttribute> getByDisplayOnVisitSchedule( boolean displayOnVisitSchedule );
+    
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientService.java	2013-05-17 04:15:47 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientService.java	2013-05-24 09:10:42 +0000
@@ -208,7 +208,8 @@
 
     void removeErollmentPrograms( Program program );
 
-    Collection<Patient> searchPatients( List<String> searchKeys, OrganisationUnit orgunit, Integer min, Integer max );
+    Collection<Patient> searchPatients( List<String> searchKeys, OrganisationUnit orgunit,
+        Collection<PatientAttribute> patientAttributes, Integer min, Integer max );
 
     int countSearchPatients( List<String> searchKeys, OrganisationUnit orgunit );
 
@@ -217,7 +218,8 @@
 
     List<Integer> getProgramStageInstances( List<String> searchKeys, OrganisationUnit orgunit, Integer min, Integer max );
 
-    Grid getScheduledEventsReport( List<String> searchKeys, OrganisationUnit orgunit, I18n i18n );
+    Grid getScheduledEventsReport( List<String> searchKeys, OrganisationUnit orgunit, Integer min, Integer max,
+        I18n i18n );
 
     Collection<Patient> getPatientsByPhone( String phoneNumber, Integer min, Integer max );
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientStore.java	2013-05-17 04:15:47 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientStore.java	2013-05-24 09:10:42 +0000
@@ -68,21 +68,24 @@
 
     void removeErollmentPrograms( Program program );
 
-    Collection<Patient> search( List<String> searchKeys, OrganisationUnit orgunit, Integer min, Integer max );
-
     int countSearch( List<String> searchKeys, OrganisationUnit orgunit );
 
-    Collection<String> getPatientPhoneNumbers( List<String> searchKeys, OrganisationUnit orgunit, Integer min,
-        Integer max );
-
-    List<Integer> getProgramStageInstances( List<String> searchKeys, OrganisationUnit orgunit, Integer min, Integer max );
-
-    Grid getPatientEventReport( Grid grid, List<String> searchKeys, OrganisationUnit orgunit );
-
     Collection<Patient> getByPhoneNumber( String phoneNumber, Integer min, Integer max );
 
     Collection<Patient> getByFullName( String fullName, Integer orgunitId );
 
     Collection<Integer> getRegistrationOrgunitIds( Date startDate, Date endDate );
 
+    Collection<Patient> search( List<String> searchKeys, OrganisationUnit orgunit,
+        Collection<PatientAttribute> patientAttributes, Integer min, Integer max );
+
+    Collection<String> getPatientPhoneNumbers( List<String> searchKeys, OrganisationUnit orgunit,
+        Collection<PatientAttribute> patientAttributes, Integer min, Integer max );
+
+    List<Integer> getProgramStageInstances( List<String> searchKeys, OrganisationUnit orgunit,
+        Collection<PatientAttribute> patientAttributes, Integer min, Integer max );
+
+    Grid getPatientEventReport( Grid grid, List<String> searchKeys, OrganisationUnit orgunit,
+        Collection<PatientAttribute> patientAttributes, Integer min, Integer max );
+
 }

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientAttributeService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientAttributeService.java	2013-05-18 06:51:47 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientAttributeService.java	2013-05-24 09:10:42 +0000
@@ -29,8 +29,14 @@
 import static org.hisp.dhis.i18n.I18nUtils.i18n;
 
 import java.util.Collection;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
 
 import org.hisp.dhis.i18n.I18nService;
+import org.hisp.dhis.period.CalendarPeriodType;
+import org.hisp.dhis.period.Period;
+import org.hisp.dhis.period.PeriodType;
 import org.springframework.transaction.annotation.Transactional;
 
 /**
@@ -122,5 +128,10 @@
     {
         return i18n( i18nService, patientAttributeStore.getByUid( uid ) );
     }
-
+    
+    public Collection<PatientAttribute> getPatientAttributesByDisplayOnVisitSchedule( boolean displayOnVisitSchedule )
+    {
+        return i18n( i18nService, patientAttributeStore.getByDisplayOnVisitSchedule( displayOnVisitSchedule ) );
+    }
+   
 }

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java	2013-05-17 04:15:47 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java	2013-05-24 09:10:42 +0000
@@ -523,10 +523,10 @@
         patientStore.removeErollmentPrograms( program );
     }
 
-    public Collection<Patient> searchPatients( List<String> searchKeys, OrganisationUnit orgunit, Integer min,
-        Integer max )
+    public Collection<Patient> searchPatients( List<String> searchKeys, OrganisationUnit orgunit,
+        Collection<PatientAttribute> patientAttributes, Integer min, Integer max )
     {
-        return patientStore.search( searchKeys, orgunit, min, max );
+        return patientStore.search( searchKeys, orgunit, patientAttributes, min, max );
     }
 
     public int countSearchPatients( List<String> searchKeys, OrganisationUnit orgunit )
@@ -534,16 +534,16 @@
         return patientStore.countSearch( searchKeys, orgunit );
     }
 
-    public Collection<String> getPatientPhoneNumbers( List<String> searchKeys, OrganisationUnit orgunit, Integer min,
-        Integer max )
+    public Collection<String> getPatientPhoneNumbers( List<String> searchKeys, OrganisationUnit orgunit,
+        Integer min, Integer max )
     {
-        return patientStore.getPatientPhoneNumbers( searchKeys, orgunit, min, max );
+        return patientStore.getPatientPhoneNumbers( searchKeys, orgunit, null, min, max );
     }
 
     public List<Integer> getProgramStageInstances( List<String> searchKeys, OrganisationUnit orgunit, Integer min,
         Integer max )
     {
-        return patientStore.getProgramStageInstances( searchKeys, orgunit, min, max );
+        return patientStore.getProgramStageInstances( searchKeys, orgunit, null, min, max );
     }
 
     @Override
@@ -553,7 +553,8 @@
     }
 
     @Override
-    public Grid getScheduledEventsReport( List<String> searchKeys, OrganisationUnit orgunit, I18n i18n )
+    public Grid getScheduledEventsReport( List<String> searchKeys, OrganisationUnit orgunit, Integer min, Integer max,
+        I18n i18n )
     {
         String startDate = "";
         String endDate = "";
@@ -580,11 +581,19 @@
         grid.addHeader( new GridHeader( i18n.getString( "last_name" ), false, true ) );
         grid.addHeader( new GridHeader( i18n.getString( "gender" ), false, true ) );
         grid.addHeader( new GridHeader( i18n.getString( "phone_number" ), false, true ) );
+
+        Collection<PatientAttribute> patientAttributes = patientAttributeService
+            .getPatientAttributesByDisplayOnVisitSchedule( true );
+        for ( PatientAttribute patientAttribute : patientAttributes )
+        {
+            grid.addHeader( new GridHeader( patientAttribute.getDisplayName(), false, true ) );
+        }
+
         grid.addHeader( new GridHeader( "programstageinstanceid", true, true ) );
         grid.addHeader( new GridHeader( i18n.getString( "program_stage" ), false, true ) );
         grid.addHeader( new GridHeader( i18n.getString( "due_date" ), false, true ) );
 
-        return patientStore.getPatientEventReport( grid, searchKeys, orgunit );
+        return patientStore.getPatientEventReport( grid, searchKeys, orgunit, patientAttributes, min, max );
 
     }
 
@@ -599,5 +608,5 @@
     {
         return patientStore.getRegistrationOrgunitIds( startDate, endDate );
     }
-
+    
 }

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientAttributeStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientAttributeStore.java	2013-01-07 05:07:05 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientAttributeStore.java	2013-05-24 09:10:42 +0000
@@ -42,6 +42,10 @@
     extends HibernateIdentifiableObjectStore<PatientAttribute>
     implements PatientAttributeStore
 {
+    // -------------------------------------------------------------------------
+    // Implementation methods
+    // -------------------------------------------------------------------------
+    
     @SuppressWarnings( "unchecked" )
     public Collection<PatientAttribute> getByValueType( String valueType )
     {
@@ -66,9 +70,17 @@
         return (PatientAttribute) getCriteria( Restrictions.eq( "groupBy", groupBy ) ).uniqueResult();
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings( "unchecked" )
     public Collection<PatientAttribute> getWithoutGroup()
     {
         return getCriteria( Restrictions.isNull( "patientAttributeGroup" ) ).list();
     }
+
+    @SuppressWarnings( "unchecked" )
+    public Collection<PatientAttribute> getByDisplayOnVisitSchedule( boolean displayOnVisitSchedule )
+    {
+        return getCriteria( Restrictions.eq( "displayOnVisitSchedule", displayOnVisitSchedule ) ).list();
+    }
+
+    
 }

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java	2013-05-17 04:15:47 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java	2013-05-24 09:10:42 +0000
@@ -48,6 +48,7 @@
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.patient.Patient;
+import org.hisp.dhis.patient.PatientAttribute;
 import org.hisp.dhis.patient.PatientStore;
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.program.ProgramInstance;
@@ -253,9 +254,10 @@
     }
 
     @Override
-    public Collection<Patient> search( List<String> searchKeys, OrganisationUnit orgunit, Integer min, Integer max )
+    public Collection<Patient> search( List<String> searchKeys, OrganisationUnit orgunit,
+        Collection<PatientAttribute> patientAttributes, Integer min, Integer max )
     {
-        String sql = searchPatientSql( false, searchKeys, orgunit, min, max );
+        String sql = searchPatientSql( false, searchKeys, orgunit, patientAttributes, min, max );
         Collection<Patient> patients = new HashSet<Patient>();
         try
         {
@@ -276,10 +278,10 @@
     }
 
     @Override
-    public Collection<String> getPatientPhoneNumbers( List<String> searchKeys, OrganisationUnit orgunit, Integer min,
-        Integer max )
+    public Collection<String> getPatientPhoneNumbers( List<String> searchKeys, OrganisationUnit orgunit,
+        Collection<PatientAttribute> patientAttributes, Integer min, Integer max )
     {
-        String sql = searchPatientSql( false, searchKeys, orgunit, min, max );
+        String sql = searchPatientSql( false, searchKeys, orgunit, patientAttributes, min, max );
         Collection<String> phoneNumbers = new HashSet<String>();
         try
         {
@@ -301,10 +303,10 @@
     }
 
     @Override
-    public List<Integer> getProgramStageInstances( List<String> searchKeys, OrganisationUnit orgunit, Integer min,
-        Integer max )
+    public List<Integer> getProgramStageInstances( List<String> searchKeys, OrganisationUnit orgunit,
+        Collection<PatientAttribute> patientAttributes, Integer min, Integer max )
     {
-        String sql = searchPatientSql( false, searchKeys, orgunit, min, max );
+        String sql = searchPatientSql( false, searchKeys, orgunit, patientAttributes, min, max );
         List<Integer> programStageInstanceIds = new ArrayList<Integer>();
         try
         {
@@ -327,18 +329,19 @@
 
     public int countSearch( List<String> searchKeys, OrganisationUnit orgunit )
     {
-        String sql = searchPatientSql( true, searchKeys, orgunit, null, null );
+        String sql = searchPatientSql( true, searchKeys, orgunit, null, null, null );
         return jdbcTemplate.queryForObject( sql, Integer.class );
     }
 
     @Override
-    public Grid getPatientEventReport( Grid grid, List<String> searchKeys, OrganisationUnit orgunit )
+    public Grid getPatientEventReport( Grid grid, List<String> searchKeys, OrganisationUnit orgunit,
+        Collection<PatientAttribute> patientAttributes, Integer min, Integer max )
     {
         // ---------------------------------------------------------------------
         // Get SQL and build grid
         // ---------------------------------------------------------------------
 
-        String sql = searchPatientSql( false, searchKeys, orgunit, null, null );
+        String sql = searchPatientSql( false, searchKeys, orgunit, patientAttributes, null, null );
 
         SqlRowSet rowSet = jdbcTemplate.queryForRowSet( sql );
 
@@ -351,13 +354,24 @@
     // Supportive methods
     // -------------------------------------------------------------------------
 
-    private String searchPatientSql( boolean count, List<String> searchKeys, OrganisationUnit orgunit, Integer min,
-        Integer max )
+    private String searchPatientSql( boolean count, List<String> searchKeys, OrganisationUnit orgunit,
+        Collection<PatientAttribute> patientAttributes, Integer min, Integer max )
     {
         String selector = count ? "count(*) " : "* ";
 
         String sql = "select " + selector
             + " from ( select distinct p.patientid, p.firstname, p.middlename, p.lastname, p.gender, p.phonenumber,";
+
+        if ( patientAttributes != null )
+        {
+            for ( PatientAttribute patientAttribute : patientAttributes )
+            {
+                sql += "(select value from patientattributevalue where patientid=p.patientid and patientattributeid="
+                    + patientAttribute.getId() + " ) as " + Patient.PREFIX_PATIENT_ATTRIBUTE + "_"
+                    + patientAttribute.getId() + " ,";
+            }
+        }
+
         String patientWhere = "";
         String patientOperator = " where ";
         String patientGroupBy = " GROUP BY  p.patientid, p.firstname, p.middlename, p.lastname, p.gender, p.phonenumber ";

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientAttribute.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientAttribute.hbm.xml	2013-02-07 10:25:34 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientAttribute.hbm.xml	2013-05-24 09:10:42 +0000
@@ -34,6 +34,8 @@
     <property name="inherit" column="inherit" />
 
     <property name="expression" column="expression" />
+    
+    <property name="displayOnVisitSchedule" />
 
   </class>
 </hibernate-mapping>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java	2013-03-21 07:56:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java	2013-05-24 09:10:42 +0000
@@ -39,8 +39,12 @@
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.paging.ActionPagingSupport;
 import org.hisp.dhis.patient.Patient;
+import org.hisp.dhis.patient.PatientAttribute;
+import org.hisp.dhis.patient.PatientAttributeService;
 import org.hisp.dhis.patient.PatientIdentifierType;
 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.ProgramService;
@@ -82,6 +86,20 @@
         this.programStageInstanceService = programStageInstanceService;
     }
 
+    private PatientAttributeService patientAttributeService;
+
+    public void setPatientAttributeService( PatientAttributeService patientAttributeService )
+    {
+        this.patientAttributeService = patientAttributeService;
+    }
+
+    private PatientAttributeValueService patientAttributeValueService;
+
+    public void setPatientAttributeValueService( PatientAttributeValueService patientAttributeValueService )
+    {
+        this.patientAttributeValueService = patientAttributeValueService;
+    }
+
     private I18n i18n;
 
     public void setI18n( I18n i18n )
@@ -163,6 +181,20 @@
         return grid;
     }
 
+    private List<PatientAttribute> patientAttributes;
+
+    public List<PatientAttribute> getPatientAttributes()
+    {
+        return patientAttributes;
+    }
+
+    private Map<Integer, List<String>> patientAttributeValueMap = new HashMap<Integer, List<String>>();
+
+    public Map<Integer, List<String>> getPatientAttributeValueMap()
+    {
+        return patientAttributeValueMap;
+    }
+
     // -------------------------------------------------------------------------
     // Implementation Action
     // -------------------------------------------------------------------------
@@ -183,6 +215,9 @@
         {
             if ( type == null )
             {
+                patientAttributes = new ArrayList<PatientAttribute>(
+                    patientAttributeService.getPatientAttributesByDisplayOnVisitSchedule( true ) );
+
                 total = patientService.countSearchPatients( searchTexts, orgunit );
                 this.paging = createPaging( total );
 
@@ -191,12 +226,32 @@
 
                 for ( Integer stageInstanceId : stageInstanceIds )
                 {
-                    programStageInstances.add( programStageInstanceService.getProgramStageInstance( stageInstanceId ) );
+                    // Get programStageInstance
+
+                    ProgramStageInstance programStageInstance = programStageInstanceService
+                        .getProgramStageInstance( stageInstanceId );
+                    programStageInstances.add( programStageInstance );
+
+                    // Get Patient-attributes
+
+                    Patient patient = programStageInstance.getProgramInstance().getPatient();
+                    if ( patientAttributeValueMap.get( patient.getId() ) == null )
+                    {
+                        List<String> values = new ArrayList<String>();
+                        for ( PatientAttribute patientAttribute : patientAttributes )
+                        {
+                            PatientAttributeValue patientAttributeValue = patientAttributeValueService
+                                .getPatientAttributeValue( patient, patientAttribute );
+                            String value = (patientAttributeValue == null) ? "" : patientAttributeValue.getValue();
+                            values.add( value );
+                        }
+                        patientAttributeValueMap.put( patient.getId(), values );
+                    }
                 }
             }
             else
             {
-                grid = patientService.getScheduledEventsReport( searchTexts, orgunit, i18n );
+                grid = patientService.getScheduledEventsReport( searchTexts, orgunit, null, null, i18n );
             }
         }
 

=== 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	2012-10-11 08:00:24 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SearchPatientAction.java	2013-05-24 09:10:42 +0000
@@ -168,7 +168,7 @@
 
             total = patientService.countSearchPatients( searchTexts, organisationUnit );
             this.paging = createPaging( total );
-            patients = patientService.searchPatients( searchTexts, organisationUnit, paging.getStartPos(),
+            patients = patientService.searchPatients( searchTexts, organisationUnit, null, paging.getStartPos(),
                 paging.getPageSize() );
 
             if ( !searchBySelectedOrgunit )

=== 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	2013-05-21 04:05:54 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2013-05-24 09:10:42 +0000
@@ -215,6 +215,8 @@
 		<property name="programStageInstanceService"
 			ref="org.hisp.dhis.program.ProgramStageInstanceService" />
 		<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
+		<property name="patientAttributeService" ref="org.hisp.dhis.patient.PatientAttributeService" />
+		<property name="patientAttributeValueService" ref="org.hisp.dhis.patientattributevalue.PatientAttributeValueService" />
 	</bean>
 
 	<!-- Single-event DataEntry -->

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanRecords.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanRecords.vm	2013-05-21 04:33:28 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanRecords.vm	2013-05-24 09:10:42 +0000
@@ -18,10 +18,13 @@
 			<th>$i18n.getString('orgunit')</th>
 			
 			#if( $auth.hasAccess( "dhis-web-caseentry", "accessPatientAttributes" ) )
-			<th>$i18n.getString('full_name')</th>
-			<th>$i18n.getString('phone_number')</th>
+				<th>$i18n.getString('full_name')</th>
+				<th>$i18n.getString('phone_number')</th>
+				#foreach( $patientAttribute in $patientAttributes)
+				<th>$patientAttribute.displayName</th>
+				#end
 			#else
-			<th>$i18n.getString('system_identifier')</th>
+				<th>$i18n.getString('system_identifier')</th>
 			#end
 			
 			<th>$i18n.getString('events')</th>
@@ -72,6 +75,12 @@
 			</a></td>
 			
 			<td>$!patient.phoneNumber</td>
+			
+			#set( $attributeValues = $patientAttributeValueMap.get($programStageInstance.programInstance.patient.id))
+			#foreach( $attributeValue in $attributeValues)
+				<td>$attributeValue</td>
+			#end
+			
 			#else
 				#set($value="")
 				#foreach( $identifier in $patient.identifiers)

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanSelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanSelect.vm	2013-04-15 08:20:20 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanSelect.vm	2013-05-24 09:10:42 +0000
@@ -27,6 +27,12 @@
 	<input type='hidden' id='isSearchByProgram' name='isSearchByProgram' value='false' >
 	<input type='hidden' id='export' name= 'export'>
 	<input type='hidden' class='stage-object-selected'>
+	<select id='displayOnVisitSchedule' name='displayOnVisitSchedule' class='hidden'>
+		#foreach( $patientAttribute in $patientAttributes)
+			<option value='$patientAttribute.id'>$patientAttribute.name</option>
+		#end
+	</select>
+	
 	<div id='selectDiv' class='advanced-search' style='width:550px;'>
 		<table style="margin-bottom:8px;width:550px;">    
 			<tr>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/AddPatientAttributeAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/AddPatientAttributeAction.java	2012-12-21 09:23:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/AddPatientAttributeAction.java	2013-05-24 09:10:42 +0000
@@ -113,7 +113,7 @@
     {
         this.expression = expression;
     }
-
+    
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/SavePatientAttributeVisitScheduleAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/SavePatientAttributeVisitScheduleAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/SavePatientAttributeVisitScheduleAction.java	2013-05-24 09:10:42 +0000
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2004-2012, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.hisp.dhis.patient.action.patientattribute;
+
+import java.util.Collection;
+
+import org.hisp.dhis.patient.PatientAttribute;
+import org.hisp.dhis.patient.PatientAttributeService;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Chau Thu Tran
+ * @version $ SavePatientAttributeVisitScheduleAction.java May 24, 2013 12:31:55
+ *          PM $
+ */
+public class SavePatientAttributeVisitScheduleAction
+    implements Action
+{
+
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private PatientAttributeService patientAttributeService;
+
+    public void setPatientAttributeService( PatientAttributeService patientAttributeService )
+    {
+        this.patientAttributeService = patientAttributeService;
+    }
+
+    // -------------------------------------------------------------------------
+    // Input/Output
+    // -------------------------------------------------------------------------
+
+    private Integer[] selectedAttributeIds;
+
+    public void setSelectedAttributeIds( Integer[] selectedAttributeIds )
+    {
+        this.selectedAttributeIds = selectedAttributeIds;
+    }
+
+    // -------------------------------------------------------------------------
+    // Action implementation
+    // -------------------------------------------------------------------------
+
+    public String execute()
+        throws Exception
+    {
+        Collection<PatientAttribute> patientAttributes = patientAttributeService.getAllPatientAttributes();
+        
+        for ( Integer attributeId : selectedAttributeIds )
+        {
+            PatientAttribute patientAttribute = patientAttributeService.getPatientAttribute( attributeId );
+            patientAttribute.setDisplayOnVisitSchedule( true );
+            patientAttributeService.updatePatientAttribute( patientAttribute );
+            
+            patientAttributes.remove( patientAttribute );
+        }
+        
+        // Set visitSchedule=false for other patientAttributes 
+        for ( PatientAttribute patientAttribute : patientAttributes )
+        {
+            patientAttribute.setDisplayOnVisitSchedule( false );
+            patientAttributeService.updatePatientAttribute( patientAttribute ); 
+        }
+        
+        return SUCCESS;
+    }
+}

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/ShowPatientAttributeVisitScheduleFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/ShowPatientAttributeVisitScheduleFormAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/ShowPatientAttributeVisitScheduleFormAction.java	2013-05-24 09:10:42 +0000
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2004-2012, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.hisp.dhis.patient.action.patientattribute;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+import org.hisp.dhis.patient.PatientAttribute;
+import org.hisp.dhis.patient.PatientAttributeService;
+import org.hisp.dhis.patient.comparator.PatientAttributeComparator;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Chau Thu Tran
+ * @version $ ShowPatientAttributeVisitScheduleFormAction.java May 24, 2013
+ *          1:22:52 PM $
+ */
+public class ShowPatientAttributeVisitScheduleFormAction
+    implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependency
+    // -------------------------------------------------------------------------
+
+    private PatientAttributeService patientAttributeService;
+
+    public void setPatientAttributeService( PatientAttributeService patientAttributeService )
+    {
+        this.patientAttributeService = patientAttributeService;
+    }
+
+    // -------------------------------------------------------------------------
+    // Output
+    // -------------------------------------------------------------------------
+
+    private List<PatientAttribute> availablePatientAttributes = new ArrayList<PatientAttribute>();
+
+    public List<PatientAttribute> getAvailablePatientAttributes()
+    {
+        return availablePatientAttributes;
+    }
+
+    private List<PatientAttribute> selectedPatientAttributes = new ArrayList<PatientAttribute>();
+
+    public List<PatientAttribute> getSelectedPatientAttributes()
+    {
+        return selectedPatientAttributes;
+    }
+
+    // -------------------------------------------------------------------------
+    // Action implementation
+    // -------------------------------------------------------------------------
+
+    public String execute()
+        throws Exception
+    {
+        availablePatientAttributes = new ArrayList<PatientAttribute>( patientAttributeService.getAllPatientAttributes() );
+
+        selectedPatientAttributes = new ArrayList<PatientAttribute>(
+            patientAttributeService.getPatientAttributesByDisplayOnVisitSchedule( true ) );
+
+        availablePatientAttributes.removeAll( selectedPatientAttributes );
+        
+        Collections.sort( availablePatientAttributes, new PatientAttributeComparator() );
+        Collections.sort( selectedPatientAttributes, new PatientAttributeComparator() );
+
+        return SUCCESS;
+    }
+
+}

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml	2013-05-03 07:36:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml	2013-05-24 09:10:42 +0000
@@ -152,6 +152,22 @@
 		<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
 	</bean>
 
+	<bean
+		id="org.hisp.dhis.patient.action.patientattribute.ShowPatientAttributeVisitScheduleFormAction"
+		class="org.hisp.dhis.patient.action.patientattribute.ShowPatientAttributeVisitScheduleFormAction"
+		scope="prototype">
+		<property name="patientAttributeService"
+			ref="org.hisp.dhis.patient.PatientAttributeService" />
+	</bean>
+	
+	<bean
+		id="org.hisp.dhis.patient.action.patientattribute.SavePatientAttributeVisitScheduleAction"
+		class="org.hisp.dhis.patient.action.patientattribute.SavePatientAttributeVisitScheduleAction"
+		scope="prototype">
+		<property name="patientAttributeService"
+			ref="org.hisp.dhis.patient.PatientAttributeService" />
+	</bean>
+	
 	<!-- Program -->
 
 	<bean id="org.hisp.dhis.patient.action.program.AddProgramAction"

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties	2013-05-23 16:04:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties	2013-05-24 09:10:42 +0000
@@ -406,4 +406,6 @@
 orgunit_group = Organisation unit group
 enrollement_date = Enrollement date
 days_since_incident_date = Days since incident date
-view_all = View all
\ No newline at end of file
+view_all = View all
+patient_attribute_visit_schedule = Patient attribute visit schedule
+intro_patient_attribute_visit_schedule = Allow to configure which person attributes that are added to the vsit schedule.This is very useful when the list is printed and used for tracking in the community.
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml	2013-04-28 08:54:29 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml	2013-05-24 09:10:42 +0000
@@ -190,6 +190,23 @@
 			</result>
 			<param name="requiredAuthorities">F_PATIENTATTRIBUTE_DELETE</param>
 		</action>
+		
+		<action name="patientAttributeVisitSchedule"
+			class="org.hisp.dhis.patient.action.patientattribute.ShowPatientAttributeVisitScheduleFormAction">
+			<result name="success" type="velocity">/main.vm</result>
+			<param name="page">
+				/dhis-web-maintenance-patient/patientAttributeVisitSchedule.vm</param>
+			<param name="menu">/dhis-web-maintenance-patient/menu.vm</param>
+			<param name="javascripts">javascript/patientAttribute.js</param>
+			<param name="stylesheets">style/basic.css</param>
+			<param name="requiredAuthorities">F_PATIENTATTRIBUTE_UPDATE</param>
+		</action>
+		
+		<action name="savePatientAttributeVisitSchedule"
+			class="org.hisp.dhis.patient.action.patientattribute.SavePatientAttributeVisitScheduleAction">
+			<result name="success" type="redirect">index.action</result>
+			<param name="requiredAuthorities">F_PATIENTATTRIBUTE_UPDATE</param>
+		</action>
 
 		<!-- Program -->
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/index.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/index.vm	2013-02-01 08:40:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/index.vm	2013-05-24 09:10:42 +0000
@@ -9,6 +9,7 @@
 
 <ul class="introList">
     #introListImgItem( "patientAttribute.action" "patient_attribute" "patient" )
+    #introListImgItem( "patientAttributeVisitSchedule.action" "patient_attribute_visit_schedule" "patient" )
     #introListImgItem( "patientAttributeGroup.action" "patient_attribute_group" "patient" )
     #introListImgItem( "patientIdentifierType.action" "patient_identifier_type" "patient" )
     #introListImgItem( "relationshipType.action" "relationship_type" "patient" )

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/menu.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/menu.vm	2013-02-01 08:40:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/menu.vm	2013-05-24 09:10:42 +0000
@@ -1,6 +1,7 @@
 <h2>$i18n.getString( "patients" )</h2>
 <ul>
 	<li><a href="patientAttribute.action">$i18n.getString( "patient_attribute" )</a></li>
+	<li><a href="patientAttributeVisitSchedule.action">$i18n.getString( "patient_attribute_visit_schedule" )</a></li>
 	<li><a href="patientAttributeGroup.action">$i18n.getString( "patient_attribute_group" )</a></li>
 	<li><a href="patientIdentifierType.action">$i18n.getString( "patient_identifier_type" )</a></li>
 	<li><a href="relationshipType.action">$i18n.getString( "relationship_type" )</a></li>

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttributeVisitSchedule.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttributeVisitSchedule.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttributeVisitSchedule.vm	2013-05-24 09:10:42 +0000
@@ -0,0 +1,51 @@
+<h3>$i18n.getString( "patient_attribute_visit_schedule" )</h3>
+																			
+<form id="patientAttributeVisitScheduleForm" name="patientAttributeVisitScheduleForm" action="savePatientAttributeVisitSchedule.action" method="post" action='savePatientAttributeVisitSchedule.action'>
+
+<table>
+	<colgroup>
+		<col style='width:300px'/>
+		<col/>
+		<col style='width:300px'/>
+	</colgroup>
+	<tr>
+		<th>$i18n.getString( "availableAttribute" )</th>
+		<th>$i18n.getString( "filter" )</th>
+		<th>$i18n.getString( "selectedAttribute" )</th>
+	</tr>
+	
+	<tr>
+		<td>
+			<select style='width:322px' multiple="multiple" id="availableAttributes" name="availableAttributes" size="15" ondblclick="moveSelectedById( 'availableAttributes', 'selectedAttributeIds' )" >
+				#foreach($attribute in $availablePatientAttributes)
+					<option value='$attribute.id'>$attribute.name</option>
+				#end
+			</select>
+		</td>
+		<td>
+			<input type="button" value="&gt;" onclick="moveSelectedById( 'availableAttributes', 'selectedAttributeIds' )" class='filterButton' /><br/>
+			<input type="button" value="&lt;" onclick="moveSelectedById( 'selectedAttributeIds', 'availableAttributes' )" class='filterButton' /><br/>
+			<input type="button" value="&gt;&gt;" onclick="moveAllById( 'availableAttributes', 'selectedAttributeIds' )" class='filterButton' /><br/>
+			<input type="button" value="&lt;&lt;" onclick="moveAllById( 'selectedAttributeIds', 'availableAttributes' )" class='filterButton' />
+		</td>
+		<td>
+			<select style='width:322px' multiple="multiple" id="selectedAttributeIds" name="selectedAttributeIds" size="15" ondblclick="moveSelectedById( 'selectedAttributeIds', 'availableAttributes' )" >
+				#foreach($attribute in $selectedPatientAttributes)
+					<option value='$attribute.id'>$attribute.name</option>
+				#end
+			</select>
+		</td>
+	</tr>  
+	<tr>
+		<td colspan='2'>
+			<input type="submit" value="$i18n.getString( 'add' )" />
+			<input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='patientAttributeGroup.action'"/>
+		</td>
+	</tr>
+</table>
+
+</form>
+
+<script>
+	var i18n_remove_option = '$encoder.jsEscape( $i18n.getString( "remove_option" ) , "'") ';
+</script>