You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What feature do you want to improve?
In the contact-summary there's no way to check the number of items that have been captured under a parent.
For example, the amount of household members captured for a household.
Describe the improvement you'd like
I would like to expose the children of a contact and use it to verify the enumerated items against the expected amount.
Should there be a mismatch, I want to notify the CHW that further action is required via a contact flag.
Describe alternatives you've considered
NA
Additional context
After some pointers from @jkuester we managed to achieve the desired functionality:
Just as a note the config/<your_project>/.eslintrc will need to have children added to its globals block.
The count can be used as follows:
const getChildCount = (items, key) => {
for (let i = 0; i < items.length; i++) {
const element = items[i];
if (element.type.id === key) {
return element.contacts.length;
}
}
return 0; // No children exist
};
const contactChildren = children;
getChildCount(contactChildren ? contactChildren : [],'hhm')
@ChinHairSaintClair I am closing this in favor of #9104. 9104 is about the general functionality of providing the contact's children to the contact-summary calculation. This seems to be essentially what is implemented in your PR. Using those children in a workflow to calculate the actual "count" (as described in this issue) is functionality that will be enabled by 9104 (as implemented in your PR).
Please respond here, though, if you feel like I have misunderstood something!
What feature do you want to improve?
In the contact-summary there's no way to check the number of items that have been captured under a parent.
For example, the amount of household members captured for a household.
Describe the improvement you'd like
I would like to expose the children of a contact and use it to verify the enumerated items against the expected amount.
Should there be a mismatch, I want to notify the CHW that further action is required via a contact flag.
Describe alternatives you've considered
NA
Additional context
After some pointers from @jkuester we managed to achieve the desired functionality:
Just as a note the
config/<your_project>/.eslintrc
will need to havechildren
added to itsglobals
block.The count can be used as follows:
https://forum.communityhealthtoolkit.org/t/expose-child-count-to-contact-summary/3493
The text was updated successfully, but these errors were encountered: