Age calculation check
Calculate an age using Informed Consent and Date of Birth.
Rule description: calculate age using Date of Informed Consent Signed and Date of Birth.
Rule expression
//Returns the age value as the difference infconst-dob
return dateDiffInYears(infconst,dob);
Definitions
Return value
Verification steps
- Using a subject for testing, go to the given visit and form
containing the items to check, in this example the date of birth
<
dob
> and date of inform consent signed <infconst
>. - Update the form items
dob
andinfconst
as in the following table and verify the result is as listed:dob
infconst
Result 2-Jan-1942 2-Jan-2021 79 3-Jan-1942 2-Jan-2021 78 1-Jan-1942 2-Jan-2021 79 1-Jan-1993 2-Jan-2021 28 3-Jan-1993 2-Jan-2021 27 3-Jan-1993 3-Jan-2021 28 3-Jan-1993 Null
Null
Parent topic: Electronic Data Collection (EDC) examples