I’m attempting to enable target aggregates for Supervisors in the eCHIS Kenya project.
Hierarchy is County > Sub-County > Unit > CHW Area > CHW Primary Contact.
Supervisors have replication depth: 1 and report_depth: 1 and are linked to a Unit place in the hierarchy.
When I login as the supervisor, I see no data for their target aggregates.
If I increase the replication depth to 2 and login again, I can see all the expected aggregate data.
What’s going on here? Do I need to have the CHW Area’s Primary Contact to view the CHW’s performance? This causes a host of other problems where a CHA would download thousands of unnecessary contacts. Any workaround for this?
The target aggregate is connected to the CHW Primary Contact and not the CHW Area, so you would need to see the CHW Primary Contact in order to get their target doc.
There is no workaround.
Since that issue looks complicated, another vector to fix might be if the target doc was changed to be associated with the facility instead of the primary contact. Suppose this is likely “breaking change” territory… But imo primary contacts kinda suck and relying on them for a user’s data or functionality is often a mistake. Admittedly, this was my mistake when setting the target doc schema.
There are multiple use cases for replicating primary contacts, as they are at the moment. I’m pretty invested in getting this done as is, even if it’s complicated.