ohcnetwork / care_fe

Care is a Digital Public Good enabling TeleICU & Decentralised Administration of Healthcare Capacity across States.
https://care.ohc.network
MIT License
225 stars 401 forks source link

Severity Based Sort By in patient list page is malfunctioning #8634

Open nihal467 opened 2 weeks ago

nihal467 commented 2 weeks ago

Describe the bug

When sorting the patient list by "High severity" or "Lowest Severity," the cards are currently being sorted based on the patient category from the initial consultation form. However, the sorting should be done using the most recent patient category from the log updates, if available.

Context: The patient category is assigned during the creation of a patient consultation, but it can be updated later through the log update functionality. When sorting the patient list, the system should first check if any log updates exist for a patient. If a log update is present, the patient should be sorted based on the category in the latest log update. If no log update exists, the category from the consultation form should be used for sorting.

To Reproduce Steps to reproduce the behavior

Create a patient

  1. Go to patient tab and create a new patient
  2. Once you successfully created a patient , in the patient dashboard click on the log update button
  3. then create a new log update with different patient category mentioned from consultation
  4. submit the form and return back the patient tab
  5. apply the sort by based on high severity
  6. See error

Expected behavior

Screenshots

image

bodhish commented 2 weeks ago

Who need this sort?

aparnacoronasafe commented 2 weeks ago

This sorting was introduced after request from TeleICU Hubs to allow doctors to see the most severe cases on top

bodhish commented 2 weeks ago

@aparnacoronasafe we can make it a filter, sorting doesn't make sense, can you specify the use case.

aparnacoronasafe commented 6 days ago

I still think severity wise sorting is needed. The doctors in 1 glance would want to know how many severe patients are there and so on.