Closed aparnacoronasafe closed 1 month ago
Hi @aparnacoronasafe, I would like to work on this issue. I have set up the project locally. I have a doubt, when I add a sort 1-N filter, how can I identify the bed number? ps: This is my first issue. I'm new to opensource
@aparnacoronasafe @rithviknishad could you please assign this issue to me.
Hey, sure! Could you specify how this is going to be solved?
@swayam-agrahari Currently it is sorting by the 'name' attribute of the bed object by the backend. Bed number is part of the name.
https://github.com/ohcnetwork/care/blob/develop/care/facility/api/viewsets/patient.py#L455
https://github.com/ohcnetwork/care/blob/develop/care/facility/models/bed.py#L20
@rithviknishad we could seperate the number from the name while filtering and based on the number and name we could sort the names and return the data, for the beds with same number but different names we could just let the names be sorted by the lexicographical order, while the whole list is first sorted based on bed number, this way we wouldn't need to modify the schema and the filtering will also work just fine
@rithviknishad is there some other way we could do it?
Not sure if that's the right way.
Having a sort order for the best is the solution here. Bed number should be independent from sort order.
@aparnacoronasafe how big a pain is this? I am assuming most 10 beds just have 10 beds so it maynot be a large issue here;
Having a sort order for the best is the solution here. Bed number should be independent from sort order. @aparnacoronasafe how big a pain is this? I am assuming most 10 beds just have 10 beds so it maynot be a large issue here;
It isn't a critical issue that needs to be solved immediately.
There are larger 10bedicus with up to 20 beds.
Describe the bug CARE has option to sort patient list by the bed number they are assigned to.
But the feature is not working as expected
To Reproduce Steps to reproduce the behavior:
Expected behavior The sorting should be as Bed 1,2,3,4......and so on