dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #21732
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10373: Error when to export visit schedule to excel file.
------------------------------------------------------------
revno: 10373
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-03-21 14:56:35 +0700
message:
Error when to export visit schedule to excel file.
modified:
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStore.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java 2013-03-06 08:07:23 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java 2013-03-21 07:56:35 +0000
@@ -580,7 +580,6 @@
grid.addHeader( new GridHeader( i18n.getString( "last_name" ), false, true ) );
grid.addHeader( new GridHeader( i18n.getString( "gender" ), false, true ) );
grid.addHeader( new GridHeader( i18n.getString( "phone_number" ), false, true ) );
- grid.addHeader( new GridHeader( "orgunitid", true, true ) );
grid.addHeader( new GridHeader( "programstageinstanceid", true, true ) );
grid.addHeader( new GridHeader( i18n.getString( "program_stage" ), false, true ) );
grid.addHeader( new GridHeader( i18n.getString( "due_date" ), false, true ) );
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java 2013-03-21 04:51:21 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java 2013-03-21 07:56:35 +0000
@@ -590,7 +590,7 @@
String from = " from patient p ";
if ( isSearchEvent )
{
- String subSQL = " , psi.programstageinstanceid as programstageinstanceid, pgs.name as programstagename, min(psi.duedate) as duedate ";
+ String subSQL = " , psi.programstageinstanceid as programstageinstanceid, pgs.name as programstagename, psi.duedate as duedate ";
sql = sql + subSQL + from + " inner join programinstance pgi on " + " (pgi.patientid=p.patientid) "
+ " inner join programstageinstance psi on " + " (psi.programinstanceid=pgi.programinstanceid) "
+ " inner join programstage pgs on (pgs.programstageid=psi.programstageid) ";
@@ -599,7 +599,7 @@
sql += " inner join patientattributevalue pav on p.patientid=pav.patientid ";
}
patientGroupBy += ",psi.programstageinstanceid, pgs.name ";
- orderBy = " ORDER BY duedate DESC ";
+ orderBy = " ORDER BY duedate asc ";
from = " ";
}
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStore.java 2013-03-14 09:06:32 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStore.java 2013-03-21 07:56:35 +0000
@@ -135,7 +135,7 @@
}
else
{
- programs = getAll();
+ programs = getByType(type);
}
return programs;
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java 2013-03-21 04:37:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java 2013-03-21 07:56:35 +0000
@@ -35,6 +35,7 @@
import org.hisp.dhis.caseentry.state.SelectedStateManager;
import org.hisp.dhis.common.Grid;
+import org.hisp.dhis.i18n.I18n;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.paging.ActionPagingSupport;
import org.hisp.dhis.patient.Patient;
@@ -81,17 +82,17 @@
this.programStageInstanceService = programStageInstanceService;
}
+ private I18n i18n;
+
+ public void setI18n( I18n i18n )
+ {
+ this.i18n = i18n;
+ }
+
// -------------------------------------------------------------------------
// Input/output
// -------------------------------------------------------------------------
- private Boolean searchBySelectedOrgunit;
-
- public void setSearchBySelectedOrgunit( Boolean searchBySelectedOrgunit )
- {
- this.searchBySelectedOrgunit = searchBySelectedOrgunit;
- }
-
private Integer programId;
public void setProgramId( Integer programId )
@@ -148,6 +149,13 @@
return program;
}
+ private String type;
+
+ public void setType( String type )
+ {
+ this.type = type;
+ }
+
private Grid grid;
public Grid getGrid()
@@ -167,24 +175,31 @@
if ( programId != null )
{
program = programService.getProgram( programId );
-
+
identifierTypes = program.getPatientIdentifierTypes();
}
-
+
if ( searchTexts.size() > 0 )
{
- total = patientService.countSearchPatients( searchTexts, orgunit );
- this.paging = createPaging( total );
-
- List<Integer> stageInstanceIds = patientService.getProgramStageInstances( searchTexts, orgunit,
- paging.getStartPos(), paging.getPageSize() );
-
- for ( Integer stageInstanceId : stageInstanceIds )
- {
- programStageInstances.add( programStageInstanceService.getProgramStageInstance( stageInstanceId ) );
+ if ( type == null )
+ {
+ total = patientService.countSearchPatients( searchTexts, orgunit );
+ this.paging = createPaging( total );
+
+ List<Integer> stageInstanceIds = patientService.getProgramStageInstances( searchTexts, orgunit,
+ paging.getStartPos(), paging.getPageSize() );
+
+ for ( Integer stageInstanceId : stageInstanceIds )
+ {
+ programStageInstances.add( programStageInstanceService.getProgramStageInstance( stageInstanceId ) );
+ }
+ }
+ else
+ {
+ grid = patientService.getScheduledEventsReport( searchTexts, orgunit, i18n );
}
}
- return SUCCESS;
+ return type == null ? SUCCESS : type;
}
}