Skip to content
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

Add location filter for patients #6456

Merged
merged 5 commits into from
Oct 31, 2023
Merged

Add location filter for patients #6456

merged 5 commits into from
Oct 31, 2023

Conversation

Ashesh3
Copy link
Member

@Ashesh3 Ashesh3 commented Oct 16, 2023

WHAT

🤖 Generated by Copilot at 9d9c810

This pull request adds a new location filter feature to the patient management module. It also adds a disabled prop to the LocationSelect component and its dependent components to control the visibility of the location input based on the facility selection. This improves the user experience and reduces unnecessary API calls.

Proposed Changes

image
image

@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers

HOW

🤖 Generated by Copilot at 9d9c810

  • Add a new optional prop disabled to the LocationSelect component to control its enabled state based on the facility selection (link, link, link, link)
  • Prevent fetching the location options in the LocationSelect component if the facility id is not defined (link)
  • Hide the button in the AutoCompleteAsync, Autocomplete, and AutocompleteMultiselect components when the disabled prop is true (link, link, link)
  • Import the getFacilityAssetLocation action in the ManagePatients.tsx file to fetch the location name based on the facility and location ids (link)
  • Add a new state variable locationBadgeName in the PatientManager component to store and display the location name as a badge in the patient list filter (link, link)
  • Add a new query parameter location to the filter object and the useQuery hook in the PatientManager component to filter the patient list by the location id (link, link)
  • Add a new useCallback hook to define the fetchLocationBadgeName function in the PatientManager component to dispatch the getFacilityAssetLocation action and set the locationBadgeName state (link)
  • Import and render the LocationSelect component in the PatientFilter component to create a form field with a label and a location select input (link, link)
  • Add a new property location to the filter, initialFilterData, and filterState objects in the PatientFilter component to store and update the location id value (link, link, link, link)

@Ashesh3 Ashesh3 requested a review from a team October 16, 2023 12:39
@Ashesh3 Ashesh3 requested a review from a team as a code owner October 16, 2023 12:39
@netlify
Copy link

netlify bot commented Oct 16, 2023

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit b70e001
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/6540a916869e6c0008a30647
😎 Deploy Preview https://deploy-preview-6456--care-egov-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@vercel
Copy link

vercel bot commented Oct 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
care-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 31, 2023 7:14am

@cypress
Copy link

cypress bot commented Oct 16, 2023

Passing run #1502 ↗︎

0 82 0 0 Flakiness 0

Details:

Add location filter for patients
Project: CARE Commit: b70e00139a
Status: Passed Duration: 03:41 💡
Started: Oct 31, 2023 7:17 AM Ended: Oct 31, 2023 7:21 AM

Review all test suite changes for PR #6456 ↗︎

@nihal467
Copy link
Member

nihal467 commented Oct 18, 2023

@Ashesh3

image image

the patient filter is malfunctioning, the patient's card is getting filtered based on the bed history not the current location

@Ashesh3
Copy link
Member Author

Ashesh3 commented Oct 23, 2023

in new issue
Edit
Hide
Delete
Report content

Issue fixed.

@nihal467
Copy link
Member

LGTM

@khavinshankar khavinshankar merged commit abe4be9 into develop Oct 31, 2023
56 checks passed
@khavinshankar khavinshankar deleted the issue-6426 branch October 31, 2023 11:21
@github-actions
Copy link

@Ashesh3 We truly appreciate your efforts. Thank you for taking the time to contribute; this is a very valuable contribution to us 🥇. We always welcome your contribution 🙂, so feel free to contribute to anything anytime, and never lose that spirit of innovation 🙌.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Location based filter: Patient list
4 participants