Start a conversation

Compliance checks for subject visits

Calculation fields can be used to validate visit dates.   In the example below, inclusion occurred on Sept 1, 2020. For the purposes of this example, there is 7+/-2 day washout.

Calculate the Time Between Visits

This  calculation finds the difference in days between Inclusion and Baseline. Since the is a 2 day window, if baseline occurred less than 5 days or more than 9 days after in inclusion, a message will appear.

var incl = moment('{inc_date}', 'DD-MM-YYYY');
var baseline = moment('{bl_v_dt}', 'DD-MM-YYYY');
var diff = baseline.diff(incl, 'days');

if(diff < 5 || diff > 9){
"This visit requires a deviation!"
} else {

Your output in data entry view will be the following:

Once you have constructed your calculations, you can automate queries for visit compliance by following these steps or you can opt to create a validation message. If you opt to automate queries, you will need to edit the output of your calculation:

"This visit requires a deviation!" or "ok" would be 1 or 0 respectively.

Choose files or drag and drop files
Was this article helpful?
  1. Castor Support Team

  2. Posted
  3. Updated