-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfig.json
338 lines (338 loc) · 12.8 KB
/
config.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
{
"name": "API Sync",
"namespace": "Vanderbilt\\APISyncExternalModule",
"framework-version": 10,
"description": "Automates exporting/importing to/from remote REDCap servers via the API. The Data Dictionaries for the local and remote projects are expected to be either identical or compatible. This module could easily be expanded to support additional scenarios (like automatically syncing the data dictionary as well).",
"authors": [
{
"name": "Mark McEver",
"email": "datacore@vumc.org",
"institution": "Vanderbilt University Medical Center"
}
],
"compatibility": {
"redcap-version-min": "11.2.0"
},
"permissions": [],
"project-settings": [
{
"key": "error-recipients",
"name": "<b>Error Recipients</b> - If left blank, errors will be sent to all users with design rights",
"type": "user-list",
"repeatable": true
},
{
"key": "log-requests",
"name": "<b>Log Request Contents</b> - Only check this <b>TEMPORARILY</b> while debugging, or a significant amount of space will be used in the database",
"type": "checkbox"
},
{
"key": "export-descriptive",
"name": "<h5 style='margin-top: 10px'>Exports</h5> Exports overwrite remote data with local data. Automatic exports of fields changed since the last export (according the the 'Logging' page) can be configured below. Initial exports (or exports delayed due to misconfiguration or cron issues) will only sync changes up to one week ago for performance reasons. All records may also be exported at once via the <b>API Sync</b> page/link in the left menu.",
"type": "descriptive"
},
{
"key": "export-minute",
"name": "<b>Weekly/Daily/Hourly Export Minute (0-59)</b><br>• The minute on which weekly, daily, or hourly exports will occur<br>• If omitted, neither weekly nor daily nor hourly exports will occur",
"type": "text"
},
{
"key": "export-hour",
"name": "<b>Weekly/Daily Export Hour (0-23)</b><br>• The hour on which weekly or daily exports will occur<br>• If omitted, exports will occur hourly. However, weekly or daily exports are recommended whenever possible to minimize server resource usage",
"type": "text"
},
{
"key": "export-weekday",
"name": "<b>Export Day of Week (0-6)</b><br>• The day of the week on which the export will occur. Sunday = 0, Monday = 1, ..., Saturday = 6.<br>• Requires that Export Hour is set. <br>• If omitted, exports will occur daily",
"type": "text"
},
{
"key": "export-exclude-identifiers",
"name": "Exclude Identifiers From Exports",
"type": "checkbox"
},
{
"key": "export-shift-dates",
"name": "Shift Dates",
"type": "checkbox"
},
{
"key": "export-batch-size",
"name": "<b>Max Records Per Batch</b><br>This value <b>should be left blank</b> to allow auto-calculation unless a more optimal size for the project/servers has been <b>carefully calculated</b>, and the <b>sync is monitored</b> to ensure it completes as quickly as possible to avoid consuming <b>significant server resources</b>",
"type": "text"
},
{
"key": "export-sub-batch-size",
"name": "<b>Max Megabytes Per Sub-Batch</b><br>This value defaults to <b>7</b> if left blank. It should be set only with great care while <b>monitoring the sync</b> to ensure it completes as quickly as possible to avoid consuming <b>significant server resources</b>",
"type": "text"
},
{
"key": "export-field-list-type-all",
"name": "<b>Field List Type</b> - If left blank, the list below will be ignored",
"type": "dropdown",
"choices": [
{
"name": "Include - Only the fields listed below will be exported",
"value": "include"
},
{
"name": "Exclude - All fields will be exported except those listed below",
"value": "exclude"
}
]
},
{
"key": "export-field-list-all",
"name": "Field List",
"type": "field-list",
"repeatable": true
},
{
"key": "export-servers",
"name": "Export Destinations",
"type": "sub_settings",
"repeatable" : true,
"sub_settings" : [
{
"key": "export-redcap-url",
"name": "Remote REDCap URL (ex: redcap.vanderbilt.edu)",
"type": "text"
},
{
"key": "export-projects",
"name": "Projects",
"type": "sub_settings",
"repeatable" : true,
"sub_settings" : [
{
"key": "export-project-name",
"name": "<div style='max-width: 350px; display: inline-block; vertical-align: top;'><b>Project Name</b> - This is required, but is only used for local logging and does not have to exactly match the remote project.</div>",
"type": "text"
},
{
"key": "export-api-key",
"name": "API Key",
"type": "text"
},
{
"key": "export-record-id-prefix",
"name": "<div style='max-width: 350px; display: inline-block; vertical-align: top;'><b>Record ID Prefix</b> - Optional, but highly recommend if data is coming into the destination project from other sources. This prefix will be prepended to all exported records ids to ensure that they're unique on the destination.</div>",
"type": "text"
},
{
"key": "export-field-list-type",
"name": "<b>Field List Type</b> - This and the list below override the top level Field List settings shared by all exports. If left blank, the list below will be ignored",
"type": "dropdown",
"choices": [
{
"name": "Include - Only the fields listed below will be exported",
"value": "include"
},
{
"name": "Exclude - All fields will be exported except those listed below",
"value": "exclude"
}
]
},
{
"key": "export-field-list",
"name": "Field List",
"type": "field-list",
"repeatable": true
},
{
"key": "export-form-translations",
"name": "JSON matrix containing form name translations. To specify translations, visit the 'Configure Translations' module page in the project sidebar",
"type": "text",
"hidden": true
},
{
"key": "export-event-translations",
"name": "JSON matrix containing event name translations. To specify translations, visit the 'Configure Translations' module page in the project sidebar",
"type": "text",
"hidden": true
}
]
}
]
},
{
"key": "import-descriptive",
"name": "<h5 style='margin-top: 10px'>Imports</h5> Imports overwrite local data with remote data. Imports can be configured to occur automatically below, or can be triggered manually via the <b>API Sync</b> page/link in the left menu. Imports may take a long time on large projects. In one test case an import took 15 minutes for a project with about 10,000 records and 1,500 fields.",
"type": "descriptive"
},
{
"key": "import-filter-logic-all",
"name": "<b>Filter Logic</b> - Used to limit which records are included in the sync. This will include records in the same way that a report would that uses the same logic and displays only record IDs. ALL events & instances are synced for matching records",
"type": "textarea"
},
{
"key": "import-field-list-type-all",
"name": "<b>Field List Type</b> - If left blank, the list below will be ignored",
"type": "dropdown",
"choices": [
{
"name": "Include - Only the fields listed below will be imported",
"value": "include"
},
{
"name": "Exclude - All fields will be imported except those listed below",
"value": "exclude"
}
]
},
{
"key": "import-field-list-all",
"name": "Field List",
"type": "field-list",
"repeatable": true
},
{
"key": "servers",
"name": "Import Sources",
"type": "sub_settings",
"repeatable" : true,
"sub_settings" : [
{
"key": "redcap-url",
"name": "Remote REDCap URL (ex: redcap.vanderbilt.edu)",
"type": "text"
},
{
"key": "daily-record-import-minute",
"name": "<div style='display: inline-block; vertical-align: top'><b>Weekly/Daily/Hourly Import Minute (0-59)</b><br>• The minute on which weekly, daily, or hourly imports will occur<br>• If omitted, neither weekly nor daily nor hourly imports will occur</div>",
"type": "text"
},
{
"key": "daily-record-import-hour",
"name": "<div style='display: inline-block; vertical-align: top'><b>Weekly/Daily Import Hour (0-23)</b><br>• The hour on which weekly or daily imports will occur<br>• If omitted, imports will occur hourly</div>",
"type": "text"
},
{
"key": "daily-record-import-weekday",
"name": "<div style='display: inline-block; vertical-align: top'><b>Import Day of Week (0-6)</b><br>• The day of the week on which the export will occur. Sunday = 0, Monday = 1, ..., Saturday = 6.<br>• Requires that Import Hour is set. <br>• If omitted, exports will occur daily</div>",
"type": "text"
},
{
"key": "last-import-time",
"name": "Last Import Time - Do <b>NOT</b> modify this setting",
"type": "text",
"hidden": true
},
{
"key": "projects",
"name": "Projects",
"type": "sub_settings",
"repeatable" : true,
"sub_settings" : [
{
"key": "api-key",
"name": "API Key",
"type": "text"
},
{
"key": "record-id-prefix",
"name": "<div style='max-width: 350px; display: inline-block; vertical-align: top;'><b>Record ID Prefix</b> - If data is being imported from multiple projects or entered manually it is <b>highly recommended</b> to specify a record id prefix. This prefix will be prepended to all imported records ids to ensure that they're unique.</div>",
"type": "text"
},
{
"key": "import-batch-size",
"name": "Import Batch Size (optional)",
"type": "text"
},
{
"key": "import-filter-logic-combination-operator",
"name": "<b>Filter Logic Combination Operator</b> - If <b>Filter Logic</b> is specified for all projects AND this project, this operator will be used to combine the logic",
"type": "dropdown",
"choices": [
{
"name": "AND",
"value": "AND"
},
{
"name": "OR",
"value": "OR"
}
]
},
{
"key": "import-filter-logic",
"name": "<b>Filter Logic</b> - Used to limit which records are included in the sync. This will include records in the same way that a report would that uses the same logic and displays only record IDs. ALL events & instances are synced for matching records",
"type": "textarea"
},
{
"key": "import-field-list-type",
"name": "<b>Field List Type</b> - This and the list below override the top level Field List settings shared by all imports. If left blank, the list below will be ignored",
"type": "dropdown",
"choices": [
{
"name": "Include - Only the fields listed below will be imported",
"value": "include"
},
{
"name": "Exclude - All fields will be imported except those listed below",
"value": "exclude"
}
]
},
{
"key": "import-field-list",
"name": "Field List",
"type": "field-list",
"repeatable": true
},
{
"key": "form-translations",
"name": "DO NOT MODIFY THIS SETTING. This setting can be safely marked as 'hidden' in config.json once this module is updated to framework version 13. JSON matrix containing form name translations. To specify translations, visit the 'Configure Translations' module page in the project sidebar",
"type": "text"
},
{
"key": "event-translations",
"name": "DO NOT MODIFY THIS SETTING. This setting can be safely marked as 'hidden' in config.json once this module is updated to framework version 13. JSON matrix containing event name translations. To specify translations, visit the 'Configure Translations' module page in the project sidebar",
"type": "text"
}
]
}
]
}
],
"links": {
"project": [
{
"name": "API Sync",
"icon": "databases_arrow",
"url": "api-sync.php",
"show-header-and-footer": true
},
{
"name": "API Sync - Configure Translations",
"icon": "databases_arrow",
"url": "config_translations.php",
"show-header-and-footer": false
},
{
"name": "API Sync - Latest Activity",
"icon": "list-alt",
"url": "log_digest.php",
"show-header-and-footer": true
}
]
},
"crons": [
{
"cron_name": "exports",
"cron_description": "API Sync External Module - Exports",
"method": "cron",
"cron_frequency": "60",
"cron_max_run_time": "86400"
},
{
"cron_name": "imports",
"cron_description": "API Sync External Module - Imports",
"method": "cron",
"cron_frequency": "60",
"cron_max_run_time": "86400",
"comment": "Imports are in a separate cron so that long running imports do not prevent real-time exports from occurring."
}
]
}