I’m working on customizing fields of the contact-summary.templated.js and have encountered a limitation. When working at the village level (appliesToType: 'village'), I don’t have access to hierarchical data for levels below the village, and the reports variable is empty.
This makes it challenging to display details about patients or other sub-level data at the village level.
Does anyone know of a way to access this data or have suggestions for handling this limitation?
I’m wondering what hierarchical data you are expecting (below the village) and which reports.
The contact-summary function receives: the contact you are summarizing, its lineage (parents, and grandparents), reports submitted against this contact and target documents (for certain places and person contacts).
Can you please clarify which data you are expecting?
Thanks!
Hi @diana
The hierarchy we’re working with is structured as follows: District → Hospital → Village → Household → Patients
Currently, when switching profiles at the district, hospital, or village levels, the reports are empty. However, at the lower levels (household and patient), the reports are accessible and display as expected.
I’m looking for a way to access the reports of patients from higher-level “Places” like villages. For instance, when viewing a village profile, the tasks and reports sections are empty
This is a hardcoded limitation of the CHT. We only query and collect tasks and reports for leaf type places.
A leaf type place is a place type that doesn’t have any other possible place child. In your hierarchy, Household is a leaf place type, but Village is not, because it has Households (other places) as children.
Thank you for the clarification. Just to confirm, is it correct that creating something like this is not possible within our hierarchy at the village level?
I do not know how you get this data and what it represents exactly.
I would have a clearer idea and could give you an answer only if you shared your contact summary function.