Messages sorting/display bug

penguin8r wrote on Wednesday, June 27, 2012:

Anybody else noticed how when the Messages frame loads, the messages first come up in basically a random order instead of being sorted chronologically?  Then you have to click on them, to make it re-sort the messages into ascending order, & then click again to make it sort descending so you have the newest messages at the top of the list.  Doesn’t bother me that much, but it really grinds on the doctors & office staff, especially anyone who uses the Lab interface.  It’s been that way for quite a long time.  Seems like it would make more sense for it to just sort chronologically by default with the newest messages at the top.  I get a lot of complaints about “Too many extra clicks”.
What does everyone else think?

yehster wrote on Wednesday, June 27, 2012:

around line 370 in interface/main/message/messages.php
The default sort order is by users.lname.  You could very easily change this to by date ad descending.

    $sort = array("users.lname", "patient_data.lname", "pnotes.title", "pnotes.date", "pnotes.message_status");
    $sortby = (isset($_REQUEST['sortby']) && ($_REQUEST['sortby']!="")) ? $_REQUEST['sortby'] : $sort[0];
    $sortorder = (isset($_REQUEST['sortorder'])  && ($_REQUEST['sortorder']!="")) ? $_REQUEST['sortorder']  : "asc";

penguin8r wrote on Monday, July 16, 2012:

Thanks Brady!  I will work on that more this week.
Another messaging question, we noticed that if you try to send a message to yourself (no, it doesn’t make sense to me either, but some docs would like to be able to do this), it won’t let you, tells you the message can’t be sent because the recipient list is empty.  Is this a bug, or is looping a message back to yourself not allowed for a reason?

bradymiller wrote on Tuesday, July 17, 2012:

Hi,
Sounds like a bug since can’t think of any reason why looping a message to yourself should not be allowed.
-brady
OpenEMR