← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6129: (patient) Don't generate visit plans and Minor fix for reports.

 

------------------------------------------------------------
revno: 6129
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-02-28 15:07:22 +0700
message:
  (patient) Don't generate visit plans and Minor fix for reports.
modified:
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/activityplan/DefaultActivityPlanService.java
  dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/DerbyStatementBuilder.java
  dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/H2StatementBuilder.java
  dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/MySQLStatementBuilder.java
  dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/PostgreSQLStatementBuilder.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/report.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEventReport.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/loadVisitPlan.vm


--
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/activityplan/DefaultActivityPlanService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/activityplan/DefaultActivityPlanService.java	2012-01-11 05:31:53 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/activityplan/DefaultActivityPlanService.java	2012-02-28 08:07:22 +0000
@@ -116,7 +116,7 @@
 
         List<ProgramInstance> programInstances = new ArrayList<ProgramInstance>();
 
-        Collection<Program> programs = programService.getPrograms( organisationUnit );
+        Collection<Program> programs = programService.getPrograms( false, false, organisationUnit );
 
         for ( Program program : programs )
         {
@@ -155,7 +155,7 @@
     {
         Collection<Activity> activities = new ArrayList<Activity>();
 
-        Collection<Program> programs = programService.getPrograms( organisationUnit );
+        Collection<Program> programs = programService.getPrograms( false, false, organisationUnit );
 
         if ( programs.size() > 0 )
         {
@@ -181,7 +181,7 @@
 
         Collection<Activity> activities = new ArrayList<Activity>();
 
-        if ( programService.getPrograms( organisationUnit ).containsAll( programs ) )
+        if ( programService.getPrograms( false, false, organisationUnit ).containsAll( programs ) )
         {
             Collection<ProgramInstance> programInstances = programInstanceService.getProgramInstances( programs, false );
 
@@ -313,7 +313,7 @@
     // Supportive methods
     // -------------------------------------------------------------------------
 
-    Collection<Activity> getActivties( Collection<ProgramInstance> programInstances )
+    private Collection<Activity> getActivties( Collection<ProgramInstance> programInstances )
     {
         Collection<Activity> activities = new ArrayList<Activity>();
 

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/DerbyStatementBuilder.java'
--- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/DerbyStatementBuilder.java	2012-02-17 12:10:18 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/DerbyStatementBuilder.java	2012-02-28 08:07:22 +0000
@@ -320,28 +320,31 @@
            
     public String getActivityPlan( int orgunitId, int min, int max )
     {
-       return  "SELECT psi.programstageinstanceid " +
-               "FROM programstageinstance psi " +
-                   "INNER JOIN programinstance pi " +
-                       "ON pi.programinstanceid = psi.programinstanceid " +
-                   "INNER JOIN programstage ps " +
-                       "ON ps.programstageid=psi.programstageid " +
-                   "INNER JOIN program_organisationunits po " +
-                       "ON po.programid=pi.programid " +
-                "WHERE pi.completed = FALSE  " +
-                       "AND po.organisationunitid = " + orgunitId + " AND psi.completed = FALSE " +
-                       "AND ps.stageinprogram in ( SELECT min(ps1.stageinprogram) " +
-                           "FROM programstageinstance psi1 " +
-                           "INNER JOIN programinstance pi1 " +
-                               "ON pi1.programinstanceid = psi1.programinstanceid " +
-                           "INNER JOIN programstage ps1 " +
-                               "ON ps1.programstageid=psi1.programstageid " +
-                           "INNER JOIN program_organisationunits po1 " +
-                               "ON po1.programid=pi1.programid " +
-                           "WHERE pi1.completed = FALSE  " +
-                               "AND po1.organisationunitid = " + orgunitId + " AND psi1.completed = FALSE ) " +
-                "ORDER BY ps.stageinprogram " +
-                "LIMIT " + max + " OFFSET " + min;
+        return  "SELECT psi.programstageinstanceid " +
+                "FROM programstageinstance psi " +
+                    "INNER JOIN programinstance pi " +
+                        "ON pi.programinstanceid = psi.programinstanceid " +
+                    "INNER JOIN programstage ps " +
+                        "ON ps.programstageid=psi.programstageid " +
+                    "INNER JOIN program_organisationunits po " +
+                        "ON po.programid=pi.programid " +
+                    "INNER JOIN program pg " +
+                        "ON po.programid=pg.programid " +
+                 "WHERE pi.completed = FALSE  " +
+                        "AND pg.singleEvent=FALSE "+
+                        "AND po.organisationunitid = " + orgunitId + " AND psi.completed = FALSE " +
+                        "AND ps.stageinprogram in ( SELECT min(ps1.stageinprogram) " +
+                            "FROM programstageinstance psi1 " +
+                            "INNER JOIN programinstance pi1 " +
+                                "ON pi1.programinstanceid = psi1.programinstanceid " +
+                            "INNER JOIN programstage ps1 " +
+                                "ON ps1.programstageid=psi1.programstageid " +
+                            "INNER JOIN program_organisationunits po1 " +
+                                "ON po1.programid=pi1.programid " +
+                            "WHERE pi1.completed = FALSE  " +
+                                "AND po1.organisationunitid = " + orgunitId + " AND psi1.completed = FALSE ) " +
+                 "ORDER BY ps.stageinprogram " +
+                 "LIMIT " + max + " OFFSET " + min;
     }
 
     public String limitRecord( int min, int max )

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/H2StatementBuilder.java'
--- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/H2StatementBuilder.java	2012-02-17 12:10:18 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/H2StatementBuilder.java	2012-02-28 08:07:22 +0000
@@ -341,28 +341,31 @@
     
     public String getActivityPlan( int orgunitId, int min, int max )
     {
-        return "SELECT psi.programstageinstanceid " +
-               "FROM programstageinstance psi " +
-                   "INNER JOIN programinstance pi " +
-                       "ON pi.programinstanceid = psi.programinstanceid " +
-                   "INNER JOIN programstage ps " +
-                       "ON ps.programstageid=psi.programstageid " +
-                   "INNER JOIN program_organisationunits po " +
-                       "ON po.programid=pi.programid " +
-               "WHERE pi.completed = FALSE  " +
-                       "AND po.organisationunitid = " + orgunitId + " AND psi.completed = FALSE " +
-                       "AND ps.stageinprogram in ( SELECT min(ps1.stageinprogram) " +
-                           "FROM programstageinstance psi1 " +
-                           "INNER JOIN programinstance pi1 " +
-                               "ON pi1.programinstanceid = psi1.programinstanceid " +
-                           "INNER JOIN programstage ps1 " +
-                               "ON ps1.programstageid=psi1.programstageid " +
-                           "INNER JOIN program_organisationunits po1 " +
-                               "ON po1.programid=pi1.programid " +
-                           "WHERE pi1.completed = FALSE  " +
-                               "AND po1.organisationunitid = " + orgunitId + " AND psi1.completed = FALSE ) " +
-               "ORDER BY ps.stageinprogram " +
-               "LIMIT " + max + " OFFSET " + min;
+        return  "SELECT psi.programstageinstanceid " +
+                "FROM programstageinstance psi " +
+                    "INNER JOIN programinstance pi " +
+                        "ON pi.programinstanceid = psi.programinstanceid " +
+                    "INNER JOIN programstage ps " +
+                        "ON ps.programstageid=psi.programstageid " +
+                    "INNER JOIN program_organisationunits po " +
+                        "ON po.programid=pi.programid " +
+                    "INNER JOIN program pg " +
+                        "ON po.programid=pg.programid " +
+                 "WHERE pi.completed = FALSE  " +
+                        "AND pg.singleEvent=FALSE "+
+                        "AND po.organisationunitid = " + orgunitId + " AND psi.completed = FALSE " +
+                        "AND ps.stageinprogram in ( SELECT min(ps1.stageinprogram) " +
+                            "FROM programstageinstance psi1 " +
+                            "INNER JOIN programinstance pi1 " +
+                                "ON pi1.programinstanceid = psi1.programinstanceid " +
+                            "INNER JOIN programstage ps1 " +
+                                "ON ps1.programstageid=psi1.programstageid " +
+                            "INNER JOIN program_organisationunits po1 " +
+                                "ON po1.programid=pi1.programid " +
+                            "WHERE pi1.completed = FALSE  " +
+                                "AND po1.organisationunitid = " + orgunitId + " AND psi1.completed = FALSE ) " +
+                 "ORDER BY ps.stageinprogram " +
+                 "LIMIT " + max + " OFFSET " + min;
     }
 
     public String limitRecord( int min, int max )

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/MySQLStatementBuilder.java'
--- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/MySQLStatementBuilder.java	2012-02-17 12:10:18 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/MySQLStatementBuilder.java	2012-02-28 08:07:22 +0000
@@ -346,7 +346,10 @@
                         "ON ps.programstageid=psi.programstageid " +
                     "INNER JOIN program_organisationunits po " +
                         "ON po.programid=pi.programid " +
+                    "INNER JOIN program pg " +
+                        "ON po.programid=pg.programid " +
                  "WHERE pi.completed = FALSE  " +
+                        "AND pg.singleEvent=FALSE "+
                         "AND po.organisationunitid = " + orgunitId + " AND psi.completed = FALSE " +
                         "AND ps.stageinprogram in ( SELECT min(ps1.stageinprogram) " +
                             "FROM programstageinstance psi1 " +

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/PostgreSQLStatementBuilder.java'
--- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/PostgreSQLStatementBuilder.java	2012-02-17 12:10:18 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/PostgreSQLStatementBuilder.java	2012-02-28 08:07:22 +0000
@@ -346,7 +346,10 @@
                         "ON ps.programstageid=psi.programstageid " +
                     "INNER JOIN program_organisationunits po " +
                         "ON po.programid=pi.programid " +
+                    "INNER JOIN program pg " +
+                        "ON po.programid=pg.programid " +
                  "WHERE pi.completed = FALSE  " +
+                        "AND pg.singleEvent=FALSE "+
                         "AND po.organisationunitid = " + orgunitId + " AND psi.completed = FALSE " +
                         "AND ps.stageinprogram in ( SELECT min(ps1.stageinprogram) " +
                             "FROM programstageinstance psi1 " +

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/report.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/report.js	2012-02-25 03:16:51 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/report.js	2012-02-28 08:07:22 +0000
@@ -92,7 +92,7 @@
 			title: i18n_reports,
 			maximize: true, 
 			closable: true,
-			modal:true,
+			modal:false,
 			overlay:{background:'#000000', opacity:0.1},
 			width: 800,
 			height: 400

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEventReport.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEventReport.js	2012-02-25 03:16:51 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEventReport.js	2012-02-28 08:07:22 +0000
@@ -75,7 +75,7 @@
 			title: i18n_reports,
 			maximize: true, 
 			closable: true,
-			modal:true,
+			modal:false,
 			overlay:{background:'#000000', opacity:0.1},
 			width: 800,
 			height: 400

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/loadVisitPlan.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/loadVisitPlan.vm	2011-09-30 08:37:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/loadVisitPlan.vm	2012-02-28 08:07:22 +0000
@@ -3,10 +3,10 @@
     <table class="mainPageTable"> 
         <tr>            
             <td>
-                <span class='bold'>$i18n.getString( "full_name" ):</span>$encoder.htmlEncode( $patient.getFullName() )<br>
-                <span class='bold'>$i18n.getString( "gender" ):</span>$i18n.getString( $patient.gender )<br>
-                <span class='bold'>$i18n.getString( "date_of_birth" ):</span>$format.formatDate( $patient.birthDate )<br>
-                <span class='bold'>$i18n.getString( "age" ):</span>$encoder.htmlEncode( $patient.getAge() )
+                <span class='bold'>$i18n.getString( "full_name" ):</span>$encoder.htmlEncode( $!patient.getFullName() )<br>
+                <span class='bold'>$i18n.getString( "gender" ):</span>$i18n.getString( "$!patient.gender" )<br>
+                <span class='bold'>$i18n.getString( "date_of_birth" ):</span>$format.formatDate( $!patient.birthDate )<br>
+                <span class='bold'>$i18n.getString( "age" ):</span>$encoder.htmlEncode( $!patient.getAge() )
             </td>   
             <td style="vertical-align:top">
                 <div style="float:right">