msupply-foundation / mobile

Open source mobile app for medical inventory control
http://msupply.org.nz/mobile
Other
42 stars 27 forks source link

Patient search results sorted by created date #5395

Closed GaryWilletts closed 6 months ago

GaryWilletts commented 7 months ago

Is your feature request related to a problem? Please describe.

PLM Sierra Leone want patients to be sorted by their created date.

Describe the solution you'd like

Patient records returned form the search function sorted by created date in this window:

image

Implementation

  1. Add a new store preference "mobile: patient search sorted by created date" in mSupply
  2. If this preference is checked, the patient search window shown above has an extra "Created date" column and the patients are sorted by their created date, most recent at the top.
  3. The "Created date" is sortable i.e. you can click on it to sort by that column, same as the other columns.
  4. If a new patient is added it must be added to the top of the list if this preference is turned on (not sure what it does now, it might already do this).

Describe alternatives you've considered

This has been agreed with PLM.

Additional context

Requested by PLM Sierra Leone, paid for by them

MoneyWorks jobcode

PLM:MOB03

GaryWilletts commented 7 months ago

@mark-prins or @arjunSussol please let me know when this will be complete so that I can let PLM know.

arjunSussol commented 6 months ago

@GaryWilletts @mark-prins can I look at this issue?

mark-prins commented 6 months ago

yes please! thanks @arjunSussol

arjunSussol commented 6 months ago

@GaryWilletts pending this issue as @sanjeevsussol priorities desktop issue over mobile.

arjunSussol commented 6 months ago

Hi @GaryWilletts after standup discussion, I am going to add this Created date column as general column without using the store preference.

Reasons behind it: 1) It will be easier to introduce the column for all clients without any store preference 2) Recently, there is two different types of patient list visible; one for general list for all and another if usingAdverseDrugReactions is enabled then one extra column for adverse reaction will be added. 3) If we are going to add another store preference to show created date column then either we have to show created date column with/without the adverse reaction column. We can bypass the adverse reaction column and show the created date column as general list. If we are going to show both columns then we have add another patient list and handle the store preference which takes more time. 4) Recently visibility of patient list is handle in two way only. If we are going with above point 3 then we have to handle the list in three or four different way. 5) If we are going to show the created date column by default to both patient list then no need to add store preference, less work and no more conflict.

Anyway, please let me know about your opinion! PR also submitted, please review it too.

AnushaUp commented 6 months ago

Testing

Tested in mSupply server V7-11-02 mobile V8.6.8-rc-2 Steps to reproduce or otherwise test the changes of this PR:

Screen Shot 2024-01-08 at 16 29 27
GaryWilletts commented 6 months ago

@arjunSussol adding the column with no store preference is fine.