Skip to content

Conversation

@sachin-panayil
Copy link
Contributor

@sachin-panayil sachin-panayil commented Jan 5, 2026

Important

This is the base PR that includes 2 other PRs that were merged into this one.

Practitioner Search Page

Jira Ticket #478

Problem

We aren't able to search for Practitioners currently through the frontend or sort through results

Solution

Implement a separate search page similar to Organizations to handle the search of Practitioners and add sort capabilities via api queries

Result

Using the same patterns in the Organization search, we created a Practitioner search that serves as an MVP and both Practitioner and Organizations are sortable

Practitioners

Screenshot 2026-01-07 at 3 07 09 PM Screenshot 2026-01-07 at 3 07 19 PM Screenshot 2026-01-07 at 3 07 22 PM Screenshot 2026-01-07 at 3 07 26 PM

Organizations

Screenshot 2026-01-07 at 3 08 08 PM Screenshot 2026-01-07 at 3 08 11 PM

Test Plan

@sachin-panayil sachin-panayil force-pushed the sachin/ndh-478-searching-practitioners branch from be078b1 to 88ad429 Compare January 5, 2026 22:22
@sachin-panayil sachin-panayil changed the title [NDH-478] - Practitioner Search Page [NDH-478] Practitioner Search Page Jan 6, 2026
@sachin-panayil sachin-panayil marked this pull request as ready for review January 6, 2026 20:01
@sachin-panayil sachin-panayil self-assigned this Jan 8, 2026
* fixed bugs with both pages

* [NDH-483] Adding Basic Sort Functionality  (#304)

* added sort functionality

* added practitioner sort support

* added sort to all practitioners/organizations page

* added sorting tests

* fixed spacing

* quick test

backend tests are failing on my local and im wondering if its doing the same on remote
@sachin-panayil sachin-panayil changed the title [NDH-478] Practitioner Search Page [NDH-478] Practitioner Search Page and Sort Capabilities Jan 9, 2026
Copy link
Contributor

@spopelka-dsac spopelka-dsac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great! One thing I notice off the bat, is that the default API sorting is "Last Name (A-Z)", but the default sort label is "First Name (A-Z)" (screenshot below). Can you update that please? We should have a corresponding test for that. Speaking of tests... it's great to have Playwright tests, but we also need unit tests for the OrganizationSearch and PractitionerSearch pages, to ensure that the components render as expected, given the supplied props

Image

Copy link
Contributor

@spopelka-dsac spopelka-dsac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what I see when I click an individual provider... Is this to be expected?
Image

</div>
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
{t("organizations.sort.by")}
<Dropdown
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A note for a future PR (not a blocker for this PR) we'd want to create a sort component, so that the drop down and logic aren't repeated across multiple pages


return (
<>
<TitlePanel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General comment (but not a blocker for this PR), it would be cool to make this whole search bar its own component, so you don't have to repeat the rendering and logic across the organization and practitioner pages

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should ticketify this for a low prio item

return (
<SearchProvider
useSearchAPI={usePractitionersAPI}
defaultSort="first-name-asc"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might not have been clear in my prior comment; it would be great to stick with the default API sort as the default sort here, the label should just be set to last-name-asc accordingly

Copy link
Contributor Author

@sachin-panayil sachin-panayil Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i changed the default to display last-name-asc but it is third on the list of sort options. is this fine to leave? so when a user enters any search, the default will be last-name-asc and will display that in the sort dropdown

Screenshot 2026-01-13 at 2 58 21 PM

if (params.query) {
const query = params.query
const key = detectQueryKey(query)
url.searchParams.set(key, query)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're changing the test of the search to read "Name or NPI", then we should append NPI| to the query here if the key is "identifier"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call out!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd also want a corresponding test to ensure that only records with the specified NPI and not records that have that value as an other identifier are returned when that value is supplied to the search

@sachin-panayil
Copy link
Contributor Author

the screenshot you sent is not to be expected but a quick workaround is to change the featureflag perms. i am getting that same bug. i think something got messed up with the user creation maybe? @spopelka-dsac

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants