How to sort encounters/visits according to encounter dates?

Hi everyone,

I have different types of encounters on my Openmrs. I thought encounters are displayed according to encounter dates by default but I have notice that my encounters/visits are not sorted according to encounter dates. What I wanted to know is how do I setup encounters to be sorted according to encounter dates?

write up a hibernate query that sorts by encounter date if at all it does not exist in our current api,i will the api too

What query? Where do I write that hibernate query? And will it take effect to sort encounter dates for other users?

check this random method openmrs-core/HibernateConditionDAO.java at master · openmrs/openmrs-core · GitHub that sorts things by date in descending order

I have seen the script but I have no idea what to do with it

ok let me see whether i can get some time later on for this

Thanks that will be helpful

When i look at this patient, they seem to be sorted as you expect. Which version of the OpenMRS platform and legacyui module are you running?

From the image look at the last two encounters they were supposed to be at the top according to their dates. I am usiing openmrs 2.0.6 and legacyui 1.4.0.

the solution seems to be existing in openmrs platform 2.4.0

Meaning when I upgrade to openmrs 2.4.0 encounters will automatically all be sorted according to encounter dates? By the way I have seen on download page that openmrs 2.4.0 is recommended for users using reference application 2.x does this means it is not recommended for users using legayui?

you can still use the legacy ui in 2.4 very well

Thank you let me try to upgrade to openmrs 2.4

1 Like