-
-
Notifications
You must be signed in to change notification settings - Fork 204
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
fix(#8815): fix contact-summary calculation to use max (500) fetched reports #8984
Conversation
This fix adopts the limit of reports for a user used in However, unlike the Below is a performance test on Samsung Galaxy S23+ using a CHW with just 1 household with 5 people household used in the video above. Performance (Telemetry) for contact with 2 reports
Performance (Telemetry) for contact with 52 reports
Performance (Telemetry) for contact with 490 reports
The performance when loading all |
Not sure if this is any easier but it would probably also be fine to limit the "3 month" view to 50 (since it is selected by default) but have "6 month" and "View all" show everything applicable. |
Why 500 and not another number? Just curious how it was picked |
@latin-panda as I was exploring how the search function works I came across the limit set in |
@Benmuiruri If you use git-blame to track down the changes, it will take you to 7y ago (commit) and this is the conversation how they came up with this number, previously the report list page was loading 1000 reports but that's too much for the bulk delete api. Bulk delete isn't related to what we're doing here. I'm unsure if this number is still relevant for this case - is it too high or too low? |
I have adopted @michaelkohn suggestion.
I added the constraint for With my implementation, if a contact has 400 tasks and 400 reports.
Video demoScreen.Recording.2024-04-04.at.11.25.12.movTwo points for discussion.
|
Hi @dianabarsan I have requested you for a review of my implementation of the fix while we explore the right number to represent The review request is to get your thoughts on
|
FWIW... I don't have a problem setting a max of 500, though if it were super easy to implement, it would probably be better to show 50 and if there are more than 50, have a "Show more" link that redirects them to the Reports page, prefiltered to that Contact. It wouldn't be possible to do that for Tasks since the Tasks page doesn't have a filter, but it's also a lot less likely to have that many tasks (unless something is mis-configured). |
Hi @michaelkohn based on your comment, here is my suggestion.
|
Good idea
Feels weird to call it "All Reports" when it's actually "max reports" (since we are limiting it to 500). FWIW, from a functional perspective I think 500 is totally fine. I ran some quick queries and in one big project only
Cool.
I appreciate the awareness around scope-creep on this ticket, but we aren't going to do the efficient loading work unless we hear the need so I'd actually rather just not even create the ticket since it'll just sit there open/un-addressed until we hear about it. |
Hi @ralfudx when you get some time, please review this, let's try and merge it this week. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Benmuiruri it looks good to me
Hi @latin-panda given Rafa's QA approval. Please give this PR a once over before I merge it. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done! Just a feedback below
f03cd0f
to
abe24a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main problem was that you needed to define a date for t_pregnancy_follow_up_date
and set t_pregnancy_follow_up
to yes
to be able to see the Next ANC clinic visit
field.
I left some suggestions inline, could you please have a look and let me know what you think?
As a QA team, we should improve these factories to make them flexible for developers to create your desired scenarios.
Thank you Lorena, that worked. These reports can be tricky, thanks for spotting the missing factor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! A couple of suggestions. Remember to request review to Lorena, otherwise GH won't let you merge this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Benmuiruri for adding my suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks
@Benmuiruri can you please update the docs as well https://docs.communityhealthtoolkit.org/apps/reference/contact-page/ |
…8984) * Chore: add search limit * Chore: add filter limit * chore: update factory to create active pregnancy * chore: add test to confirm pregnancy card * chore: add display limit * chore: feedback * chore: make sonar happy * fix: update tests * fix: make sonar really happy * fix: sonar please * chore: feedback * fix: feedback * fix: feedback
Description
This PR fixes the unintended bug where the number of reports that would be retrieved for the contact and passed to the
contact-summary
calculation was capped at 50. So, thecontact-summary
for contacts associated with >50 reports, would not have the full context of all that contacts reports.With this fix, for the sake of accuracy, we provide all the reports associated with that contact (limit of 500 reports).
Before the fix
Video showing created woman has pregnancy card when reports are less than 50
Screen.Recording.2024-03-27.at.21.04.44.mov
Video showing pregnancy card for woman does not appear when reports than 50 reports and the pregnancy report is not part of the 50
Screen.Recording.2024-03-27.at.21.13.38.mov
After the fix
Closes #8815
Code review checklist
Compose URLs
If Build CI hasn't passed, these may 404:
License
The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.