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 result and condition filters to test results list #6682

Merged
merged 42 commits into from
Oct 25, 2023

Conversation

nathancrtr
Copy link
Contributor

@nathancrtr nathancrtr commented Oct 2, 2023

Related Issue

Changes Proposed

  • Adds condition and result filters for test results list
  • To enable filtering on these values, the test results list now queries the GraphQL endpoint for results rather than test events

Additional Information

  • This is a follow-up to Refactor results table to accommodate more diseases #6104
    • This work unrolled individual multiplex results for a test event into separate rows on the result table
    • Filtering worked fine for values that do not change between results within a test (patient name, test date, etc)
    • However, since result and condition vary within a single test event, these filters had to be updated for more granular access
  • Adds a new resolver and associated GraphQL schema and query definitions
  • Adds new service code and Specifications to apply filters from user to database retrieval

Testing

Name filter

Screen.Recording.2023-10-05.at.4.22.04.PM.mov

Date filters

Screen.Recording.2023-10-05.at.4.22.20.PM.mov

Condition filter

Screen.Recording.2023-10-05.at.4.20.59.PM.mov

Result filter

Screen.Recording.2023-10-05.at.4.21.18.PM.mov

Role filter

Screen.Recording.2023-10-05.at.4.21.34.PM.mov

Facility filter

Screen.Recording.2023-10-05.at.4.25.58.PM.mov

Multiple filters applied; clearing filters

Screen.Recording.2023-10-05.at.4.22.38.PM.mov

@nathancrtr nathancrtr temporarily deployed to dev3 October 4, 2023 16:43 — with GitHub Actions Inactive
@nathancrtr nathancrtr temporarily deployed to dev3 October 4, 2023 16:54 — with GitHub Actions Inactive
@nathancrtr nathancrtr changed the title Nac/6303 results table add condition result filters Add result and condition filters to test results list Oct 5, 2023
@nathancrtr nathancrtr marked this pull request as ready for review October 5, 2023 20:36
@nathancrtr nathancrtr force-pushed the nac/6303-results-table-add-condition-result-filters branch from 941c343 to a101869 Compare October 18, 2023 21:21
@nathancrtr nathancrtr temporarily deployed to dev3 October 19, 2023 16:14 — with GitHub Actions Inactive
@nathancrtr nathancrtr temporarily deployed to dev3 October 19, 2023 16:23 — with GitHub Actions Inactive
Copy link
Contributor

@zdeveloper zdeveloper left a comment

Choose a reason for hiding this comment

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

LGTU, paired on the review with @mpbrown, some minor suggestions and we believe we need a follow up pr to no hard code the diseases on the disease filter list

backend/src/main/resources/graphql/main.graphqls Outdated Show resolved Hide resolved
SupportedDisease supportedDisease =
disease != null ? diseaseService.getDiseaseByName(disease) : null;

if (facilityId == null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

remove if statement and only use getFacilityResults

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a clean way to move this null conditional into the service instead of having it in the resolver? This was related to our other comment about combining getOrganizationResults and getFacilityResults, although not sure whether the different auth requirements complicates this then

Copy link
Contributor Author

@nathancrtr nathancrtr Oct 23, 2023

Choose a reason for hiding this comment

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

I think having this conditional in the resolver makes sense for the auth reasons discussed elsewhere.

Fwiw, this pattern (and the associated auth requirements) are lifted one-to-one from the existing TestResultResolver and TestOrderService classes, which these changes largely supplant:

if (facilityId == null) {
return tos.getOrganizationTestEventsResults(
patientId,
Translators.parseTestResult(result),
Translators.parsePersonRole(role, true),
startDate,
endDate,
pageNumber,
pageSize);
}
return tos.getFacilityTestEventsResults(
facilityId,
patientId,
Translators.parseTestResult(result),
Translators.parsePersonRole(role, true),
startDate,
endDate,
pageNumber,
pageSize);
}

frontend/src/app/testResults/TestResultsList.test.tsx Outdated Show resolved Hide resolved
]}
defaultSelect
onChange={setFilterParams("disease")}
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Per story AC, the values here should be loaded from the backend so we dont have to keep adding more values as we add more diseases, doesnt have to block this PR, but it could be added as a followup pr as part of the same ticket

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm honestly not sure if I'm sold on pulling those values from the backend here to begin with. Adding new diseases to SimpleReport will already involve touchpoints in the frontend code, like our constants.

Also, HIV and RSV have already been added to the database but we're not ready to expose those values to the disease filter, so we'd need to turn around and hardcode those values somewhere instead.

Basically I'm leaning towards there being a logical distinction between diseases that SR "knows about" and diseases that users can submit for, at least at this time.

Whatchy'all think?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm that's a good point where the frontend already requires some hardcoded reference for the diseases. At our next pairing session I'm curious to get your thoughts on this as it relates to what I'm working on with adding HIV support since it seems like we'll always need some way to distinguish which AOE questions to show

frontend/src/app/testResults/operations.graphql Outdated Show resolved Hide resolved
frontend/src/app/testResults/resultsTable/ResultsTable.tsx Outdated Show resolved Hide resolved
mpbrown
mpbrown previously approved these changes Oct 23, 2023
Copy link
Collaborator

@mpbrown mpbrown left a comment

Choose a reason for hiding this comment

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

LGTM! Nice work on this!

DanielSass
DanielSass previously approved these changes Oct 24, 2023
Copy link
Collaborator

@DanielSass DanielSass left a comment

Choose a reason for hiding this comment

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

lgtm

@nathancrtr nathancrtr dismissed stale reviews from DanielSass and mpbrown via 8152475 October 24, 2023 17:41
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 6 Code Smells

85.1% 85.1% Coverage
0.0% 0.0% Duplication

@nathancrtr nathancrtr added this pull request to the merge queue Oct 25, 2023
Merged via the queue into main with commit 8353d11 Oct 25, 2023
33 checks passed
@nathancrtr nathancrtr deleted the nac/6303-results-table-add-condition-result-filters branch October 25, 2023 15:54
@emyl3
Copy link
Collaborator

emyl3 commented Oct 30, 2023

@nathancrtr I noticed something interesting with this new functionality... if we correct a result is it now expected that we see the previously corrected test in the results page along with the newly submitted result?

To repro:

  • submit a test
  • correct result -> click something like "Incorrect test result"
  • see that it is added to the queue
  • submit the corrected result
  • go to the results page and see both the previous test and newly corrected test in the results

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.

Condition and result filters on results table
5 participants