-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(fix) O3-2197: Add the ability to remove a patient from a list #832
Conversation
@denniskigen, @ibacher, @vasharma05, @dkayiwa Kindly in reference to this link, I kindly request you review my work at your convinient time please! |
98c793e
to
d6905dd
Compare
return postData( | ||
`${cohortUrl}/cohortmember/${cohortMembershipUuid}`, | ||
{ | ||
endDate: new Date(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dkayiwa what should happen after removing a patient from a list using this function? Should subsequently fetching the list return a response whose endDate
property is set to the value passed above? And further, should the frontend filter the returned cohort data to remove entries with an endDate
property?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After removing a patient from the list, the original REST call which was used, should return a list which does not include the removed patient.
1ffcf07
to
b7d434b
Compare
584b0ae
to
f623038
Compare
`${cohortUrl}/cohortmember?cohort=${patientListUuid}&startIndex=${startIndex}&limit=${pageSize}&v=${v}&q=${searchQuery}`, | ||
openmrsFetch, | ||
); | ||
return { ...swrResult, data: swrResult?.data?.data?.results }; | ||
|
||
// FIXME: This is a workaround for removing a patient from a list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dkayiwa I've ended up filtering the lists on the frontend to remove patients from the list if a cohort membership has an endDate
property.
f623038
to
5772452
Compare
5772452
to
de53f66
Compare
Requirements
Summary
In this PR, I've added the ability to remove a patient from a list. I've added an icon button to each row in the list members datatable on the list details page. When this button is clicked, a modal prompts the user to confirm that they want to remove the specified patient from the list. Confirming removes the patient from the list and updates the list accordingly.
Screenshots
screencast.2023-10-04.3.AM-01-25.mp4
Related Issue
https://issues.openmrs.org/browse/O3-2197
Other
None