This function breaks a comma-separated list of values into a set. For example, the list “gluc, thy, gluc, lipid” becomes a set containing the three unique strings “gluc”, “lipid” and “thy”.

A typical use of this function would be to compare two lists, either from different attributes or from different episodes of the same attribute. You can also compare the values of a attribute with a fixed set of values.

When sets are compared, the order of values is not taken into account.

  • To compare two sets, use is or is not
  • To find the number of values in a set, use number of.
  • To find the intersection of two sets, use intersect.

For example, given the following case fragment,

TestsOrdered             gluc, thy           thy, GLUC
AllTests                 gluc, thy, lipid    lipid, thy, gluc

the following conditions are true:

TestsOrdered as set is “gluc, thy”

TestsOrdered as set is second most recent TestsOrdered as set

TestsOrdered as set is not AllTests as set

TestsOrdered as set intersect AllTests as set is TestsOrdered as set

Number of (TestsOrdered as set) is 2

Number of (AllTests as set) is 3

Note 1: The first example above shows the values of TestsOrdered being compared with a fixed set of values.

Note 2: Values in a set are converted to lower case before any comparisons are done. This is also shown in the first example above.

Note 3: The comma-separated expression to be converted to a set can also be the value of a constant.