=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java' --- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java 2013-03-15 13:36:01 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java 2013-03-20 13:45:53 +0000 @@ -675,7 +675,7 @@ sql = getAggregateReportSQL8( programStage, orgunitIds, facilityLB, filterSQL, deGroupBy, periods .iterator().next(), aggregateType, limit, useCompletedEvents, format ); } - + if ( !sql.isEmpty() ) { SqlRowSet rowSet = jdbcTemplate.queryForRowSet( sql ); @@ -685,11 +685,11 @@ || position == PatientAggregateReport.POSITION_ROW_DATA_COLUMN_ORGUNIT || (position == PatientAggregateReport.POSITION_ROW_DATA_COLUMN_PERIOD && deGroupBy == null) ) { - pivotTable( grid, rowSet, i18n ); + pivotTable( grid, rowSet, i18n, format ); } else { - fillDataInGrid( grid, rowSet, i18n ); + fillDataInGrid( grid, rowSet, i18n, format ); } } @@ -1021,7 +1021,7 @@ sql += where; // filters sql = sql.substring( 0, sql.length() - 1 ) + " "; // Remove last comma sql += (min != null && max != null) ? statementBuilder.limitRecord( min, max ) : ""; - + return sql; } @@ -1861,10 +1861,10 @@ String operator = (filterValue.substring( 0, index )); String value = filterValue.substring( index + 1, filterValue.length() ); filter += "AND (SELECT "; - if( dataElement.getType().equals( DataElement.VALUE_TYPE_INT ) ) + if ( dataElement.getType().equals( DataElement.VALUE_TYPE_INT ) ) { - filter += "cast(value as " + statementBuilder.getDoubleColumnType()+ ") "; - + filter += "cast(value as " + statementBuilder.getDoubleColumnType() + ") "; + } else { @@ -1988,7 +1988,7 @@ return orgunitIds; } - private void fillDataInGrid( Grid grid, SqlRowSet rs, I18n i18n ) + private void fillDataInGrid( Grid grid, SqlRowSet rs, I18n i18n, I18nFormat format ) { int cols = rs.getMetaData().getColumnCount(); int dataCols = 0; @@ -2028,29 +2028,14 @@ double value = rs.getDouble( i ); sumRow[i] += value; total += value; - - if ( value == (int) value ) - { - grid.addValue( (int) value ); - } - else - { - grid.addValue( value ); - } + grid.addValue( format.formatValue( value ) ); } } // total if ( dataCols > 1 ) { - if ( total == (int) total ) - { - grid.addValue( (int) total ); - } - else - { - grid.addValue( total ); - } + grid.addValue( format.formatValue( total )); } } @@ -2062,31 +2047,18 @@ int total = 0; for ( int i = cols - dataCols + 1; i <= cols; i++ ) { - if ( sumRow[i] == (int) sumRow[i] ) - { - grid.addValue( (int) sumRow[i] ); - } - else - { - grid.addValue( sumRow[i] ); - } + grid.addValue( format.formatValue(sumRow[i] )); + total += sumRow[i]; } if ( cols > cols - dataCols + 1 ) { - if ( total == (int) total ) - { - grid.addValue( (int) total ); - } - else - { - grid.addValue( total ); - } + grid.addValue( format.formatValue( total )); } } } - private void pivotTable( Grid grid, SqlRowSet rowSet, I18n i18n ) + private void pivotTable( Grid grid, SqlRowSet rowSet, I18n i18n, I18nFormat format ) { try { @@ -2120,14 +2092,7 @@ // Add total value of the column if ( cols > 2 ) { - if ( total == (int) total ) - { - column.add( (int) total ); - } - else - { - column.add( total ); - } + grid.addValue( format.formatValue( total )); } columnValues.put( index, column ); @@ -2176,26 +2141,13 @@ total += (Long) columnValues.get( i ).get( j ); } } - if ( total == (int) total ) - { - column.add( (int) total ); - } - else - { - column.add( total ); - } + column.add( format.formatValue( total ) ); + allTotal += total; } if ( cols > 2 ) { - if ( allTotal == (int) allTotal ) - { - column.add( (int) allTotal ); - } - else - { - column.add( allTotal ); - } + column.add(format.formatValue(allTotal )); } grid.addColumn( column ); } === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ValidatePatientProgramEnrollmentAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ValidatePatientProgramEnrollmentAction.java 2012-12-27 05:20:24 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ValidatePatientProgramEnrollmentAction.java 2013-03-20 13:45:53 +0000 @@ -28,7 +28,6 @@ package org.hisp.dhis.caseentry.action.patient; import org.hisp.dhis.i18n.I18n; -import org.hisp.dhis.i18n.I18nFormat; import org.hisp.dhis.patient.Patient; import org.hisp.dhis.patient.PatientService; import org.hisp.dhis.program.Program; @@ -62,13 +61,6 @@ this.programService = programService; } - private I18nFormat format; - - public void setFormat( I18nFormat format ) - { - this.format = format; - } - // ------------------------------------------------------------------------- // Input/Output // ------------------------------------------------------------------------- @@ -116,29 +108,10 @@ if ( criteria != null ) { - message = i18n.getString( "patient_could_not_be_enrolled_due_to_following_enrollment_criteria" ) + ": " + i18n.getString( criteria.getProperty() ); - - switch ( criteria.getOperator() ) - { - case ValidationCriteria.OPERATOR_EQUAL_TO: - message += " = "; - break; - case ValidationCriteria.OPERATOR_GREATER_THAN: - message += " > "; - break; - default: - message += " < "; - break; - } + message = i18n.getString( "patient_could_not_be_enrolled_due_to_following_enrollment_criteria" ) + ": "; - if ( criteria.getProperty() == "birthDate" ) - { - message += " " + format.formatValue( criteria.getValue() ); - } - else - { - message += " " + criteria.getValue().toString(); - } + message += (criteria.getDescription() != null && !criteria.getDescription().isEmpty()) ? criteria + .getDescription() : criteria.getDisplayName(); return INPUT; } === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleDataEntryForm.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleDataEntryForm.vm 2013-02-18 09:50:45 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleDataEntryForm.vm 2013-03-20 13:45:53 +0000 @@ -1,6 +1,150 @@ +#set( $sections = $programStage.programStageSections ) +#set( $program = $programStage.program ) + #if( $customDataEntryFormCode ) $customDataEntryFormCode +#elseif( $sections && $sections.size() > 0 ) + + + $programStage.program.displayName + + + #set($program = $programStage.program) + #parse( "/dhis-web-caseentry/identifierAndAttributeForm.vm" ) + + + +
+ + + +#foreach( $section in $sections ) + + + + + + + +
+

$encoder.htmlEncode( $section.displayName )

+
+
+ + + + + #if( $programStage.program.displayProvidedOtherFacility=='true') + + #end + + + + + + + #if( $programStage.program.displayProvidedOtherFacility=='true') + + #end + + + #set( $dataElementRowCount = 0 ) + #set( $mark = true ) + #set( $tabIndex = 1 ) + #foreach( $programStageDataElement in $section.programStageDataElements ) + #set( $dataElementRowCount = $dataElementRowCount + 1 ) + #set( $mark = !$mark ) + #set( $patientDataValue = false ) + #set( $key = $programStageDataElement.dataElement.id ) + #set( $patientDataValue = $patientDataValueMap.get( $key ) ) + + ##data element name + + + ##entry + + + + + #set( $tabIndex = $tabIndex + 1 ) + #end +
+ + $i18n.getString( "value" )$i18n.getString( "provided_elsewhere" )
+ ${encoder.htmlEncode( $programStageDataElement.dataElement.getFormNameFallback() )} + #if ( $programStageDataElement.compulsory ) + * + #end + + ##type + + #set( $id = $programStageDataElement.programStage.id + '-' + $programStageDataElement.dataElement.id + '-val' ) + #if( $!programStageDataElement.dataElement.optionSet ) + #set($hasOptionSet = 'true') + #else + #set($hasOptionSet = 'false') + #end + + #set($type=$programStageDataElement.dataElement.getDetailedNumberType()) + #set($validate = '') + #if( $type=='number' ) + #set($validate="number:true") + #elseif( $type=='positiveNumber' ) + #set($validate="positive_integer:true") + #elseif( $type=='negativeNumber' ) + #set($validate="negative_integer:true") + #elseif( $type=='int' ) + #set($validate="integer:true") + #end + + #if($programStageDataElement.compulsory=='true') + #if($validate != '') + #set($validate=$validate + ",") + #end + #set($validate=$validate + "required:true") + #end + + #if( $programStageDataElement.dataElement.textType == "longText" ) + + #elseif( $programStageDataElement.dataElement.type == "bool" ) + + #elseif( $programStageDataElement.dataElement.type == "trueOnly" ) + + #elseif( $programStageDataElement.dataElement.type == "date" ) + + + #elseif($hasOptionSet=='true') + + #elseif($programStageDataElement.dataElement.type=='username') + + #else + + #end + + #if( $programStage.program.displayProvidedOtherFacility=='true' ) + #set( $id = $programStageDataElement.programStage.id + '_' + $programStageDataElement.dataElement.id + '_facility' ) + #if( $programStageDataElement.allowProvidedElsewhere == 'true') + + #else + + #end + #end +
+
+
+#end + + +
#else + + $programStage.program.displayName @@ -31,7 +175,7 @@ ##entry - #set( $id = "DE_" + $programStageDataElement.programStage.id + '-' + $programStageDataElement.dataElement.id + '-val' ) + #set( $id = $programStageDataElement.programStage.id + '-' + $programStageDataElement.dataElement.id + '-val' ) #if( $!programStageDataElement.dataElement.optionSet ) #set($hasOptionSet = 'true') #else @@ -68,17 +212,19 @@ #elseif( $programStageDataElement.dataElement.type == "trueOnly" ) #elseif( $programStageDataElement.dataElement.type == "date" ) - + #elseif($hasOptionSet=='true') + #elseif($programStageDataElement.dataElement.type=='username') + #else #end #if( $programStage.program.displayProvidedOtherFacility=='true' ) - #set( $id = "DE_" + $programStageDataElement.programStage.id + '_' + $programStageDataElement.dataElement.id + '_facility' ) + #set( $id = $programStageDataElement.programStage.id + '_' + $programStageDataElement.dataElement.id + '_facility' ) #if( $programStageDataElement.allowProvidedElsewhere == 'true') #else === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css 2013-03-18 07:22:55 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css 2013-03-20 13:45:53 +0000 @@ -41,7 +41,7 @@ input.option { - width: 235px; + width: 240px; } select @@ -192,10 +192,9 @@ input.optionset[type="text"] { - width:230px; + width:240px; } - input.datefield[type="text"] { width:240px; === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programUserrole.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programUserrole.vm 2013-02-20 15:10:33 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programUserrole.vm 2013-03-20 13:45:53 +0000 @@ -2,7 +2,7 @@

$program.displayName

-
+