dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #18426
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7767: made patientdatavalue archiving work again
------------------------------------------------------------
revno: 7767
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-07-30 13:53:35 +0200
message:
made patientdatavalue archiving work again
modified:
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataarchive/jdbc/JdbcDataArchiveStore.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.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 2012-06-18 07:02:55 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataarchive/jdbc/JdbcDataArchiveStore.java 2012-07-30 11:53:35 +0000
@@ -171,7 +171,7 @@
// Move data from patientdatavalue to patientdatavaluearchive
String sql = "INSERT INTO patientdatavaluearchive ( "
+ "SELECT pdv.programstageinstanceid, pdv.dataelementid, pdv.value, "
- +" providedelsewhere, pdv.timestamp FROM patientdatavalue AS pdv "
+ +" pdv.timestamp, pdv.storedBy, pdv.providedelsewhere FROM patientdatavalue AS pdv "
+ "INNER JOIN programstageinstance AS psi "
+ "ON pdv.programstageinstanceid = psi.programstageinstanceid "
+ "INNER JOIN programinstance AS pi "
@@ -194,7 +194,7 @@
// Move data from patientdatavalue to patientdatavaluearchive
String sql = "INSERT INTO patientdatavalue ( "
+ "SELECT pdv.programstageinstanceid, pdv.dataelementid, pdv.value, "
- +"providedelsewhere, pdv.timestamp FROM patientdatavaluearchive AS pdv "
+ +" pdv.timestamp, pdv.providedelsewhere, pdv.storedBy 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-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java 2012-07-30 04:48:17 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java 2012-07-30 11:53:35 +0000
@@ -83,7 +83,8 @@
executeSql( "ALTER TABLE patientdatavalue DROP COLUMN categoryoptioncomboid" );
executeSql( "ALTER TABLE patientdatavaluearchive DROP COLUMN providedbyanotherfacility" );
executeSql( "ALTER TABLE patientdatavaluearchive DROP COLUMN organisationunitid" );
- executeSql( "ALTER TABLE patientdatavaluearchive DROP COLUMN storedby" );
+ executeSql( "ALTER TABLE patientdatavaluearchive ADD COLUMN storedby VARCHAR(31)" );
+ executeSql( "ALTER TABLE patientdatavaluearchive ADD COLUMN providedelsewhere BOOLEAN" );
executeSql( "DROP TABLE patientchart" );
executeSql( "ALTER TABLE program DROP COLUMN hidedateofincident" );