The
ValueSet.sort function sorts the order of entries in the
ValueSet object by either label or code. An optional argument,
ascending or
descending, allows for the specification of the sort order. Another optional argument,
by code or
by label allows you to specify whether to sort the value set's entries by code or label. By default the value set will be sorted in ascending order by label.
Labels are sorted in case insensitive order, so "c" is considered the same as "C". On the other hand, codes for alphanumeric value sets are sorted in case sensitive order, so "c" is recognized as different from "C".
The function returns a logical value of 1 (true).