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

Provide children contacts of current contact to contact-summary calculation #9104

Open
jkuester opened this issue May 8, 2024 · 0 comments
Labels
Type: Feature Add something new

Comments

@jkuester
Copy link
Contributor

jkuester commented May 8, 2024

Is your feature request related to a problem? Please describe.
When calculating the contact summary for a place, it would be useful to be able to include data about the child contacts of the place in the calculation. (E.g. to show a warning if the number of contacts does not match what is expected). Currently, there is no way to access any information about those child contacts.

Describe the solution you'd like
In webapp, when we have a contact in context (e.g. we are viewing that contact's profile page), we have already done the heavy lifting to look up the contact's children. (This involves finding which contact types are valid children of the current contact and then querying medic-client/contacts_by_parent for each of the types.) We only calculate the contact-summary when we have a contact in context, so I do not think adding support for this functionality would negatively impact performance (except perhaps when loading a form for a task. I believe we are currently calculating a the contact-summary in that case, but we might not have the children loaded already...)

Describe alternatives you've considered
We could rework our contact hierarchy model to be doubly linked so contacts contain the _ids both for their parent and their children. Seems like that would cause more trouble than it would resolve....

@jkuester jkuester added the Type: Feature Add something new label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Add something new
Projects
None yet
Development

No branches or pull requests

1 participant