Skip to content

Commit 3b389ba

Browse files
authored
fix(data): cleaning questionnaire data (#602)
* remove legacy data * resolve foreign key issue * fix foreign key contraint * CR * fix foreign key contraint * rename files * slipt dictionary table&fix missing data
1 parent 8716cb5 commit 3b389ba

16 files changed

+7391
-36956
lines changed

db_management/questionnairedb/data/initial/01_dictionary.sql

Lines changed: 4969 additions & 16425 deletions
Large diffs are not rendered by default.

db_management/questionnairedb/data/initial/01_initial.sql

Lines changed: 815 additions & 7639 deletions
Large diffs are not rendered by default.

db_management/questionnairedb/data/test/01_dictionary.sql

Lines changed: 579 additions & 5591 deletions
Large diffs are not rendered by default.

db_management/questionnairedb/data/test/02_question.sql

Lines changed: 23 additions & 608 deletions
Large diffs are not rendered by default.

db_management/questionnairedb/data/test/03_questionSection.sql

Lines changed: 0 additions & 1230 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
-- SPDX-FileCopyrightText: Copyright (C) 2023 Opal Health Informatics Group at the Research Institute of the McGill University Health Centre <[email protected]>
2+
--
3+
-- SPDX-License-Identifier: AGPL-3.0-or-later
4+
INSERT INTO `questionnaire` VALUES
5+
(12, -1, 1, 1, 213, -1, -1, 1190, -1, 1, 1, -1, 0, 1, 1, '', 0, '', '2019-11-05 19:04:15', 'QUESTIONNAIRE_MIGRATION_2019', '2019-11-07 14:23:51', 'QUESTIONNAIRE_MIGRATION_2019', 'Edmonton Symptom Assessment System / Échelle d\'évaluation des symptômes d\'Edmonton'),
6+
(26, -1, 1, 1, 549, -1, -1, 1197, -1, 1, 1, -1, 0, 1, 0, '', 0, '', '2019-11-05 19:04:17', 'QUESTIONNAIRE_MIGRATION_2019', '2019-11-07 14:23:51', 'QUESTIONNAIRE_MIGRATION_2019', 'Patient-Reported Daily Side Effects / Effects secondaires quotidiens signalés par le patient'),
7+
(111, 28, 1, 1, 2809, 2811, -1, 2810, 2812, 1, 1, -1, 0, 1, 0, '', 0, '', '2020-05-26 16:51:54', 'MACFARIA', '2020-08-26 20:00:12', 'MACFARIA', ''),
8+
(134, 28, 1, 1, 4848, 4850, -1, 4849, 4851, 1, 1, -1, 0, 1, 0, '', 0, '', '2020-07-24 10:50:55', 'MACFARIA', '2020-08-07 15:12:10', 'briana', ''),
9+
(137, 28, 1, 1, 5100, 5102, -1, 5101, 5103, 1, 1, -1, 0, 1, 0, '', 0, '', '2020-07-26 13:54:52', 'MACFARIA', '2020-08-07 15:14:59', 'briana', ''),
10+
(139, 8, 1, 1, 5412, 5414, -1, 5413, 5415, 1, 1, -1, 0, 1, 0, '', 0, '', '2020-08-10 09:20:25', 'briana', '2020-08-10 13:21:22', 'briana', ''),
11+
(248, 13, 4, 1, 20077, 20079, -1, 20078, 20080, 1, 1, -1, 0, 1, 0, '', 0, '', '2023-12-20 13:52:15', 'AGKE6000', '2023-12-20 13:52:28', 'AGKE6000', '');

db_management/questionnairedb/data/test/04_section.sql

Lines changed: 7 additions & 141 deletions
Large diffs are not rendered by default.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
-- SPDX-FileCopyrightText: Copyright (C) 2023 Opal Health Informatics Group at the Research Institute of the McGill University Health Centre <[email protected]>
2+
--
3+
-- SPDX-License-Identifier: AGPL-3.0-or-later
4+
5+
INSERT INTO `questionSection` VALUES
6+
(109, 791, 12, 1, 0, 0),
7+
(110, 794, 12, 2, 0, 0),
8+
(111, 795, 12, 3, 0, 0),
9+
(112, 791, 12, 1, 0, 0),
10+
(113, 796, 12, 4, 0, 0),
11+
(114, 796, 12, 6, 0, 0),
12+
(115, 799, 12, 7, 0, 0),
13+
(116, 797, 12, 5, 0, 0),
14+
(117, 798, 12, 6, 0, 0),
15+
(181, 885, 26, 1, 0, 0),
16+
(182, 886, 26, 2, 0, 0),
17+
(183, 887, 26, 3, 0, 0),
18+
(597, 1130, 61, 1, 0, 0),
19+
(598, 1131, 61, 2, 0, 0),
20+
(599, 1132, 61, 3, 0, 0),
21+
(600, 1133, 61, 4, 0, 0),
22+
(601, 1134, 61, 5, 0, 0),
23+
(602, 1135, 61, 6, 0, 0),
24+
(603, 1136, 61, 7, 0, 0),
25+
(1161, 1121, 84, 1, 0, 0),
26+
(1162, 1122, 84, 2, 0, 0),
27+
(1163, 1123, 84, 3, 0, 0),
28+
(1164, 1124, 84, 4, 0, 0),
29+
(1165, 1125, 84, 5, 0, 0),
30+
(1166, 1126, 84, 6, 0, 0),
31+
(1167, 1127, 84, 7, 0, 0),
32+
(1168, 1128, 84, 8, 0, 0),
33+
(1169, 1129, 84, 9, 0, 0),
34+
(1201, 1359, 87, 9, 0, 0),
35+
(1203, 1351, 84, 10, 0, 1),
36+
(1221, 1380, 87, 2, 0, 0),
37+
(1222, 1382, 87, 4, 0, 0),
38+
(1223, 1383, 87, 5, 0, 0),
39+
(1224, 1385, 87, 7, 0, 0),
40+
(1225, 1384, 87, 6, 0, 0),
41+
(1226, 1386, 87, 8, 0, 1),
42+
(1228, 1381, 87, 3, 0, 0),
43+
(1229, 1162, 87, 1, 0, 0),
44+
(1231, 1390, 89, 1, 0, 0),
45+
(1232, 1391, 89, 2, 0, 0),
46+
(1233, 1392, 89, 3, 0, 0),
47+
(1234, 1393, 89, 4, 0, 0),
48+
(1235, 1394, 89, 5, 0, 0),
49+
(1236, 1395, 89, 6, 0, 0),
50+
(1237, 1396, 89, 7, 0, 0),
51+
(1238, 1397, 89, 8, 0, 0),
52+
(1239, 1398, 89, 9, 0, 0),
53+
(1240, 1351, 89, 10, 0, 1),
54+
-- finalized econsent form
55+
(2656, 1942, 198, 1, 0, 1),
56+
(2657, 1943, 198, 2, 0, 0),
57+
(2658, 1944, 198, 3, 0, 0),
58+
(2659, 1945, 198, 4, 0, 0);

db_management/questionnairedb/data/test/05_questionnaire.sql

Lines changed: 0 additions & 147 deletions
This file was deleted.
Lines changed: 272 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,272 @@
1+
-- SPDX-FileCopyrightText: Copyright (C) 2023 Opal Health Informatics Group at the Research Institute of the McGill University Health Centre <[email protected]>
2+
--
3+
-- SPDX-License-Identifier: AGPL-3.0-or-later
4+
5+
-- Insert question details
6+
INSERT INTO `checkbox` (`ID`, `questionId`, `minAnswer`, `maxAnswer`) VALUES
7+
(24, 1380, 1, 5),
8+
(25, 1381, 1, 4),
9+
(26, 1382, 1, 4),
10+
(27, 1383, 1, 5),
11+
(28, 1384, 1, 8),
12+
(29, 1385, 1, 4);
13+
14+
INSERT INTO `checkboxOption` (`ID`, `parentTableId`, `order`, `description`, `specialAction`) VALUES
15+
(202, 24, 1, 5254, 0),
16+
(203, 24, 2, 5255, 0),
17+
(204, 24, 3, 5256, 0),
18+
(205, 24, 4, 5257, 0),
19+
(206, 24, 5, 5258, 0),
20+
(207, 25, 1, 5262, 0),
21+
(208, 25, 2, 5263, 0),
22+
(209, 25, 3, 5264, 0),
23+
(210, 25, 4, 5265, 0),
24+
(211, 26, 1, 5269, 0),
25+
(212, 26, 2, 5270, 0),
26+
(213, 26, 3, 5271, 0),
27+
(214, 26, 4, 5272, 0),
28+
(215, 27, 1, 5276, 0),
29+
(216, 27, 2, 5277, 0),
30+
(217, 27, 3, 5278, 0),
31+
(218, 27, 4, 5279, 0),
32+
(219, 27, 5, 5280, 0),
33+
(220, 28, 1, 5284, 0),
34+
(221, 28, 2, 5285, 0),
35+
(222, 28, 3, 5286, 0),
36+
(223, 28, 4, 5287, 0),
37+
(224, 28, 5, 5288, 0),
38+
(225, 28, 6, 5289, 0),
39+
(226, 28, 7, 5290, 0),
40+
(227, 28, 8, 5291, 0),
41+
(228, 29, 1, 5295, 0),
42+
(229, 29, 2, 5296, 0),
43+
(230, 29, 3, 5297, 0),
44+
(231, 29, 4, 5298, 0);
45+
46+
INSERT INTO `library` (`ID`, `OAUserId`, `name`, `order`, `private`, `deleted`, `deletedBy`, `creationDate`, `createdBy`, `lastUpdated`, `updatedBy`) VALUES
47+
(13, 28, 2575, 1, 0, 0, '', '2020-05-25 17:44:27', 'MACFARIA', '2020-05-26 01:44:27', 'MACFARIA'),
48+
(14, 28, 2650, 1, 0, 0, '', '2020-05-25 18:20:18', 'MACFARIA', '2020-05-26 02:20:18', 'MACFARIA'),
49+
(32, 28, 4922, 1, 0, 0, '', '2020-07-24 15:55:52', 'MACFARIA', '2020-07-24 23:55:52', 'MACFARIA'),
50+
(33, 28, 5106, 1, 0, 0, '', '2020-07-26 14:02:41', 'MACFARIA', '2020-07-26 22:02:41', 'MACFARIA'),
51+
(35, 8, 5348, 1, 0, 0, '', '2020-08-10 08:46:50', 'briana', '2020-08-10 16:46:50', 'briana');
52+
53+
INSERT INTO `libraryQuestion` (`ID`, `questionId`, `libraryId`) VALUES
54+
(160, 1121, 13),
55+
(161, 1122, 13),
56+
(162, 1123, 13),
57+
(163, 1124, 13),
58+
(164, 1125, 13),
59+
(165, 1126, 13),
60+
(166, 1127, 13),
61+
(167, 1128, 13),
62+
(168, 1129, 13),
63+
(169, 1130, 14),
64+
(170, 1131, 14),
65+
(171, 1132, 14),
66+
(172, 1133, 14),
67+
(173, 1134, 14),
68+
(174, 1135, 14),
69+
(175, 1136, 14),
70+
(489, 1351, 13),
71+
(497, 1359, 32),
72+
(518, 1162, 33),
73+
(519, 1380, 33),
74+
(520, 1382, 33),
75+
(521, 1383, 33),
76+
(522, 1384, 33),
77+
(523, 1385, 33),
78+
(524, 1386, 33),
79+
(528, 1390, 35),
80+
(529, 1391, 35),
81+
(530, 1392, 35),
82+
(531, 1393, 35),
83+
(532, 1394, 35),
84+
(533, 1395, 35),
85+
(534, 1396, 35),
86+
(535, 1397, 35),
87+
(536, 1398, 35);
88+
89+
INSERT INTO `radioButton` (`ID`, `questionId`) VALUES
90+
(42, 885),
91+
(43, 886),
92+
(44, 887),
93+
(227, 1121),
94+
(228, 1122),
95+
(229, 1123),
96+
(230, 1124),
97+
(231, 1125),
98+
(232, 1126),
99+
(233, 1127),
100+
(234, 1128),
101+
(235, 1129),
102+
(236, 1130),
103+
(237, 1131),
104+
(238, 1132),
105+
(239, 1133),
106+
(240, 1134),
107+
(241, 1135),
108+
(242, 1136),
109+
(259, 1162),
110+
(399, 1351),
111+
(407, 1359),
112+
(426, 1390),
113+
(427, 1391),
114+
(428, 1392),
115+
(429, 1393),
116+
(430, 1394),
117+
(431, 1395),
118+
(432, 1396),
119+
(433, 1397),
120+
(434, 1398),
121+
(784, 1944),
122+
(785, 1945);
123+
124+
INSERT INTO `radioButtonOption` (`ID`, `parentTableId`, `description`, `order`) VALUES
125+
(168, 42, 554, 1),
126+
(169, 42, 555, 2),
127+
(170, 42, 556, 3),
128+
(171, 42, 557, 4),
129+
(172, 43, 561, 1),
130+
(173, 43, 562, 2),
131+
(174, 43, 563, 3),
132+
(175, 43, 564, 4),
133+
(176, 44, 568, 1),
134+
(177, 44, 569, 2),
135+
(178, 44, 570, 3),
136+
(179, 44, 571, 4),
137+
(1120, 227, 2579, 1),
138+
(1121, 227, 2580, 2),
139+
(1122, 227, 2581, 3),
140+
(1123, 227, 2582, 4),
141+
(1124, 228, 2586, 1),
142+
(1125, 228, 2587, 2),
143+
(1126, 228, 2588, 3),
144+
(1127, 228, 2589, 4),
145+
(1128, 229, 2593, 1),
146+
(1129, 229, 2594, 2),
147+
(1130, 229, 2595, 3),
148+
(1131, 229, 2596, 4),
149+
(1132, 230, 2600, 1),
150+
(1133, 230, 2601, 2),
151+
(1134, 230, 2602, 3),
152+
(1135, 230, 2603, 4),
153+
(1136, 231, 2607, 1),
154+
(1137, 231, 2608, 2),
155+
(1138, 231, 2609, 3),
156+
(1139, 231, 2610, 4),
157+
(1140, 232, 2614, 1),
158+
(1141, 232, 2615, 2),
159+
(1142, 232, 2616, 3),
160+
(1143, 232, 2617, 4),
161+
(1144, 233, 2621, 1),
162+
(1145, 233, 2622, 2),
163+
(1146, 233, 2623, 3),
164+
(1147, 233, 2624, 4),
165+
(1148, 234, 2628, 1),
166+
(1149, 234, 2629, 2),
167+
(1150, 234, 2630, 3),
168+
(1151, 234, 2631, 4),
169+
(1152, 235, 2635, 1),
170+
(1153, 235, 2636, 2),
171+
(1154, 235, 2637, 3),
172+
(1155, 235, 2638, 4),
173+
(1156, 236, 2654, 1),
174+
(1157, 236, 2655, 2),
175+
(1158, 236, 2656, 3),
176+
(1159, 236, 2657, 4),
177+
(1160, 237, 2661, 1),
178+
(1161, 237, 2662, 2),
179+
(1162, 237, 2663, 3),
180+
(1163, 237, 2664, 4),
181+
(1164, 238, 2668, 1),
182+
(1165, 238, 2669, 2),
183+
(1166, 238, 2670, 3),
184+
(1167, 238, 2671, 4),
185+
(1168, 239, 2675, 1),
186+
(1169, 239, 2676, 2),
187+
(1170, 239, 2677, 3),
188+
(1171, 239, 2678, 4),
189+
(1172, 240, 2682, 1),
190+
(1173, 240, 2683, 2),
191+
(1174, 240, 2684, 3),
192+
(1175, 240, 2685, 4),
193+
(1176, 241, 2689, 1),
194+
(1177, 241, 2690, 2),
195+
(1178, 241, 2691, 3),
196+
(1179, 241, 2692, 4),
197+
(1180, 242, 2696, 1),
198+
(1181, 242, 2697, 2),
199+
(1182, 242, 2698, 3),
200+
(1183, 242, 2699, 4),
201+
(1252, 259, 2999, 1),
202+
(1253, 259, 3000, 2),
203+
(1254, 259, 3001, 3),
204+
(1255, 259, 3002, 4),
205+
(1256, 259, 3003, 5),
206+
(1257, 259, 3004, 6),
207+
(1258, 259, 3005, 7),
208+
(1259, 259, 3006, 8),
209+
(1260, 259, 3007, 9),
210+
(1261, 259, 3008, 10),
211+
(1262, 259, 3009, 11),
212+
(1878, 399, 4844, 1),
213+
(1879, 399, 4845, 2),
214+
(1880, 399, 4846, 3),
215+
(1881, 399, 4847, 4),
216+
(1910, 407, 4926, 1),
217+
(1911, 407, 4927, 2),
218+
(2075, 426, 5352, 1),
219+
(2076, 426, 5353, 2),
220+
(2077, 426, 5354, 3),
221+
(2078, 426, 5355, 4),
222+
(2079, 427, 5359, 1),
223+
(2080, 427, 5360, 2),
224+
(2081, 427, 5361, 3),
225+
(2082, 427, 5362, 4),
226+
(2083, 428, 5366, 1),
227+
(2084, 428, 5367, 2),
228+
(2085, 428, 5368, 3),
229+
(2086, 428, 5369, 4),
230+
(2087, 429, 5373, 1),
231+
(2088, 429, 5374, 2),
232+
(2089, 429, 5375, 3),
233+
(2090, 429, 5376, 4),
234+
(2091, 430, 5380, 1),
235+
(2092, 430, 5381, 2),
236+
(2093, 430, 5382, 3),
237+
(2094, 430, 5383, 4),
238+
(2095, 431, 5387, 1),
239+
(2096, 431, 5388, 2),
240+
(2097, 431, 5389, 3),
241+
(2098, 431, 5390, 4),
242+
(2099, 432, 5394, 1),
243+
(2100, 432, 5395, 2),
244+
(2101, 432, 5396, 3),
245+
(2102, 432, 5397, 4),
246+
(2103, 433, 5401, 1),
247+
(2104, 433, 5402, 2),
248+
(2105, 433, 5403, 3),
249+
(2106, 433, 5404, 4),
250+
(2107, 434, 5408, 1),
251+
(2108, 434, 5409, 2),
252+
(2109, 434, 5410, 3),
253+
(2110, 434, 5411, 4),
254+
(3764, 784, 20070, 1),
255+
(3765, 784, 20071, 2),
256+
(3766, 785, 20075, 1),
257+
(3767, 785, 20076, 2);
258+
259+
INSERT INTO `slider` (`ID`, `questionId`, `minValue`, `maxValue`, `minCaption`, `maxCaption`, `increment`) VALUES
260+
(5, 791, 1, 10, 218, 219, 1),
261+
(6, 794, 1, 10, 223, 224, 1),
262+
(7, 795, 1, 10, 228, 229, 1),
263+
(8, 796, 1, 10, 233, 234, 1),
264+
(9, 797, 1, 10, 238, 239, 1),
265+
(10, 798, 1, 10, 243, 244, 1),
266+
(11, 799, 1, 10, 248, 249, 1);
267+
268+
INSERT INTO `textBox` (`ID`, `questionId`) VALUES
269+
(52, 1386),
270+
-- city of birth and middle name databank questions
271+
(100, 1942),
272+
(101, 1943);

0 commit comments

Comments
 (0)