lsgs / redcap-copy-data-on-save

REDCap external module for copying data to other projects/fields on save events
GNU General Public License v3.0
6 stars 3 forks source link
mcri murdoch-childrens redcap redcap-external-module redcap-repo

Copy Data on Save

Luke Stevens, Murdoch Children's Research Institute https://www.mcri.edu.au

https://github.com/lsgs/redcap-copy-data-on-save

Description

This module enables data to be copied from one place to another when you save a form. You can set up multiple copy processes to different projects or even to other fields in the same project.

Copying the value of one field to multiple fields in the destination is supported. (Copying multiple fields to a single field is also supported but only the last value will be retained!)

Enable and configure the module in the source project. No action is required in the destination project.

Repeating Data

Behaviour with repeating data is dependent on whether the field is repeating in the source, or in the destination, or both, as follows:

Source Destination Behaviour
Not repeating Not repeating To non-repeating field
Repeating Not repeating To non-repeating field
Not repeating Repeating New instance *
Repeating Repeating Same instance

* Note that this will create a new instance every time the rule is triggered. Select the "only if empty" option to create a new instance only when the value copied is different to the value in the current highest-numbered instance. This mode is like an audit trail - it gives a history of values for a field.

File Fields

Copying for file fields is supported from v1.2.0 of the module. New versions of source field files will be created and saved to the destination field when a change in file name, type, or contents is detected.

Enabling the Module with Existing Configurations

From v1.2.0, when you enable the module and existing configurations are present, such as following the creation of a project via copying another where the module is in use, certain configuration settings are automatically adjusted to reduce the risk of data being copied to an incorrect project. For example, it is not desirable for data to be copied back to a Production status project from a copy made of it for testing purposes.

For instructions that are enabled, and where the destination project is different to the source project:

Limitations

Configuration

Name / Description (Optional)

Enabled?

Trigger form(s)

Trigger condition

Destination project

Destination event name

Field containing destination record id

Data Access Group option

DAG Mapping

Copy fields

Example

This example illustrates a few things that the module facilitates:

Copy on save Copy on save config