=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java 2012-03-23 03:46:08 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java 2012-04-11 06:25:02 +0000 @@ -37,6 +37,8 @@ import org.hisp.dhis.i18n.I18nFormat; import org.hisp.dhis.organisationunit.OrganisationUnit; import org.hisp.dhis.patient.Patient; +import org.hisp.dhis.patient.PatientAttribute; +import org.hisp.dhis.patient.PatientIdentifierType; /** * @author Abyot Asalefew @@ -87,13 +89,13 @@ List getProgramStageInstances( Patient patient, Boolean completed ); - List searchProgramStageInstances( ProgramStage programStage, Map searchingKeys, Collection orgunitIds, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, int min, int max ); + List searchProgramStageInstances( ProgramStage programStage, Map searchingIdenKeys, Map searchingAttrKeys, Map searchingDEKeys, Collection orgunitIds, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, int min, int max ); - Grid getTabularReport( ProgramStage programStage, List dataElements, Map searchingKeys, Collection orgunitIds, int level, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, int min, int max, I18nFormat format, I18n i18n ); + Grid getTabularReport( ProgramStage programStage, List idens, List attributes, List dataElements, Map searchingIdenKeys, Map searchingAttrKeys, Map searchingDEKeys, Collection orgunitIds, int level, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, int min, int max, I18nFormat format, I18n i18n ); - Grid getTabularReport( ProgramStage programStage, List dataElements, Map searchingKeys, Collection orgunitIds, int level, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, I18nFormat format, I18n i18n ); + Grid getTabularReport( ProgramStage programStage, List idens, List attributes, List dataElements, Map searchingIdenKeys, Map searchingAttrKeys, Map searchingDEKeys, Collection orgunitIds, int level, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, I18nFormat format, I18n i18n ); - int countProgramStageInstances( ProgramStage programStage, Map searchingKeys, Collection orgunitIds, Date startDate, Date endDate ); + int countProgramStageInstances( ProgramStage programStage, Map searchingIdenKeys, Map searchingAttrKeys, Map searchingDEKeys, Collection orgunitIds, Date startDate, Date endDate ); List getProgramStageInstancesReport( ProgramInstance programInstance, I18nFormat format, I18n i18n ); } === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceStore.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceStore.java 2012-03-10 05:06:47 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceStore.java 2012-04-11 06:25:02 +0000 @@ -71,10 +71,10 @@ List get( ProgramStage programStage, OrganisationUnit orgunit, Date startDate, Date endDate, int min, int max ); - List get( ProgramStage programStage, Map searchingKeys, Collection orgunitIds, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, int min, int max ); + List get( ProgramStage programStage, Map searchingIdenKeys, Map searchingAttrKeys, Map searchingDEKeys, Collection orgunitIds, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, int min, int max ); - List get( ProgramStage programStage, Map searchingKeys, Collection orgunitIds, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc ); + List get( ProgramStage programStage, Map searchingIdenKeys, Map searchingAttrKeys, Map searchingDEKeys, Collection orgunitIds, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc ); - int count( ProgramStage programStage, Map searchingKeys, Collection orgunitIds, Date startDate, Date endDate ); + int count( ProgramStage programStage, Map searchingIdenKeys, Map searchingAttrKeys, Map searchingKeys, Collection orgunitIds, Date startDate, Date endDate ); } === modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java' --- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java 2012-04-10 10:10:21 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/DefaultProgramStageInstanceService.java 2012-04-11 06:25:02 +0000 @@ -42,6 +42,12 @@ import org.hisp.dhis.organisationunit.OrganisationUnit; import org.hisp.dhis.organisationunit.OrganisationUnitService; import org.hisp.dhis.patient.Patient; +import org.hisp.dhis.patient.PatientAttribute; +import org.hisp.dhis.patient.PatientIdentifier; +import org.hisp.dhis.patient.PatientIdentifierService; +import org.hisp.dhis.patient.PatientIdentifierType; +import org.hisp.dhis.patientattributevalue.PatientAttributeValue; +import org.hisp.dhis.patientattributevalue.PatientAttributeValueService; import org.hisp.dhis.patientdatavalue.PatientDataValue; import org.hisp.dhis.patientdatavalue.PatientDataValueService; import org.hisp.dhis.system.grid.ListGrid; @@ -80,6 +86,20 @@ this.organisationUnitService = organisationUnitService; } + private PatientIdentifierService identifierService; + + public void setIdentifierService( PatientIdentifierService identifierService ) + { + this.identifierService = identifierService; + } + + private PatientAttributeValueService patientAttributeValueService; + + public void setPatientAttributeValueService( PatientAttributeValueService patientAttributeValueService ) + { + this.patientAttributeValueService = patientAttributeValueService; + } + // ------------------------------------------------------------------------- // Implementation methods // ------------------------------------------------------------------------- @@ -195,48 +215,58 @@ } public List searchProgramStageInstances( ProgramStage programStage, - Map searchingKeys, Collection orgunitIds, Date startDate, Date endDate, + Map searchingIdenKeys, Map searchingAttrKeys, + Map searchingDEKeys, Collection orgunitIds, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, int min, int max ) { - return programStageInstanceStore.get( programStage, searchingKeys, orgunitIds, startDate, endDate, - orderByOrgunitAsc, orderByExecutionDateByAsc, min, max ); + return programStageInstanceStore.get( programStage, searchingIdenKeys, searchingAttrKeys, searchingDEKeys, + orgunitIds, startDate, endDate, orderByOrgunitAsc, orderByExecutionDateByAsc, min, max ); } public List searchProgramStageInstances( ProgramStage programStage, - Map searchingKeys, Collection orgunitIds, Date startDate, Date endDate, + Map searchingIdenKeys, Map searchingAttrKeys, + Map searchingDEKeys, Collection orgunitIds, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc ) { - return programStageInstanceStore.get( programStage, searchingKeys, orgunitIds, startDate, endDate, - orderByOrgunitAsc, orderByExecutionDateByAsc ); - } - - public Grid getTabularReport( ProgramStage programStage, List dataElements, - Map searchingKeys, Collection orgunitIds, int level, Date startDate, Date endDate, - boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, int min, int max, I18nFormat format, I18n i18n ) - { - List programStageInstances = searchProgramStageInstances( programStage, searchingKeys, - orgunitIds, startDate, endDate, orderByOrgunitAsc, orderByExecutionDateByAsc, min, max ); - - return createTabularGrid( level, programStage, programStageInstances, dataElements, startDate, endDate, format, - i18n ); - } - - public Grid getTabularReport( ProgramStage programStage, List dataElements, - Map searchingKeys, Collection orgunitIds, int level, Date startDate, Date endDate, - boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, I18nFormat format, I18n i18n ) - { - List programStageInstances = searchProgramStageInstances( programStage, searchingKeys, + return programStageInstanceStore.get( programStage, searchingIdenKeys, searchingAttrKeys, searchingDEKeys, orgunitIds, startDate, endDate, orderByOrgunitAsc, orderByExecutionDateByAsc ); - - return createTabularGrid( level, programStage, programStageInstances, dataElements, startDate, endDate, format, - i18n ); + } + + public Grid getTabularReport( ProgramStage programStage, List idens, + List attributes, List dataElements, Map searchingIdenKeys, + Map searchingAttrKeys, Map searchingDEKeys, Collection orgunitIds, + int level, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, int min, + int max, I18nFormat format, I18n i18n ) + { + List programStageInstances = searchProgramStageInstances( programStage, + searchingIdenKeys, searchingAttrKeys, searchingDEKeys, orgunitIds, startDate, endDate, orderByOrgunitAsc, + orderByExecutionDateByAsc, min, max ); + + return createTabularGrid( level, programStage, programStageInstances, idens, attributes, dataElements, + startDate, endDate, format, i18n ); + } + + public Grid getTabularReport( ProgramStage programStage, List idens, + List attributes, List dataElements, Map searchingIdenKeys, + Map searchingAttrKeys, Map searchingDEKeys, Collection orgunitIds, + int level, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, + I18nFormat format, I18n i18n ) + { + List programStageInstances = searchProgramStageInstances( programStage, + searchingIdenKeys, searchingAttrKeys, searchingDEKeys, orgunitIds, startDate, endDate, orderByOrgunitAsc, + orderByExecutionDateByAsc ); + + return createTabularGrid( level, programStage, programStageInstances, idens, attributes, dataElements, + startDate, endDate, format, i18n ); } @Override - public int countProgramStageInstances( ProgramStage programStage, Map searchingKeys, - Collection orgunitIds, Date startDate, Date endDate ) + public int countProgramStageInstances( ProgramStage programStage, Map searchingIdenKeys, + Map searchingAttrKeys, Map searchingDEKeys, Collection orgunitIds, + Date startDate, Date endDate ) { - return programStageInstanceStore.count( programStage, searchingKeys, orgunitIds, startDate, endDate ); + return programStageInstanceStore.count( programStage, searchingIdenKeys, searchingAttrKeys, searchingDEKeys, + orgunitIds, startDate, endDate ); } public List getProgramStageInstancesReport( ProgramInstance programInstance, I18nFormat format, I18n i18n ) @@ -311,17 +341,16 @@ // ------------------------------------------------------------------------- private Grid createTabularGrid( Integer level, ProgramStage programStage, - List programStageInstances, List dataElements, Date startDate, Date endDate, + List programStageInstances, List idens, + List attributes, List dataElements, Date startDate, Date endDate, I18nFormat format, I18n i18n ) { Grid grid = new ListGrid(); - if ( dataElements != null && dataElements.size() > 0 && programStageInstances.size() > 0 ) + if ( programStageInstances.size() > 0 ) { Program program = programStage.getProgram(); - Boolean anonymous = program.getAnonymous(); - // --------------------------------------------------------------------- // Create a grid // --------------------------------------------------------------------- @@ -337,26 +366,87 @@ grid.addHeader( new GridHeader( i18n.getString( "report_unit" ), false, true ) ); grid.addHeader( new GridHeader( i18n.getString( "report_date" ), false, true ) ); - for ( DataElement dataElement : dataElements ) - { - grid.addHeader( new GridHeader( dataElement.getName(), false, true ) ); - } - - if ( !anonymous ) - { - grid.addHeader( new GridHeader( "", true, false ) ); + if ( idens != null && idens.size() > 0 ) + { + for ( PatientIdentifierType identifierType : idens ) + { + grid.addHeader( new GridHeader( identifierType.getName(), false, true ) ); + } + } + + if ( attributes != null && attributes.size() > 0 ) + { + for ( PatientAttribute attribute : attributes ) + { + grid.addHeader( new GridHeader( attribute.getName(), false, true ) ); + } + } + + if ( dataElements != null && dataElements.size() > 0 ) + { + for ( DataElement dataElement : dataElements ) + { + grid.addHeader( new GridHeader( dataElement.getName(), false, true ) ); + } } // --------------------------------------------------------------------- - // Values + // Get patient-identifiers // --------------------------------------------------------------------- for ( ProgramStageInstance programStageInstance : programStageInstances ) { grid.addRow(); + + // ------------------------------------------------------------- + // Add enrollment information + // ------------------------------------------------------------- + grid.addValue( getHierarchyOrgunit( programStageInstance.getOrganisationUnit(), level ) ); grid.addValue( format.formatDate( programStageInstance.getExecutionDate() ) ); + // ------------------------------------------------------------- + // Add patient-identifiers + // ------------------------------------------------------------- + + for ( PatientIdentifierType identifierType : idens ) + { + Patient patient = programStageInstance.getProgramInstance().getPatient(); + + PatientIdentifier patientIdentifier = identifierService.getPatientIdentifier( identifierType, + patient ); + + if ( patientIdentifier != null ) + { + grid.addValue( i18n.getString( patientIdentifier.getIdentifier() ) ); + } + else + { + grid.addValue( "" ); + } + } + + // --------------------------------------------------------------------- + // Get patient-attribute-values + // --------------------------------------------------------------------- + + for ( PatientAttribute attribute : attributes ) + { + Patient patient = programStageInstance.getProgramInstance().getPatient(); + + PatientAttributeValue patientAttributeValue = patientAttributeValueService + .getPatientAttributeValue( patient, attribute ); + + if ( patientAttributeValue != null ) + { + grid.addValue( i18n.getString( patientAttributeValue.getValue() ) ); + } + else + { + grid.addValue( "" ); + } + } + for ( DataElement dataElement : dataElements ) { PatientDataValue patientDataValue = patientDataValueService.getPatientDataValue( @@ -378,21 +468,9 @@ grid.addValue( "" ); } } - - if ( !anonymous ) - { - ProgramInstance programInstance = programStageInstance.getProgramInstance(); - - if ( programInstance != null && programInstance.getPatient() != null ) - { - grid.addValue( programInstance.getPatient().getId() ); - } - else - { - grid.addValue( "" ); - } - } - } + + }// end for + } return grid; @@ -401,9 +479,9 @@ private String getHierarchyOrgunit( OrganisationUnit orgunit, int level ) { String hierarchyOrgunit = orgunit.getName(); - + orgunit = orgunit.getParent(); - + while ( orgunit != null && organisationUnitService.getLevelOfOrganisationUnit( orgunit.getId() ) >= level ) { hierarchyOrgunit = orgunit.getName() + " / " + hierarchyOrgunit; === 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 2012-03-28 12:29:54 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java 2012-04-11 06:25:02 +0000 @@ -188,14 +188,14 @@ } @SuppressWarnings( "unchecked" ) - public List get( ProgramStage programStage, Map searchingKeys, - Collection orgunitIds, Date startDate, Date endDate, boolean orderByOrgunitAsc, - boolean orderByExecutionDateByAsc, int min, int max ) + public List get( ProgramStage programStage, Map searchingIdenKeys, + Map searchingAttrKeys, Map searchingDEKeys, Collection orgunitIds, + Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, int min, int max ) { - if ( searchingKeys.keySet().size() > 0 ) + if ( searchingDEKeys.keySet().size() > 0 ) { - String sql = getBySearchingValues( false, programStage, searchingKeys, orgunitIds, startDate, endDate, - orderByOrgunitAsc, orderByExecutionDateByAsc ) + String sql = getTabularReportStatement( false, programStage, searchingIdenKeys, searchingAttrKeys, + searchingDEKeys, orgunitIds, startDate, endDate, orderByOrgunitAsc, orderByExecutionDateByAsc ) + statementBuilder.limitRecord( min, max ); List ids = executeSQL( sql ); @@ -206,6 +206,7 @@ { programStageInstances.add( get( id ) ); } + return programStageInstances; } @@ -235,14 +236,14 @@ } @SuppressWarnings( "unchecked" ) - public List get( ProgramStage programStage, Map searchingKeys, - Collection orgunitIds, Date startDate, Date endDate, boolean orderByOrgunitAsc, - boolean orderByExecutionDateByAsc ) + public List get( ProgramStage programStage, Map searchingIdenKeys, + Map searchingAttrKeys, Map searchingDEKeys, Collection orgunitIds, + Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc ) { - if ( searchingKeys.keySet().size() > 0 ) + if ( searchingDEKeys.keySet().size() > 0 ) { - String sql = getBySearchingValues( false, programStage, searchingKeys, orgunitIds, startDate, endDate, - orderByOrgunitAsc, orderByExecutionDateByAsc ); + String sql = getTabularReportStatement( false, programStage, searchingIdenKeys, searchingAttrKeys, + searchingDEKeys, orgunitIds, startDate, endDate, orderByOrgunitAsc, orderByExecutionDateByAsc ); List ids = executeSQL( sql ); @@ -257,8 +258,7 @@ } Criteria criteria = (getCriteria( Restrictions.eq( "programStage", programStage ), Restrictions.in( - "organisationUnit.id", orgunitIds ), Restrictions.between( "executionDate", startDate, endDate ) )) - .addOrder( Order.desc( "organisationUnit" ) ).addOrder( Order.desc( "executionDate" ) ); + "organisationUnit.id", orgunitIds ), Restrictions.between( "executionDate", startDate, endDate ) )); if ( orderByOrgunitAsc ) { @@ -281,14 +281,17 @@ return criteria.list(); } - public int count( ProgramStage programStage, Map searchingKeys, Collection orgunitIds, + public int count( ProgramStage programStage, Map searchingIdenKeys, + Map searchingAttrKeys, Map searchingDEKeys, Collection orgunitIds, Date startDate, Date endDate ) { - if ( searchingKeys.keySet().size() > 0 ) + if ( searchingIdenKeys.keySet().size() > 0 || searchingAttrKeys.keySet().size() > 0 + || searchingDEKeys.keySet().size() > 0 ) { - String sql = getBySearchingValues( true, programStage, searchingKeys, orgunitIds, startDate, endDate, true, - true ); + String sql = getTabularReportStatement( false, programStage, searchingIdenKeys, searchingAttrKeys, + searchingDEKeys, orgunitIds, startDate, endDate, true, true ); List countRow = executeSQL( sql ); + return (countRow != null && countRow.size() > 0) ? countRow.get( 0 ) : 0; } @@ -299,35 +302,132 @@ return rs != null ? rs.intValue() : 0; } - private String getBySearchingValues( boolean isCount, ProgramStage programStage, - Map searchingKeys, Collection orgunitIds, Date startDate, Date endDate, + private String getTabularReportStatement( boolean isCount, ProgramStage programStage, + Map searchingIdenKeys, Map searchingAttrKeys, + Map searchingDEKeys, Collection orgunitIds, Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc ) { - String sql = " select distinct psi.programstageinstanceid from patientdatavalue pdv " + String select = "SELECT distinct psi.programstageinstanceid, psi.organisationunitid , psi.executiondate "; + String sqlID = " select distinct psi.programstageinstanceid from patientdatavalue pdv " + + "inner join programstageinstance psi on pdv.programstageinstanceid=psi.programstageinstanceid " + + "INNER JOIN patientidentifier as pid ON pid.patientid = p.patientid " + + "INNER JOIN patientidentifiertype as pit ON pid.patientidentifiertypeid = pit.patientidentifiertypeid "; + String sqlATTR = " select distinct psi.programstageinstanceid from patientdatavalue pdv " + "inner join programstageinstance psi on pdv.programstageinstanceid=psi.programstageinstanceid "; - - String select = "select distinct psi.programstageinstanceid, psi.organisationunitid, psi.executiondate "; - - String condition = " from patientdatavalue pdv " + String sqlDE = " select distinct psi.programstageinstanceid from patientdatavalue pdv " + "inner join programstageinstance psi on pdv.programstageinstanceid=psi.programstageinstanceid " - + "WHERE psi.executiondate >= '" + DateUtils.getMediumDateString( startDate ) + + "INNER JOIN patientattributevalue as pav ON pav.patientid = p.patientid " + + "INNER JOIN patientattribute as pa ON pa.patientattributeid = pav.patientattributeid "; + String condition = "FROM patientdatavalue pdv " + + "INNER JOIN programstageinstance psi ON pdv.programstageinstanceid=psi.programstageinstanceid " + + "INNER JOIN programinstance pi ON pi.programinstanceid=psi.programinstanceid "; + + if ( !programStage.getProgram().getAnonymous() ) + { + condition += " INNER JOIN patient p ON p.patientid = pi.patientid "; + if ( searchingAttrKeys != null ) + { + condition += "INNER JOIN patientattributevalue as pav ON pav.patientid = p.patientid " + + "INNER JOIN patientattribute as pa ON pa.patientattributeid = pav.patientattributeid "; + } + if ( searchingIdenKeys != null ) + { + condition += "INNER JOIN patientidentifier as pid ON pid.patientid = p.patientid " + + "INNER JOIN patientidentifiertype as pit ON pid.patientidentifiertypeid = pit.patientidentifiertypeid "; + } + } + + condition += "WHERE psi.executiondate >= '" + DateUtils.getMediumDateString( startDate ) + "' AND psi.executiondate <= '" + DateUtils.getMediumDateString( endDate ) + "' " + " AND psi.organisationunitid in " + splitListHelper( orgunitIds ) + " "; - Iterator keys = searchingKeys.keySet().iterator(); + // --------------------------------------------------------------------- + // Searching program-stage-instances by patient-identifiers + // --------------------------------------------------------------------- + + Iterator idenKeys = searchingIdenKeys.keySet().iterator(); boolean index = false; - while ( keys.hasNext() ) - { - Integer dataElementId = keys.next(); - - if ( index ) - { - condition += " AND psi.programstageinstanceid in ( " + sql + " WHERE 1=1 "; - } + while ( idenKeys.hasNext() ) + { + Integer attributeId = idenKeys.next(); + + if ( index ) + { + condition += " AND psi.programstageinstanceid in ( " + sqlID + " WHERE 1=1 ";; + } + + condition += " AND pid.patientidentifierTypeid=" + attributeId + " AND lower(pid.identifier) "; + + String compareValue = searchingIdenKeys.get( attributeId ).toLowerCase(); + + if ( compareValue.contains( "%" ) ) + { + compareValue = compareValue.replace( "=", "like " ); + } + + condition += compareValue; + + if ( index ) + { + condition += ") "; + } + + index = true; + } + + // --------------------------------------------------------------------- + // Searching program-stage-instances by patient-attributes + // --------------------------------------------------------------------- + + Iterator attrKeys = searchingAttrKeys.keySet().iterator(); + index = false; + while ( attrKeys.hasNext() ) + { + Integer attributeId = attrKeys.next(); + + if ( index ) + { + condition += " AND psi.programstageinstanceid in ( " + sqlATTR + " WHERE 1=1 "; + } + + condition += " AND pav.patientattributeid=" + attributeId + " AND lower(pav.value) "; + + String compareValue = searchingAttrKeys.get( attributeId ).toLowerCase(); + + if ( compareValue.contains( "%" ) ) + { + compareValue = compareValue.replace( "=", "like " ); + } + + condition += compareValue; + + if ( index ) + { + condition += ") "; + } + + index = true; + } + + // --------------------------------------------------------------------- + // Searching program-stage-instances by dataelements + // --------------------------------------------------------------------- + + Iterator deKeys = searchingDEKeys.keySet().iterator(); + + index = false; + while ( deKeys.hasNext() ) + { + Integer dataElementId = deKeys.next(); + + //if ( index ) + //{ + condition += " AND psi.programstageinstanceid in ( " + sqlDE + " WHERE 1=1 "; + //} condition += " AND pdv.dataElementid=" + dataElementId + " AND lower(pdv.value) "; - String compareValue = searchingKeys.get( dataElementId ).toLowerCase(); + String compareValue = searchingDEKeys.get( dataElementId ).toLowerCase(); if ( compareValue.contains( "%" ) ) { @@ -336,19 +436,19 @@ condition += compareValue; - if ( index ) - { + //if ( index ) + //{ condition += ") "; - } + //} - index = true; + //index = true; } if ( isCount ) { return "select count(psi.programstageinstanceid) " + condition; } - + condition += " ORDER BY psi.organisationunitid "; condition += orderByOrgunitAsc ? "asc" : "desc"; condition += ", psi.executiondate "; === 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-27 01:29:30 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml 2012-04-11 06:25:02 +0000 @@ -207,6 +207,10 @@ ref="org.hisp.dhis.patientdatavalue.PatientDataValueService" /> + + === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadProgramStagesAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadProgramStagesAction.java 2011-12-16 06:45:30 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadProgramStagesAction.java 2012-04-11 06:25:02 +0000 @@ -131,6 +131,11 @@ public String execute() throws Exception { + if ( programId == null ) + { + return SUCCESS; + } + selectedStateManager.clearSelectedProgramInstance(); selectedStateManager.clearSelectedProgramStageInstance(); @@ -158,7 +163,7 @@ programInstance = programInstances.iterator().next(); selectedStateManager.setSelectedProgramInstance( programInstance ); - + if ( programInstance.getProgramStageInstances() != null ) { colorMap = programStageInstanceService.colorProgramStageInstances( programInstance @@ -166,7 +171,6 @@ } } - return SUCCESS; } === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java 2012-03-23 03:46:08 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java 2012-04-11 06:25:02 +0000 @@ -35,7 +35,6 @@ import java.util.Map; import java.util.Set; -import org.hisp.dhis.caseentry.state.SelectedStateManager; import org.hisp.dhis.common.Grid; import org.hisp.dhis.dataelement.DataElement; import org.hisp.dhis.dataelement.DataElementService; @@ -44,7 +43,12 @@ import org.hisp.dhis.organisationunit.OrganisationUnit; import org.hisp.dhis.organisationunit.OrganisationUnitHierarchy; import org.hisp.dhis.organisationunit.OrganisationUnitService; +import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager; import org.hisp.dhis.paging.ActionPagingSupport; +import org.hisp.dhis.patient.PatientAttribute; +import org.hisp.dhis.patient.PatientAttributeService; +import org.hisp.dhis.patient.PatientIdentifierType; +import org.hisp.dhis.patient.PatientIdentifierTypeService; import org.hisp.dhis.program.ProgramStage; import org.hisp.dhis.program.ProgramStageInstance; import org.hisp.dhis.program.ProgramStageInstanceService; @@ -58,15 +62,21 @@ public class GenerateTabularReportAction extends ActionPagingSupport { + private String PREFIX_IDENTIFIER_TYPE = "iden"; + + private String PREFIX_PATIENT_ATTRIBUTE = "attr"; + + private String PREFIX_DATA_ELEMENT = "de"; + // ------------------------------------------------------------------------- // Dependencies // ------------------------------------------------------------------------- - private SelectedStateManager selectedStateManager; + private OrganisationUnitSelectionManager selectionManager; - public void setSelectedStateManager( SelectedStateManager selectedStateManager ) + public void setSelectionManager( OrganisationUnitSelectionManager selectionManager ) { - this.selectedStateManager = selectedStateManager; + this.selectionManager = selectionManager; } private OrganisationUnitService organisationUnitService; @@ -97,10 +107,31 @@ this.programStageInstanceService = programStageInstanceService; } + private PatientIdentifierTypeService identifierTypeService; + + public void setIdentifierTypeService( PatientIdentifierTypeService identifierTypeService ) + { + this.identifierTypeService = identifierTypeService; + } + + private PatientAttributeService patientAttributeService; + + public void setPatientAttributeService( PatientAttributeService patientAttributeService ) + { + this.patientAttributeService = patientAttributeService; + } + // ------------------------------------------------------------------------- // Input/Output // ------------------------------------------------------------------------- + private Integer orgunitId; + + public void setOrgunitId( Integer orgunitId ) + { + this.orgunitId = orgunitId; + } + private Integer programStageId; public void setProgramStageId( Integer programStageId ) @@ -108,13 +139,6 @@ this.programStageId = programStageId; } - private List dataElementIds = new ArrayList(); - - public void setDataElementIds( List dataElementIds ) - { - this.dataElementIds = dataElementIds; - } - private String startDate; public void setStartDate( String startDate ) @@ -129,13 +153,18 @@ this.endDate = endDate; } - private Set searchingValues = new HashSet(); + private List searchingValues = new ArrayList(); - public void setSearchingValues( Set searchingValues ) + public void setSearchingValues( List searchingValues ) { this.searchingValues = searchingValues; } + public List getSearchingValues() + { + return searchingValues; + } + private boolean orderByOrgunitAsc; public void setOrderByOrgunitAsc( boolean orderByOrgunitAsc ) @@ -185,7 +214,21 @@ this.format = format; } - private List dataElements; + private List identifierTypes = new ArrayList(); + + public List getIdentifierTypes() + { + return identifierTypes; + } + + private List patientAttributes = new ArrayList(); + + public List getPatientAttributes() + { + return patientAttributes; + } + + private List dataElements = new ArrayList(); public List getDataElements() { @@ -206,6 +249,12 @@ this.facilityLB = facilityLB; } + private Map searchingIdenKeys = new HashMap(); + + private Map searchingAttrKeys = new HashMap(); + + private Map searchingDEKeys = new HashMap(); + // ------------------------------------------------------------------------- // Implementation Action // ------------------------------------------------------------------------- @@ -217,13 +266,16 @@ // Get orgunitIds // --------------------------------------------------------------------- - OrganisationUnit selectedOrgunit = selectedStateManager.getSelectedOrganisationUnit(); + OrganisationUnit selectedOrgunit = selectionManager.getSelectedOrganisationUnit(); + + // OrganisationUnit selectedOrgunit = + // organisationUnitService.getOrganisationUnit( orgunitId ); Set orgunitIds = new HashSet(); if ( facilityLB.equals( "selected" ) ) { - orgunitIds.add( selectedOrgunit.getId() ); + orgunitIds.add( orgunitId ); } else { @@ -249,29 +301,11 @@ Date endValue = format.parseDate( endDate ); - dataElements = new ArrayList(); - - // --------------------------------------------------------------------- - // Get selected dataelements - // --------------------------------------------------------------------- - - for ( Integer dataElementId : dataElementIds ) - { - dataElements.add( dataElementService.getDataElement( dataElementId ) ); - } - - // --------------------------------------------------------------------- - // Get searching-keys - // --------------------------------------------------------------------- - - Map searchingKeys = new HashMap(); - - for ( String searchingValue : searchingValues ) - { - String[] infor = searchingValue.split( "_" ); - - searchingKeys.put( Integer.parseInt( infor[0] ), infor[1] ); - } + // --------------------------------------------------------------------- + // Get DE searching-keys + // --------------------------------------------------------------------- + + getParams(); // --------------------------------------------------------------------- // Generate tabular report @@ -279,20 +313,66 @@ if ( type == null ) { - total = programStageInstanceService.countProgramStageInstances( programStage, searchingKeys, orgunitIds, - startValue, endValue ); + total = programStageInstanceService.countProgramStageInstances( programStage, searchingIdenKeys, + searchingAttrKeys, searchingDEKeys, orgunitIds, startValue, endValue ); this.paging = createPaging( total ); - grid = programStageInstanceService.getTabularReport( programStage, dataElements, searchingKeys, orgunitIds, - level, startValue, endValue, orderByOrgunitAsc, orderByExecutionDateByAsc, paging - .getStartPos(), paging.getPageSize(), format, i18n ); + grid = programStageInstanceService.getTabularReport( programStage, identifierTypes, patientAttributes, + dataElements, searchingIdenKeys, searchingAttrKeys, searchingDEKeys, orgunitIds, level, startValue, + endValue, orderByOrgunitAsc, orderByExecutionDateByAsc, paging.getStartPos(), paging.getPageSize(), + format, i18n ); + return SUCCESS; } - grid = programStageInstanceService.getTabularReport( programStage, dataElements, searchingKeys, orgunitIds, - level, startValue, endValue, orderByOrgunitAsc, orderByExecutionDateByAsc, format, i18n ); + grid = programStageInstanceService.getTabularReport( programStage, identifierTypes, patientAttributes, + dataElements, searchingIdenKeys, searchingAttrKeys, searchingDEKeys, orgunitIds, level, startValue, + endValue, orderByOrgunitAsc, orderByExecutionDateByAsc, format, i18n ); return type; } + + // --------------------------------------------------------------------- + // Supportive methods + // --------------------------------------------------------------------- + + private void getParams() + { + // --------------------------------------------------------------------- + // Get Patient-Identifier searching-keys + // --------------------------------------------------------------------- + + for ( String searchingValue : searchingValues ) + { + String[] infor = searchingValue.split( "_" ); + String objectType = infor[0]; + int objectId = Integer.parseInt( infor[1] ); + + if ( objectType.equals( PREFIX_IDENTIFIER_TYPE ) ) + { + identifierTypes.add( identifierTypeService.getPatientIdentifierType( objectId ) ); + if ( infor.length == 3 ) + { + searchingIdenKeys.put( objectId, infor[2].trim() ); + } + } + else if ( objectType.equals( PREFIX_PATIENT_ATTRIBUTE ) ) + { + patientAttributes.add( patientAttributeService.getPatientAttribute( objectId ) ); + if ( infor.length == 3 ) + { + searchingAttrKeys.put( objectId, infor[2].trim() ); + } + } + else if ( objectType.equals( PREFIX_DATA_ELEMENT ) ) + { + dataElements.add( dataElementService.getDataElement( objectId ) ); + if ( infor.length == 3 ) + { + searchingDEKeys.put( objectId, infor[2].trim() ); + } + } + } + } } === added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetOrganisationUnitChildrenAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetOrganisationUnitChildrenAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetOrganisationUnitChildrenAction.java 2012-04-11 06:25:02 +0000 @@ -0,0 +1,105 @@ +package org.hisp.dhis.caseentry.action.report; + +/* + * Copyright (c) 2004-2012, 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. + */ + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator; +import org.hisp.dhis.organisationunit.OrganisationUnit; +import org.hisp.dhis.organisationunit.OrganisationUnitService; + +import com.opensymphony.xwork2.Action; + +/** + * @author Jan Henrik Overland + */ +public class GetOrganisationUnitChildrenAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private OrganisationUnitService organisationUnitService; + + public void setOrganisationUnitService( OrganisationUnitService organisationUnitService ) + { + this.organisationUnitService = organisationUnitService; + } + + // ------------------------------------------------------------------------- + // Input + // ------------------------------------------------------------------------- + + private Integer node; + + public void setNode( Integer node ) + { + this.node = node; + } + + // ------------------------------------------------------------------------- + // Output + // ------------------------------------------------------------------------- + + private List units = new ArrayList(); + + public List getUnits() + { + return units; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + @Override + public String execute() + throws Exception + { + OrganisationUnit unit = organisationUnitService.getOrganisationUnit( node ); + + int level = organisationUnitService.getLevelOfOrganisationUnit( unit.getId() ) + 1; + + if ( unit != null ) + { + units = new ArrayList( unit.getChildren() ); + + for ( OrganisationUnit organisationUnit : units ) + { + organisationUnit.setLevel( level ); + } + + Collections.sort( units, new IdentifiableObjectNameComparator() ); + } + + return SUCCESS; + } +} === added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetTabularParamsAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetTabularParamsAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetTabularParamsAction.java 2012-04-11 06:25:02 +0000 @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2004-2012, 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.report; + +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; + +import org.hisp.dhis.patient.PatientAttribute; +import org.hisp.dhis.patient.PatientAttributeService; +import org.hisp.dhis.patient.PatientIdentifierType; +import org.hisp.dhis.patient.PatientIdentifierTypeService; +import org.hisp.dhis.program.Program; +import org.hisp.dhis.program.ProgramService; +import org.hisp.dhis.program.ProgramStage; + +import com.opensymphony.xwork2.Action; + +/** + * @author Chau Thu Tran + * + * @version $GetTabularParamsAction.java Apr 3, 2012 8:42:24 AM$ + */ +public class GetTabularParamsAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private PatientIdentifierTypeService identifierTypeService; + + private PatientAttributeService attributeService; + + private ProgramService programService; + + // ------------------------------------------------------------------------- + // Input/Output + // ------------------------------------------------------------------------- + + private Integer programId; + + private Collection identifierTypes = new HashSet(); + + private Collection attributes = new HashSet(); + + private Set programStages = new HashSet(); + + // ------------------------------------------------------------------------- + // Getter && Setters + // ------------------------------------------------------------------------- + + public Collection getIdentifierTypes() + { + return identifierTypes; + } + + public Collection getAttributes() + { + return attributes; + } + + public void setIdentifierTypeService( PatientIdentifierTypeService identifierTypeService ) + { + this.identifierTypeService = identifierTypeService; + } + + public void setAttributeService( PatientAttributeService attributeService ) + { + this.attributeService = attributeService; + } + + public void setProgramService( ProgramService programService ) + { + this.programService = programService; + } + + public void setProgramId( Integer programId ) + { + this.programId = programId; + } + + public Set getProgramStages() + { + return programStages; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + @Override + public String execute() + throws Exception + { + Program program = programService.getProgram( programId ); + + programStages = program.getProgramStages(); + + identifierTypes = identifierTypeService.getPatientIdentifierTypesWithoutProgram(); + identifierTypes.addAll( identifierTypeService.getPatientIdentifierTypes( program ) ); + + attributes = attributeService.getPatientAttributes( null, null ); + attributes.addAll( attributeService.getPatientAttributes( program ) ); + + return SUCCESS; + } + +} === added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadAttributeGroupsAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadAttributeGroupsAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadAttributeGroupsAction.java 2012-04-11 06:25:02 +0000 @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2004-2012, 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.report; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +import org.hisp.dhis.patient.PatientAttributeGroup; +import org.hisp.dhis.patient.PatientAttributeGroupService; +import org.hisp.dhis.patient.comparator.PatientAttributeGroupSortOrderComparator; +import org.hisp.dhis.program.Program; +import org.hisp.dhis.program.ProgramService; + +import com.opensymphony.xwork2.Action; + +/** + * @author Chau Thu Tran + * + * @version $LoadAttributeGroupsAction.java Apr 3, 2012 8:42:24 AM$ + */ +public class LoadAttributeGroupsAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private ProgramService programService; + + private PatientAttributeGroupService attributeGroupService; + + // ------------------------------------------------------------------------- + // Input/Output + // ------------------------------------------------------------------------- + + private Integer programId; + + private List attributeGroups = new ArrayList(); + + // ------------------------------------------------------------------------- + // Getter && Setters + // ------------------------------------------------------------------------- + + public Collection getAttributeGroups() + { + return attributeGroups; + } + + public void setAttributeGroupService( PatientAttributeGroupService attributeGroupService ) + { + this.attributeGroupService = attributeGroupService; + } + + public void setProgramService( ProgramService programService ) + { + this.programService = programService; + } + + public void setProgramId( Integer programId ) + { + this.programId = programId; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + @Override + public String execute() + throws Exception + { + Program program = programService.getProgram( programId ); + + attributeGroups = new ArrayList( attributeGroupService + .getPatientAttributeGroups( program ) ); + Collections.sort( attributeGroups, new PatientAttributeGroupSortOrderComparator() ); + + return SUCCESS; + } + +} === added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadAttributesAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadAttributesAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadAttributesAction.java 2012-04-11 06:25:02 +0000 @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2004-2012, 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.report; + +import java.util.Collection; +import java.util.HashSet; + +import org.hisp.dhis.patient.PatientAttribute; +import org.hisp.dhis.patient.PatientAttributeGroupService; +import org.hisp.dhis.patient.PatientAttributeService; +import org.hisp.dhis.program.Program; +import org.hisp.dhis.program.ProgramService; + +import com.opensymphony.xwork2.Action; + +/** + * @author Chau Thu Tran + * + * @version $LoadAttributesAction.java Apr 3, 2012 8:42:24 AM$ + */ +public class LoadAttributesAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private ProgramService programService; + + private PatientAttributeGroupService attributeGroupService; + + private PatientAttributeService attributeService; + + // ------------------------------------------------------------------------- + // Input/Output + // ------------------------------------------------------------------------- + + private Integer programId; + + private Integer attributeGroupId; + + private Collection patientAttributes = new HashSet(); + + // ------------------------------------------------------------------------- + // Getter && Setters + // ------------------------------------------------------------------------- + + public void setAttributeGroupService( PatientAttributeGroupService attributeGroupService ) + { + this.attributeGroupService = attributeGroupService; + } + + public Collection getPatientAttributes() + { + return patientAttributes; + } + + public void setAttributeGroupId( Integer attributeGroupId ) + { + this.attributeGroupId = attributeGroupId; + } + + public void setAttributeService( PatientAttributeService attributeService ) + { + this.attributeService = attributeService; + } + + public void setProgramService( ProgramService programService ) + { + this.programService = programService; + } + + public void setProgramId( Integer programId ) + { + this.programId = programId; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + @Override + public String execute() + throws Exception + { + Program program = programService.getProgram( programId ); + patientAttributes = attributeService.getPatientAttributes( program ); + + if ( attributeGroupId == null ) + { + patientAttributes.addAll( attributeService.getPatientAttributes( null, null ) ); + } + else + { + patientAttributes.retainAll( attributeGroupService.getPatientAttributeGroup( attributeGroupId ) + .getAttributes() ); + } + + return SUCCESS; + + } + +} === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadDataElementsAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadDataElementsAction.java 2012-03-05 04:22:57 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadDataElementsAction.java 2012-04-11 06:25:02 +0000 @@ -79,8 +79,11 @@ public String execute() throws Exception { - psDataElements = programStageService.getProgramStage( programStageId ).getProgramStageDataElements(); - + if ( programStageId != null ) + { + psDataElements = programStageService.getProgramStage( programStageId ).getProgramStageDataElements(); + } + return SUCCESS; } } === added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadIdentifierTypesAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadIdentifierTypesAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadIdentifierTypesAction.java 2012-04-11 06:25:02 +0000 @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2004-2012, 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.report; + +import java.util.Collection; +import java.util.HashSet; + +import org.hisp.dhis.patient.PatientIdentifierType; +import org.hisp.dhis.patient.PatientIdentifierTypeService; +import org.hisp.dhis.program.Program; +import org.hisp.dhis.program.ProgramService; + +import com.opensymphony.xwork2.Action; + +/** + * @author Chau Thu Tran + * + * @version $LoadIdentifierTypesAction.java Apr 5, 2012 7:27:52 PM$ + */ +public class LoadIdentifierTypesAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private PatientIdentifierTypeService identifierTypeService; + + private ProgramService programService; + + // ------------------------------------------------------------------------- + // Input/Output + // ------------------------------------------------------------------------- + + private Integer programId; + + private Collection identifierTypes = new HashSet(); + + // ------------------------------------------------------------------------- + // Getter && Setters + // ------------------------------------------------------------------------- + + public void setProgramService( ProgramService programService ) + { + this.programService = programService; + } + + public void setIdentifierTypeService( PatientIdentifierTypeService identifierTypeService ) + { + this.identifierTypeService = identifierTypeService; + } + + public Collection getIdentifierTypes() + { + return identifierTypes; + } + + public void setProgramId( Integer programId ) + { + this.programId = programId; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + @Override + public String execute() + throws Exception + { + Program program = programService.getProgram( programId ); + + identifierTypes = identifierTypeService.getPatientIdentifierTypesWithoutProgram(); + identifierTypes.addAll( identifierTypeService.getPatientIdentifierTypes( program ) ); + + return SUCCESS; + } + +} === added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadProgramsAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadProgramsAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadProgramsAction.java 2012-04-11 06:25:02 +0000 @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2004-2012, 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.report; + +import java.util.Collection; + +import org.hisp.dhis.program.Program; +import org.hisp.dhis.program.ProgramService; + +import com.opensymphony.xwork2.Action; + +/** + * @author Chau Thu Tran + * + * @version $LoadProgramsAction.java Feb 28, 2012 9:35:50 AM$ + */ +public class LoadProgramsAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private ProgramService programService; + + public void setProgramService( ProgramService programService ) + { + this.programService = programService; + } + + // ------------------------------------------------------------------------- + // Input/output + // ------------------------------------------------------------------------- + + private Collection programs; + + public Collection getPrograms() + { + return programs; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + @Override + public String execute() + throws Exception + { + programs = programService.getAllPrograms(); + + return SUCCESS; + } +} === added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/TabularInitializeAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/TabularInitializeAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/TabularInitializeAction.java 2012-04-11 06:25:02 +0000 @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2004-2012, 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.report; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import org.hisp.dhis.organisationunit.OrganisationUnit; +import org.hisp.dhis.organisationunit.OrganisationUnitLevel; +import org.hisp.dhis.organisationunit.OrganisationUnitService; +import org.hisp.dhis.program.Program; +import org.hisp.dhis.program.ProgramService; + +import com.opensymphony.xwork2.Action; + +/** + * @author Chau Thu Tran + * + * @version $TabularInitializeAction.java Apr 5, 2012 9:44:37 AM$ + */ +public class TabularInitializeAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private OrganisationUnitService organisationUnitService; + + public void setOrganisationUnitService( OrganisationUnitService organisationUnitService ) + { + this.organisationUnitService = organisationUnitService; + } + + private ProgramService programService; + + public void setProgramService( ProgramService programService ) + { + this.programService = programService; + } + + // ------------------------------------------------------------------------- + // Output + // ------------------------------------------------------------------------- + + private OrganisationUnit rootNode; + + public OrganisationUnit getRootNode() + { + return rootNode; + } + + private Collection programs; + + public Collection getPrograms() + { + return programs; + } + + private List levels; + + public List getLevels() + { + return levels; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + public String execute() + throws Exception + { + Collection rootUnits = new ArrayList( organisationUnitService + .getOrganisationUnitsAtLevel( 1 ) ); + + programs = programService.getAllPrograms(); + + rootNode = rootUnits.size() > 0 ? rootUnits.iterator().next() : new OrganisationUnit(); + + levels = organisationUnitService.getFilledOrganisationUnitLevels(); + + 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-29 04:15:07 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2012-04-11 06:25:02 +0000 @@ -25,8 +25,7 @@ ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" /> - + - - - + - + @@ -257,41 +256,104 @@ ref="org.hisp.dhis.caseentry.state.SelectedStateManager" /> - + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + - - - - - - - - - - - - - + class="org.hisp.dhis.caseentry.action.report.LoadDataElementsAction" + scope="prototype"> + + + + + + + + + + + + + + + + + + + + + @@ -335,7 +397,7 @@ - + - + - + - - + + - - + + - - + + - - + + - + - + - + - + @@ -600,20 +664,22 @@ - - - - + ref="org.hisp.dhis.oust.manager.SelectionTreeManager" /> @@ -625,7 +691,8 @@ - + - - - - - - - + + + + + + + - + - + - - - - - + + + + + - + - - @@ -724,10 +804,9 @@ - + + class="org.hisp.dhis.caseentry.action.patient.GetPartnerAction" scope="prototype"> @@ -735,24 +814,22 @@ - - - + - - @@ -761,16 +838,15 @@ - - - + - + - + - + - - - + === 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 2012-03-30 02:13:18 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2012-04-11 06:25:02 +0000 @@ -250,7 +250,7 @@ see_history_plan=See history / plan name_based_data_entry=Name-based data entry multiple_name_based_data_entry=Multiple name-based data entry -orgunit_level= Organisation unit level +use_data_from_level=Use data from level(s) saved = Saved save_selected_values = Save selected values save_all_values = Save all values @@ -285,7 +285,7 @@ D=Declared A=Approximated some_data_element_not_exist = Some data element is not exist -orgunit_hiererachy_included_on = Organisation unit hiererachy included on +include_parent_orgunits_starting_from_level = Include parent organisation units starting from (level) level = Level please_fill_out_only_one_of_these_fields = Please fill out at only one of these fields. age_year = Age(year) @@ -298,4 +298,15 @@ modify_due_date_or_visit_date = Modify Due/Visit dates data_entry_screen = Data entry Screen unenrol_success = Beneficiary un-enrolled successfully -enrolled_for = Enrolled for \ No newline at end of file +enrolled_for = Enrolled for +selected_boundary = Selected (boundary) +regular_program = Regular program +please_select_a_program_stage = Please select a program stage +available_identifier_types = Available identifier types +selected_identifier_types = Selected identifier types +show_hierachy_from_level = Show hierachy from level +attribute = Attribute +download = Download +xls = XLS +pdf = PDF +pdf = PDF \ 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 2012-03-29 04:15:07 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2012-04-11 06:25:02 +0000 @@ -276,16 +276,61 @@ F_GENERATE_BENEFICIARY_TABULAR_REPORT - + + /dhis-web-caseentry/jsonminOrganisationUnitChildren.vm + + + + + /dhis-web-caseentry/jsonTabularInitialize.vm + + + + + /dhis-web-commons/ajax/jsonPrograms.vm + + + + /dhis-web-caseentry/responseTabularParams.vm + + + + + /dhis-web-caseentry/jsonIdentifierTypes.vm + + + + + /dhis-web-commons/ajax/jsonPatientAttributeGroups.vm + + + /dhis-web-caseentry/responseProgramStages.vm + + /dhis-web-commons/ajax/jsonPatientAttributes.vm + + /dhis-web-caseentry/responseDataElements.vm + + /dhis-web-caseentry/responseTabularParams.vm + + @@ -303,12 +348,26 @@ F_GENERATE_BENEFICIARY_TABULAR_REPORT + + /dhis-web-caseentry/searchTabularReportResult.vm F_GENERATE_BENEFICIARY_TABULAR_REPORT + + + + /dhis-web-caseentry/i18n.vm + + - $i18n.getString( "orgunit_level" ) + $i18n.getString( "use_data_from_level" ) + + #end + #foreach( $patientAttribute in $patientAttributes ) + + + + #end #foreach( $dataElement in $dataElements ) - + #end - #if( $anonymous == "false" ) - - #end === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/tabularReportSelect.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/tabularReportSelect.vm 2012-03-23 03:53:21 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/tabularReportSelect.vm 2012-04-11 06:25:02 +0000 @@ -5,10 +5,10 @@ }, { 'beforeValidateHandler' : function() { - listValidator( 'memberValidator', 'dataElementIds' ); + listValidator( 'memberDEValidator', 'dataElementIds' ); } } ); - + datePickerInRange( 'startDate' , 'endDate' ); }); @@ -17,9 +17,10 @@

-
+
+ @@ -27,20 +28,20 @@ - - - + + - - - - - - - - - - - - - - - - - - - - - +
- $i18n.getString( "orgunit_level" ) + $i18n.getString( "use_data_from_level" )
- $i18n.getString( "orgunit_hiererachy_included_on" ) + $i18n.getString( "include_parent_orgunits_starting_from_level" )
-
+
- -
- -
- -
- - -
- - -

-

-
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - @@ -145,4 +240,5 @@ var i18n_syntax_error_in_search_value = '$encoder.jsEscape( $i18n.getString( "syntax_error_in_search_value" ) , "'")'; var i18n_remove_selected_data_elements = '$encoder.jsEscape( $i18n.getString( "remove_selected_data_elements" ) , "'")'; var i18n_patient_details_and_history = '$encoder.jsEscape( $i18n.getString( "patient_details_and_history" ) , "'" )'; + var i18n_please_select_a_program_stage = '[' + '$encoder.jsEscape( $i18n.getString( "please_select_a_program_stage" ), "'")' + ']'; === modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/org/hisp/dhis/visualizer/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/org/hisp/dhis/visualizer/i18n_module.properties 2012-03-14 23:25:58 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/org/hisp/dhis/visualizer/i18n_module.properties 2012-04-11 06:25:02 +0000 @@ -118,4 +118,6 @@ wm_multiple_filter_period=Multiple periods selected as filter. wm_multiple_filter_orgunit=Multiple organisation units selected as filter. wm_multiple_filter_groups=Multiple organisation unit groups selected as filter. -wm_first_filter_used=The first one is being used. \ No newline at end of file +wm_first_filter_used=The first one is being used. +available_attribute = Available attribute +selected_attribute = Selected attribute \ No newline at end of file
$i18n.getString( "available_identifier_types" ) + $i18n.getString( "filter" )$i18n.getString( "selected_identifier_types" ) * +
$i18n.getString( "available_attribute" ) + $i18n.getString( "filter" )$i18n.getString( "selected_attribute" ) * +
$i18n.getString( "available_data_elements" ) + $i18n.getString( "filter" )$i18n.getString( "selected_data_elements" ) * +

+ +