Luke Stevens, Murdoch Children's Research Institute https://www.mcri.edu.au
https://github.com/lsgs/redcap-extended-reports
Provides some extensions & additional functionality for REDCap's built-in Data Exports & Reports functionality.
The module enables REDCap's standard row-per-record-per-event and row-per-record-per-instance results to be collapsed to row-per-record.
Options for reshaping event rows to columns are:
event_1_arm_1.var1, event_1_arm_1.var2, event_2_arm_1.var1, event_2_arm_1.var2
event_1_arm_1.var1, event_2_arm_1.var1, event_1_arm_1.var2, event_2_arm_1.var2
Options for handling repeating data - repeating events or repeating instruments - are:
With the "Column per instance" option, field names will incorporate event and instance number information in a dot- or space-separated form as follows:
The "Concatenate (space/comma/pipe)" causes a report to be handled as if "Combine checkbox options into single column" is selected irrespective of its actual setting. (There is no obvious way to show the data otherwise.)
Live filters are not supported (mainly because they're not supported by the REDCap::getReport()
developer method).
Row-per-record reshaping is not applied to stats package (SAS, SPSS, R, Stata) or ODM exports.
The functionality of this external module differs in some respects from the old (pre-external module framework) "[https://github.com/lsgs/redcap-longitudinal-reports/](Longitudinal Reports)" plugin. For example, this module does not allow you full control of the order of fields, or include schedule dates or survey links as selectable options (you can create fields for these using smart variables if you need them in reports), whereas the old plugin does not integrate fully with REDCap's regular reports for all types of export, including API, nor offer customised reporting with SQL reports. The external module renders the plugin obsolete.
Selecting the "Custom SQL Query" option after entering a report's title and description causes the field/event/filter/sort sections of the report configuration page to be hidden and replaced with a text area into which administrators may enter a custom SQL query.
Notes:
[user-name]
, [user-dag-name]
, [user-role-name]
, [project-id]
etc. can be utilised within the SQL (include quotes for string values where appropriate).$
character. For example:
select record as record_id$Record, ...
gives a field name of record_id
and field label "Record".select record as 'person_id$Person ID', ...
gives a field name of person_id
and field label "Person ID" (single-quotes are required where your label contains spaces).SQL reports are exported only in CSV format via the Data Exports Reports & Stats page, but are additionally available in JSON and XML form via the API.
SQL reports can be created and have their SQL edited only by REDCap administrators. Report title, description and visibility are editable by regular users in the usual way.