Skip to content

fom-ds-redcap/data-entry-trigger-builder

 
 

Repository files navigation

Data Entry Trigger Builder

Acknowledgement

Some functionality within the module has been inspired by work done by Andy Martin (https://github.com/123andy), Jae Lee, and Ihab Zeedia at Stanford University.

Important

This modules is an updated version of the module developed at BC Children's Hospital Research Institute. When switching from the previous module (https://github.com/BCCHR-IT/data-entry-trigger-builder), you'll have to enter your previous settings again, by hand. This is because the settings are stored as JSON in REDCap, and the structure of the JSON object has changed with ours. The module will not function otherwise.

Instructions

  1. Make sure the module has been enabled in your project. After, navigate to External Modules, in your REDCap sidebar. Only administrators with "Access to all projects and data with maximum user privileges" can see the link.

CustomApplicationLink

  1. Add a trigger to move data. Multiple conditions can be chained in one trigger using && (AND), or || (OR). See the table attached to the module, for allowed qualifiers. If you’ve exported your DET settings from another project, you may import them, instead.

AddTrigger

The following form will appear.

AddTriggerForm

Start by creating a trigger. Data movement will occur when your trigger is met.

CreateTrigger

  1. Select your destination project. Your current project is automatically used as the source.

SelectDestination

  1. Determine which fields you’ll use to link your source and destination projects. These fields will be used to link records between the projects, when at least one trigger condition is met.

RecordLinkage

(OPTIONAL) Decide whether you want to append a static prefix, or postfix to the linking value.

PrefixPostfix

  1. Add data to move when the condition is true.

DataMovement

Or create an empty record

CreateEmptyRecord

Data Movement Options:

  • Add an instrument to move. All fields in the chosen instrument must exist in the destination project, for the chosen event.
  • Add a field to move. You can choose to pipe a field, or manually set a value to move. (i.e set completion status to ‘2’)

AddField

  1. (OPTIONAL) Determine whether the module will pull the url for a survey into your source project, and where to save it.

GenerateSurveyUrl

  1. Determine whether you want blank fields to overwrite data in the destination project.

OverwriteData

  1. Determine whether you want to import DAGs to the destination project. This will only work if the DAGs are identical between projects.

ImportDAGs

  1. The module will allow up to 10 triggers that each move their own data.

  2. Save your DET. If it passes validation, then it will automatically run every time data is entered via a survey or data entry. Otherwise errors will be returned to you for correction. The DET will not save until your errors are corrected.

  3. Once your DET is created, refresh the page, then you can export the settings as a JSON string.

ExportSettings

  1. The module logs all DET errors. You may check there whenever you want to check on the status of your DET.

Warnings

  • Any changes made to the REDCap project, after the DET has been created, has the potential to break it. After you’ve updated your project, please make sure to update the DET in accordance with your changes.
  • Functionality developed at BCCHR to export your settings to a word document has been disabled, as it has not been made compatible with the new JSON structure.
  • Module now logs to the external module logs, rather than a project's regular logs.

Limitations

  • Is not compatible with repeatable instruments.
  • Can have a maximum of 10 triggers, with unlimited data to pipe.

About

An External Module that provides an interface to create a DET between a source and destination project.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 84.5%
  • JavaScript 15.5%