Skip to main content

Data validation recipes: ranges, dates, visit windows and cross-visit checks

Twelve ready-made edit checks, the severity to choose for each, and the checks Datacapt cannot run

Build automated queries with data validation explains the mechanism. This page gives you the rules most protocols need, ready to copy.

🔑 Prerequisite: eCRF Builder (Edit), and a study in Draft or Suspended status.


Pick the severity first

Severity

Use it for

Information

A reminder that needs no action: "Value above 140, record an AE if clinically significant"

Warning

A value that is possible and unusual. The site confirms or corrects, and Datacapt raises an automatic query

Exclusion

An answer that makes the subject ineligible under the protocol

Disqualified

Screening forms sent to participants, where a wrong answer ends the questionnaire

Datacapt checks a rule when the site saves the answer, not while typing.


Ranges

Check

Question

Rule

Systolic pressure plausible

SBP, Number

Lower than 70 → Warning. Second rule: Greater than 220 → Warning

Temperature in °C, not °F

TEMP, Number

Greater than 45 → Warning "Check the unit: enter °C"

BMI eligibility 18.5 to 30

BMI, Calcul

Lower than 18.5 → Exclusion. Greater than 30 → Exclusion

Pain score triggers AE reminder

PAIN, Rating

Greater or equal 7 → Information

💡 Tip: set Min number and Max number on the question for values that cannot exist (a weight of 900 kg). Keep data validations for values that can exist and need a second look. The first blocks entry; the second opens a conversation with the site.

Dates

Check

Question

Rule

No date in the future

Any Date/time

Tick Disable future dates on the question. No rule needed

Consent before any procedure

VISIT1_DT

Before, compare to Date linked CONSENT_DT → Warning "Visit date precedes consent"

AE end after AE start

AEENDT

Before, Date linked AESTDT → Warning

Adult at inclusion

AGE, Calcul (Calculate age)

Lower than 18 → Exclusion

Sample within 2 hours of dose

PK_DTM

More than (after), period 2 Hours, Date linked DOSE_DTM → Warning

Visit windows

Datacapt has no window setting on the visit itself. Two blocks do the job.

Step

Block

Show the target date to the site

A Calcul question, type Calculate Date / Time: reference V1_DT, 14 Days

Flag a visit outside Day 14 ± 3

On V2_DT: Less than (after) 11 Days, Date linked V1_DT → Warning "Visit 2 before window". Second rule: More than (after) 17 Days, Date linked V1_DT → Warning "Visit 2 after window"

Cross-visit and cross-form checks

A rule can read a question from another form or another visit as an extra condition.

Check

Rule

Pregnancy test required for women

On PREG_RES: condition SEX Equal to Female (from the demographics visit)

Weight change above 10 %

A Calcul WT_CHG = ({V3_WEIGHT}-{V1_WEIGHT})/{V1_WEIGHT}*100, then Greater than 10 → Warning, and Lower than -10 → Warning

Dose matches weight band

On DOSE: Greater than 500 with condition WEIGHT Lower than 50 → Warning


What a validation cannot check

  • The content of a Text input, a Checkbox or a File upload question. For a required format such as initials, use a Dropdown or a Number question where you can.

  • A rule limited to one visit when the same variable name exists in several. Each visit has its own variable (V1_SBP, V2_SBP), so write the rule on the one you target.

  • A question with Hide in eCRF switched on. The Builder says "Data validation is unavailable when Hide in eCRF is enabled".

  • Two visits compared without a date question in each. Visits carry no date of their own, so add a visit date question at the top of each visit.


Test each rule twice

Enter one value that must fire the rule and one that must not, on a draft subject, logged in with a site role. Record both in your validation file with a screenshot. An inspector will ask how you tested your edit checks, and Datacapt deletes test subjects at go-live.


👉🏻 Next step

Did this answer your question?