← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6020: Removed categoryoptioncomboid in patientdatavaluearchive.

 

------------------------------------------------------------
revno: 6020
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-02-17 19:10:18 +0700
message:
  Removed categoryoptioncomboid in patientdatavaluearchive.
modified:
  dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataarchive/jdbc/JdbcDataArchiveStore.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableCreator.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


--
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-administration/src/main/java/org/hisp/dhis/dataarchive/jdbc/JdbcDataArchiveStore.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataarchive/jdbc/JdbcDataArchiveStore.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataarchive/jdbc/JdbcDataArchiveStore.java	2012-02-17 12:10:18 +0000
@@ -192,7 +192,8 @@
     {
         // Move data from patientdatavalue to patientdatavaluearchive
         String sql = "INSERT INTO patientdatavalue ( " 
-            + "SELECT pdv.* FROM patientdatavaluearchive AS pdv "
+            + "SELECT pdv.programstageinstanceid, pdv.dataelementid, pdv.organisationunitid, pdv.value, "
+                    +"pdv.providedbyanotherfacility, pdv.timestamp FROM patientdatavaluearchive AS pdv "
             + "INNER JOIN programstageinstance AS psi " 
                 + "ON pdv.programstageinstanceid = psi.programstageinstanceid "
             + "INNER JOIN programinstance AS pi " 

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2012-02-16 15:31:42 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2012-02-17 12:10:18 +0000
@@ -418,6 +418,8 @@
         executeSql( "DROP TABLE chartgroupmembers" );
         executeSql( "DROP TABLE chartgroup" );
         
+        executeSql( "ALTER TABLE patientdatavaluearchive DROP COLUMN categoryoptioncomboid" );
+        
         log.info( "Tables updated" );
     }
 

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableCreator.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableCreator.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableCreator.java	2012-02-17 12:10:18 +0000
@@ -102,7 +102,6 @@
              " programstageinstanceid integer NOT NULL, " +
              " dataelementid integer NOT NULL, " +
              " organisationunitid integer NOT NULL, " +
-             " categoryoptioncomboid integer default NULL, " +
              " value varchar(255) default NULL, " +
              " providedbyanotherfacility boolean NOT NULL, " +
              " timestamp TIMESTAMP, " +

=== 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-01-03 03:50:58 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/DerbyStatementBuilder.java	2012-02-17 12:10:18 +0000
@@ -235,7 +235,6 @@
             + "WHERE d.programstageinstanceid=a.programstageinstanceid " 
             + "AND d.dataelementid=a.dataelementid "
             + "AND d.organisationunitid=a.organisationunitid " 
-            + "AND d.categoryoptioncomboid=a.categoryoptioncomboid "
             + "AND d.timestamp<a.timestamp;";
     }
 
@@ -245,8 +244,7 @@
             + "USING patientdatavalue AS d "
             + "WHERE d.programstageinstanceid=a.programstageinstanceid " 
             + "AND d.dataelementid=a.dataelementid "
-            + "AND d.organisationunitid=a.organisationunitid " 
-            + "AND d.categoryoptioncomboid=a.categoryoptioncomboid ";
+            + "AND d.organisationunitid=a.organisationunitid ";
     }
 
     public String deleteOldestOverlappingPatientDataValue()
@@ -256,7 +254,6 @@
             + "WHERE d.programstageinstanceid=a.programstageinstanceid " 
             + "AND d.dataelementid=a.dataelementid "
             + "AND d.organisationunitid=a.organisationunitid " 
-            + "AND d.categoryoptioncomboid=a.categoryoptioncomboid "
             + "AND d.timestamp<a.timestamp;";
     }
 
@@ -264,7 +261,7 @@
     {
         return "DELETE FROM patientdatavalue AS d " + "USING patientdatavaluearchive AS a "
             + "WHERE d.programstageinstanceid=a.programstageinstanceid " + "AND d.dataelementid=a.dataelementid "
-            + "AND d.organisationunitid=a.organisationunitid " + "AND d.categoryoptioncomboid=a.categoryoptioncomboid "
+            + "AND d.organisationunitid=a.organisationunitid "
             + "AND a.timestamp<=d.timestamp;";
     }
 

=== 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-01-03 03:50:58 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/H2StatementBuilder.java	2012-02-17 12:10:18 +0000
@@ -250,7 +250,6 @@
                 "WHERE d.programstageinstanceid=a.programstageinstanceid " +
                 "AND d.dataelementid=a.dataelementid " +
                 "AND d.organisationunitid=a.organisationunitid " +
-                "AND d.categoryoptioncomboid=a.categoryoptioncomboid " +
                 "AND d.timestamp<a.timestamp;";
     }
     
@@ -260,8 +259,7 @@
                 "USING patientdatavalue AS d " +
                 "WHERE d.programstageinstanceid=a.programstageinstanceid " +
                 "AND d.dataelementid=a.dataelementid " +
-                "AND d.organisationunitid=a.organisationunitid " +
-                "AND d.categoryoptioncomboid=a.categoryoptioncomboid ";
+                "AND d.organisationunitid=a.organisationunitid ";
     }
     
     public String deleteOldestOverlappingPatientDataValue()
@@ -271,7 +269,6 @@
                 "WHERE d.programstageinstanceid=a.programstageinstanceid " +
                 "AND d.dataelementid=a.dataelementid " +
                 "AND d.organisationunitid=a.organisationunitid " +
-                "AND d.categoryoptioncomboid=a.categoryoptioncomboid " +
                 "AND d.timestamp<a.timestamp;";
     }
     
@@ -282,7 +279,6 @@
                 "WHERE d.programstageinstanceid=a.programstageinstanceid " +
                 "AND d.dataelementid=a.dataelementid " +
                 "AND d.organisationunitid=a.organisationunitid " +
-                "AND d.categoryoptioncomboid=a.categoryoptioncomboid " +
                 "AND a.timestamp<=d.timestamp;";
     }
     

=== 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-01-03 03:50:58 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/MySQLStatementBuilder.java	2012-02-17 12:10:18 +0000
@@ -248,8 +248,7 @@
             "INNER JOIN patientdatavaluearchive AS a " +
             "WHERE d.programstageinstanceid=a.programstageinstanceid " +
             "AND d.dataelementid=a.dataelementid " +
-            "AND d.organisationunitid=a.organisationunitid " +
-            "AND d.categoryoptioncomboid=a.categoryoptioncomboid;";
+            "AND d.organisationunitid=a.organisationunitid; " ;
     }
    
     public String deleteArchivedOverlappingPatientData()
@@ -258,8 +257,7 @@
             "INNER JOIN patientdatavalue AS d " +
             "WHERE d.programstageinstanceid=a.programstageinstanceid " +
             "AND d.dataelementid=a.dataelementid " +
-            "AND d.organisationunitid=a.organisationunitid " +
-            "AND d.categoryoptioncomboid=a.categoryoptioncomboid ";
+            "AND d.organisationunitid=a.organisationunitid ";
     }
    
     public String deleteOldestOverlappingPatientDataValue()
@@ -269,7 +267,6 @@
             "WHERE d.programstageinstanceid=a.programstageinstanceid " +
             "AND d.dataelementid=a.dataelementid " +
             "AND d.organisationunitid=a.organisationunitid " +
-            "AND d.categoryoptioncomboid=a.categoryoptioncomboid " +
             "AND d.timestamp<a.timestamp;";
     }
    
@@ -280,7 +277,6 @@
             "WHERE d.programstageinstanceid=a.programstageinstanceid " +
             "AND d.dataelementid=a.dataelementid " +
             "AND d.organisationunitid=a.organisationunitid " +
-            "AND d.categoryoptioncomboid=a.categoryoptioncomboid " +
             "AND a.timestamp<=d.timestamp;";
     }
 

=== 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-01-03 03:50:58 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/PostgreSQLStatementBuilder.java	2012-02-17 12:10:18 +0000
@@ -247,8 +247,7 @@
                 "USING patientdatavaluearchive AS a " +
                 "WHERE d.programstageinstanceid=a.programstageinstanceid " +
                 "AND d.dataelementid=a.dataelementid " +
-                "AND d.organisationunitid=a.organisationunitid " +
-                "AND d.categoryoptioncomboid=a.categoryoptioncomboid ";
+                "AND d.organisationunitid=a.organisationunitid; ";
     }
     
     public String deleteArchivedOverlappingPatientData()
@@ -257,8 +256,7 @@
                 "USING patientdatavalue AS d " +
                 "WHERE d.programstageinstanceid=a.programstageinstanceid " +
                 "AND d.dataelementid=a.dataelementid " +
-                "AND d.organisationunitid=a.organisationunitid " +
-                "AND d.categoryoptioncomboid=a.categoryoptioncomboid ";
+                "AND d.organisationunitid=a.organisationunitid ";
     }
     
     public String deleteOldestOverlappingPatientDataValue()
@@ -268,7 +266,6 @@
                 "WHERE d.programstageinstanceid=a.programstageinstanceid " +
                 "AND d.dataelementid=a.dataelementid " +
                 "AND d.organisationunitid=a.organisationunitid " +
-                "AND d.categoryoptioncomboid=a.categoryoptioncomboid " +
                 "AND d.timestamp<a.timestamp;";
     }
     
@@ -279,7 +276,6 @@
                 "WHERE d.programstageinstanceid=a.programstageinstanceid " +
                 "AND d.dataelementid=a.dataelementid " +
                 "AND d.organisationunitid=a.organisationunitid " +
-                "AND d.categoryoptioncomboid=a.categoryoptioncomboid " +
                 "AND a.timestamp<=d.timestamp;";
     }