← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5396: Add anonymous program (Patient module).

 

------------------------------------------------------------
revno: 5396
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-12-14 14:33:18 +0700
message:
  Add anonymous program (Patient module).
added:
  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/program/hibernate/HibernateProgramStore.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/webapp/dhis-web-caseentry/anonymousRegistration.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttributeGroupService.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/ProgramInstance.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramService.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/resources/META-INF/dhis/beans.xml
  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/ProgramInstance.hbm.xml
  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/SaveExecutionDateAction.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/resources/org/hisp/dhis/caseentry/i18n_module.properties
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/index.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.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/programUnenrollmentSelectForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/registrationMenu.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/program/AddProgramAction.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/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/patient/PatientAttributeGroupService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttributeGroupService.java	2010-01-29 03:08:45 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttributeGroupService.java	2011-12-14 07:33:18 +0000
@@ -34,7 +34,6 @@
  */
 public interface PatientAttributeGroupService
 {
-
     String ID = PatientAttributeGroupService.class.getName();
 
     int savePatientAttributeGroup( PatientAttributeGroup patientAttributeGroup );

=== 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	2011-09-14 06:36:13 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/Program.java	2011-12-14 07:33:18 +0000
@@ -52,7 +52,7 @@
     private String name;
 
     private String description;
-    
+
     private Integer version;
 
     /**
@@ -76,9 +76,11 @@
     private Set<ValidationCriteria> patientValidationCriteria = new HashSet<ValidationCriteria>();
 
     private Integer maxDaysAllowedInputData;
-    
+
     private Boolean singleEvent;
-    
+
+    private Boolean anonymousEvent;
+
     // -------------------------------------------------------------------------
     // Constructors
     // -------------------------------------------------------------------------
@@ -164,7 +166,6 @@
     {
         this.organisationUnits = organisationUnits;
     }
-    
 
     public Integer getVersion()
     {
@@ -251,6 +252,16 @@
         this.patientValidationCriteria = patientValidationCriteria;
     }
 
+    public Boolean getAnonymousEvent()
+    {
+        return anonymousEvent;
+    }
+
+    public void setAnonymousEvent( Boolean anonymousEvent )
+    {
+        this.anonymousEvent = anonymousEvent;
+    }
+
     // -------------------------------------------------------------------------
     // Logic methods
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstance.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstance.java	2011-05-05 21:14:56 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstance.java	2011-12-14 07:33:18 +0000
@@ -115,7 +115,14 @@
         int result = 1;
 
         result = result * prime + enrollmentDate.hashCode();
-        result = result * prime + patient.hashCode();
+        if ( patient != null )
+        {
+            result = result * prime + patient.hashCode();
+        }
+        else
+        {
+            result = result * prime + id;
+        }
         result = result * prime + program.hashCode();
 
         return result;
@@ -262,7 +269,7 @@
     {
         this.attributes = attributes;
     }
-    
+
     // -------------------------------------------------------------------------
     // Convenience method
     // -------------------------------------------------------------------------

=== 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-09-14 06:36:13 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramService.java	2011-12-14 07:33:18 +0000
@@ -47,14 +47,19 @@
     void updateProgram( Program program );
 
     Program getProgram( int id );
-    
+
     Program getProgramByName( String name );
 
     Collection<Program> getAllPrograms();
 
     Collection<Program> getPrograms( OrganisationUnit organisationUnit );
-    
+
     Collection<Program> getPrograms( ValidationCriteria validationCriteria );
-    
+
     Collection<Program> getPrograms( boolean singleEvent );
+
+    Collection<Program> getPrograms( boolean singleEvent, boolean anonymousEvent );
+
+    Collection<Program> getPrograms( boolean singleEvent, boolean anonymousEvent, OrganisationUnit orgunit );
+
 }

=== added 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	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStore.java	2011-12-14 07:33:18 +0000
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2004-2010, 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.program;
+
+import java.util.Collection;
+
+import org.hisp.dhis.common.GenericNameableObjectStore;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+
+/**
+ * @author Chau Thu Tran
+ *
+ * @version $Id: ProgramStore.java Dec 14, 2011 9:22:17 AM $
+ */
+public interface ProgramStore extends GenericNameableObjectStore<Program>
+{ 
+    String ID = ProgramStore.class.getName();
+
+    Collection<Program> get( boolean singleEvent );
+
+    Collection<Program> get( boolean singleEvent, boolean anonymousEvent );
+
+    Collection<Program> get( boolean singleEvent, boolean anonymousEvent, OrganisationUnit orgunit );
+}

=== 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	2011-10-27 03:12:50 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java	2011-12-14 07:33:18 +0000
@@ -106,10 +106,14 @@
 
         executeSql( "UPDATE dataset SET version = 1 WHERE version is null" );
         
-        executeSql( "UPDATE program SET singleevent = false WHERE singleevent is null" );
+        executeSql( "UPDATE program SET singleEvent = false WHERE singleevent is null" );
+        
+        executeSql( "UPDATE program SET anonymousEvent = false WHERE anonymousEvent is null" );
         
         executeSql( "UPDATE programstage SET irregular = false WHERE irregular is null" );
 
+        executeSql( "Alter table programinstance modify patientid integer null");
+        		
         updateSingleProgramValidation();
 
         updateStageInProgram();

=== 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-09-14 06:36:13 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramService.java	2011-12-14 07:33:18 +0000
@@ -31,7 +31,6 @@
 import java.util.HashSet;
 import java.util.Set;
 
-import org.hisp.dhis.common.GenericIdentifiableObjectStore;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.validation.ValidationCriteria;
 import org.springframework.transaction.annotation.Transactional;
@@ -48,9 +47,9 @@
     // Dependencies
     // -------------------------------------------------------------------------
 
-    private GenericIdentifiableObjectStore<Program> programStore;
+    private ProgramStore programStore;
 
-    public void setProgramStore( GenericIdentifiableObjectStore<Program> programStore )
+    public void setProgramStore( ProgramStore programStore )
     {
         this.programStore = programStore;
     }
@@ -121,17 +120,17 @@
 
     public Collection<Program> getPrograms( boolean singleEvent )
     {
-        Set<Program> programs = new HashSet<Program>();
-
-        for ( Program program : getAllPrograms() )
-        {
-            if ( program.getSingleEvent() == singleEvent)
-            {
-                programs.add( program );
-            }
-        }
-
-        return programs;
+        return programStore.get( singleEvent );
+    }
+
+    public Collection<Program> getPrograms( boolean singleEvent, boolean anonymousEvent )
+    {
+        return programStore.get( singleEvent, anonymousEvent );
+    }
+    
+    public Collection<Program> getPrograms( boolean singleEvent, boolean anonymousEvent, OrganisationUnit orgunit )
+    {
+        return programStore.get( singleEvent, anonymousEvent, orgunit );
     }
 
 }

=== added 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	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStore.java	2011-12-14 07:33:18 +0000
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2004-2010, 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.program.hibernate;
+
+import java.util.Collection;
+
+import org.hibernate.criterion.Restrictions;
+import org.hisp.dhis.hibernate.HibernateGenericStore;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.program.Program;
+import org.hisp.dhis.program.ProgramAttribute;
+import org.hisp.dhis.program.ProgramAttributeOption;
+import org.hisp.dhis.program.ProgramAttributeOptionStore;
+import org.hisp.dhis.program.ProgramStore;
+
+/**
+ * @author Chau Thu Tran
+ * 
+ * @version $Id: HibernateProgramStore.java Dec 14, 2011 9:24:21 AM $
+ */
+public class HibernateProgramStore
+    extends HibernateGenericStore<Program>
+    implements ProgramStore
+{
+    @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 anonymousEvent )
+    {
+        return getCriteria( Restrictions.eq( "singleEvent", singleEvent ),
+            Restrictions.eq( "anonymousEvent", anonymousEvent ) ).list();
+    }
+
+    @SuppressWarnings( "unchecked" )
+    @Override
+    public Collection<Program> get( boolean singleEvent, boolean anonymousEvent, OrganisationUnit orgunit )
+    {
+        return getCriteria( Restrictions.eq( "singleEvent", singleEvent ),
+            Restrictions.eq( "anonymousEvent", anonymousEvent ) ).createAlias( "organisationUnits", "orgunit" ).add(
+            Restrictions.eq( "orgunit.id", orgunit.getId() ) ).list();
+    }
+
+}

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml	2011-12-07 02:20:11 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml	2011-12-14 07:33:18 +0000
@@ -50,7 +50,7 @@
 		<property name="sessionFactory" ref="sessionFactory" />
 	</bean>
 
-	<bean id="org.hisp.dhis.program.ProgramStore" class="org.hisp.dhis.hibernate.HibernateGenericStore">
+	<bean id="org.hisp.dhis.program.ProgramStore" class="org.hisp.dhis.program.hibernate.HibernateProgramStore">
 		<property name="clazz" value="org.hisp.dhis.program.Program" />
 		<property name="sessionFactory" ref="sessionFactory" />
 	</bean>

=== 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	2011-09-14 06:36:13 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/Program.hbm.xml	2011-12-14 07:33:18 +0000
@@ -38,6 +38,8 @@
     <property name="maxDaysAllowedInputData" />
 
     <property name="singleEvent" />
+    
+    <property name="anonymousEvent" />
 
   </class>
 </hibernate-mapping>

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramInstance.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramInstance.hbm.xml	2011-05-28 21:25:46 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramInstance.hbm.xml	2011-12-14 07:33:18 +0000
@@ -18,7 +18,7 @@
 
     <property name="completed" not-null="true" />
 
-    <many-to-one name="patient" class="org.hisp.dhis.patient.Patient" column="patientid" not-null="true"
+    <many-to-one name="patient" class="org.hisp.dhis.patient.Patient" column="patientid"
       foreign-key="fk_programinstance_patientid" />
 
     <many-to-one name="program" class="org.hisp.dhis.program.Program" column="programid" not-null="true"

=== added 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	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadAnonymousProgramsAction.java	2011-12-14 07:33:18 +0000
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2004-2010, 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.caseentry.action.caseentry;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
+import org.hisp.dhis.program.Program;
+import org.hisp.dhis.program.ProgramService;
+import org.hisp.dhis.program.comparator.ProgramNameComparator;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Chau Thu Tran
+ * 
+ * @version $Id: LoadAnonymousProgramsAction.java Dec 14, 2011 9:12:34 AM $
+ */
+public class LoadAnonymousProgramsAction
+    implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private OrganisationUnitSelectionManager selectionManager;
+
+    public void setSelectionManager( OrganisationUnitSelectionManager selectionManager )
+    {
+        this.selectionManager = selectionManager;
+    }
+
+    private ProgramService programService;
+
+    public void setProgramService( ProgramService programService )
+    {
+        this.programService = programService;
+    }
+
+    // -------------------------------------------------------------------------
+    // Output
+    // -------------------------------------------------------------------------
+
+    private List<Program> programs;
+
+    public List<Program> getPrograms()
+    {
+        return programs;
+    }
+
+    // -------------------------------------------------------------------------
+    // Implementation Action
+    // -------------------------------------------------------------------------
+
+    public String execute()
+        throws Exception
+    {
+        OrganisationUnit orgunit = selectionManager.getSelectedOrganisationUnit();
+
+        if ( orgunit != null )
+        {
+            programs = new ArrayList<Program>( programService.getPrograms( true, true, orgunit ) );
+
+            Collections.sort( programs, new ProgramNameComparator() );
+        }
+        
+        return SUCCESS;
+    }
+}

=== 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	2011-09-14 06:36:13 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadProgramStagesAction.java	2011-12-14 07:33:18 +0000
@@ -27,9 +27,10 @@
 
 package org.hisp.dhis.caseentry.action.caseentry;
 
-import java.util.Collection;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -132,15 +133,26 @@
     {
         selectedStateManager.clearSelectedProgramInstance();
         selectedStateManager.clearSelectedProgramStageInstance();
-        
+
         Patient patient = selectedStateManager.getSelectedPatient();
 
         program = programService.getProgram( programId );
-        
+
         programStages = program.getProgramStages();
 
-        Collection<ProgramInstance> programInstances = programInstanceService.getProgramInstances( patient, program, false );
-       
+        List<ProgramInstance> programInstances = new ArrayList<ProgramInstance>();
+
+        if ( program.getAnonymousEvent() )
+        {
+            programInstances = new ArrayList<ProgramInstance>( programInstanceService.getProgramInstances( program,
+                false ) );
+        }
+        else
+        {
+            programInstances = new ArrayList<ProgramInstance>( programInstanceService.getProgramInstances( patient,
+                program, false ) );
+        }
+
         if ( programInstances != null && programInstances.size() > 0 )
         {
             programInstance = programInstances.iterator().next();

=== 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	2011-09-29 06:46:04 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveExecutionDateAction.java	2011-12-14 07:33:18 +0000
@@ -155,14 +155,17 @@
                     programInstance.setEnrollmentDate( dateValue );
                     programInstance.setDateOfIncident( dateValue );
                     programInstance.setProgram( program );
-                    programInstance.setPatient( patient );
                     programInstance.setCompleted( false );
-
+                    
+                    if ( !programStage.getProgram().getAnonymousEvent() )
+                    {
+                        programInstance.setPatient( patient );
+                        patient.getPrograms().add( program );
+                        patientService.updatePatient( patient );
+                    }
+                    
                     programInstanceService.addProgramInstance( programInstance );
-
-                    patient.getPrograms().add( program );
-                    patientService.updatePatient( patient );
-
+                    
                     // Add a new program-stage-instance
                     programStageInstance = new ProgramStageInstance();
                     programStageInstance.setProgramInstance( programInstance );
@@ -187,7 +190,7 @@
             LOG.debug( "Updating Execution Date, value added/changed" );
 
             message = programStageInstance.getId() + "";
-            
+
             return SUCCESS;
         }
 

=== 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	2011-10-27 05:51:06 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2011-12-14 07:33:18 +0000
@@ -373,6 +373,14 @@
 		<property name="programValidationService"
 			ref="org.hisp.dhis.program.ProgramValidationService" />
 	</bean>
+	
+	<bean id="org.hisp.dhis.caseentry.action.caseentry.LoadAnonymousProgramsAction"
+		class="org.hisp.dhis.caseentry.action.caseentry.LoadAnonymousProgramsAction" scope="prototype">
+		<property name="selectionManager"
+			ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
+		<property name="programService"
+			ref="org.hisp.dhis.program.ProgramService" />
+	</bean>
 
 	<!--  Patient chart -->
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2011-12-06 17:41:41 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2011-12-14 07:33:18 +0000
@@ -445,4 +445,6 @@
 relationship_for 												= Relationship for
 enter_new_encounter												= Enter new encounter
 date_of_edit													= Date of edit
-can_not_enrol_into_the_program_because							= Can not enrol into the program because
\ No newline at end of file
+can_not_enrol_into_the_program_because							= Can not enrol into the program because
+event_registration												= Event registration
+intro_event_registration										= Anonymous event registration	
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2011-11-25 03:54:15 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2011-12-14 07:33:18 +0000
@@ -171,7 +171,7 @@
 			<result name="success" type="redirect">
 				getDataRecords.action?programId=${programId}</result>
 		</action>
-
+		
 		<!-- Visit Plan -->
 
 		<action name="visitplan"
@@ -420,6 +420,25 @@
 			<param name="stylesheets">../dhis-web-commons/paging/paging.css</param>
 		</action>
 
+		<action name="anonymousRegistration"
+			class="org.hisp.dhis.caseentry.action.caseentry.LoadAnonymousProgramsAction">
+			<interceptor-ref name="organisationUnitTreeStack" />
+			<result name="success" type="velocity">/main.vm</result>
+			<param name="page">/dhis-web-caseentry/anonymousRegistration.vm</param>
+			<param name="menu">/dhis-web-caseentry/registrationMenu.vm</param>
+			<param name="javascripts">../dhis-web-commons/ouwt/ouwt.js
+				,javascript/commons.js
+				,javascript/anonymousRegistration.js
+				,javascript/entry.js
+				,../dhis-web-commons/javascripts/date.js</param>
+		</action>
+		
+		<action name="loadAnonymousPrograms"
+			class="org.hisp.dhis.caseentry.action.caseentry.LoadAnonymousProgramsAction">
+			<result name="success" type="velocity-json">
+				/dhis-web-commons/ajax/jsonPrograms.vm</result>
+		</action>
+		
 		<!-- Patient-Program Enrollment -->
 
 		<action name="showProgramEnrollmentForm"

=== added 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	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm	2011-12-14 07:33:18 +0000
@@ -0,0 +1,36 @@
+<h3>$i18n.getString( "event_registration" )</h3>	
+
+	<div id='dataRecordingSelectDiv' class="inputCriteria" style="width:420px;height:80px;">
+		
+		<input type='hidden' id="programStageId">
+		
+		<table>
+			<tr>
+				<td>$i18n.getString('program')</td>
+				<td>
+					<select id='programId' style='width:300px' onchange='showEventForm();'>
+						<option value="">[ $i18n.getString('please_select') ]</option>
+						#foreach( $program in $programs)
+							<option value="$program.id" singleevent='$program.singleEvent'>$program.name</option>
+						#end
+					</select>
+				</td>
+			</tr>
+			<tr>
+				<td><label for="executionDate">$i18n.getString( "report_date" ) </label></td>
+				<td><input type="text" id="executionDate" name="executionDate" disabled style="width:300px" value="$!format.formatDate( $programStageInstance.executionDate )" >
+					<script type="text/javascript">
+					   datePickerValid( 'executionDate', false );
+					</script>
+			</tr>
+		</table>
+	</div>
+
+	#parse( "dhis-web-commons/loader/loader.vm" )
+
+
+		<div id='dataEntryFormDiv'> </div>
+
+<script>
+	var i18n_please_select = '[ ' + '$encoder.jsEscape( $i18n.getString( "please_select" ) , "'" )' + ' ]';
+</script>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/index.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/index.vm	2011-10-04 03:10:03 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/index.vm	2011-12-14 07:33:18 +0000
@@ -3,6 +3,7 @@
 
 <ul id="introList">
 	#introListImgItem( "patient.action" "patient_registration" "patient" )
+	#introListImgItem( "anonymousRegistration.action" "event_registration" "patient" )
     #introListImgItem( "dataEntrySelect.action" "data_entry" "dataentry" )
 	#introListImgItem( "multipledataEntrySelect.action" "multiple_dataentry" "dataentry" )
     #introListImgItem( "reportSelect.action" "summary_report" "summaryreport" )

=== added 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	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js	2011-12-14 07:33:18 +0000
@@ -0,0 +1,57 @@
+
+function organisationUnitSelected( orgUnits )
+{
+	disable('executionDate');
+	setFieldValue('executionDate', '');
+	
+	$.postJSON( 'loadAnonymousPrograms.action',{}
+		, function( json ) 
+		{
+			clearListById( 'programId' );
+			addOptionById( 'programId', '', i18n_please_select );
+			
+			for ( i in json.programs ) 
+			{
+				$('#programId').append('<option value=' + json.programs[i].id + ' singleevent="true">' + json.programs[i].name + '</option>');
+			}			
+			
+		} );
+}
+
+selection.setListenerFunction( organisationUnitSelected );
+
+
+function showEventForm()
+{	
+	if( getFieldValue('programId') == '' )
+	{
+		disable('executionDate');
+		setFieldValue('executionDate', '');
+		return;
+	}
+	
+	showLoader();
+	
+	jQuery.postJSON( "loadProgramStages.action",
+		{
+			programId: getFieldValue('programId')
+		}, 
+		function( json ) 
+		{    
+			setFieldValue( 'programStageId', json.programStages[0].id );
+			loadEventRegistrationForm();
+			
+	});
+}
+
+function loadEventRegistrationForm()
+{
+	$( '#dataEntryFormDiv' ).load( "dataentryform.action", 
+		{ 
+			programStageId:getFieldValue('programStageId')
+		},function( )
+		{
+			enable('executionDate');
+			hideById('loaderDiv');
+		} );
+}
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm	2011-10-04 03:10:03 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm	2011-12-14 07:33:18 +0000
@@ -1,7 +1,8 @@
 
 <h2>$i18n.getString( "registration" )&nbsp;</h2>
 <ul>
-	<li><a href="patient.action">$i18n.getString( "patient_registration" )</a></li>		
+	<li><a href="patient.action">$i18n.getString( "patient_registration" )</a></li>	
+	<li><a href="anonymousRegistration.action">$i18n.getString( "event_registration" )</a></li>	
 </ul>
 
 <h2>$i18n.getString( "data_entry" )&nbsp;</h2>

=== 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	2011-12-13 03:18:09 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentSelectForm.vm	2011-12-14 07:33:18 +0000
@@ -20,7 +20,12 @@
 		<tr>
 			<td class='bold'>$i18n.getString( "age" ):</td>
 			<td>$encoder.htmlEncode( $patient.getAge() )</td>
-			<td align='right'>
+		</tr>
+		<tr>
+			<td>&nbsp;</td>
+		</tr>
+		<tr>
+			<td align='left' colspan='2'>
 				<input type="button" value="$i18n.getString( "back_to_registration" )" onclick="loadPatientList();" style="width:10em">
 			</td>
 		</tr>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programUnenrollmentSelectForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programUnenrollmentSelectForm.vm	2011-10-29 14:16:54 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programUnenrollmentSelectForm.vm	2011-12-14 07:33:18 +0000
@@ -40,10 +40,14 @@
     <tr>
         <td class="bold">$i18n.getString( "age" ):</td>
         <td>$encoder.htmlEncode( $patient.getAge() )</td>
-		<td align='right'>
+    <tr>
+		<td>&nbsp;</td>
+	</tr>
+	<tr>
+		<td align='left' colspan='2'>
 			<input type="button" value="$i18n.getString( "back_to_registration" )" onclick="onClickBackBtn();" style="width:10em">
 		</td>
-    </tr>
+	</tr>
 </table>
 
 <hr style="clear:both">

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/registrationMenu.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/registrationMenu.vm	2011-10-04 03:10:03 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/registrationMenu.vm	2011-12-14 07:33:18 +0000
@@ -3,6 +3,7 @@
 
 <ul>
 	<li><a href="patient.action">$i18n.getString( "patient_registration" )</a></li>
+	<li><a href="anonymousRegistration.action">$i18n.getString( "event_registration" )</a></li>
 </ul>
 
 <br>

=== 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	2011-10-04 08:53:41 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonProgram.vm	2011-12-14 07:33:18 +0000
@@ -4,6 +4,7 @@
 	"name": "$!encoder.jsEncode( ${program.name} )",
 	"description": "$!encoder.jsEncode( ${program.description} )",
 	"singleEvent": "$!program.singleEvent",
+	"anonymousEvent": "$!program.anonymousEvent",
 	"dateOfEnrollmentDescription": "$!encoder.jsEncode( ${program.dateOfEnrollmentDescription} )",
 	"dateOfIncidentDescription": "$!encoder.jsEncode( ${program.dateOfIncidentDescription} )",
 	"programStageCount": "${program.programStages.size()}",

=== 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	2011-09-20 09:07:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java	2011-12-14 07:33:18 +0000
@@ -107,6 +107,13 @@
         this.singleEvent = singleEvent;
     }
 
+    private Boolean anonymousEvent;
+
+    public void setAnonymousEvent( Boolean anonymousEvent )
+    {
+        this.anonymousEvent = anonymousEvent;
+    }
+
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -114,11 +121,9 @@
     public String execute()
         throws Exception
     {
-        if ( singleEvent == null )
-        {
-            singleEvent = false;
-        }
-        
+        singleEvent = (singleEvent == null) ? false : singleEvent;
+        anonymousEvent = (anonymousEvent == null) ? false : anonymousEvent;
+
         Program program = new Program();
 
         program.setName( name );
@@ -128,7 +133,8 @@
         program.setDateOfIncidentDescription( dateOfIncidentDescription );
         program.setMaxDaysAllowedInputData( maxDaysAllowedInputData );
         program.setSingleEvent( singleEvent );
-
+        program.setAnonymousEvent( anonymousEvent );
+        
         programService.saveProgram( program );
 
         if ( singleEvent )

=== 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	2011-09-20 09:07:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java	2011-12-14 07:33:18 +0000
@@ -124,6 +124,13 @@
         this.singleEvent = singleEvent;
     }
 
+    private Boolean anonymousEvent;
+
+    public void setAnonymousEvent( Boolean anonymousEvent )
+    {
+        this.anonymousEvent = anonymousEvent;
+    }
+
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -131,11 +138,9 @@
     public String execute()
         throws Exception
     {
-        if ( singleEvent == null )
-        {
-            singleEvent = false;
-        }
-        
+        singleEvent = (singleEvent == null) ? false : singleEvent;
+        anonymousEvent = (anonymousEvent == null) ? false : anonymousEvent;
+
         Program program = programService.getProgram( id );
         program.setName( name );
         program.setDescription( description );
@@ -144,6 +149,7 @@
         program.setDateOfIncidentDescription( dateOfIncidentDescription );
         program.setMaxDaysAllowedInputData( maxDaysAllowedInputData );
         program.setSingleEvent( singleEvent );
+        program.setAnonymousEvent( anonymousEvent );
 
         programService.updateProgram( program );
 
@@ -159,7 +165,7 @@
 
             programStageService.saveProgramStage( programStage );
         }
-        
+
         return SUCCESS;
     }
 }

=== 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	2011-11-30 06:38:30 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties	2011-12-14 07:33:18 +0000
@@ -384,4 +384,5 @@
 run_fail = Run failed
 patients_registered = Registered Beneficiaries No
 irregular_encounter = Irregular encounter
-date_of_birth = Date of Birth
\ No newline at end of file
+date_of_birth = Date of Birth
+anonymous_event = Anonymous Event
\ No newline at end of file

=== 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	2011-10-04 06:37:23 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramForm.vm	2011-12-14 07:33:18 +0000
@@ -40,6 +40,12 @@
 		</tr>
 		
 		<tr>
+			<td><label>$i18n.getString( "anonymous_event" )</label></td>
+			<td><input type="checkbox" id="anonymousEvent" name="anonymousEvent" value='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" style="width:30em" class="{validate:{required:true,minlength:4}}"></td>
 			<td></td>

=== 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	2011-10-04 08:53:41 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js	2011-12-14 07:33:18 +0000
@@ -10,9 +10,13 @@
 		setInnerHTML( 'idField', json.program.id );
 		setInnerHTML( 'nameField', json.program.name );
 		setInnerHTML( 'descriptionField', json.program.description );
+		
 		var singleEvent = ( json.program.singleEvent == 'true') ? i18n_yes : i18n_no;
-				
-		setInnerHTML( 'singleEventField', singleEvent );   
+		setInnerHTML( 'singleEventField', singleEvent );  
+		
+		var anonymousEvent = ( json.program.anonymousEvent == 'true') ? i18n_yes : i18n_no;
+		setInnerHTML( 'anonymousEventField', anonymousEvent );   		
+		
 		setInnerHTML( 'dateOfEnrollmentDescriptionField', json.program.dateOfEnrollmentDescription );   
 		setInnerHTML( 'dateOfIncidentDescriptionField', json.program.dateOfIncidentDescription );   		
 		setInnerHTML( 'programStageCountField',  json.program.programStageCount );

=== 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	2011-10-04 08:53:41 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.vm	2011-12-14 07:33:18 +0000
@@ -48,6 +48,7 @@
 				<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_event" ):</label><br><span id="anonymousEventField"></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>

=== 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	2011-10-14 02:48:15 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm	2011-12-14 07:33:18 +0000
@@ -43,6 +43,12 @@
 		<td></td>
 	 </tr>
 	 
+	 <tr>
+		<td><label>$i18n.getString( "anonymous_event" )</label></td>
+		<td><input type="checkbox" id="anonymousEvent" name="anonymousEvent" value='true' #if( $program.anonymousEvent=='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" style="width:30em" class="{validate:{required:true,number:true}}"></td>