Duplicate values check - flat section items
Check if more than one form instance contains the same value for a given item in the flat section of a two-section form.
Rule description: all Form Instances contain a unique Lesion ID. Issue a query if a Lesion ID is duplicated.
Rule expression
if(findDuplicate2SForm(null,lesid))
{
return false; //System sends query when return false condition is met
}
else
{
return true;
}
Query Message: The number recorded for Lesion ID has already has been used. Please confirm and correct.
Definitions
- lesid
-
Corresponds to Lesion ID that is present in the flat section of a two-section form from rule description.
- findDuplicate2SForm( )
-
Identifies duplicated data as item values for the variables provided as parameters, in this case
lesid
.
Return value
Usage tips
Use this when the item is not a choice control.
Verification steps
- Using a subject for testing, go to the given visit and form
containing the iems to check, in this example the Lesion ID
<
lesid
> in the specified two-section form instance. - Update the form item
lesid
as in the following table and verify the result is as listed:Step Notes Result a. In the first two-section form instance (Form1) enter the
lesid
item as '1'.Only one two-section form instance. No query.
b. Create a second two-section form instance (Form2), and enter the
lesid
item as '1'.Matching values in Form1 and Form2: - Form1 - 1
- Form2 - 1
Query in Form1 and Form2.
c. Update
lesid
item in Form2 as '2'.Different values in Form1 and Form2: - Form1 - 1
- Form2 -2
No queries.
d. Update
lesid
item in Form1 as '2'.Matching values in Form1 and Form2: - Form1 - 2
- Form2 -2
Query in Form1 and Form2.
e. Clear
lesid
item in Form2.Different values in Form1 and Form2: - Form1 - 2
- Form2
-
Null
No queries.
f. Update
lesid
item in Form2 as '3'.Different values in Form1 and Form2: - Form1 - 2
- Form2 -3
No queries.
g. Create a third two-section form instance (Form3), and enter the
lesid
item as '2'.Matching values in Form1 and Form3: - Form1 - 2
- Form2 -3
- Form3 - 2
Query in Form1 and Form3.
No query in Form2.
h. Update
lesid
item in Form3 as '1'.Different values in Form1, Form2 and Form3: - Form1 - 2
- Form2 -3
- Form3 - 1
No queries.
i. Update
lesid
item in Form3 as '3'.Matching values in Form2 and Form3: - Form1 - 2
- Form2 -3
- Form3 - 3
Query in Form2 and Form3.
No query in Form1.
j. Delete Form2.
Different values in Form1 and Form3, and no Form2 present: - Form1 - 2
- Form3 - 3
No queries.
Note:
Repeat the above steps if the form is present in multiple visits.
Other examples
Example 4-30 Method of Assessment should stay the same across all records
if(findDuplicate2SForm(null,assmethod))
{
return true;
}
else
{
return false;
}
Query message: Method of Assessment is different than the value previously recorded. Please verify.
Parent topic: Two-section form examples