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

[BUG] Fix download csv test results filters #7948

Open
emyl3 opened this issue Jul 24, 2024 · 2 comments · Fixed by #8052 · May be fixed by #8110
Open

[BUG] Fix download csv test results filters #7948

emyl3 opened this issue Jul 24, 2024 · 2 comments · Fixed by #8052 · May be fixed by #8110
Assignees
Labels

Comments

@emyl3
Copy link
Collaborator

emyl3 commented Jul 24, 2024

Description

As a user, when I select filters (e.g. "Condition") on the "Test Results" page and I click the "Download results" button, the confirmation modal displays the correct number of rows in the CSV download. However, when opening the CSV result, the result is unfiltered.

Steps to reproduce

If applicable, add screenshots to help explain your problem.

  1. Go to the "Test results" page
  2. Select a "Condition" and/or "Test Result" filter
  3. Click the "Download results" button
  4. In the "Download test results" confirmation modal, see that the number of rows to be included is correct and click "Download results"
  5. Open the downloaded CSV
  6. See that the CSV does not match the filtered results

Expected behavior

As a user, I would expect the CSV download rows matches the results when the filters are applied

Additional context

Please ensure every filter is working for the download

@mehansen
Copy link
Collaborator

Looks like when we added condition and test result filtering to the result page, we forgot to add it to the Download results functionality as well - we pass the correct filter values to the query but it doesn't use them:

query GetFacilityResultsForCsvWithCount(
$facilityId: ID
$patientId: ID
$result: String
$role: String
$startDate: DateTime
$endDate: DateTime
$pageNumber: Int
$pageSize: Int
) {

@mehansen
Copy link
Collaborator

Reopening because I am still seeing this bug in demo with the test result filter. I think because the backend query is returning test events, we're going to get any test event that has at least 1 result matching the filter, so the current logic breaks down for multiplex results. So as an example, if we have the filter applied for positive results, the CSV download will still include all the results for a multiplex test that has at least 1 positive result.

Fwiw I think we really should be querying for test results from the backend instead of test events. That way we don't have to build a query with a bunch of filters on the backend and then filter again on the frontend like we are now.

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