b = valueset_name.randomize(ʃexclude(exclude_code1, ..., exclude_codeN)ʅ);
The
ValueSet.randomize function scrambles the order of values in the
ValueSet object. The function is useful when using
capture types in a data entry application. Some survey applications choose to display the possible response categories in a randomized way so as to minimize an enumerator or respondent's selection bias.
An optional exclusion list, exclude_code1, ..., exclude_codeN, allows you to prevent certain values from being given a random order. This is useful for variables like Don't Know, which, after the randomization, would remain at the original location in the list of values.
You can use the
seed function to initialize the random number generation.
The function returns a logical value of 1 (true).
FAVORITE_FOOD_GROUP_VS1.randomize(exclude(5));
becomes