How does the Sort() function work in VFE? I can not find any documentation for most of the commands in VFE, so I am trying to learn how they work. Thanks!
Sort and many of the other functions I think you are looking for are not VFE specific, but rather Centricity specific. You'll want to search for them in the Centricity Help Text, not the VFE Help Text. Please see the attached screenshot for the Sort function to see what I mean.
Thank you so much!
Two things to remember when using sort:
1) While the sort is alphanumeric, it does a poor job with case. All upper case items will appear in the list first followed by lower case items.
Example:
List to sort:
Apple, banana, Orange, pear
Result:
Apple, Orange, banana, pear
If you are dealing with mixed case items, it can be a bit of a nuggle to contend with.
2) Proper dates are not sorted correctly. To sort dates, you must convert them to YYYYMMDD format, sort, then return them to MM/DD/YYYY (if needed).
Hope this helps!
Centricity MEL SORT fn and what it does:
For a reference, I used this ASCII Table: http://web.cs.mun.ca/~michael/c/ascii-table.html
MEL SORT fn does an ASCII sort. Look at an ASCII Table which lists characters in ascending order (ASC) by their numeric value.
this is the order for an ASC sort:
space,!,",#,$,%,&,',(,),*,+,comma,-,.,/
0 through 9
:,;,,?,@
A through Z
[,\,],^,_,`
a through z
{,|,},~
Example 1: ("Ba,BZ") will sort as:
BZ
Ba
Lists that contain ", " as well as "," for separators will sort weird (as spaces have higher sort order than alpha chars)
Example 2: ", Yitem,Aitem, Zitem" will sort as:
Yitem
Zitem
Aitem
- Beverly
The biggest issue I found with the sort is that it only sorts one item. For example, date. If you want to sort, say, immunizations by vaccine and date - can't do that out of the box. It's kind of like the capitalization and date issue Lee brings up.
Here's an answer:
Build yourself an array with a your own index of sort items as the first column. The index might be left(lower(vaccine_name) + " ", 16) + YYYYMMDD
Then you just use your data from column 2 on after your sort...
Sneaky, but effective!