Checking for data uniqueness
When you select key items for a repeating form or an itemset, you can specify that the key items create a unique key, either separately or together. When key items are designated unique keys, if a user attempts to submit a repeating form or itemset row in which a unique key item value already exists, the InForm application accepts or rejects the new form instance or itemset row according to the following rules:
- When key items are individually unique, the InForm application evaluates each key item value separately to determine if it is different from previously entered values. If a new repeating form instance or itemset row contains a value that matches a previously entered unique key item, the instance or row is rejected. The following table gives an example in a repeating form instance or itemset where the DATE and PROCEDURE items have been designated separate unique keys:
DATE value
PROCEDURE value
Result
May 1, 2002
Hematocrit
Instance/row added
May 1, 2002
Hemoglobin
Instance/row rejected
June 14, 2002
Hematocrit
Instance/row rejected
June 15, 2002
Platelet count
Instance/row added
- When key items are unique together, the InForm application evaluates the key items in combination to determine whether the combination of items is different from a previously entered combination. If a new repeating form instance or itemset row contains a set of values that match a previously entered combination of key items, the instance or row is rejected. The following table shows how the DATE and PROCEDURE items are evaluated when they are designated a unique key combination:
DATE value
PROCEDURE value
Result
May 1, 2002
Hematocrit
Instance/row added
May 1, 2002
Hemoglobin
Instance/row added
June 14, 2002
Hematocrit
Instance/row added
May 1, 2002
Hemoglobin
Instance/row rejected