=== 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 patientValidationCriteria = new HashSet(); 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 getAllPrograms(); Collection getPrograms( OrganisationUnit organisationUnit ); - + Collection getPrograms( ValidationCriteria validationCriteria ); - + Collection getPrograms( boolean singleEvent ); + + Collection getPrograms( boolean singleEvent, boolean anonymousEvent ); + + Collection 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 +{ + String ID = ProgramStore.class.getName(); + + Collection get( boolean singleEvent ); + + Collection get( boolean singleEvent, boolean anonymousEvent ); + + Collection 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 programStore; + private ProgramStore programStore; - public void setProgramStore( GenericIdentifiableObjectStore programStore ) + public void setProgramStore( ProgramStore programStore ) { this.programStore = programStore; } @@ -121,17 +120,17 @@ public Collection getPrograms( boolean singleEvent ) { - Set programs = new HashSet(); - - for ( Program program : getAllPrograms() ) - { - if ( program.getSingleEvent() == singleEvent) - { - programs.add( program ); - } - } - - return programs; + return programStore.get( singleEvent ); + } + + public Collection getPrograms( boolean singleEvent, boolean anonymousEvent ) + { + return programStore.get( singleEvent, anonymousEvent ); + } + + public Collection 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 + implements ProgramStore +{ + @SuppressWarnings( "unchecked" ) + @Override + public Collection get( boolean singleEvent ) + { + return getCriteria( Restrictions.eq( "singleEvent", singleEvent )).list(); + } + + @SuppressWarnings( "unchecked" ) + @Override + public Collection get( boolean singleEvent, boolean anonymousEvent ) + { + return getCriteria( Restrictions.eq( "singleEvent", singleEvent ), + Restrictions.eq( "anonymousEvent", anonymousEvent ) ).list(); + } + + @SuppressWarnings( "unchecked" ) + @Override + public Collection 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 @@ - + === 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 @@ + + === 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 @@ - programs; + + public List getPrograms() + { + return programs; + } + + // ------------------------------------------------------------------------- + // Implementation Action + // ------------------------------------------------------------------------- + + public String execute() + throws Exception + { + OrganisationUnit orgunit = selectionManager.getSelectedOrganisationUnit(); + + if ( orgunit != null ) + { + programs = new ArrayList( 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 programInstances = programInstanceService.getProgramInstances( patient, program, false ); - + List programInstances = new ArrayList(); + + if ( program.getAnonymousEvent() ) + { + programInstances = new ArrayList( programInstanceService.getProgramInstances( program, + false ) ); + } + else + { + programInstances = new ArrayList( 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 @@ + + + + + === 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 @@ getDataRecords.action?programId=${programId} - + ../dhis-web-commons/paging/paging.css + + + /main.vm + /dhis-web-caseentry/anonymousRegistration.vm + /dhis-web-caseentry/registrationMenu.vm + ../dhis-web-commons/ouwt/ouwt.js + ,javascript/commons.js + ,javascript/anonymousRegistration.js + ,javascript/entry.js + ,../dhis-web-commons/javascripts/date.js + + + + + /dhis-web-commons/ajax/jsonPrograms.vm + + $i18n.getString( "event_registration" ) + +
+ + + + + + + + + + + +
$i18n.getString('program') + +
+ +
+
+ + #parse( "dhis-web-commons/loader/loader.vm" ) + + +
+ + \ 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 @@
    #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(''); + } + + } ); +} + +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 @@

    $i18n.getString( "registration" ) 

    $i18n.getString( "data_entry" ) 

    === 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 @@ $i18n.getString( "age" ): $encoder.htmlEncode( $patient.getAge() ) - + + +   + + + === 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 @@ $i18n.getString( "age" ): $encoder.htmlEncode( $patient.getAge() ) - + +   + + + - +
    === 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 @@
    === 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 @@ + + + + + + === 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 @@




    +





    === 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 @@ + + + + + +