=== removed directory 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientchart' === removed 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 2011-09-06 02:47:21 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientchart/PatientChart.java 1970-01-01 00:00:00 +0000 @@ -1,211 +0,0 @@ -/* - * 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; - } -} === removed 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 2011-10-03 09:40:38 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientchart/PatientChartService.java 1970-01-01 00:00:00 +0000 @@ -1,60 +0,0 @@ -/* - * 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 ); - - PatientChart getPatientChartByTitle( String title ); - - Collection getPatientCharts( Collection programs ); - - Collection getAllPatientCharts(); - - JFreeChart getJFreeChart( int id, I18nFormat format ); -} === removed 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 2011-11-03 01:02:13 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientchart/PatientChartStore.java 1970-01-01 00:00:00 +0000 @@ -1,48 +0,0 @@ -/* - * 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.GenericNameableObjectStore; -import org.hisp.dhis.program.Program; - -/** - * @author Chau Thu Tran - * @version $ PatientChartStore.java Sep 5, 2011 8:06:43 AM $ - * - */ -public interface PatientChartStore - extends GenericNameableObjectStore -{ - String ID = PatientChartStore.class.getName(); - - Collection getPatientCharts( Collection programs ); - - PatientChart getByTitle( String title ); -} === modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java' --- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java 2012-03-22 14:17:16 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java 2012-03-23 05:58:50 +0000 @@ -79,7 +79,9 @@ executeSql( "ALTER TABLE patientdatavaluearchive DROP COLUMN providedbyanotherfacility" ); executeSql( "ALTER TABLE patientdatavaluearchive DROP COLUMN organisationunitid" ); - executeSql( "ALTER TABLE patientdatavaluearchive DROP COLUMN storedby" ); + executeSql( "ALTER TABLE patientdatavaluearchive DROP COLUMN storedby" ); + executeSql( "DROP TABLE patientchart" ); + executeSql( "DROP TABLE patientchart" ); } // ------------------------------------------------------------------------- === removed directory 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientchart' === removed 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 2012-02-01 09:10:08 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientchart/DefaultPatientChartService.java 1970-01-01 00:00:00 +0000 @@ -1,282 +0,0 @@ -/* - * 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 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.LineAndShapeRenderer; -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 PatientChart getPatientChartByTitle( String title ) - { - return patientChartStore.getByTitle( title ); - } - - @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 LineAndShapeRenderer lineRenderer = getLineRenderer(); - - // --------------------------------------------------------------------- - // Plot - // --------------------------------------------------------------------- - - CategoryPlot plot = null; - - CategoryDataset[] dataSets = getCategoryDataSet( patientChart ); - - if ( patientChart.isType( TYPE_BAR ) ) - { - plot = new CategoryPlot( dataSets[0], new CategoryAxis(), new NumberAxis(), barRenderer ); - } - else - { - plot = new CategoryPlot( dataSets[0], new CategoryAxis(), new NumberAxis(), lineRenderer ); - } - - 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 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 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 }; - } -} === removed directory 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientchart/hibernate' === removed 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 2011-10-03 09:40:38 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patientchart/hibernate/HibernatePatientChartStore.java 1970-01-01 00:00:00 +0000 @@ -1,63 +0,0 @@ -/* - * 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(); - } - - @Override - public PatientChart getByTitle( String title ) - { - return getObject( Restrictions.eq( "title", title ) ); - } -} === 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 2012-03-23 03:46:08 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml 2012-03-23 05:58:50 +0000 @@ -137,11 +137,6 @@ - - - - - - - - - - === removed directory 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientchart' === removed directory 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientchart/hibernate' === removed file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientchart/hibernate/patientchart.hbm.xml' --- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientchart/hibernate/patientchart.hbm.xml 2011-09-06 02:47:21 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patientchart/hibernate/patientchart.hbm.xml 1970-01-01 00:00:00 +0000 @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - === removed directory 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patientchart' === removed 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 2011-12-14 11:15:54 +0000 +++ 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 @@ -1,110 +0,0 @@ -/* - * 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; - } -} === removed 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 2011-09-06 02:47:21 +0000 +++ 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 @@ -1,98 +0,0 @@ -/* - * 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 2012-03-23 03:46:08 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2012-03-23 05:58:50 +0000 @@ -423,25 +423,6 @@ ref="org.hisp.dhis.program.ProgramStageInstanceService" /> - - - - - - - - - - - - - - - /content.vm - /dhis-web-caseentry/patientChartList.vm - javascript/patientChart.js - - - - - F_GENERATE_PATIENT_CHART - - #end - + # $i18n.getString( "full_name" ) @@ -60,7 +60,6 @@ #end $i18n.getString( 'data_entry' ) - $i18n.getString( 'view_patient_chart' ) $i18n.getString( "patient_details_and_history" ) @@ -86,10 +85,6 @@
-
- - -

$i18n.getString( "create_new_patient_chart" )

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$i18n.getString( "patient_chart_details" )
- -
- -
 
$i18n.getString( "value_x_dataelements" ) * - -
 
- - -
- -
- - - - - === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/addPatientChartForm.js' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/addPatientChartForm.js 2012-03-19 09:35:42 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/addPatientChartForm.js 1970-01-01 00:00:00 +0000 @@ -1,6 +0,0 @@ -jQuery(document).ready( function(){ - validation( 'addPatientChartForm', function( form ){ - form.submit(); - }); - checkValueIsExist( "title", "validatePatientChart.action"); -}); \ No newline at end of file === removed 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 2012-03-13 09:47:39 +0000 +++ 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 @@ -1,41 +0,0 @@ - -function showPatientChartDetails( patientChartId ) -{ - jQuery.getJSON( "getPatientChart.action", { - id:patientChartId - }, function( json ){ - setInnerHTML( 'titleField', json.title ); - - var typeMap = { - 'bar' : i18n_bar_chart, - 'bar3d' : i18n_bar3d_chart, - 'line' : i18n_line_chart, - 'line3d' : i18n_line3d_chart - }; - var type = json.type; - setInnerHTML( 'typeField', typeMap[type] ); - - var sizeMap = { - 'normal' : i18n_normal, - 'wide' : i18n_wide, - 'tall' : i18n_tall - }; - var size = json.size; - setInnerHTML( 'sizeField', sizeMap[size] ); - - var regression = ( json.regression == 'true') ? i18n_yes : i18n_no; - - setInnerHTML( 'regressionField', 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 === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updatePatientChartForm.js' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updatePatientChartForm.js 2012-03-19 09:35:42 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updatePatientChartForm.js 1970-01-01 00:00:00 +0000 @@ -1,7 +0,0 @@ -jQuery(document).ready( function(){ - validation( 'updatePatientChartForm', function( form ){ - form.submit(); - }); - - checkValueIsExist( "title", "validatePatientChart.action", {id:'$patientChart.id'}); -}); === removed 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 2012-02-15 07:24:07 +0000 +++ 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 @@ -1,74 +0,0 @@ -

$i18n.getString( "patient_chart_management" )

-

$program.name

- - - - - - - - - -
-
- -
- - - - - - - - - - - - #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 2012-03-05 04:22:57 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.vm 2012-03-23 05:58:50 +0000 @@ -29,7 +29,6 @@ #end $i18n.getString( 'edit' ) $i18n.getString( 'view_stage_management' ) - $i18n.getString( 'remove' ) $i18n.getString( 'remove' ) $i18n.getString( 'show_details' ) === removed 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 2011-09-06 02:47:21 +0000 +++ 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 @@ -1,8 +0,0 @@ -{ - "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 === removed 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 2012-03-19 09:35:42 +0000 +++ 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 @@ -1,77 +0,0 @@ - - -

$i18n.getString( "edit_patient_chart" )

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$i18n.getString( "patient_chart_details" )
- -
- -
 
$i18n.getString( "value_x_dataelements" ) * - -
 
- - -
- -
- - - -