dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #27647
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13761: Minor fix in table alterator of patient-service.
------------------------------------------------------------
revno: 13761
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-01-17 13:08:31 +0700
message:
Minor fix in table alterator of patient-service.
modified:
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-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 2014-01-17 03:52:27 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java 2014-01-17 06:08:31 +0000
@@ -290,14 +290,13 @@
updateCoordinatesProgramStageInstance();
addPatientAttributes();
-
+
executeSql( "ALTER TABLE program DROP COLUMN useBirthDateAsIncidentDate" );
executeSql( "ALTER TABLE program DROP COLUMN useBirthDateAsEnrollmentDate" );
executeSql( "UPDATE patientattribute SET displayinlistnoprogram=false WHERE displayinlistnoprogram is null" );
executeSql( "UPDATE patientidentifiertype SET displayinlistnoprogram=false WHERE displayinlistnoprogram is null" );
-
- executeSql( "ALTER TABLE patientattribute DROP COLUMN displayedinlist" );
+
executeSql( "ALTER TABLE patientidentifiertype DROP COLUMN persondisplayname" );
updateProgramAttributes();
@@ -318,6 +317,8 @@
+ "FROM program_patientattributes pp";
executeSql( attributeSql );
+ log.info( "Inserted data into program_attributes table." );
+
String identifierSql = "INSERT INTO program_identifiertypes (programidentifiertypeid, identifiertypeid, sort_order, displayinlist, programid) "
+ "SELECT "
+ autoIncrVal
@@ -325,8 +326,14 @@
+ "FROM program_patientidentifiertypes pp";
executeSql( identifierSql );
- executeSql( "DROP TABLE program_patientattributes" );
- executeSql( "DROP TABLE program_patientidentifiertypes" );
+ log.info( "Inserted data into program_identifiertypes table." );
+
+ executeSql( "DROP TABLE program_patientattributes." );
+ log.info( "Dropped program_patientattributes table." );
+
+ executeSql( "DROP TABLE program_patientidentifiertypes." );
+ log.info( "Dropped program_patientidentifiertypes table." );
+
}
private void updateUid()
@@ -852,44 +859,45 @@
// Update custom entry form
removeFixedAttributeInCustomRegistrationForm( "associate", uid );
-
+
log.info( "Dropping fixed properties of person" );
executeSql( "ALTER TABLE patient DROP COLUMN gender" );
log.info( "Dropped gender column" );
-
+
executeSql( "ALTER TABLE patient DROP COLUMN deathDate" );
log.info( "Dropped deathDate column" );
-
+
executeSql( "ALTER TABLE patient DROP COLUMN registrationDate" );
log.info( "Dropped registrationdate column" );
-
+
executeSql( "ALTER TABLE patient DROP COLUMN isDead" );
log.info( "Dropped isdead column" );
-
+
executeSql( "ALTER TABLE patient DROP COLUMN underAge" );
log.info( "Dropped underage column" );
-
+
executeSql( "ALTER TABLE patient DROP COLUMN dobType" );
log.info( "Dropped dobType column" );
-
+
executeSql( "ALTER TABLE patient DROP COLUMN birthdate" );
log.info( "Dropped birthdate column" );
-
+
executeSql( "ALTER TABLE patient DROP COLUMN phoneNumber" );
log.info( "Dropped phoneNumber column" );
-
+
executeSql( "ALTER TABLE patient DROP COLUMN name" );
log.info( "Dropped name column" );
-
+
executeSql( "ALTER TABLE patient DROP COLUMN healthworkerid" );
log.info( "Dropped healthworkerid column" );
-
+
}
}
catch ( Exception ex )
{
+ ex.printStackTrace();
}
}