Lists: easy way to sort in alphabetical order?

rdh61 wrote on Saturday, April 23, 2016:

My drop down list for “Occupation” is very long and the items in it are not in alphabetical order, so it is difficult to quickly find and select the required item. I know that if I go to Admin -> Lists I can sort the items manually but that would take a very long time, and it would need to be done again with each new addition to the list. Is there no way that the list can be sorted in alphabetical order at the click of a button? Or alternatively, if the drop down list would allow me to write the first letters of the required item and then offer me a filtered down list to select from? Thanks.

fsgl wrote on Saturday, April 23, 2016:

Instead of using the Listbox as the Data Type, try changing to Textbox & using autofill.

Best to experiment on test copy first before changing on production copy.

yehster wrote on Saturday, April 23, 2016:

If you want to sponsor development to add a “sort button” to the list editor screen let me know.

sunsetsystems wrote on Saturday, April 23, 2016:

Generally lists should already sort by title within sequence number. So if the sequence numbers are all the same they should sort alphabetically. Try it with a few of the items and see if that doesn’t work.

Rod
http://www.sunsetsystems.com/

osverdlov wrote on Saturday, April 23, 2016:

AFAICS there’s a funny problem with translations and sorting list values in alphabetical order…

With best regards,
Oleg Sverdlov

bradymiller wrote on Saturday, April 23, 2016:

Hi,
Regarding translations and sorting, Rod created a nice solution for this awhile back. As I recall, it was either the listing of the languages on the login screen or the listing of the lists in Administration->Lists. It basically uses the mysql collation to sort the translated values, as I recall. That mechanism could be leveraged.
-brady
OpenEMR

sunsetsystems wrote on Saturday, April 23, 2016:

True that most lists are sorted before translating, if enabled.

Brady’s memory is better than mine… the “mechanism” is from 6 years ago! See interface/super/edit_list.php for one example.

Rod
http://www.sunsetsystems.com/

rdh61 wrote on Tuesday, April 26, 2016:

Thanks for your suggestion. Sorry to appear so dumb, but I can’t figure out how to change to Textbox.

rdh61 wrote on Tuesday, April 26, 2016:

@ Rod. Thanks for your suggestion. Yes, that sort of works - imperfectly but well enough to make things easier.

rdh61 wrote on Thursday, April 28, 2016:

Hi fsgl,
Maybe you didn’t see my previous. I’d really appreciate your clarification. Many thanks.

fsgl wrote on Thursday, April 28, 2016:

Hi Robert,

Yes, I did overlooked your reply. Sorry.

Textbox is the default Data Type, see attachment. The editor is located in Administration/Layouts/Demographics. Someone must have changed it to Listbox if Occuption has a drop-down menu.

The nice thing about Autocomplete is that once “trained”, if you type “ca”, it should bring up “carpenter”. Less clicking & no need to scroll down a long list, if you’re looking for “wainwright” (wagon-builder). No need to bother about alphabetizing either.

rdh61 wrote on Thursday, April 28, 2016:

Got it. Much appreciated.

fsgl wrote on Thursday, April 28, 2016:

You’re most welcome.

Autocomplete counts as one of those great ideas since sliced bread.