Changeset 1955
- Timestamp:
- Apr 24, 2013, 1:47:20 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/testdata/cleanup_dev_clone.sql
r1830 r1955 16 16 17 17 * Replace the ROOT account login and password with 'root'/'root' 18 * Replace the PersonalNumber for all patients with '201212121212'19 18 * Replace the DateOfBirth with a random date for all patients 19 * Replace the PersonalNumber for all patients with a random based on the 'DateOfBith' annotation 20 20 * Replace the AllFirstNames and FamilyName with other values 21 21 */ … … 28 28 where id = (select u.id from `Users` u where u.system_id='net.sf.basedb.core.User.ROOT'); 29 29 30 /* Replace PersonalNumber with '201212121212' for all patients */31 update `StringValues` set value='201212121212'32 where id in33 (select a.value_id from `Annotations` a inner join `AnnotationTypes` at on at.id=a.annotationtype_id34 where at.name='PersonalNumber');35 36 30 /* Replace DateOfBirth with random values for all patients */ 37 31 update `DateValues` set value=makedate(1900+floor(100*rand()), ceil(365*rand())) … … 40 34 where at.name='DateOfBirth'); 41 35 36 /* Replace PersonalNumber with '201212121212' for all patients */ 37 /* 38 update `StringValues` set value='201212121212' 39 where id in 40 (select a.value_id from `Annotations` a inner join `AnnotationTypes` at on at.id=a.annotationtype_id 41 where at.name='PersonalNumber'); 42 */ 43 44 /* Replace PersonalNumber with value generated from corresponding DateOfBirth 45 * padded with 'X' and a random 3-digit number. Patients with no BirthOfDate will 46 * get '201212121212' as PersonalNumber. If this query doesn't work, use the one 47 * above instead which set all PersonalNumber's to '201212121212'. 48 */ 49 update `StringValues` pnr set pnr.value=coalesce(concat(date_format( 50 ( 51 select dofb.value from `DateValues` dofb 52 inner join `Annotations` a1 on dofb.id=a1.value_id 53 inner join `AnnotationTypes` at1 on at1.id=a1.annotationtype_id and at1.name='DateOfBirth' 54 inner join `Annotations` a2 on a1.annotationset_id=a2.annotationset_id 55 inner join `AnnotationTypes` at2 on at2.id=a2.annotationtype_id and at2.name='PersonalNumber' 56 where a2.value_id=pnr.id 57 ), 58 '%Y%m%d'), 100+floor(900*rand()), 'X'), '201212121212') 59 where pnr.id in 60 (select a.value_id from `Annotations` a inner join `AnnotationTypes` at on at.id=a.annotationtype_id 61 where at.name='PersonalNumber'); 62 42 63 /* Replace AllFirstNames with 'Blue', 'Red', 'Green', 'Yellow' or 'White' for all patients */ 43 64 update `StringValues` set value=
Note: See TracChangeset
for help on using the changeset viewer.