=== added directory 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientchart' === added file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientchart/PatientChart.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientchart/PatientChart.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientchart/PatientChart.java 2011-09-06 02:47:21 +0000 @@ -0,0 +1,211 @@ +/* + * Copyright (c) 2004-2011, 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.patientchart; + +import java.io.Serializable; + +import org.hisp.dhis.dataelement.DataElement; +import org.hisp.dhis.i18n.I18nFormat; +import org.hisp.dhis.program.Program; + +/** + * @author Chau Thu Tran + * @version $ PatientChart.java Sep 5, 2011 7:45:02 AM $ + * + */ +public class PatientChart + implements Serializable +{ + private static final long serialVersionUID = 8363053813064346240L; + + public static final String TYPE_BAR = "bar"; + + public static final String TYPE_BAR3D = "bar3d"; + + public static final String TYPE_LINE = "line"; + + public static final String TYPE_LINE3D = "line3d"; + + public static final String SIZE_NORMAL = "normal"; + + public static final String SIZE_WIDE = "wide"; + + public static final String SIZE_TALL = "tall"; + + private Integer id; + + private String title; + + private String type; + + private String size; + + private boolean regression; + + private Program program; + + private DataElement dataElement; + + private transient I18nFormat format; + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + public PatientChart() + { + + } + + // ------------------------------------------------------------------------- + // equals && hashcode + // ------------------------------------------------------------------------- + + @Override + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + ((title == null) ? 0 : title.hashCode()); + return result; + } + + @Override + public boolean equals( Object obj ) + { + if ( this == obj ) + return true; + if ( obj == null ) + return false; + if ( getClass() != obj.getClass() ) + return false; + PatientChart other = (PatientChart) obj; + if ( title == null ) + { + if ( other.title != null ) + return false; + } + else if ( !title.equals( other.title ) ) + return false; + return true; + } + + // ------------------------------------------------------------------------- + // Getters && Setters + // ------------------------------------------------------------------------- + + public boolean isType( String type ) + { + return this.type != null && this.type.equals( type ); + } + + public boolean isSize( String size ) + { + return this.size != null && this.size.equals( size ); + } + + public String getTitle() + { + return title; + } + + public void setTitle( String title ) + { + this.title = title; + } + + public String getType() + { + return type; + } + + public void setType( String type ) + { + this.type = type; + } + + public String getSize() + { + return size; + } + + public void setSize( String size ) + { + this.size = size; + } + + public Program getProgram() + { + return program; + } + + public void setProgram( Program program ) + { + this.program = program; + } + + public DataElement getDataElement() + { + return dataElement; + } + + public void setDataElement( DataElement dataElement ) + { + this.dataElement = dataElement; + } + + public I18nFormat getFormat() + { + return format; + } + + public void setFormat( I18nFormat format ) + { + this.format = format; + } + + public boolean isRegression() + { + return regression; + } + + public void setRegression( boolean regression ) + { + this.regression = regression; + } + + public Integer getId() + { + return id; + } + + public void setId( Integer id ) + { + this.id = id; + } +} === added file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientchart/PatientChartService.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientchart/PatientChartService.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientchart/PatientChartService.java 2011-09-06 02:47:21 +0000 @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2004-2011, 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.patientchart; + +import java.util.Collection; + +import org.hisp.dhis.i18n.I18nFormat; +import org.hisp.dhis.program.Program; +import org.jfree.chart.JFreeChart; + +/** + * @author Chau Thu Tran + * @version $ PatientChartService.java Sep 5, 2011 8:59:04 AM $ + * + */ +public interface PatientChartService +{ + String ID = PatientChartService.class.getName(); + + int savePientChart( PatientChart patientChart ); + + void deletePatientChart( PatientChart patientChart ); + + void updatePatientChart( PatientChart patientChart ); + + PatientChart getPatientChart( int id ); + + Collection getPatientCharts ( Collection programs ); + + Collection getAllPatientCharts(); + + JFreeChart getJFreeChart( int id, I18nFormat format ); +} === added file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientchart/PatientChartStore.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientchart/PatientChartStore.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientchart/PatientChartStore.java 2011-09-06 02:47:21 +0000 @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2004-2011, 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.patientchart; + +import java.util.Collection; + +import org.hisp.dhis.common.GenericStore; +import org.hisp.dhis.program.Program; + +/** + * @author Chau Thu Tran + * @version $ PatientChartStore.java Sep 5, 2011 8:06:43 AM $ + * + */ +public interface PatientChartStore extends GenericStore +{ + String ID = PatientChartStore.class.getName(); + + Collection getPatientCharts ( Collection programs ); +} === added directory 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientchart' === added file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientchart/DefaultPatientChartService.java' --- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientchart/DefaultPatientChartService.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientchart/DefaultPatientChartService.java 2011-09-06 02:47:21 +0000 @@ -0,0 +1,324 @@ +/* + * 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.patientchart; + +import static org.hisp.dhis.chart.Chart.TYPE_BAR; +import static org.hisp.dhis.chart.Chart.TYPE_BAR3D; +import static org.hisp.dhis.chart.Chart.TYPE_LINE; +import static org.hisp.dhis.chart.Chart.TYPE_LINE3D; + +import java.awt.Color; +import java.awt.Font; +import java.util.Collection; +import java.util.Iterator; + +import org.apache.commons.math.stat.regression.SimpleRegression; +import org.hisp.dhis.i18n.I18nFormat; +import org.hisp.dhis.patientdatavalue.PatientDataValue; +import org.hisp.dhis.patientdatavalue.PatientDataValueService; +import org.hisp.dhis.program.Program; +import org.jfree.chart.JFreeChart; +import org.jfree.chart.axis.CategoryAxis; +import org.jfree.chart.axis.CategoryLabelPositions; +import org.jfree.chart.axis.NumberAxis; +import org.jfree.chart.plot.CategoryPlot; +import org.jfree.chart.plot.DatasetRenderingOrder; +import org.jfree.chart.plot.PlotOrientation; +import org.jfree.chart.renderer.category.BarRenderer; +import org.jfree.chart.renderer.category.BarRenderer3D; +import org.jfree.chart.renderer.category.LineAndShapeRenderer; +import org.jfree.chart.renderer.category.LineRenderer3D; +import org.jfree.data.category.CategoryDataset; +import org.jfree.data.category.DefaultCategoryDataset; +import org.springframework.transaction.annotation.Transactional; + +/** + * @author Chau Thu Tran + * @version $ DefaultPatientChartService.java Sep 4, 2011 7:13:19 PM $ + * + */ +@Transactional +public class DefaultPatientChartService + implements PatientChartService +{ + private static final Font titleFont = new Font( "Tahoma", Font.BOLD, 14 ); + + private static final Color[] colors = { Color.decode( "#d54a4a" ), Color.decode( "#2e4e83" ), + Color.decode( "#75e077" ), Color.decode( "#e3e274" ), Color.decode( "#e58c6d" ), Color.decode( "#df6ff3" ), + Color.decode( "#88878e" ), Color.decode( "#6ff3e8" ), Color.decode( "#6fc3f3" ), Color.decode( "#aaf36f" ), + Color.decode( "#9d6ff3" ), Color.decode( "#474747" ) }; + + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private PatientChartStore patientChartStore; + + public void setPatientChartStore( PatientChartStore patientChartStore ) + { + this.patientChartStore = patientChartStore; + } + + private PatientDataValueService patientDataValueService; + + public void setPatientDataValueService( PatientDataValueService patientDataValueService ) + { + this.patientDataValueService = patientDataValueService; + } + + // ------------------------------------------------------------------------- + // ChartService implementation + // ------------------------------------------------------------------------- + + @Override + public void deletePatientChart( PatientChart patientChart ) + { + patientChartStore.delete( patientChart ); + } + + @Override + public Collection getAllPatientCharts() + { + return patientChartStore.getAll(); + } + + @Override + public PatientChart getPatientChart( int id ) + { + return patientChartStore.get( id ); + } + + @Override + public Collection getPatientCharts( Collection programs ) + { + return patientChartStore.getPatientCharts( programs ); + } + + @Override + public int savePientChart( PatientChart patientChart ) + { + return patientChartStore.save( patientChart ); + } + + @Override + public void updatePatientChart( PatientChart patientChart ) + { + patientChartStore.update( patientChart ); + } + + @Override + public JFreeChart getJFreeChart( int id, I18nFormat format ) + { + PatientChart patientChart = getPatientChart( id ); + + patientChart.setFormat( format ); + + return getJFreeChart( patientChart ); + } + + // ------------------------------------------------------------------------- + // Supportive methods + // ------------------------------------------------------------------------- + + private JFreeChart getJFreeChart( PatientChart patientChart ) + { + final BarRenderer barRenderer = getBarRenderer(); + final BarRenderer bar3dRenderer = getBar3DRenderer(); + final LineAndShapeRenderer lineRenderer = getLineRenderer(); + final LineRenderer3D line3dRenderer = getLineRenderer3D(); + + // --------------------------------------------------------------------- + // Plot + // --------------------------------------------------------------------- + + CategoryPlot plot = null; + + CategoryDataset[] dataSets = getCategoryDataSet( patientChart ); + + if ( patientChart.isType( TYPE_LINE ) ) + { + plot = new CategoryPlot( dataSets[0], new CategoryAxis(), new NumberAxis(), lineRenderer ); + } + if ( patientChart.isType( TYPE_LINE3D ) ) + { + plot = new CategoryPlot( dataSets[0], new CategoryAxis(), new NumberAxis(), line3dRenderer ); + } + else if ( patientChart.isType( TYPE_BAR3D ) ) + { + plot = new CategoryPlot( dataSets[0], new CategoryAxis(), new NumberAxis(), bar3dRenderer ); + } + else if ( patientChart.isType( TYPE_BAR ) ) + { + plot = new CategoryPlot( dataSets[0], new CategoryAxis(), new NumberAxis(), barRenderer ); + } + + if ( patientChart.isRegression() ) + { + plot.setDataset( 1, dataSets[1] ); + plot.setRenderer( 1, lineRenderer ); + } + + JFreeChart jFreeChart = new JFreeChart( patientChart.getTitle(), titleFont, plot, true ); + + // --------------------------------------------------------------------- + // Plot orientation + // --------------------------------------------------------------------- + + plot.setOrientation( PlotOrientation.VERTICAL ); + plot.setDatasetRenderingOrder( DatasetRenderingOrder.FORWARD ); + + // --------------------------------------------------------------------- + // Category label positions + // --------------------------------------------------------------------- + + CategoryAxis xAxis = plot.getDomainAxis(); + xAxis.setCategoryLabelPositions( CategoryLabelPositions.UP_45 ); + + // --------------------------------------------------------------------- + // Color & antialias + // --------------------------------------------------------------------- + + jFreeChart.setBackgroundPaint( Color.WHITE ); + jFreeChart.setAntiAlias( true ); + + return jFreeChart; + } + + /** + * Returns a bar renderer. + */ + private BarRenderer getBarRenderer() + { + BarRenderer renderer = new BarRenderer(); + + renderer.setMaximumBarWidth( 0.07 ); + + for ( int i = 0; i < colors.length; i++ ) + { + renderer.setSeriesPaint( i, colors[i] ); + renderer.setShadowVisible( false ); + } + + return renderer; + } + + /** + * Returns a bar3d renderer. + */ + private BarRenderer getBar3DRenderer() + { + BarRenderer3D renderer = new BarRenderer3D(); + + renderer.setMaximumBarWidth( 0.07 ); + + for ( int i = 0; i < colors.length; i++ ) + { + renderer.setSeriesPaint( i, colors[i] ); + renderer.setShadowVisible( false ); + } + + return renderer; + } + + /** + * Returns a line and shape renderer. + */ + private LineAndShapeRenderer getLineRenderer() + { + LineAndShapeRenderer renderer = new LineAndShapeRenderer(); + + for ( int i = 0; i < colors.length; i++ ) + { + renderer.setSeriesPaint( i, colors[i] ); + } + + return renderer; + } + + /** + * Returns a line3d renderer. + */ + private LineRenderer3D getLineRenderer3D() + { + LineRenderer3D renderer = new LineRenderer3D(); + + for ( int i = 0; i < colors.length; i++ ) + { + renderer.setSeriesPaint( i, colors[i] ); + } + + return renderer; + } + + /** + * Returns a DefaultCategoryDataSet based on patient-data-values for the + * patient-chart. + */ + private CategoryDataset[] getCategoryDataSet( PatientChart patientChart ) + { + final DefaultCategoryDataset regularDataSet = new DefaultCategoryDataset(); + final DefaultCategoryDataset regressionDataSet = new DefaultCategoryDataset(); + + if ( patientChart != null ) + { + Collection patientDataValues = patientDataValueService.getPatientDataValues( patientChart + .getDataElement() ); + + Iterator iter = patientDataValues.iterator(); + + while ( iter.hasNext() ) + { + if ( !iter.next().getProgramStageInstance().getProgramInstance().getProgram().equals( + patientChart.getProgram() ) ) + { + iter.remove(); + } + } + + // --------------------------------------------------------- + // Regular dataset + // --------------------------------------------------------- + + int columnIndex = 0; + + for ( PatientDataValue patientDataValue : patientDataValues ) + { + final SimpleRegression regression = new SimpleRegression(); + + regularDataSet.addValue( Double.parseDouble( patientDataValue.getValue() ), patientChart.getDataElement().getName(), patientChart.getFormat() + .formatDate( patientDataValue.getProgramStageInstance().getExecutionDate() ) ); + + columnIndex++; + + regression.addData( columnIndex, Double.parseDouble( patientDataValue.getValue() ) ); + } + } + + return new CategoryDataset[] { regularDataSet, regressionDataSet }; + } +} === added directory 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientchart/hibernate' === added file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientchart/hibernate/HibernatePatientChartStore.java' --- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientchart/hibernate/HibernatePatientChartStore.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientchart/hibernate/HibernatePatientChartStore.java 2011-09-06 02:47:21 +0000 @@ -0,0 +1,57 @@ +/* + * 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.patientchart.hibernate; + +import java.util.Collection; + +import org.hibernate.Criteria; +import org.hibernate.criterion.Restrictions; +import org.hisp.dhis.hibernate.HibernateGenericStore; +import org.hisp.dhis.patientchart.PatientChart; +import org.hisp.dhis.patientchart.PatientChartStore; +import org.hisp.dhis.program.Program; + +/** + * @author Chau Thu Tran + * @version $ HibernatePatientChartStore.java Sep 5, 2011 8:32:56 AM $ + * + */ +public class HibernatePatientChartStore + extends HibernateGenericStore + implements PatientChartStore + +{ + @SuppressWarnings( "unchecked" ) + @Override + public Collection getPatientCharts ( Collection programs ) + { + Criteria criteria = getCriteria(); + criteria.add( Restrictions.in( "program", programs ) ); + return criteria.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-09-02 10:40:22 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml 2011-09-06 02:47:21 +0000 @@ -133,6 +133,11 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + === added directory 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patientchart' === added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patientchart/GeneratePatientChartAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patientchart/GeneratePatientChartAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patientchart/GeneratePatientChartAction.java 2011-09-06 02:47:21 +0000 @@ -0,0 +1,111 @@ +/* + * 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.caseentry.action.patientchart; + +import org.hisp.dhis.i18n.I18nFormat; +import org.hisp.dhis.patientchart.PatientChartService; +import org.jfree.chart.JFreeChart; + +import com.opensymphony.xwork2.Action; + +/** + * @author Chau Thu Tran + * @version $ ViewPatientChartAction.java Sep 5, 2011 2:55:44 PM $ + * + */ +public class GeneratePatientChartAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private PatientChartService patientChartService; + + public void setPatientChartService( PatientChartService patientChartService ) + { + this.patientChartService = patientChartService; + } + + private I18nFormat format; + + public void setFormat( I18nFormat format ) + { + this.format = format; + } + + // ------------------------------------------------------------------------- + // Input + // ------------------------------------------------------------------------- + + private Integer id; + + public void setId( Integer id ) + { + this.id = id; + } + + private int width; + + public int getWidth() + { + return width; + } + + private int height; + + public int getHeight() + { + return height; + } + + // ------------------------------------------------------------------------- + // Output + // ------------------------------------------------------------------------- + + private JFreeChart chart; + + public JFreeChart getChart() + { + return chart; + } + + @Override + public String execute() + throws Exception + { + width = 500; + + height = 400; + + chart = patientChartService.getJFreeChart( id, format ); + + return SUCCESS; + } + +} === added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patientchart/GetPatientChartListAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patientchart/GetPatientChartListAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patientchart/GetPatientChartListAction.java 2011-09-06 02:47:21 +0000 @@ -0,0 +1,98 @@ +/* + * 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.caseentry.action.patientchart; + +import java.util.Collection; + +import org.hisp.dhis.patient.Patient; +import org.hisp.dhis.patient.PatientService; +import org.hisp.dhis.patientchart.PatientChart; +import org.hisp.dhis.patientchart.PatientChartService; + +import com.opensymphony.xwork2.Action; + +/** + * @author Chau Thu Tran + * @version $ GetPatientChartListAction.java Sep 5, 2011 9:11:31 AM $ + * + */ +public class GetPatientChartListAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private PatientChartService patientChartService; + + public void setPatientChartService( PatientChartService patientChartService ) + { + this.patientChartService = patientChartService; + } + + private PatientService patientService; + + public void setPatientService( PatientService patientService ) + { + this.patientService = patientService; + } + + // ------------------------------------------------------------------------- + // Input/output + // ------------------------------------------------------------------------- + + private Integer patientId; + + public void setPatientId( Integer patientId ) + { + this.patientId = patientId; + } + + private Collection patientCharts; + + public Collection getPatientCharts() + { + return patientCharts; + } + + // ------------------------------------------------------------------------- + // Implementation Action + // ------------------------------------------------------------------------- + + @Override + public String execute() + throws Exception + { + Patient patient = patientService.getPatient( patientId ); + + patientCharts = patientChartService.getPatientCharts( patient.getPrograms() ); + + 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-07-25 06:49:16 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2011-09-06 02:47:21 +0000 @@ -268,5 +268,18 @@ + + + + + + + + + + + === 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-09-01 04:57:17 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2011-09-06 02:47:21 +0000 @@ -313,4 +313,7 @@ filter_by = Filter by hierachy_orgunit = Hierarchy Organisation Unit F = F -M = M \ No newline at end of file +M = M +view_patient_chart = View Patient chart +generate_patient_chart = Generate patient chart +patient_chart_management = Patient Chart Management \ 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-07-25 06:49:16 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2011-09-06 02:47:21 +0000 @@ -239,5 +239,17 @@ /dhis-web-caseentry/validationResult.vm + + + + /content.vm + /dhis-web-caseentry/patientChartList.vm + javascript/patientChart.js + + + + + + === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/dataEntry.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/dataEntry.js 2011-08-30 01:41:05 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/dataEntry.js 2011-09-06 02:47:21 +0000 @@ -1131,4 +1131,20 @@ TOGGLE.init(); } -} \ No newline at end of file +} + +// ------------------------------------------------------------------------- +// Show Patient chart list +// ------------------------------------------------------------------------- + +function patientChartList( patientId ) +{ + $( '#patientChartListDiv' ).load('patientChartList.action?patientId=' + patientId ).dialog( { + autoOpen : true, + modal : true, + height : 400, + width : 500, + resizable : false, + title : 'Viewing Chart' + } ); +} === added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patientChart.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patientChart.js 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patientChart.js 2011-09-06 02:47:21 +0000 @@ -0,0 +1,20 @@ + +// ----------------------------------------------------------------------------- +// View chart +// ----------------------------------------------------------------------------- + +function viewChart( url, size ) +{ + var width = size === 'wide' ? 1000 : 700; + var height = size === 'tall' ? 800 : 500; + + $( '#chartImage' ).attr( 'src', url ); + $( '#chartView' ).dialog( { + autoOpen : true, + modal : true, + height : 450, + width : 600, + resizable : false, + title : 'Viewing Chart' + } ); +} === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/listPatient.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/listPatient.vm 2011-09-01 04:50:41 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/listPatient.vm 2011-09-06 02:47:21 +0000 @@ -21,6 +21,7 @@ #end + @@ -28,6 +29,7 @@ + $i18n.getString( "full_name" ) $i18n.getString( "gender" ) @@ -36,7 +38,7 @@ #if($mapPatientOrgunit.size()!=0) $i18n.getString( "hierachy_orgunit" ) #end - $i18n.getString( "operations" ) + $i18n.getString( "operations" ) @@ -63,6 +65,9 @@ $i18n.getString( 'data_entry' ) + + $i18n.getString( 'view_patient_chart' ) + $i18n.getString( 'show_details' ) @@ -98,5 +103,11 @@ - + +
+ + + === added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientChartList.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientChartList.vm 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientChartList.vm 2011-09-06 02:47:21 +0000 @@ -0,0 +1,23 @@ +

$i18n.getString( "patient_chart_management" )

+ + + + + + + + + + #foreach( $patientChart in $patientCharts ) + + + + + #end + + +
$i18n.getString( "name" )$i18n.getString( "operations" )
+ $patientChart.title + + $i18n.getString( 'generate_patient_chart' ) +
=== added directory 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientchart' === added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientchart/AddPatientChartAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientchart/AddPatientChartAction.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/patientchart/AddPatientChartAction.java 2011-09-06 02:47:21 +0000 @@ -0,0 +1,154 @@ +/* + * 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.patientchart; + +import org.hisp.dhis.dataelement.DataElement; +import org.hisp.dhis.dataelement.DataElementService; +import org.hisp.dhis.patientchart.PatientChart; +import org.hisp.dhis.patientchart.PatientChartService; +import org.hisp.dhis.program.Program; +import org.hisp.dhis.program.ProgramService; + +import com.opensymphony.xwork2.Action; + +/** + * @author Chau Thu Tran + * @version $ AddPatientChartAction.java Sep 5, 2011 9:11:29 AM $ + * + */ +public class AddPatientChartAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private PatientChartService patientChartService; + + public void setPatientChartService( PatientChartService patientChartService ) + { + this.patientChartService = patientChartService; + } + + private ProgramService programService; + + public void setProgramService( ProgramService programService ) + { + this.programService = programService; + } + + private DataElementService dataElementService; + + public void setDataElementService( DataElementService dataElementService ) + { + this.dataElementService = dataElementService; + } + + // ------------------------------------------------------------------------- + // Input + // ------------------------------------------------------------------------- + + private String title; + + private String type; + + private String size; + + private boolean regression; + + private Integer programId; + + private Integer dataElementId; + + // ------------------------------------------------------------------------- + // Input + // ------------------------------------------------------------------------- + + public void setTitle( String title ) + { + this.title = title; + } + + public void setType( String type ) + { + this.type = type; + } + + public void setSize( String size ) + { + this.size = size; + } + + public void setRegression( boolean regression ) + { + this.regression = regression; + } + + public void setProgramId( Integer programId ) + { + this.programId = programId; + } + + public Integer getProgramId() + { + return programId; + } + + public void setDataElementId( Integer dataElementId ) + { + this.dataElementId = dataElementId; + } + + + // ------------------------------------------------------------------------- + // Implementation Action + // ------------------------------------------------------------------------- + + @Override + public String execute() + throws Exception + { + PatientChart patientChart = new PatientChart(); + + patientChart.setTitle( title ); + patientChart.setType( type ); + patientChart.setSize( size ); + patientChart.setRegression( regression ); + + DataElement dataElement = dataElementService.getDataElement( dataElementId ); + patientChart.setDataElement( dataElement ); + + Program program = programService.getProgram( programId ); + patientChart.setProgram( program ); + + patientChartService.savePientChart( patientChart ); + + return SUCCESS; + } + +} === added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientchart/DeletePatientChartAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientchart/DeletePatientChartAction.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/patientchart/DeletePatientChartAction.java 2011-09-06 02:47:21 +0000 @@ -0,0 +1,84 @@ +/* + * 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.patientchart; + +import org.hisp.dhis.patientchart.PatientChart; +import org.hisp.dhis.patientchart.PatientChartService; + +import com.opensymphony.xwork2.Action; + +/** + * @author Chau Thu Tran + * @version $ DeletePatientChartAction.java Sep 5, 2011 9:14:20 AM $ + * + */ +public class DeletePatientChartAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private PatientChartService patientChartService; + + public void setPatientChartService( PatientChartService patientChartService ) + { + this.patientChartService = patientChartService; + } + + // ------------------------------------------------------------------------- + // Input + // ------------------------------------------------------------------------- + + private Integer id; + + // ------------------------------------------------------------------------- + // Input + // ------------------------------------------------------------------------- + + public void setId( Integer id ) + { + this.id = id; + } + + // ------------------------------------------------------------------------- + // Implementation Action + // ------------------------------------------------------------------------- + + @Override + public String execute() + throws Exception + { + PatientChart patientChart = patientChartService.getPatientChart( id ); + + patientChartService.deletePatientChart( patientChart ); + + return SUCCESS; + } + +} === added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientchart/GetPatientChartAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientchart/GetPatientChartAction.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/patientchart/GetPatientChartAction.java 2011-09-06 02:47:21 +0000 @@ -0,0 +1,124 @@ +/* + * 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.patientchart; + +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; + +import org.hisp.dhis.dataelement.DataElement; +import org.hisp.dhis.patientchart.PatientChart; +import org.hisp.dhis.patientchart.PatientChartService; +import org.hisp.dhis.program.Program; +import org.hisp.dhis.program.ProgramStage; +import org.hisp.dhis.program.ProgramStageDataElementService; +import org.hisp.dhis.system.filter.AggregatableDataElementFilter; +import org.hisp.dhis.system.util.FilterUtils; + +import com.opensymphony.xwork2.Action; + +/** + * @author Chau Thu Tran + * @version $ DeletePatientChartAction.java Sep 5, 2011 9:18:20 AM $ + * + */ +public class GetPatientChartAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private PatientChartService patientChartService; + + public void setPatientChartService( PatientChartService patientChartService ) + { + this.patientChartService = patientChartService; + } + + private ProgramStageDataElementService programStageDataElementService; + + public void setProgramStageDataElementService( ProgramStageDataElementService programStageDataElementService ) + { + this.programStageDataElementService = programStageDataElementService; + } + + // ------------------------------------------------------------------------- + // Input/Output + // ------------------------------------------------------------------------- + + private Integer id; + + private PatientChart patientChart; + + private Collection dataElements = new HashSet(); + + // ------------------------------------------------------------------------- + // Input + // ------------------------------------------------------------------------- + + public void setId( Integer id ) + { + this.id = id; + } + + public PatientChart getPatientChart() + { + return patientChart; + } + + public Collection getDataElements() + { + return dataElements; + } + + // ------------------------------------------------------------------------- + // Implementation Action + // ------------------------------------------------------------------------- + + @Override + public String execute() + throws Exception + { + patientChart = patientChartService.getPatientChart( id ); + + Program program = patientChart.getProgram(); + + Set programStages = program.getProgramStages(); + + for ( ProgramStage programStage : programStages ) + { + dataElements.addAll( programStageDataElementService.getListDataElement( programStage ) ); + } + + FilterUtils.filter( dataElements, new AggregatableDataElementFilter() ); + + return SUCCESS; + } + +} === added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientchart/GetPatientChartListAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientchart/GetPatientChartListAction.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/patientchart/GetPatientChartListAction.java 2011-09-06 02:47:21 +0000 @@ -0,0 +1,107 @@ +/* + * 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.patientchart; + +import java.util.ArrayList; +import java.util.Collection; + +import org.hisp.dhis.patientchart.PatientChart; +import org.hisp.dhis.patientchart.PatientChartService; +import org.hisp.dhis.program.Program; +import org.hisp.dhis.program.ProgramService; + +import com.opensymphony.xwork2.Action; + +/** + * @author Chau Thu Tran + * @version $ GetPatientChartListAction.java Sep 5, 2011 9:08:23 AM $ + * + */ +public class GetPatientChartListAction + implements Action +{ + + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private PatientChartService patientChartService; + + public void setPatientChartService( PatientChartService patientChartService ) + { + this.patientChartService = patientChartService; + } + + private ProgramService programService; + + public void setProgramService( ProgramService programService ) + { + this.programService = programService; + } + + // ------------------------------------------------------------------------- + // Input/output + // ------------------------------------------------------------------------- + + private Integer programId; + + public void setProgramId( Integer programId ) + { + this.programId = programId; + } + + public Integer getProgramId() + { + return programId; + } + + private Collection patientCharts; + + public Collection getPatientCharts() + { + return patientCharts; + } + + // ------------------------------------------------------------------------- + // Implementation Action + // ------------------------------------------------------------------------- + + @Override + public String execute() + throws Exception + { + Program program = programService.getProgram( programId ); + Collection programs = new ArrayList(); + programs.add( program ); + + patientCharts = patientChartService.getPatientCharts( programs ); + + return SUCCESS; + } + +} === added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientchart/ShowAddPatientChartFormAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientchart/ShowAddPatientChartFormAction.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/patientchart/ShowAddPatientChartFormAction.java 2011-09-06 02:47:21 +0000 @@ -0,0 +1,114 @@ +/* + * 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.patientchart; + +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; + +import org.hisp.dhis.dataelement.DataElement; +import org.hisp.dhis.program.Program; +import org.hisp.dhis.program.ProgramService; +import org.hisp.dhis.program.ProgramStage; +import org.hisp.dhis.program.ProgramStageDataElementService; +import org.hisp.dhis.system.filter.AggregatableDataElementFilter; +import org.hisp.dhis.system.util.FilterUtils; + +import com.opensymphony.xwork2.Action; + +/** + * @author Chau Thu Tran + * @version $ ShowAddPatientChartFormAction.java Sep 5, 2011 9:24:10 AM $ + * + */ +public class ShowAddPatientChartFormAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private ProgramService programService; + + public void setProgramService( ProgramService programService ) + { + this.programService = programService; + } + + private ProgramStageDataElementService programStageDataElementService; + + public void setProgramStageDataElementService( ProgramStageDataElementService programStageDataElementService ) + { + this.programStageDataElementService = programStageDataElementService; + } + + // ------------------------------------------------------------------------- + // Input/Output + // ------------------------------------------------------------------------- + + private Integer programId; + + public void setProgramId( Integer programId ) + { + this.programId = programId; + } + + public Integer getProgramId() + { + return programId; + } + + private Collection dataElements = new HashSet(); + + public Collection getDataElements() + { + return dataElements; + } + + // ------------------------------------------------------------------------- + // Implementation Action + // ------------------------------------------------------------------------- + + @Override + public String execute() + throws Exception + { + Program program = programService.getProgram( programId ); + + Set programStages = program.getProgramStages(); + + for( ProgramStage programStage : programStages) + { + dataElements.addAll( programStageDataElementService.getListDataElement( programStage ) ); + } + + FilterUtils.filter( dataElements, new AggregatableDataElementFilter() ); + + return SUCCESS; + } +} === added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientchart/UpdatePatientChartAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientchart/UpdatePatientChartAction.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/patientchart/UpdatePatientChartAction.java 2011-09-06 02:47:21 +0000 @@ -0,0 +1,145 @@ +/* + * 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.patientchart; + +import org.hisp.dhis.dataelement.DataElement; +import org.hisp.dhis.dataelement.DataElementService; +import org.hisp.dhis.patientchart.PatientChart; +import org.hisp.dhis.patientchart.PatientChartService; + +import com.opensymphony.xwork2.Action; + +/** + * @author Chau Thu Tran + * @version $ UpdatePatientChartAction.java Sep 5, 2011 9:13:29 AM $ + * + */ +public class UpdatePatientChartAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private PatientChartService patientChartService; + + public void setPatientChartService( PatientChartService patientChartService ) + { + this.patientChartService = patientChartService; + } + + private DataElementService dataElementService; + + public void setDataElementService( DataElementService dataElementService ) + { + this.dataElementService = dataElementService; + } + + // ------------------------------------------------------------------------- + // Input + // ------------------------------------------------------------------------- + + private Integer id; + + private String title; + + private String type; + + private String size; + + private boolean regression; + + private Integer programId; + + private Integer dataElementId; + + // ------------------------------------------------------------------------- + // Input + // ------------------------------------------------------------------------- + + public void setTitle( String title ) + { + this.title = title; + } + + public void setType( String type ) + { + this.type = type; + } + + public void setSize( String size ) + { + this.size = size; + } + + public void setRegression( boolean regression ) + { + this.regression = regression; + } + + public Integer getProgramId() + { + return programId; + } + + public void setDataElementId( Integer dataElementId ) + { + this.dataElementId = dataElementId; + } + + public void setId( Integer id ) + { + this.id = id; + } + + // ------------------------------------------------------------------------- + // Implementation Action + // ------------------------------------------------------------------------- + + @Override + public String execute() + throws Exception + { + PatientChart patientChart = patientChartService.getPatientChart( id ); + + patientChart.setTitle( title ); + patientChart.setType( type ); + patientChart.setSize( size ); + patientChart.setRegression( regression ); + + DataElement dataElement = dataElementService.getDataElement( dataElementId ); + patientChart.setDataElement( dataElement ); + + programId = patientChart.getProgram().getId(); + + patientChartService.updatePatientChart( patientChart ); + + return SUCCESS; + } + +} === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/relationship/SaveRelationshipAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/relationship/SaveRelationshipAction.java 2011-05-13 09:11:13 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/relationship/SaveRelationshipAction.java 2011-09-06 02:47:21 +0000 @@ -29,7 +29,6 @@ import org.hisp.dhis.i18n.I18n; import org.hisp.dhis.patient.Patient; import org.hisp.dhis.patient.PatientService; -import org.hisp.dhis.patient.state.SelectedStateManager; import org.hisp.dhis.relationship.Relationship; import org.hisp.dhis.relationship.RelationshipService; import org.hisp.dhis.relationship.RelationshipType; @@ -55,13 +54,6 @@ this.patientService = patientService; } - private SelectedStateManager selectedStateManager; - - public void setSelectedStateManager( SelectedStateManager selectedStateManager ) - { - this.selectedStateManager = selectedStateManager; - } - private RelationshipTypeService relationshipTypeService; public void setRelationshipTypeService( RelationshipTypeService relationshipTypeService ) === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/relationship/ShowRelationshipListAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/relationship/ShowRelationshipListAction.java 2011-09-01 09:17:33 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/relationship/ShowRelationshipListAction.java 2011-09-06 02:47:21 +0000 @@ -46,8 +46,6 @@ public class ShowRelationshipListAction implements Action { - private static final String RELATIONSHIP_LIST = "relationshiplist"; - // ------------------------------------------------------------------------- // Dependencies // ------------------------------------------------------------------------- === 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-09-02 10:40:22 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml 2011-09-06 02:47:21 +0000 @@ -98,7 +98,7 @@ - + - - - @@ -653,7 +650,7 @@ - + - + - +
- + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file === 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-09-02 10:40:22 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2011-09-06 02:47:21 +0000 @@ -483,4 +483,22 @@ search_patients_by_attributes = Search beneficiaries by attributes delete_program_data_entry_confirm = Do you want to delete program data entry ? F = F -M = M \ No newline at end of file +M = M +patient_chart_management = Patient Chart Management +add_patient_chart = Add Patient Chart +chart_type = Chart type +chart_size = Chart size +save = Save +title = Title +include_regression_line = Include regression line +must_select_one_dataelement = Please select one dataelement +value_x_dataelements = Value (X) - Data elements +bar_chart= Bar chart +bar3d_chart= Bar 3D chart +line_chart= Line chart +line3d_chart= Line 3D chart +chart_size= Chart size +normal= Normal +wide= Wide +tall= Tall +patient_chart_details = Patient chart details \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml 2011-09-02 10:40:22 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml 2011-09-06 02:47:21 +0000 @@ -4,10 +4,9 @@ "http://struts.apache.org/dtds/struts-2.0.dtd"> - + - + /main.vm @@ -117,10 +116,11 @@ - /dhis-web-maintenance-patient/responseRelationshipPatients.vm + /dhis-web-maintenance-patient/responseRelationshipPatients.vm + F_RELATIONSHIP_ADD - + @@ -267,10 +267,11 @@ /dhis-web-commons/ajax/jsonResponseInput.vm F_PATIENTATTRIBUTE_DELETE - + - + /main.vm /dhis-web-maintenance-patient/selectPatient.vm @@ -284,7 +285,7 @@ ,javascript/relationshipPatient.js - + @@ -292,7 +293,7 @@ /dhis-web-commons/ajax/jsonResponseInput.vm - + @@ -323,7 +324,7 @@ /content.vm /dhis-web-maintenance-patient/detailsPatient.vm - + @@ -362,7 +363,8 @@ - /dhis-web-commons/ajax/jsonResponseSuccess.vm + + /dhis-web-commons/ajax/jsonResponseSuccess.vm F_PATIENT_UPDATE @@ -383,7 +385,8 @@ class="org.hisp.dhis.patient.action.patient.ShowAddRepresentativeAction"> /content.vm /dhis-web-maintenance-patient/underAgeForm.vm - javascript/underage.js, ../dhis-web-commons/javascripts/date.js + javascript/underage.js, + ../dhis-web-commons/javascripts/date.js style/basic.css @@ -404,7 +407,7 @@ class="org.hisp.dhis.patient.action.patient.GetPatientsByNameAction"> /content.vm /dhis-web-maintenance-patient/resultSearchPatients.vm - ../dhis-web-commons/paging/paging.css + ../dhis-web-commons/paging/paging.css /dhis-web-maintenance-patient/programUnenrollmentSelectForm.vm F_PATIENT_UPDATE - + @@ -644,7 +647,8 @@ - program.action + program.action + F_PROGRAM_UPDATE @@ -679,7 +683,8 @@ - programStage.action?id=${id} + programStage.action?id=${id} + F_PROGRAMSTAGE_ADD @@ -694,7 +699,8 @@ - programStage.action?id=${programId} + + programStage.action?id=${programId} F_PROGRAMSTAGE_UPDATE @@ -728,7 +734,8 @@ - programStage.action?id=${id} + programStage.action?id=${id} + @@ -805,7 +812,8 @@ - patientAttributeGroup.action + patientAttributeGroup.action + F_PATIENTATTRIBUTE_ADD @@ -845,7 +853,7 @@ /dhis-web-commons/ajax/jsonResponseInput.vm plainTextError - + /main.vm @@ -855,12 +863,13 @@ style/basic.css F_PATIENTATTRIBUTE_ADD - + - patientAttributeGroup.action + patientAttributeGroup.action + - + @@ -1020,7 +1029,7 @@ /dhis-web-commons/ajax/jsonResponseInput.vm plainTextError - + javascript/programValidation.js F_PROGRAM_VALIDATION - + /main.vm @@ -1143,7 +1152,7 @@ javascript/programValidation.js F_PROGRAM_VALIDATION - + /main.vm @@ -1207,7 +1216,7 @@ /dhis-web-commons/ajax/xmlResponseError.vm - + /main.vm @@ -1219,5 +1228,57 @@ + + + + /main.vm + /dhis-web-maintenance-patient/patientChartList.vm + /dhis-web-maintenance-patient/patientAndProgramMenu.vm + javascript/patientChart.js + + + + /main.vm + /dhis-web-maintenance-patient/addPatientChartForm.vm + /dhis-web-maintenance-patient/patientAndProgramMenu.vm + + + + + patientChartList.action?programId=${programId} + F_PROGRAM_ADD + + + + /main.vm + /dhis-web-maintenance-patient/updatePatientChartForm.vm + /dhis-web-maintenance-patient/patientAndProgramMenu.vm + + + + + patientChartList.action?programId=${programId} + F_PROGRAM_ADD + + + + + /dhis-web-commons/ajax/jsonResponseSuccess.vm + F_PROGRAM_ADD + + + + + /dhis-web-maintenance-patient/responsePatientChart.vm + F_PROGRAM_ADD + + === added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientChartForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientChartForm.vm 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientChartForm.vm 2011-09-06 02:47:21 +0000 @@ -0,0 +1,87 @@ + + +

$i18n.getString( "add_patient_chart" )

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
$i18n.getString( "patient_chart_details" )
+ +
+ +
$i18n.getString( "value_x_dataelements" ) * + +
+ + + + + + +
+ + +
+ +
+ + === added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientChart.js' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientChart.js 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientChart.js 2011-09-06 02:47:21 +0000 @@ -0,0 +1,24 @@ + +function showPatientChartDetails( patientChartId ) +{ + jQuery.postJSON( "getPatientChart.action", { + id:patientChartId + }, function(json){ + setInnerHTML( 'idField', json.id ); + setInnerHTML( 'titleField', json.title ); + setInnerHTML( 'typeField', json.type ); + setInnerHTML( 'sizeField', json.size ); + setInnerHTML( 'regressionField', json.regression ); + setInnerHTML( 'dataElementField', json.dataElement ); + showDetails(); + }); +} + +// ----------------------------------------------------------------------------- +// Remove Patient Identifier Type +// ----------------------------------------------------------------------------- + +function removePatientChart( patientChartId, name ) +{ + removeItem( patientChartId, name, i18n_confirm_delete, 'removePatientChart.action' ); +} \ No newline at end of file === added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientChartList.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientChartList.vm 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientChartList.vm 2011-09-06 02:47:21 +0000 @@ -0,0 +1,62 @@ +

$i18n.getString( "patient_chart_management" )

+ + + + + + + + + +
+ + + + + + + + + + + + #foreach( $patientChart in $patientCharts ) + + + + + + + + #end + + +
$i18n.getString( "name" )$i18n.getString( "operations" )
$encoder.htmlEncode( $patientChart.title ) + $i18n.getString( 'edit' ) + $i18n.getString( 'remove' ) + $i18n.getString( 'show_details' ) +
+
+ + + +
+ + === 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-07-28 02:46:09 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.vm 2011-09-06 02:47:21 +0000 @@ -9,7 +9,7 @@ - + @@ -27,6 +27,7 @@ $i18n.getString( 'define_program_validation' )$i18n.getString( 'edit' )$i18n.getString( 'view_stage_management' ) + $i18n.getString( 'remove' )$i18n.getString( 'remove' )$i18n.getString( 'show_details' ) === added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/responsePatientChart.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/responsePatientChart.vm 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/responsePatientChart.vm 2011-09-06 02:47:21 +0000 @@ -0,0 +1,8 @@ +{ + "id":"$patientChart.id", + "title":"$!encoder.jsEncode( ${patientChart.title} )", + "type": "$!encoder.jsEncode( ${patientChart.type} )", + "size": "$patientChart.size", + "regression": "$patientChart.regression", + "dataElement": "$!encoder.jsEncode( ${patientChart.dataElement.name} )" +} \ No newline at end of file === added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientChartForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientChartForm.vm 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientChartForm.vm 2011-09-06 02:47:21 +0000 @@ -0,0 +1,87 @@ + + +

$i18n.getString( "add_patient_chart" )

+ + + + +
$i18n.getString( "name" )
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
$i18n.getString( "patient_chart_details" )
+ +
+ +
$i18n.getString( "value_x_dataelements" ) * + +
+ + + + + + +
+ + +
+ + + +