Name: RedcapDotNetDETs
Owner: Fred Hutchinson Cancer Research Center
Description: Data entry triggers for REDCap written using .NET Web API
Created: 2016-07-26 14:41:22.0
Updated: 2017-06-19 23:48:23.0
Pushed: 2017-08-11 21:12:27.0
Size: 408
Language: C#
GitHub Committers
User | Most Recent Commit | # Commits |
---|---|---|
Paul Litwin | 2017-08-11 21:12:27.0 | 37 |
Paul Litwin (Fred Hutch) | 2016-07-25 15:55:39.0 | 3 |
Other Committers
User | Most Recent Commit | # Commits |
---|
Created by Paul Litwin, Collaborative Data Services, Fred Hutchinson Cancer Reseach Center, Seattle
A Microsoft .NET-based implementation of a set of REDCap Data Entry Triggers.
A description of each of the endpoints and supporting code follows…
This is basic example of a data entry trigger built in asp.net as a WebAPI web service. It uses common code (see below).
This REDCap DET implements Adaptive Randomization per Smoak and Lin http://www2.sas.com/proceedings/sugi26/p242-26.pdf. One difference from the Smoak and Lin paper is that there is no run-in of simple randomization as mentioned in the paper. Instead, only the first assignment for each covariate group is randomly assigned using simple randomization. Thereafter, all subjects in that group are randomized using adaptive randomization.
Here is the hook code used to create a Randomize Participant button on our randomization form which mimics the Save and Continue button on a REDCap form. It uses the Andy Martin REDCap Hook Framework. This PHP code shown here is not included in the source of this .NET project.
p
// Saved to a file named redcap_data_entry_form.php and placed in the hooks folder for the appropriate project
switch ($instrument) {
case "randomization":
print '<script type="text/javascript">$(function() {$("input[name=\'pc_rnd_ready\']").replaceWith("<input type=\'button\' id=\'btnRandomize\' name=\'submit-btn-savecontinue\' style=\'font-weight:bold;font-size:12px;margin:1px 0;\' onClick=\'dataEntrySubmit(this);return false;\' value=\'Randomize Participant\' />"); });</script>';
break;
default:
//nothing to do
}
The DotNetDETUnitTests unit test project allows you to quickly randomize a bunch of subjects to see if the adaptive randomization routine is working properly.
Performs two actions based on the value of the cityField field:
Note: The DatabasedNotifyEmailsTestMode config setting of true diverts all emails to test recipient. Need to set to false when in production.
The common code under the Infrastructure folder consists of the following classes: