REDCap interface

版本 1.1.0 (6.1 KB) 作者: Oliver_Kripfgans
Matlab REDCap interface with basic commands to read and write data. The user needs proper token and user rights to a REDCap server.
23.0 次下载
更新时间 2024/1/27

查看许可证

REDCap interface
Oliver D. Kripfgans, University of Michigan, 2019-2021
General notes
  1. The user needs an API token to communicate with REDCap server. Inquire with your administrator about obtaining a token.
  2. The user needs to have proper User Rights within the Project, such as 'Data Export Tool' ('Full Data Set'), 'API' ('Export', 'Import')
  3. The user may have to be on the database network or via VPN
  4. Read the examples provided, the REDCap manual and use the API playground. REDCap is very useful but under reported via google etc
REDCap.m Inputs
  • 'arm' - cell array list of all arms available
  • 'event' - cell array list of all events available, per arm
  • 'exportfieldnames' - provides a table with fieldnames used for export
  • 'filename' - returns the filename of a file associated with a field
  • 'generateNextRecordName' - number of next record (when generated)
  • 'init' - sets up token, url, etc.
  • 'read' - reads records, fields, files, etc. Reading a field provides the field content. Reading a file requires a pathname underwhich the file is to be stored. On macOS (and Unix) the path can be for example: '~/Downloads'. On Windows 10 the path can for exmaple be: 'C:\Users\--username--\Downloads'.
  • 'report' - cell array list of specified report, very useful way to extract large data amount
  • 'write' - writes records, fields, files, etc. to REDCap. The maximum file size may vary. In the present setup it is ~35 MB per file. Writing a field requires the field content in exactly the format specified within REDCap! Writing a file requires a pathname from which the file is read from. Successful write replies with a '{"count": 1}', indicating that one content was written.
REDCap.m Outputs
Errors within REDCap.m are reported as:
  • 0 : normal execution, no error
  • -1.2: malformed input arguments to REDCap.m
  • -1.3: too few arguments
  • -1.4: unknown command
  • -1.5: URL for REDCap server not declared
  • -1.6: token not declared
Errors within redcap server/database are reported as: '{"error":"....error description ...."}'
Compatibility/Requirements
Requires system/unix calls for curl etc. as well as the webwrite command (and weboptions).
Acknowledgements
REDCap Database software from Vanderbilt University (https://redcap.vanderbilt.edu).
Currently REDCap 11.4.3 - © 2021 Vanderbilt University.
Built on the basis of exmaple code for other, non-Matlab, code, provided by REDCap examples.

引用格式

Oliver_Kripfgans (2024). REDCap interface (https://www.mathworks.com/matlabcentral/fileexchange/101809-redcap-interface), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2021b
兼容 R2021b 到 R2023b 的版本
平台兼容性
Windows macOS Linux
标签 添加标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

REDCap_code_and_examples

版本 已发布 发行说明
1.1.0

Edits to 'write' function to overcome reported writing errors

1.0.0