← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7017: (patient) Improved program object.

 

------------------------------------------------------------
revno: 7017
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-05-23 22:02:50 +0700
message:
  (patient) Improved program object.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientdatavalue/PatientDataValue.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStore.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/activityplan/DefaultActivityPlanService.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramService.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStore.java
  dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientreport/hibernate/PatientTabularReport.hbm.xml
  dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CompleteDataEntryAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/DataRecordingSelectAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetProgramsByOrgunitAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadAnonymousProgramsAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadDataEntryAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadProgramStagesAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/MultiDataEntrySelectAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveExecutionDateAction.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/ProgramEnrollmentSelectAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/ReportSelectAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataRecordingSelect.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStages.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReport.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentSelectForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePrograms.vm
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonProgram.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/ShowUpdatePatientAttributeAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientidentifiertype/ShowUpdatePatientIdentifierTypeForm.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/GetUnAnonymousProgramAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java
  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/webapp/dhis-web-maintenance-patient/addProgramForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStageList.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.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/patientdatavalue/PatientDataValue.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientdatavalue/PatientDataValue.java	2012-03-05 04:22:57 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientdatavalue/PatientDataValue.java	2012-05-23 15:02:50 +0000
@@ -53,6 +53,8 @@
 
     private String value;
 
+    //private boolean providedElsewhere;
+    
     // -------------------------------------------------------------------------
     // Constructors
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2012-03-27 07:20:28 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2012-05-23 15:02:50 +0000
@@ -47,6 +47,13 @@
      */
     private static final long serialVersionUID = -2581751965520009382L;
 
+    public static final int MULTIPLE_EVENTS_WITH_REGISTRATION = 1;
+
+    public static final int SINGLE_EVENT_WITH_REGISTRATION = 2;
+
+    public static final int SINGLE_EVENT_WITHOUT_REGISTRATION = 3;
+    
+
     private String description;
 
     private Integer version;
@@ -73,14 +80,10 @@
 
     private Integer maxDaysAllowedInputData;
 
-    private Boolean singleEvent;
-
-    private Boolean anonymous;
+    private Integer type;
 
     private Boolean displayProvidedOtherFacility;
 
-    private Boolean hideDateOfIncident;
-
     // -------------------------------------------------------------------------
     // Constructors
     // -------------------------------------------------------------------------
@@ -212,16 +215,6 @@
         this.maxDaysAllowedInputData = maxDaysAllowedInputData;
     }
 
-    public Boolean getSingleEvent()
-    {
-        return singleEvent;
-    }
-
-    public void setSingleEvent( Boolean singleEvent )
-    {
-        this.singleEvent = singleEvent;
-    }
-
     public String getDateOfIncidentDescription()
     {
         return dateOfIncidentDescription;
@@ -232,14 +225,14 @@
         this.dateOfIncidentDescription = dateOfIncidentDescription;
     }
 
-    public Boolean getHideDateOfIncident()
+    public Integer getType()
     {
-        return hideDateOfIncident;
+        return type;
     }
 
-    public void setHideDateOfIncident( Boolean hideDateOfIncident )
+    public void setType( Integer type )
     {
-        this.hideDateOfIncident = hideDateOfIncident;
+        this.type = type;
     }
 
     public Set<ValidationCriteria> getPatientValidationCriteria()
@@ -252,16 +245,6 @@
         this.patientValidationCriteria = patientValidationCriteria;
     }
 
-    public Boolean getAnonymous()
-    {
-        return anonymous;
-    }
-
-    public void setAnonymous( Boolean anonymous )
-    {
-        this.anonymous = anonymous;
-    }
-
     // -------------------------------------------------------------------------
     // Logic methods
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramService.java	2011-12-15 02:50:32 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramService.java	2012-05-23 15:02:50 +0000
@@ -56,10 +56,14 @@
 
     Collection<Program> getPrograms( ValidationCriteria validationCriteria );
 
-    Collection<Program> getPrograms( boolean singleEvent );
-
-    Collection<Program> getPrograms( boolean singleEvent, boolean anonymous );
-
-    Collection<Program> getPrograms( boolean singleEvent, boolean anonymous, OrganisationUnit orgunit );
+    Collection<Program> getPrograms( int type );
+    
+    Collection<Program> getPrograms( int type, OrganisationUnit orgunit );
+
+//    Collection<Program> getPrograms( boolean singleEvent );
+//
+//    Collection<Program> getPrograms( boolean singleEvent, boolean anonymous );
+//
+//    Collection<Program> getPrograms( boolean singleEvent, boolean anonymous, OrganisationUnit orgunit );
 
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java	2012-03-07 02:40:08 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java	2012-05-23 15:02:50 +0000
@@ -58,6 +58,8 @@
      * programStage
      */
     private boolean compulsory = false;
+    
+    //private boolean allowProvidedElsewhere;
 
     private Integer sortOrder;
 

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStore.java	2012-01-06 04:56:54 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStore.java	2012-05-23 15:02:50 +0000
@@ -34,16 +34,22 @@
 
 /**
  * @author Chau Thu Tran
- *
+ * 
  * @version $Id: ProgramStore.java Dec 14, 2011 9:22:17 AM $
  */
-public interface ProgramStore extends GenericNameableObjectStore<Program>
-{ 
+public interface ProgramStore
+    extends GenericNameableObjectStore<Program>
+{
     String ID = ProgramStore.class.getName();
 
-    Collection<Program> get( boolean singleEvent );
-
-    Collection<Program> get( boolean singleEvent, boolean anonymous );
-
-    Collection<Program> get( boolean singleEvent, boolean anonymous, OrganisationUnit orgunit );
+    Collection<Program> getByType( int type );
+    
+    Collection<Program> get( int type, OrganisationUnit orgunit );
+
+    // Collection<Program> get( boolean singleEvent );
+    //
+    // Collection<Program> get( boolean singleEvent, boolean anonymous );
+    //
+    // Collection<Program> get( boolean singleEvent, boolean anonymous,
+    // OrganisationUnit orgunit );
 }

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/activityplan/DefaultActivityPlanService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/activityplan/DefaultActivityPlanService.java	2012-02-28 08:07:22 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/activityplan/DefaultActivityPlanService.java	2012-05-23 15:02:50 +0000
@@ -62,7 +62,7 @@
     // -------------------------------------------------------------------------
 
     private ActivityPlanStore activityPlanStore;
-    
+
     public void setActivityPlanStore( ActivityPlanStore activityPlanStore )
     {
         this.activityPlanStore = activityPlanStore;
@@ -116,7 +116,8 @@
 
         List<ProgramInstance> programInstances = new ArrayList<ProgramInstance>();
 
-        Collection<Program> programs = programService.getPrograms( false, false, organisationUnit );
+        Collection<Program> programs = programService.getPrograms( Program.MULTIPLE_EVENTS_WITH_REGISTRATION,
+            organisationUnit );
 
         for ( Program program : programs )
         {
@@ -155,7 +156,7 @@
     {
         Collection<Activity> activities = new ArrayList<Activity>();
 
-        Collection<Program> programs = programService.getPrograms( false, false, organisationUnit );
+        Collection<Program> programs = programService.getPrograms( Program.MULTIPLE_EVENTS_WITH_REGISTRATION, organisationUnit );
 
         if ( programs.size() > 0 )
         {
@@ -181,7 +182,7 @@
 
         Collection<Activity> activities = new ArrayList<Activity>();
 
-        if ( programService.getPrograms( false, false, organisationUnit ).containsAll( programs ) )
+        if ( programService.getPrograms( Program.MULTIPLE_EVENTS_WITH_REGISTRATION, organisationUnit ).containsAll( programs ) )
         {
             Collection<ProgramInstance> programInstances = programInstanceService.getProgramInstances( programs, false );
 
@@ -284,14 +285,14 @@
 
     }
 
-
     public Collection<Activity> getActivitiesByProvider( OrganisationUnit organisationUnit, int min, int max )
     {
-        Collection<Integer> programStageInstanceIds = activityPlanStore.getActivitiesByProvider ( organisationUnit.getId(), min, max);
+        Collection<Integer> programStageInstanceIds = activityPlanStore.getActivitiesByProvider( organisationUnit
+            .getId(), min, max );
 
         Collection<Activity> activities = new ArrayList<Activity>();
 
-        for( Integer id : programStageInstanceIds )
+        for ( Integer id : programStageInstanceIds )
         {
             ProgramStageInstance instance = programStageInstanceService.getProgramStageInstance( id );
             Activity activity = new Activity();
@@ -300,15 +301,15 @@
             activity.setDueDate( instance.getDueDate() );
             activities.add( activity );
         }
-        
+
         return activities;
     }
 
-    public int countActivitiesByProvider ( OrganisationUnit organisationUnit )
+    public int countActivitiesByProvider( OrganisationUnit organisationUnit )
     {
         return activityPlanStore.countActivitiesByProvider( organisationUnit.getId() );
     }
-    
+
     // -------------------------------------------------------------------------
     // Supportive methods
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java	2012-04-23 16:21:44 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java	2012-05-23 15:02:50 +0000
@@ -81,8 +81,13 @@
         executeSql( "ALTER TABLE patientdatavaluearchive DROP COLUMN storedby" );  
         executeSql( "DROP TABLE patientchart" ); 
         
-        executeSql( "UPDATE program set hideDateOfIncident=false WHERE hideDateOfIncident is null" );
-
+        executeSql( "ALTER TABLE program DROP COLUMN hidedateofincident" );
+        
+        executeSql( "UPDATE program SET type=2 where singleevent=true" );
+        executeSql( "UPDATE program SET type=3 where anonymous=true" );
+        executeSql( "ALTER TABLE program DROP COLUMN singleevent" );
+        executeSql( "ALTER TABLE program DROP COLUMN anonymous" ); 
+        executeSql( "UPDATE program SET type=1 where type is null" );
     }
 
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramService.java	2011-12-15 02:50:32 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramService.java	2012-05-23 15:02:50 +0000
@@ -117,20 +117,30 @@
 
         return programs;
     }
-
-    public Collection<Program> getPrograms( boolean singleEvent )
-    {
-        return programStore.get( singleEvent );
-    }
-
-    public Collection<Program> getPrograms( boolean singleEvent, boolean anonymous )
-    {
-        return programStore.get( singleEvent, anonymous );
-    }
-    
-    public Collection<Program> getPrograms( boolean singleEvent, boolean anonymous, OrganisationUnit orgunit )
-    {
-        return programStore.get( singleEvent, anonymous, orgunit );
-    }
+    
+    public Collection<Program> getPrograms( int type )
+    {
+        return programStore.getByType( type );
+    }
+    
+    public Collection<Program> getPrograms( int type, OrganisationUnit orgunit )
+    {
+        return programStore.get( type, orgunit );
+    }
+
+//    public Collection<Program> getPrograms( boolean singleEvent )
+//    {
+//        return programStore.get( singleEvent );
+//    }
+//
+//    public Collection<Program> getPrograms( boolean singleEvent, boolean anonymous )
+//    {
+//        return programStore.get( singleEvent, anonymous );
+//    }
+//    
+//    public Collection<Program> getPrograms( boolean singleEvent, boolean anonymous, OrganisationUnit orgunit )
+//    {
+//        return programStore.get( singleEvent, anonymous, orgunit );
+//    }
 
 }

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStore.java	2012-01-11 05:31:53 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStore.java	2012-05-23 15:02:50 +0000
@@ -46,26 +46,44 @@
 {
     @SuppressWarnings( "unchecked" )
     @Override
-    public Collection<Program> get( boolean singleEvent )
-    {
-        return getCriteria( Restrictions.eq( "singleEvent", singleEvent )).list();
-    }
-
-    @SuppressWarnings( "unchecked" )
-    @Override
-    public Collection<Program> get( boolean singleEvent, boolean anonymous )
-    {
-        return getCriteria( Restrictions.eq( "singleEvent", singleEvent ),
-            Restrictions.eq( "anonymous", anonymous ) ).list();
-    }
-
-    @SuppressWarnings( "unchecked" )
-    @Override
-    public Collection<Program> get( boolean singleEvent, boolean anonymous, OrganisationUnit orgunit )
-    {
-        return getCriteria( Restrictions.eq( "singleEvent", singleEvent ),
-            Restrictions.eq( "anonymous", anonymous ) ).createAlias( "organisationUnits", "orgunit" ).add(
+    public Collection<Program> getByType( int type )
+    {
+        return getCriteria( Restrictions.eq( "type", type ) ).list();
+    }
+
+    @SuppressWarnings( "unchecked" )
+    @Override
+    public Collection<Program> get( int type, OrganisationUnit orgunit )
+    {
+        return getCriteria( Restrictions.eq( "type", type ) ).createAlias( "organisationUnits", "orgunit" ).add(
             Restrictions.eq( "orgunit.id", orgunit.getId() ) ).list();
     }
 
+    // @SuppressWarnings( "unchecked" )
+    // @Override
+    // public Collection<Program> get( boolean singleEvent )
+    // {
+    // return getCriteria( Restrictions.eq( "singleEvent", singleEvent
+    // )).list();
+    // }
+    //
+    // @SuppressWarnings( "unchecked" )
+    // @Override
+    // public Collection<Program> get( boolean singleEvent, boolean anonymous )
+    // {
+    // return getCriteria( Restrictions.eq( "singleEvent", singleEvent ),
+    // Restrictions.eq( "anonymous", anonymous ) ).list();
+    // }
+    //
+    // @SuppressWarnings( "unchecked" )
+    // @Override
+    // public Collection<Program> get( boolean singleEvent, boolean anonymous,
+    // OrganisationUnit orgunit )
+    // {
+    // return getCriteria( Restrictions.eq( "singleEvent", singleEvent ),
+    // Restrictions.eq( "anonymous", anonymous ) ).createAlias(
+    // "organisationUnits", "orgunit" ).add(
+    // Restrictions.eq( "orgunit.id", orgunit.getId() ) ).list();
+    // }
+
 }

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientreport/hibernate/PatientTabularReport.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientreport/hibernate/PatientTabularReport.hbm.xml	2012-05-10 01:21:56 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientreport/hibernate/PatientTabularReport.hbm.xml	2012-05-23 15:02:50 +0000
@@ -22,7 +22,7 @@
 		<many-to-one name="programStage" class="org.hisp.dhis.program.ProgramStage"
 			column="programstageid" foreign-key="fk_patienttabularreport_programstageid" />
 
-		<list name="identifiers" cascade="all"
+		<list name="identifiers"
 			table="patienttabularreport_identifiers">
 			<key column="patienttabularreportid" />
 			<list-index column="sort_order" base="0" />
@@ -30,7 +30,7 @@
 				column="patientidentifiertypeid" foreign-key="patienttabularreport_indentifierid" />
 		</list>
 
-		<list name="attributes" cascade="all" table="patienttabularreport_attributes">
+		<list name="attributes" table="patienttabularreport_attributes">
 			<key column="patienttabularreportid" />
 			<list-index column="sort_order" base="0" />
 			<many-to-many class="org.hisp.dhis.patient.PatientAttribute"
@@ -43,7 +43,7 @@
 			<element type="text" column="fixedAttribute" />
 		</list>
 
-		<list name="dataElements" cascade="all"
+		<list name="dataElements"
 			table="patienttabularreport_dataelements">
 			<key column="patienttabularreportid" />
 			<list-index column="sort_order" base="0" />

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml	2012-03-27 07:20:28 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml	2012-05-23 15:02:50 +0000
@@ -39,13 +39,9 @@
     
     <property name="maxDaysAllowedInputData" />
 
-    <property name="singleEvent" />
-    
-    <property name="anonymous" />
+    <property name="type" />
     
     <property name="displayProvidedOtherFacility" />
-    
-    <property name="hideDateOfIncident" />
-    
+        
   </class>
 </hibernate-mapping>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CompleteDataEntryAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CompleteDataEntryAction.java	2012-03-27 08:30:45 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CompleteDataEntryAction.java	2012-05-23 15:02:50 +0000
@@ -29,6 +29,7 @@
 import java.util.Date;
 import java.util.Set;
 
+import org.hisp.dhis.program.Program;
 import org.hisp.dhis.program.ProgramInstance;
 import org.hisp.dhis.program.ProgramInstanceService;
 import org.hisp.dhis.program.ProgramStageInstance;
@@ -112,7 +113,7 @@
         // ProgramInstance
         // ----------------------------------------------------------------------
 
-        if ( !programStageInstance.getProgramInstance().getProgram().getAnonymous() )
+        if ( !programStageInstance.getProgramInstance().getProgram().getType().equals( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) )
         {
             ProgramInstance programInstance = programStageInstance.getProgramInstance();
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/DataRecordingSelectAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/DataRecordingSelectAction.java	2012-03-10 05:06:47 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/DataRecordingSelectAction.java	2012-05-23 15:02:50 +0000
@@ -119,14 +119,14 @@
         // Get single programs with un-completed program-instances
         // ---------------------------------------------------------------------
 
-        Collection<ProgramInstance> programInstances = programInstanceService
-            .getProgramInstances( patient, true );
+        Collection<ProgramInstance> programInstances = programInstanceService.getProgramInstances( patient, true );
 
         Collection<Program> completedPrograms = new HashSet<Program>();
 
         for ( ProgramInstance programInstance : programInstances )
         {
-            if( programInstance.getProgram().getSingleEvent() )
+            if ( programInstance.getProgram().getType() == Program.SINGLE_EVENT_WITH_REGISTRATION 
+                || programInstance.getProgram().getType() == Program.SINGLE_EVENT_WITHOUT_REGISTRATION )
             {
                 completedPrograms.add( programInstance.getProgram() );
             }
@@ -139,8 +139,8 @@
         programs = programService.getPrograms( orgunit );
 
         programs.retainAll( patient.getPrograms() );
-        
-        programs.addAll( programService.getPrograms( true, false, orgunit ) );
+
+        programs.addAll( programService.getPrograms( Program.SINGLE_EVENT_WITH_REGISTRATION, orgunit ) );
 
         programs.removeAll( completedPrograms );
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetProgramsByOrgunitAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetProgramsByOrgunitAction.java	2011-12-21 07:16:29 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetProgramsByOrgunitAction.java	2012-05-23 15:02:50 +0000
@@ -93,7 +93,7 @@
         if ( organisationUnit != null )
         {
             programs = programService.getPrograms( organisationUnit );
-            Collection<Program> anonymousPrograms = programService.getPrograms( true, true, organisationUnit );
+            Collection<Program> anonymousPrograms = programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION, organisationUnit );
             programs.removeAll( anonymousPrograms );
         }
         

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadAnonymousProgramsAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadAnonymousProgramsAction.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadAnonymousProgramsAction.java	2012-05-23 15:02:50 +0000
@@ -94,7 +94,7 @@
 
         if ( orgunit != null )
         {
-            Collection<Program> programs = programService.getPrograms( true, true, orgunit );
+            Collection<Program> programs = programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION, orgunit );
 
             if ( programs != null && programs.size() > 0 )
             {

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadDataEntryAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadDataEntryAction.java	2012-02-13 02:41:24 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadDataEntryAction.java	2012-05-23 15:02:50 +0000
@@ -127,7 +127,7 @@
     {
         this.patientDataValueService = patientDataValueService;
     }
-    
+
     public OrganisationUnit getOrganisationUnit()
     {
         return organisationUnit;
@@ -188,18 +188,20 @@
 
             if ( programStageInstance != null )
             {
-                if( program.getAnonymous() && programStageInstance.isCompleted() )
+                if ( program.getType() == Program.SINGLE_EVENT_WITHOUT_REGISTRATION
+                    && programStageInstance.isCompleted() )
                 {
                     return SUCCESS;
                 }
-                
+
                 selectedStateManager.setSelectedProgramStageInstance( programStageInstance );
-                
+
                 // ---------------------------------------------------------------------
                 // Get data values
                 // ---------------------------------------------------------------------
-               
-                programStageDataElements = new ArrayList<ProgramStageDataElement>( programStage.getProgramStageDataElements() );
+
+                programStageDataElements = new ArrayList<ProgramStageDataElement>( programStage
+                    .getProgramStageDataElements() );
 
                 Collections.sort( programStageDataElements, new ProgramStageDataElementSortOrderComparator() );
 
@@ -210,7 +212,7 @@
 
                 for ( PatientDataValue patientDataValue : patientDataValues )
                 {
-                    int key = patientDataValue.getDataElement().getId() ;
+                    int key = patientDataValue.getDataElement().getId();
                     patientDataValueMap.put( key, patientDataValue );
                 }
 
@@ -223,8 +225,8 @@
                 if ( dataEntryForm != null )
                 {
                     customDataEntryFormCode = programDataEntryService.prepareDataEntryFormForEntry( dataEntryForm
-                        .getHtmlCode(), patientDataValues, program.getDisplayProvidedOtherFacility().toString(), i18n, programStage, programStageInstance,
-                        organisationUnit );
+                        .getHtmlCode(), patientDataValues, program.getDisplayProvidedOtherFacility().toString(), i18n,
+                        programStage, programStageInstance, organisationUnit );
                 }
             }
         }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadProgramStagesAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadProgramStagesAction.java	2012-04-11 06:25:02 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadProgramStagesAction.java	2012-05-23 15:02:50 +0000
@@ -147,7 +147,7 @@
 
         List<ProgramInstance> programInstances = new ArrayList<ProgramInstance>();
 
-        if ( program.getAnonymous() )
+        if ( program.getType() == Program.SINGLE_EVENT_WITHOUT_REGISTRATION )
         {
             programInstances = new ArrayList<ProgramInstance>( programInstanceService.getProgramInstances( program,
                 false ) );
@@ -173,5 +173,4 @@
 
         return SUCCESS;
     }
-
 }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/MultiDataEntrySelectAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/MultiDataEntrySelectAction.java	2011-12-21 07:16:29 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/MultiDataEntrySelectAction.java	2012-05-23 15:02:50 +0000
@@ -118,7 +118,7 @@
         if ( organisationUnit != null )
         {
             programs = programService.getPrograms( organisationUnit );
-            Collection<Program> anonymousPrograms = programService.getPrograms( true, true, organisationUnit );
+            Collection<Program> anonymousPrograms = programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION, organisationUnit );
             programs.removeAll( anonymousPrograms );
         }
         

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveExecutionDateAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveExecutionDateAction.java	2012-03-28 12:29:54 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveExecutionDateAction.java	2012-05-23 15:02:50 +0000
@@ -156,8 +156,9 @@
                 Patient patient = selectedStateManager.getSelectedPatient();
                 ProgramStage programStage = programStageService.getProgramStage( programStageId );
                 Program program = programStage.getProgram();
+                int type = program.getType();
 
-                if ( programStage.getProgram().getSingleEvent() && !programStage.getProgram().getAnonymous() )
+                if ( type == Program.SINGLE_EVENT_WITH_REGISTRATION )
                 {
                     // Add a new program-instance
                     ProgramInstance programInstance = new ProgramInstance();
@@ -186,7 +187,7 @@
                     programStageInstanceService.addProgramStageInstance( programStageInstance );
                     selectedStateManager.setSelectedProgramInstance( programInstance );
                 }
-                else if ( !programStage.getProgram().getSingleEvent() && !programStage.getProgram().getAnonymous() )
+                else if ( type == Program.SINGLE_EVENT_WITH_REGISTRATION )
                 {
                     ProgramInstance programInstance = programInstanceService.getProgramInstances( patient, program ).iterator().next();
                     
@@ -213,7 +214,8 @@
                 programStageInstance.setStoredBy( storedBy );
                 programStageInstance.setOrganisationUnit( selectedStateManager.getSelectedOrganisationUnit() );
 
-                if ( programStageInstance.getProgramInstance().getProgram().getSingleEvent() )
+                if ( programStageInstance.getProgramInstance().getProgram().getType() == Program.SINGLE_EVENT_WITH_REGISTRATION  ||
+                    programStageInstance.getProgramInstance().getProgram().getType() == Program.SINGLE_EVENT_WITHOUT_REGISTRATION )
                 {
                     programStageInstance.setDueDate( dateValue );
                 }

=== 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	2012-03-28 07:10:48 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ProgramEnrollmentAction.java	2012-05-23 15:02:50 +0000
@@ -342,7 +342,7 @@
         {
             return false;
         }
-        else if ( !program.getSingleEvent() && programInstance == null )
+        else if ( program.getType() == Program.MULTIPLE_EVENTS_WITH_REGISTRATION && programInstance == null )
         {
             return false;
         }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ProgramEnrollmentSelectAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ProgramEnrollmentSelectAction.java	2012-03-28 08:26:44 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ProgramEnrollmentSelectAction.java	2012-05-23 15:02:50 +0000
@@ -117,10 +117,10 @@
         patient = patientService.getPatient( id );
 
         // Get all programs
-        programs = programService.getPrograms( false );
+        programs = programService.getPrograms( Program.MULTIPLE_EVENTS_WITH_REGISTRATION );
 
         // Except anonymous program
-        programs.removeAll( programService.getPrograms( true, true ) );
+        programs.removeAll( programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) );
 
         // Get single-event if patient no have any single event
         // OR have un-completed single-event
@@ -130,14 +130,15 @@
 
         for ( ProgramInstance programInstance : programInstances )
         {
-            if ( programInstance.getProgram().getSingleEvent() )
+            int type = programInstance.getProgram().getType();
+            if ( type == Program.SINGLE_EVENT_WITH_REGISTRATION || type == Program.SINGLE_EVENT_WITHOUT_REGISTRATION )
             {
                 completedPrograms.add( programInstance.getProgram() );
             }
         }
-        
+
         // Get single-event programs by the selected orgunit
-        Collection<Program> singleProgramsByOrgunit = programService.getPrograms( true, false, orgunit );
+        Collection<Program> singleProgramsByOrgunit = programService.getPrograms( Program.SINGLE_EVENT_WITH_REGISTRATION, orgunit );
         singleProgramsByOrgunit.remove( completedPrograms );
         programs.addAll( singleProgramsByOrgunit );
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/ReportSelectAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/ReportSelectAction.java	2012-04-27 08:48:27 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/ReportSelectAction.java	2012-05-23 15:02:50 +0000
@@ -89,8 +89,9 @@
         
         programs = programService.getPrograms( orgunit );
         
-        programs.removeAll( programService.getPrograms( true ) );
-        
+        programs.removeAll( programService.getPrograms( Program.SINGLE_EVENT_WITH_REGISTRATION ) );
+        programs.removeAll( programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) );
+
         return SUCCESS;
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm	2012-04-26 20:44:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm	2012-05-23 15:02:50 +0000
@@ -16,7 +16,7 @@
 				<select id='programId' name='programId' class='criteria' onchange='loadEventForm();'>
 					<option value="">[ $i18n.getString('please_select') ]</option>
 					#foreach( $programInstance in $programInstances)
-						<option value="$programInstance.program.id" singleevent='$programInstance.program.singleEvent' programInstanceId='$programInstance.id'>$programInstance.program.name</option>
+						<option value="$programInstance.program.id" type='$programInstance.program.type' programInstanceId='$programInstance.id'>$programInstance.program.name</option>
 					#end
 				</select>
 			</td>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js	2012-05-15 02:36:43 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js	2012-05-23 15:02:50 +0000
@@ -7,7 +7,7 @@
 				for (var program in r.programs) {
 					obj.system.program = [];
 					for (var i = 0; i < r.programs.length; i++) {
-						obj.system.program.push({id: r.programs[i].id, name: r.programs[i].name, anonymous: r.programs[i].anonymous });
+						obj.system.program.push({id: r.programs[i].id, name: r.programs[i].name, type: r.programs[i].type });
 					}
 				}
 				
@@ -521,7 +521,7 @@
 							
 							// IDENTIFIER TYPE
 							TR.store.identifierType.selected.removeAll();
-							if (f.identifiers && f.anonymous == "false" ) {
+							if (f.identifiers && f.type != "3" ) {
 								for (var i = 0; i < f.identifiers.length; i++) {
 									TR.cmp.params.identifierType.objects.push({id: f.identifiers[i].id, name: TR.util.string.getEncodedString(f.identifiers[i].name)});
 								}
@@ -540,7 +540,7 @@
 							
 							// PATIENT ATTRIBUTE
 							TR.store.patientAttribute.selected.removeAll();
-							if (f.attributes && f.anonymous == "false") {
+							if (f.attributes && f.type != "3") {
 								for (var i = 0; i < f.attributes.length; i++) {
 									TR.cmp.params.patientAttribute.objects.push({id: f.attributes[i].id, name: TR.util.string.getEncodedString(f.attributes[i].name)});
 								}
@@ -559,7 +559,7 @@
 							
 							// FIXED ATTRIBUTES
 							TR.util.setEnabledFixedAttr();
-							if (f.fixedAttributes && f.anonymous == "false") {
+							if (f.fixedAttributes && f.type != "3") {
 								var fixedAttributes = TR.cmp.params.fixedAttributes.checkbox;
 								Ext.Array.each(fixedAttributes, function(item) {
 									for (var i = 0; i < f.fixedAttributes.length; i++) {
@@ -613,7 +613,7 @@
     
     TR.store = {
         program: Ext.create('Ext.data.Store', {
-                fields: ['id', 'name', 'anonymous'],
+                fields: ['id', 'name', 'type'],
 				data:TR.init.system.program
             }),
 		identifierType: {
@@ -1386,7 +1386,7 @@
 									},
 									select: function(cb) {
 										var pId = cb.getValue();
-										if( cb.displayTplData[0].anonymous=='false' )
+										if( cb.displayTplData[0].type !='3' )
 										{
 											// IDENTIFIER TYPE
 											var storeIdentifierType = TR.store.identifierType.available;

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm	2012-04-26 19:43:21 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm	2012-05-23 15:02:50 +0000
@@ -3,12 +3,12 @@
 <script>
 	jQuery("#entryFormContainer").ready(function(){
 	
-		#if( $!programStageInstance.programStage.program.anonymous=="true" && $!programStageInstance.completed=='true')
+		#if( $!programStageInstance.programStage.program.type=="3" && $!programStageInstance.completed=='true')
 			hideById('entryFormContainer');
 		#elseif( $programStageInstance )
 			setFieldValue( 'dueDate', "$!format.formatDate( $programStageInstance.dueDate )" );
 			setFieldValue( 'executionDate', "$!format.formatDate( $programStageInstance.executionDate )" );
-		#elseif( $program.singleEvent == "true" )
+		#elseif( $program.type == "2" )
 		{
 			disable("dueDate");
 		}

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataRecordingSelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataRecordingSelect.vm	2012-04-26 20:44:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataRecordingSelect.vm	2012-05-23 15:02:50 +0000
@@ -46,7 +46,7 @@
 							<select id="programId" name="programId" class="criteria" onchange="loadProgramStages();" #if( $programs.size() == 0 ) disabled="disabled" #end>
 								<option value="0">[$i18n.getString( "select" )]</option>
 								#foreach( $program in $programs )
-									<option value="$program.id" singleevent="$program.singleEvent" #if( $programId && $program.id == $programId ) selected="selected" #end>$encoder.htmlEncode( $program.name )</option>
+									<option value="$program.id" type="$program.type" #if( $programId && $program.id == $programId ) selected="selected" #end>$encoder.htmlEncode( $program.name )</option>
 								#end
 							</select>
 						</td>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js	2012-03-13 09:47:39 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js	2012-05-23 15:02:50 +0000
@@ -20,11 +20,11 @@
 			{ 
 				if( preSelectedProgramId == json.programInstances[i].id )
 				{
-					$('#programId').append('<option selected value=' + json.programInstances[i].id + ' singleevent="true" programInstanceId=' + json.programInstances[i].programInstanceId + '>' + json.programInstances[i].name + '</option>');
+					$('#programId').append('<option selected value=' + json.programInstances[i].id + ' type="3" programInstanceId=' + json.programInstances[i].programInstanceId + '>' + json.programInstances[i].name + '</option>');
 				}
 				else
 				{
-					$('#programId').append('<option value=' + json.programInstances[i].id + ' singleevent="true" programInstanceId=' + json.programInstances[i].programInstanceId + '>' + json.programInstances[i].name + '</option>');
+					$('#programId').append('<option value=' + json.programInstances[i].id + ' type="3" programInstanceId=' + json.programInstances[i].programInstanceId + '>' + json.programInstances[i].name + '</option>');
 				}
 			}
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js	2012-05-03 09:06:08 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js	2012-05-23 15:02:50 +0000
@@ -33,9 +33,9 @@
 				addOptionById( 'programStageId', json.programStages[i].id, json.programStages[i].name );
 			} 
 			
-			var singleEvent = jQuery('#dataRecordingSelectDiv [name=programId] option:selected').attr('singleevent');
+			var type = jQuery('#dataRecordingSelectDiv [name=programId] option:selected').attr('type');
 				
-			if(singleEvent=='true' || json.programStages.length == 1)
+			if( type=='2' || type=='3' || json.programStages.length == 1)
 			{
 				byId('programStageId').selectedIndex = 1;
 				jQuery('#programStageIdTR').attr('class','hidden');
@@ -657,7 +657,7 @@
 					}
 					
 					var selectedProgram = jQuery('#dataRecordingSelectForm [name=programId] option:selected');
-					if( selectedProgram.attr('singleevent')=='true' && irregular == 'false' )
+					if( selectedProgram.attr('type')=='2' && irregular == 'false' )
 					{
 						selectedProgram.remove();
 					}

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js	2012-05-03 10:18:41 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js	2012-05-23 15:02:50 +0000
@@ -429,18 +429,18 @@
 			showById('programEnrollmentDiv');
 			showEnrolmentField();
 			
-			var singleEvent = jQuery('#enrollmentDiv [name=programId] option:selected').attr('singleevent');
+			var type = jQuery('#enrollmentDiv [name=programId] option:selected').attr('type');
 			
-			if(singleEvent=='true')
+			if(type=='2')
 			{
 				hideEnrolmentField();
 			}
 			else
 			{
 				showEnrolmentField();
-				var hideDateOfIncident = jQuery('#programEnrollmentSelectDiv [name=programId] option:selected').attr('hidedateofincident');
+				var type = jQuery('#programEnrollmentSelectDiv [name=programId] option:selected').attr('type');
 					
-				if( hideDateOfIncident=='true')
+				if( type=='2')
 				{
 					hideById( 'dateOfIncidentTR');
 				}

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStages.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStages.vm	2012-04-15 08:08:22 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStages.vm	2012-05-23 15:02:50 +0000
@@ -3,8 +3,7 @@
   #foreach( ${programStage} in $!{programStages} )
   {
 	"id": "${programStage.id}",
-	"name": "$!encoder.jsonEncode( ${programStage.name} )",
-	"anonymous": "${programStage.anonymous}"
+	"name": "$!encoder.jsonEncode( ${programStage.name} )"
   }#if( $velocityCount < $size ),#end
   #end
   ]

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.vm	2012-04-17 03:46:23 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.vm	2012-05-23 15:02:50 +0000
@@ -18,7 +18,7 @@
 		  {
 			"id":  "${program.id}" ,
 			"name": "$!encoder.jsonEncode( ${program.name} )",
-			"anonymous": "$program.anonymous"
+			"type": "$program.type"
 		  }#if( $velocityCount < $programs.size() ),#end
 		#end
 	],

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReport.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReport.vm	2012-05-15 02:36:43 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReport.vm	2012-05-23 15:02:50 +0000
@@ -3,7 +3,7 @@
 	"name": "$!encoder.jsonEncode( ${tabularReport.name} )",
 	"lastUpdated": "$!format.formatDate( ${tabularReport.lastUpdated} )",
 	"programId": "${tabularReport.programStage.program.id}",
-	"anonymous": "${tabularReport.programStage.program.anonymous}",
+	"type": "${tabularReport.programStage.program.type}",
 	"programStageId": "${tabularReport.programStage.id}",
 	"programStageName": "${tabularReport.programStage.name}",
 	"startDate": "$!format.formatDate( $tabularReport.startDate )",

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentSelectForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentSelectForm.vm	2012-04-27 08:53:28 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentSelectForm.vm	2012-05-23 15:02:50 +0000
@@ -48,7 +48,7 @@
 						<select id="programId" name="programId" onchange="showProgramEnrollmentForm('$patient.id', this.value);" >
 							<option value="0">[$i18n.getString( "select" )]</option>
 							#foreach( $program in $programs )
-								<option value="$program.id" singleevent='$program.singleEvent' hideDateOfIncident='$program.hideDateOfIncident'>$encoder.htmlEncode( $program.name )</option>
+								<option value="$program.id" type='$program.type'>$encoder.htmlEncode( $program.name )</option>
 							#end
 						</select>
 					</td>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePrograms.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePrograms.vm	2012-04-15 08:08:22 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePrograms.vm	2012-05-23 15:02:50 +0000
@@ -5,7 +5,7 @@
 	  {
 		"id":  ${program.id} ,
 		"name": "$!encoder.jsonEncode( ${program.name} )",
-		"anonymous": "$program.anonymous"
+		"type": "$program.type"
 	  }#if( $velocityCount < $size ),#end
 	#end]
 }
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonProgram.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonProgram.vm	2012-03-27 07:20:28 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonProgram.vm	2012-05-23 15:02:50 +0000
@@ -3,13 +3,11 @@
     "id": "$program.id",
 	"name": "$!encoder.jsEncode( ${program.name} )",
 	"description": "$!encoder.jsEncode( ${program.description} )",
-	"singleEvent": "$!program.singleEvent",
-	"anonymous": "$!program.anonymous",
+	"type": "$!program.type",
 	"displayProvidedOtherFacility": "$!program.displayProvidedOtherFacility",
 	"dateOfEnrollmentDescription": "$!encoder.jsEncode( ${program.dateOfEnrollmentDescription} )",
 	"dateOfIncidentDescription": "$!encoder.jsEncode( ${program.dateOfIncidentDescription} )",
 	"programStageCount": "${program.programStages.size()}",
-	"maxDay": "${program.maxDaysAllowedInputData}",
-	"hideDateOfIncident": "${program.hideDateOfIncident}"
+	"maxDay": "${program.maxDaysAllowedInputData}"
   }
 }
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/ShowUpdatePatientAttributeAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/ShowUpdatePatientAttributeAction.java	2012-04-20 05:45:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/ShowUpdatePatientAttributeAction.java	2012-05-23 15:02:50 +0000
@@ -98,7 +98,7 @@
         
         programs = programService.getAllPrograms();
         
-        programs.removeAll( programService.getPrograms( true, true ) );
+        programs.removeAll( programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) );
         
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientidentifiertype/ShowUpdatePatientIdentifierTypeForm.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientidentifiertype/ShowUpdatePatientIdentifierTypeForm.java	2012-04-20 05:45:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientidentifiertype/ShowUpdatePatientIdentifierTypeForm.java	2012-05-23 15:02:50 +0000
@@ -107,7 +107,7 @@
 
         programs = programService.getAllPrograms();
 
-        programs.removeAll( programService.getPrograms( true, true ) );
+        programs.removeAll( programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java	2012-03-27 07:20:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java	2012-05-23 15:02:50 +0000
@@ -111,18 +111,11 @@
         this.maxDaysAllowedInputData = maxDaysAllowedInputData;
     }
 
-    private Boolean singleEvent;
-
-    public void setSingleEvent( Boolean singleEvent )
-    {
-        this.singleEvent = singleEvent;
-    }
-
-    private Boolean anonymous;
-
-    public void setAnonymous( Boolean anonymous )
-    {
-        this.anonymous = anonymous;
+    private Integer type;
+
+    public void setType( Integer type )
+    {
+        this.type = type;
     }
 
     private Boolean displayProvidedOtherFacility;
@@ -132,13 +125,6 @@
         this.displayProvidedOtherFacility = displayProvidedOtherFacility;
     }
 
-    private Boolean hideDateOfIncident;
-
-    public void setHideDateOfIncident( Boolean hideDateOfIncident )
-    {
-        this.hideDateOfIncident = hideDateOfIncident;
-    }
-
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -146,10 +132,7 @@
     public String execute()
         throws Exception
     {
-        singleEvent = (singleEvent == null) ? false : singleEvent;
-        anonymous = (anonymous == null) ? false : anonymous;
         displayProvidedOtherFacility = (displayProvidedOtherFacility == null) ? true : displayProvidedOtherFacility;
-        hideDateOfIncident = (hideDateOfIncident == null) ? false : displayProvidedOtherFacility;
 
         Program program = new Program();
 
@@ -159,14 +142,13 @@
         program.setDateOfEnrollmentDescription( dateOfEnrollmentDescription );
         program.setDateOfIncidentDescription( dateOfIncidentDescription );
         program.setMaxDaysAllowedInputData( maxDaysAllowedInputData );
-        program.setSingleEvent( singleEvent );
-        program.setAnonymous( anonymous );
+        program.setType( type );
         program.setDisplayProvidedOtherFacility( displayProvidedOtherFacility );
-        program.setHideDateOfIncident( hideDateOfIncident );
         
         programService.saveProgram( program );
 
-        if ( singleEvent )
+        if ( program.getType().equals( Program.SINGLE_EVENT_WITH_REGISTRATION ) || 
+            program.getType().equals( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ))
         {
             ProgramStage programStage = new ProgramStage();
 
@@ -183,7 +165,7 @@
         // create program-instance for anonymous program
         // ---------------------------------------------------------------------
 
-        if ( program.getAnonymous() )
+        if ( program.getType().equals( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) )
         {
             // Add a new program-instance
             ProgramInstance programInstance = new ProgramInstance();

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/GetUnAnonymousProgramAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/GetUnAnonymousProgramAction.java	2012-04-20 05:45:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/GetUnAnonymousProgramAction.java	2012-05-23 15:02:50 +0000
@@ -80,7 +80,7 @@
     {
         programs = programService.getAllPrograms();
 
-        programs.removeAll( programService.getPrograms( true, true ) );
+        programs.removeAll( programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) );
         
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java	2012-03-27 07:20:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java	2012-05-23 15:02:50 +0000
@@ -108,18 +108,11 @@
         this.maxDaysAllowedInputData = maxDaysAllowedInputData;
     }
 
-    private Boolean singleEvent;
-
-    public void setSingleEvent( Boolean singleEvent )
-    {
-        this.singleEvent = singleEvent;
-    }
-
-    private Boolean anonymous;
-
-    public void setAnonymous( Boolean anonymous )
-    {
-        this.anonymous = anonymous;
+    private Integer type;
+
+    public void setType( Integer type )
+    {
+        this.type = type;
     }
 
     private Boolean displayProvidedOtherFacility;
@@ -129,13 +122,6 @@
         this.displayProvidedOtherFacility = displayProvidedOtherFacility;
     }
 
-    private Boolean hideDateOfIncident;
-
-    public void setHideDateOfIncident( Boolean hideDateOfIncident )
-    {
-        this.hideDateOfIncident = hideDateOfIncident;
-    }
-
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -143,10 +129,7 @@
     public String execute()
         throws Exception
     {
-        singleEvent = (singleEvent == null) ? false : singleEvent;
-        anonymous = (anonymous == null) ? false : anonymous;
         displayProvidedOtherFacility = (displayProvidedOtherFacility == null) ? true : displayProvidedOtherFacility;
-        hideDateOfIncident = (hideDateOfIncident == null) ? false : hideDateOfIncident;
 
         Program program = programService.getProgram( id );
         program.setName( name );
@@ -155,10 +138,8 @@
         program.setDateOfEnrollmentDescription( dateOfEnrollmentDescription );
         program.setDateOfIncidentDescription( dateOfIncidentDescription );
         program.setMaxDaysAllowedInputData( maxDaysAllowedInputData );
-        program.setSingleEvent( singleEvent );
-        program.setAnonymous( anonymous );
+        program.setType( type );
         program.setDisplayProvidedOtherFacility( displayProvidedOtherFacility );
-        program.setHideDateOfIncident( hideDateOfIncident );
 
         programService.updateProgram( program );
 

=== 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	2012-05-22 12:49:45 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties	2012-05-23 15:02:50 +0000
@@ -145,7 +145,7 @@
 design_data_entry_form=Design data entry form
 no_of_char=Number of characters
 letter=Letter
-no_max_days_allowed_input_data=Date range for activities
+duration_in_days=Duration in days
 program_attribute=Program Attribute
 program_attribute_management=Program attribute management
 create_new_program_attribute=Create new program attribute
@@ -253,5 +253,6 @@
 dataset= Dataset
 filter_by_data_set = Filter by dataset
 show_all_item = Show All Items
-hide_date_of_incident = Hide date of incident
-aggregation=Aggregation
\ No newline at end of file
+multiple_events_with_registration = Multiple events with registration
+single_event_with_registration = Single event with registration
+single_event_without_registration = Single event without registration

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm	2012-03-27 07:20:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm	2012-05-23 15:02:50 +0000
@@ -25,14 +25,15 @@
 		</tr>	
 		
 		<tr>
-			<td><label>$i18n.getString( "single_event" )</label></td>
-			<td><input type="checkbox" id="singleEvent" name="singleEvent" value='true' onchange="singleEventOnChange();"></td>
-			<td></td>
-		</tr>
-		
-		<tr>
-			<td><label>$i18n.getString( "anonymous" )</label></td>
-			<td><input type="checkbox" id="anonymous" name="anonymous" value='true' disabled='disabled'></td>
+			<td><label>$i18n.getString( "type" )</label></td>
+			<td>
+				<select id="type" name="type" onchange='programTypeOnChange();'>
+					<option value=''>[$i18n.getString('please_select')]</option>
+					<option value='1'>$i18n.getString('multiple_events_with_registration')</option>
+					<option value='2'>$i18n.getString('single_event_with_registration')</option>
+					<option value='3'>$i18n.getString('single_event_without_registration')</option>
+				</select>
+			</td>
 			<td></td>
 		</tr>
 		
@@ -43,12 +44,6 @@
 		</tr>
 		
 		<tr>
-			<td><label>$i18n.getString( "hide_date_of_incident" )</label></td>
-			<td><input type="checkbox" id="hideDateOfIncident" name="hideDateOfIncident" value='true' onchange='hideIncidentDateOnchange();'></td>
-			<td></td>
-		</tr>
-		
-		<tr>
 			<td><label>$i18n.getString( "date_of_enrollment_description" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
 			<td><input type="text" id="dateOfEnrollmentDescription" name="dateOfEnrollmentDescription" class="{validate:{required:true,minlength:4}}"></td>
 			<td></td>
@@ -61,7 +56,7 @@
 		</tr>	
 		
 		<tr>
-			<td><label>$i18n.getString( "no_max_days_allowed_input_data" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
+			<td><label>$i18n.getString( "duration_in_days" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
 			<td><input type="text" id="maxDaysAllowedInputData" name="maxDaysAllowedInputData" class="{validate:{required:true,number:true}}"></td>
 			<td></td>
 		</tr>	

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js	2012-03-27 07:20:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js	2012-05-23 15:02:50 +0000
@@ -10,11 +10,12 @@
 		setInnerHTML( 'nameField', json.program.name );
 		setInnerHTML( 'descriptionField', json.program.description );
 		
-		var singleEvent = ( json.program.singleEvent == 'true') ? i18n_yes : i18n_no;
-		setInnerHTML( 'singleEventField', singleEvent );  
-		
-		var anonymous = ( json.program.anonymous == 'true') ? i18n_yes : i18n_no;
-		setInnerHTML( 'anonymousField', anonymous );   		
+		var type = i18n_multiple_events_with_registration;
+		if( json.program.type == "2" )
+			type = i18n_single_event_with_registration;
+		else if( json.program.type == "3"  )
+			type = i18n_single_event_without_registration;
+		setInnerHTML( 'typeField', type );  
 		
 		var displayProvidedOtherFacility = ( json.program.displayProvidedOtherFacility == 'true') ? i18n_yes : i18n_no;
 		setInnerHTML( 'displayProvidedOtherFacilityField', displayProvidedOtherFacility );   	
@@ -22,10 +23,7 @@
 		setInnerHTML( 'dateOfEnrollmentDescriptionField', json.program.dateOfEnrollmentDescription );   
 		setInnerHTML( 'dateOfIncidentDescriptionField', json.program.dateOfIncidentDescription );   		
 		setInnerHTML( 'programStageCountField',  json.program.programStageCount );
-		setInnerHTML( 'maxDaysFromStartField',  json.program.maxDay );
-		
-		var hideIncidentDateField = ( json.program.hideDateOfIncident == 'true') ? i18n_yes : i18n_no;
-		setInnerHTML( 'hideIncidentDateField',  hideIncidentDateField );
+		setInnerHTML( 'durationInDaysField',  json.program.maxDay );
 		
 		showDetails();
 	});   
@@ -40,20 +38,26 @@
 	removeItem( programId, name, i18n_confirm_delete, 'removeProgram.action' );
 }
 
-function singleEventOnChange()
+function programTypeOnChange()
 {
-	var checked = byId('singleEvent').checked;
+	var type = getFieldValue('type');
 	
-	if(checked)
+	// anonymous
+	if(type == "3")
 	{
 		disable('dateOfEnrollmentDescription');
-		enable('anonymous');
+		disable('dateOfIncidentDescription');
+	}
+	// single-event
+	else if( type=='2')
+	{
+		enable('dateOfEnrollmentDescription');
+		disable('dateOfIncidentDescription');
 	}
 	else
 	{
 		enable('dateOfEnrollmentDescription');
-		byId('anonymous').checked = false;
-		disable('anonymous');
+		enable('dateOfIncidentDescription');
 	}
 }
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.vm	2012-03-27 07:20:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.vm	2012-05-23 15:02:50 +0000
@@ -23,8 +23,10 @@
 					<td>$encoder.htmlEncode( $program.name )</td>                
 					
 					<td style="text-align:center">
-					  <a href="defineProgramAssociationsForm.action?id=$program.id" title="$i18n.getString( 'assign_program_to_orgunits' )"><img src="../images/assign.png" alt="$i18n.getString( 'assign_program_to_orgunits' )"></a>					  #if( $program.anonymous=='false')
-					  <a href="programValidation.action?programId=$program.id" title="$i18n.getString( 'program_validation_management' )"><img src="../images/assign_b.png" alt="$i18n.getString( 'program_validation_management' )"></a>					  #else
+					  <a href="defineProgramAssociationsForm.action?id=$program.id" title="$i18n.getString( 'assign_program_to_orgunits' )"><img src="../images/assign.png" alt="$i18n.getString( 'assign_program_to_orgunits' )"></a>					  
+					  #if( $program.type=='1' || $program.type=='2' )
+					  <a href="programValidation.action?programId=$program.id" title="$i18n.getString( 'program_validation_management' )"><img src="../images/assign_b.png" alt="$i18n.getString( 'program_validation_management' )"></a>					  
+					  #else
 						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 					  #end
 					  <a href="showUpdateProgramForm.action?id=$program.id" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
@@ -47,14 +49,12 @@
 				</div>				
 				<p><label class="bold">$i18n.getString( "name" ):</label><br><span id="nameField"></span></p>
 				<p><label class="bold">$i18n.getString( "description" ):</label><br><span id="descriptionField"></span></p>				
-				<p><label class="bold">$i18n.getString( "single_event" ):</label><br><span id="singleEventField"></span></p>				
-				<p><label class="bold">$i18n.getString( "anonymous" ):</label><br><span id="anonymousField"></span></p>
+				<p><label class="bold">$i18n.getString( "type" ):</label><br><span id="typeField"></span></p>				
 				<p><label class="bold">$i18n.getString( "display_provided_other_facility_column" ):</label><br><span id="displayProvidedOtherFacilityField"></span></p>
 				<p><label class="bold">$i18n.getString( "date_of_enrollment_description" ):</label><br><span id="dateOfEnrollmentDescriptionField"></span></p>				
 				<p><label class="bold">$i18n.getString( "date_of_incident_description" ):</label><br><span id="dateOfIncidentDescriptionField"></span></p>				
 				<p><label class="bold">$i18n.getString( "stage_in_program" ):</label><br><span id="programStageCountField"></span></p>
-				<p><label class="bold">$i18n.getString( "max_days_from_start" ):</label><br><span id="maxDaysFromStartField"></span></p>
-				<p><label class="bold">$i18n.getString( "hide_date_of_incident" ):</label><br><span id="hideIncidentDateField"></span></p>
+				<p><label class="bold">$i18n.getString( "duration_in_days" ):</label><br><span id="durationInDaysField"></span></p>
 			</div>
 
 		</td>
@@ -64,9 +64,12 @@
 <script type="text/javascript">
 	var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_prorgam" ) , "'" )';
 	var i18n_none = '$encoder.jsEscape( $i18n.getString( "none" ), "'")';	
-	var i18n_yes = '$encoder.jsEscape( $i18n.getString( "yes" ) , "'")';
-    var i18n_no = '$encoder.jsEscape( $i18n.getString( "no" ) , "'")';
-   
+	var i18n_yes = '$encoder.jsEscape( $i18n.getString( "yes" ) , "'" )';
+	var i18n_no = '$encoder.jsEscape( $i18n.getString( "no" ), "'")';	
+	var i18n_multiple_events_with_registration = '$encoder.jsEscape( $i18n.getString( "multiple_events_with_registration" ) , "'")';
+    var i18n_single_event_with_registration = '$encoder.jsEscape( $i18n.getString( "single_event_with_registration" ) , "'")';
+    var i18n_single_event_without_registration = '$encoder.jsEscape( $i18n.getString( "single_event_without_registration" ) , "'")';
+
 	jQuery(document).ready(function(){	
 		tableSorter( 'listTable' );
 	});

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStageList.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStageList.vm	2012-03-07 02:40:08 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStageList.vm	2012-05-23 15:02:50 +0000
@@ -13,7 +13,7 @@
 		</td>
 		<td style="text-align:right">
 		    <input type="button" value="$i18n.getString( "back" )" onclick="window.location.href='program.action'" style="width:75px">
-			#if( $program.singleEvent!='true' )
+			#if( $program.type=='1' )
 				<input type="button" value="$i18n.getString( "sort" )" onclick="javascript:showSortProgramStage()" style="width:75px">
 				<input type="button" value="$i18n.getString( "add_new" )" onclick="javascript:addProgramStage()" style="width:75px">		  	   
 		    #end
@@ -41,7 +41,7 @@
 				
 				<td style="text-align:center"#alternate( $mark )>
 				  <a href="showUpdateProgramStageForm.action?id=$association.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"></a>
-				  #if( $association.program.singleEvent == 'false' )
+				  #if( $program.type=='1' )
 					<a href="javascript:removeItem( '$association.id', '$encoder.jsEncode( $association.name )', i18n_confirm_delete , 'removeProgramStage.action' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a>
 				  #end
 				  <a href="javascript:showProgramStageDetails( $association.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm	2012-03-30 05:33:37 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm	2012-05-23 15:02:50 +0000
@@ -24,16 +24,17 @@
 	  </tr>
 	  
       <tr>
-		<td><label>$i18n.getString( "single_event" )</td>
-		<td><input type="checkbox" id="singleEvent" value='true' name="singleEvent" #if( $program.singleEvent=='true' ) checked #end onchange="singleEventOnChange();"></td>
-		<td></td>
-	 </tr>
-	 
-	 <tr>
-		<td><label>$i18n.getString( "anonymous" )</label></td>
-		<td><input type="checkbox" id="anonymous" name="anonymous" value='true' #if( $program.anonymous=='true' ) checked #end #if( $program.singleEvent=='false' ) disabled='disabled' #end #></td>
-		<td></td>
-	 </tr>
+		<td><label>$i18n.getString( "type" )</label></td>
+		<td>
+			<select id="type" name="type" onchange='programTypeOnChange();'>
+				<option value=''>[$i18n.getString('please_select')]</option>
+				<option value='1' #if( $program.type=='1' ) selected #end>$i18n.getString('multiple_events_with_registration')</option>
+				<option value='2' #if( $program.type=='2' ) selected #end>$i18n.getString('single_event_with_registration')</option>
+				<option value='3' #if( $program.type=='3' ) selected #end>$i18n.getString('single_event_without_registration')</option>
+			</select>
+		</td>
+		<td></td>
+	</tr>
 		
 	<tr>
 		<td><label>$i18n.getString( "hide_provided_other_facility" )</label></td>
@@ -42,29 +43,23 @@
 	</tr>
 		
 	<tr>
-		<td><label>$i18n.getString( "hide_date_of_incident" )</label></td>
-		<td><input type="checkbox" id="hideDateOfIncident" name="hideDateOfIncident" value='true' onchange='hideIncidentDateOnchange();' #if( $program.hideDateOfIncident=='true' ) checked #end ></td>
-		<td></td>
-	</tr>
-	
-	<tr>
 		<td><label>$i18n.getString( "version" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
 		<td><input type="text" id="version" name="version" value="$program.version" class="{validate:{required:true,number:true}}"></td>
 		<td></td>
 	</tr>		
 	<tr>
 		<td><label>$i18n.getString( "date_of_enrollment_description" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
-		<td><input type="text" id="dateOfEnrollmentDescription" name="dateOfEnrollmentDescription"  value="$!program.dateOfEnrollmentDescription" class="{validate:{required:true,minlength:4}}" #if( $program.singleEvent=='true' ) disabled #end></td>
+		<td><input type="text" id="dateOfEnrollmentDescription" name="dateOfEnrollmentDescription"  value="$!program.dateOfEnrollmentDescription" class="{validate:{required:true,minlength:4}}" #if( $program.type=='3' ) disabled #end></td>
 		<td></td>
 	</tr>	
 	<tr>
 		<td><label>$i18n.getString( "date_of_incident_description" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
-		<td><input type="text" id="dateOfIncidentDescription" name="dateOfIncidentDescription" value="$!program.dateOfIncidentDescription" class="{validate:{required:true,minlength:4}}" #if( $program.hideDateOfIncident=='true' ) disabled #end ></td>
+		<td><input type="text" id="dateOfIncidentDescription" name="dateOfIncidentDescription" value="$!program.dateOfIncidentDescription" class="{validate:{required:true,minlength:4}}" #if( $program.type=='2' || $program.type=='3') disabled #end ></td>
 		<td></td>
 	</tr>
 	
 	  <tr>
-		<td><label>$i18n.getString( "no_max_days_allowed_input_data" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
+		<td><label>$i18n.getString( "duration_in_days" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
 		<td><input type="text" id="maxDaysAllowedInputData" name="maxDaysAllowedInputData" value="$!program.maxDaysAllowedInputData" class="{validate:{required:true,number:true}}"></td>
 		<td></td>
 	  </tr>