=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/caseaggregation/ShowAddCaseAggregationConditionFormAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/caseaggregation/ShowAddCaseAggregationConditionFormAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/caseaggregation/ShowAddCaseAggregationConditionFormAction.java 2011-05-26 05:41:52 +0000 @@ -0,0 +1,147 @@ +/* + * 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.patient.action.caseaggregation; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.hisp.dhis.dataelement.DataElement; +import org.hisp.dhis.dataelement.DataElementGroup; +import org.hisp.dhis.dataelement.DataElementService; +import org.hisp.dhis.dataelement.comparator.DataElementGroupNameComparator; +import org.hisp.dhis.patient.PatientAttribute; +import org.hisp.dhis.patient.PatientAttributeService; +import org.hisp.dhis.patient.comparator.PatientAttributeComparator; +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 ShowAddCaseAggregationConditionFormAction.java Nov 17, 2010 11:04:46 AM + */ +public class ShowAddCaseAggregationConditionFormAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + public DataElementService dataElementService; + + public ProgramService programService; + + private PatientAttributeService patientAttributeService; + + // ------------------------------------------------------------------------- + // Output + // ------------------------------------------------------------------------- + + private Integer id; + + private List patientAttributes; + + private List dataElementGroups; + + private List dataElements; + + private List programs; + + // ------------------------------------------------------------------------- + // Getters && Setters + // ------------------------------------------------------------------------- + + public Integer getId() + { + return id; + } + + public void setId( Integer id ) + { + this.id = id; + } + + public List getDataElementGroups() + { + return dataElementGroups; + } + + public List getPrograms() + { + return programs; + } + + public List getDataElements() + { + return dataElements; + } + + public void setDataElementService( DataElementService dataElementService ) + { + this.dataElementService = dataElementService; + } + + public void setProgramService( ProgramService programService ) + { + this.programService = programService; + } + + public void setPatientAttributeService( PatientAttributeService patientAttributeService ) + { + this.patientAttributeService = patientAttributeService; + } + + public List getPatientAttributes() + { + return patientAttributes; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + @Override + public String execute() + throws Exception + { + dataElementGroups = new ArrayList( dataElementService.getAllDataElementGroups() ); + Collections.sort( dataElementGroups, new DataElementGroupNameComparator() ); + + programs = new ArrayList( programService.getAllPrograms() ); + Collections.sort( programs, new ProgramNameComparator() ); + + patientAttributes = new ArrayList( patientAttributeService.getAllPatientAttributes() ); + Collections.sort( patientAttributes, new PatientAttributeComparator() ); + + return SUCCESS; + } +} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/caseaggregation/ShowCaseAggregationConditionFormAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/caseaggregation/ShowCaseAggregationConditionFormAction.java 2011-05-19 08:12:45 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/caseaggregation/ShowCaseAggregationConditionFormAction.java 1970-01-01 00:00:00 +0000 @@ -1,147 +0,0 @@ -/* - * 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.patient.action.caseaggregation; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.hisp.dhis.dataelement.DataElement; -import org.hisp.dhis.dataelement.DataElementGroup; -import org.hisp.dhis.dataelement.DataElementService; -import org.hisp.dhis.dataelement.comparator.DataElementGroupNameComparator; -import org.hisp.dhis.patient.PatientAttribute; -import org.hisp.dhis.patient.PatientAttributeService; -import org.hisp.dhis.patient.comparator.PatientAttributeComparator; -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 ShowCaseAggregationConditionFormAction.java Nov 17, 2010 11:04:46 AM - */ -public class ShowCaseAggregationConditionFormAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - public DataElementService dataElementService; - - public ProgramService programService; - - private PatientAttributeService patientAttributeService; - - // ------------------------------------------------------------------------- - // Output - // ------------------------------------------------------------------------- - - private Integer id; - - private List patientAttributes; - - private List dataElementGroups; - - private List dataElements; - - private List programs; - - // ------------------------------------------------------------------------- - // Getters && Setters - // ------------------------------------------------------------------------- - - public Integer getId() - { - return id; - } - - public void setId( Integer id ) - { - this.id = id; - } - - public List getDataElementGroups() - { - return dataElementGroups; - } - - public List getPrograms() - { - return programs; - } - - public List getDataElements() - { - return dataElements; - } - - public void setDataElementService( DataElementService dataElementService ) - { - this.dataElementService = dataElementService; - } - - public void setProgramService( ProgramService programService ) - { - this.programService = programService; - } - - public void setPatientAttributeService( PatientAttributeService patientAttributeService ) - { - this.patientAttributeService = patientAttributeService; - } - - public List getPatientAttributes() - { - return patientAttributes; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - @Override - public String execute() - throws Exception - { - dataElementGroups = new ArrayList( dataElementService.getAllDataElementGroups() ); - Collections.sort( dataElementGroups, new DataElementGroupNameComparator() ); - - programs = new ArrayList( programService.getAllPrograms() ); - Collections.sort( programs, new ProgramNameComparator() ); - - patientAttributes = new ArrayList( patientAttributeService.getAllPatientAttributes() ); - Collections.sort( patientAttributes, new PatientAttributeComparator() ); - - return SUCCESS; - } -} === added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/caseaggregation/ShowUpdateCaseAggregationConditionFormAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/caseaggregation/ShowUpdateCaseAggregationConditionFormAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/caseaggregation/ShowUpdateCaseAggregationConditionFormAction.java 2011-05-26 05:41:52 +0000 @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2004-2009, University of Oslo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of the HISP project nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package org.hisp.dhis.patient.action.caseaggregation; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.hisp.dhis.caseaggregation.CaseAggregationCondition; +import org.hisp.dhis.caseaggregation.CaseAggregationConditionService; +import org.hisp.dhis.dataelement.DataElement; +import org.hisp.dhis.dataelement.DataElementGroup; +import org.hisp.dhis.dataelement.DataElementService; +import org.hisp.dhis.dataelement.comparator.DataElementGroupNameComparator; +import org.hisp.dhis.patient.PatientAttribute; +import org.hisp.dhis.patient.PatientAttributeService; +import org.hisp.dhis.patient.comparator.PatientAttributeComparator; +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 $ ShowUpdateCaseAggregationForm.java May 26, 2011 11:43:19 AM $ + * + */ +public class ShowUpdateCaseAggregationConditionFormAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private CaseAggregationConditionService aggregationConditionService; + + public DataElementService dataElementService; + + public ProgramService programService; + + private PatientAttributeService patientAttributeService; + + // ------------------------------------------------------------------------- + // Output + // ------------------------------------------------------------------------- + + private Integer id; + + private CaseAggregationCondition caseAggregation; + + private String description; + + private List patientAttributes; + + private List dataElementGroups; + + private List dataElements; + + private List programs; + + // ------------------------------------------------------------------------- + // Getters && Setters + // ------------------------------------------------------------------------- + + public void setAggregationConditionService( CaseAggregationConditionService aggregationConditionService ) + { + this.aggregationConditionService = aggregationConditionService; + } + + public void setDataElementService( DataElementService dataElementService ) + { + this.dataElementService = dataElementService; + } + + public void setProgramService( ProgramService programService ) + { + this.programService = programService; + } + + public void setPatientAttributeService( PatientAttributeService patientAttributeService ) + { + this.patientAttributeService = patientAttributeService; + } + + public void setId( Integer id ) + { + this.id = id; + } + + public String getDescription() + { + return description; + } + + public CaseAggregationCondition getCaseAggregation() + { + return caseAggregation; + } + + public List getDataElementGroups() + { + return dataElementGroups; + } + + public List getPrograms() + { + return programs; + } + + public List getDataElements() + { + return dataElements; + } + + public List getPatientAttributes() + { + return patientAttributes; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + @Override + public String execute() + throws Exception + { + dataElementGroups = new ArrayList( dataElementService.getAllDataElementGroups() ); + Collections.sort( dataElementGroups, new DataElementGroupNameComparator() ); + + programs = new ArrayList( programService.getAllPrograms() ); + Collections.sort( programs, new ProgramNameComparator() ); + + patientAttributes = new ArrayList( patientAttributeService.getAllPatientAttributes() ); + Collections.sort( patientAttributes, new PatientAttributeComparator() ); + + caseAggregation = aggregationConditionService.getCaseAggregationCondition( id ); + description = aggregationConditionService.getConditionDescription( caseAggregation.getAggregationExpression() ); + + return SUCCESS; + } +} \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml 2011-05-19 08:12:45 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml 2011-05-26 05:41:52 +0000 @@ -1061,17 +1061,35 @@ - - - - - - - - + id="org.hisp.dhis.patient.action.caseaggregation.ShowAddCaseAggregationConditionFormAction" + class="org.hisp.dhis.patient.action.caseaggregation.ShowAddCaseAggregationConditionFormAction" + scope="prototype"> + + + + + + + + + + + + + + + + + + + + + + + === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml 2011-05-26 03:19:50 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml 2011-05-26 05:41:52 +0000 @@ -958,27 +958,19 @@ + class="org.hisp.dhis.patient.action.caseaggregation.ShowAddCaseAggregationConditionFormAction"> /main.vm /dhis-web-maintenance-patient/addCaseAggregation.vm /dhis-web-maintenance-patient/patientAndProgramMenu.vm - javascript/commons.js, - javascript/caseaggregation.js + javascript/commons.js,javascript/caseaggregation.js - updateCaseAggregationFormChain - - - - + class="org.hisp.dhis.patient.action.caseaggregation.ShowUpdateCaseAggregationConditionFormAction"> /main.vm /dhis-web-maintenance-patient/updateCaseAggregation.vm /dhis-web-maintenance-patient/patientAndProgramMenu.vm - javascript/commons.js, - javascript/caseaggregation.js + javascript/commons.js,javascript/caseaggregation.js -

$i18n.getString('configuration') #openHelp( "excelReportingConfiguration" )

+

$i18n.getString('configuration')