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

Use same endpoint for download results as the results list view #8110

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

mpbrown
Copy link
Collaborator

@mpbrown mpbrown commented Sep 11, 2024

BACKEND AND FRONTEND PULL REQUEST

Related Issue

Changes Proposed

  • Updates CSV results downloader to use new GetResultsForDownload query which hits the same endpoint at the main results list view. This makes the results download consistent with the results list by returning the data based on Results rather than TestEvents as the CSV download was previously doing.

Additional Information

  • This change should be okay with any concerns about GraphQL frontend backwards compatibility because it only adds a new query and the AOE survey data is ignored for the regular results list page.
  • Because we are no longer handling the download through TestEvents, but rather through Results directly, this simplifies the logic for the CSV data parsing so we don't have to worry about filtering out any feature disabled diseases from TestEvent data.

Testing

  • Deployed to dev6
  • Use various combinations of filters and make sure the download matches what is shown on the results list page

@mpbrown
Copy link
Collaborator Author

mpbrown commented Sep 11, 2024

Ready for review but noting that the Chromatic CI checks apparently detected some difference with dropdown icons where it is saying that main has these strange overlapping icons while this PR doesn't. Maybe one of the previous Chromatic builds had some visual bug?

Main (seems like some visual bug)
image

PR branch (seems normal as expected)
image

@mpbrown
Copy link
Collaborator Author

mpbrown commented Sep 12, 2024

FYI investigating an error Elisa found that so far only appears on dev6 instead of locally

@bobbywells52
Copy link
Collaborator

Tested a variety of different filter configs in dev6 and everything LGTM. All of the new tests are also passing for me locally. Thanks for your great work on this Mike! I agree with you and Merethe that it makes much more sense to be querying these results from the backend.

One thing of note that is outside the scope of this ticket:
I find it odd that we do include the symptoms and their onset date from the AOE survey as their own respective cols in the CSV but we don't include the pregnancy survey question as a col. Does anyone know if this is a decision that was explicitly made as an implementation decision? If not, should we consider adding pregnancy and the other missing AOE Q's to the results download? CC @DanielSass @jayna-SkylightDigital

bobbywells52
bobbywells52 previously approved these changes Sep 12, 2024
@emyl3
Copy link
Collaborator

emyl3 commented Sep 17, 2024

@mpbrown Something I'm noticing about these changes is that in the downloaded file if there is a date value in the "Symptom onset" column, it is showing up as "Invalid date".

I noticed in other envs we are able to display the correct date if there is a date in that field. Let me know if you can repro.

@mpbrown
Copy link
Collaborator Author

mpbrown commented Sep 17, 2024

@mpbrown Something I'm noticing about these changes is that in the downloaded file if there is a date value in the "Symptom onset" column, it is showing up as "Invalid date".

I noticed in other envs we are able to display the correct date if there is a date in that field. Let me know if you can repro.

Good catch! I'll look into how it's parsing the date

@mpbrown
Copy link
Collaborator Author

mpbrown commented Sep 18, 2024

Setting this back to Draft while I fix up the tests in TestResultTest

@mpbrown mpbrown marked this pull request as draft September 18, 2024 17:12
Copy link

sonarcloud bot commented Sep 19, 2024

@mpbrown
Copy link
Collaborator Author

mpbrown commented Sep 19, 2024

@bobbywells52 @emyl3 ready for re-review!

return new ResolvedSurveyData(result.getSurveyData());
}

@SchemaMapping(typeName = "Result", field = "patientLink")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need the patientLink field? I don't think we are using it on the results page or mapping it to the CSV when we download the results 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm pretty sure there was some error it ran into with the tests, but I can't remember what it specifically was so maybe that error was made obsolete by other changes, gonna test out removing that patient link then. patientLink is on the TestResult type which might be on the path to being deprecated in favor of Result now

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For TestResultTest, this line expects patientLink to be there on the result. This old unit test might be left over from when we used to need the patient link on the result but maybe we no longer do? Do you think we should edit/remove the unit test or add patient link for now?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ahhhh oops sorry for missing that! Thank you for looking into that again 😓 I think maybe for now we can put the patientLink field back so the tests could pass and this bug fix can be merged in. Thank you for your patience with me on this 😅 🙏

But if you think it'll be helpful, we can make a tech debt ticket to clean this up. That field doesn't seem to be used (based on my rough reading of the codebase) but probably best to dig more thoroughly.

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.

[BUG] Fix download csv test results filters
3 participants