# Multiple hierarchy support | Filter "middle levels"

**URL:** <https://forum.communityhealthtoolkit.org/t/multiple-hierarchy-support-filter-middle-levels/4379>\
**Category:** Development\
**Tags:** configuration, hierarchy\
**Created:** [November 22, 2024, 1:18pm UTC](https://forum.communityhealthtoolkit.org/t/multiple-hierarchy-support-filter-middle-levels/4379 "2024-11-22T13:18:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anro](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/anro/32/2145_2.png) [@Anro](https://forum.communityhealthtoolkit.org/u/Anro)\
**Post date:** [November 22, 2024, 1:18pm UTC](https://forum.communityhealthtoolkit.org/t/multiple-hierarchy-support-filter-middle-levels/4379/1 "2024-11-22T13:18:43Z")

</div>

Has any progress been made in supporting multiple hierarchy configurations on the same instance? If so, in what way:

1. Where there’s shared data between the two configurations
2. Completely different configurations that share no data

Alternatively, is there a way where we could omit/filter-out certain levels of the hierarchy for specific login roles?

Consider the following hierarchy:

```auto
NPO
- Team Area
-- Indawo
--- Team Area
---- Dwelling
----- Household
------ Household member/patient

```

We need a way to allow access to the household members/patients in two different “views”. One where the entire hierarchy is considered (metro health services), and one where we care about ALL the patients grouped by the top-level place (rural health services).

Would appreciate your thoughts.

Related threads:  
[Does the CHT support multiple hierarchies on same instance? - Product - Community Health Toolkit](https://forum.communityhealthtoolkit.org/t/does-the-cht-support-multiple-hierarchies-on-same-instance/3082)

[Can one person belong to multiple places in the same hierarchy? - Technical Support - Community Health Toolkit](https://forum.communityhealthtoolkit.org/t/can-one-person-belong-to-multiple-places-in-the-same-hierarchy/101)

---

<div class="post-metadata">

**Author:** ![jkuester](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/jkuester/32/806_2.png) [@jkuester](https://forum.communityhealthtoolkit.org/u/jkuester)\
**Post date:** [November 22, 2024, 5:28pm UTC](https://forum.communityhealthtoolkit.org/t/multiple-hierarchy-support-filter-middle-levels/4379/2 "2024-11-22T17:28:52Z")

</div>

Short answer is no. A consistent contact hierarchy is still required.

[Some limited support](https://docs.communityhealthtoolkit.org/building/features/supervision/#managing-multiple-areas) has been added for allowing supervisors to access multiple discrete parts of the contact hierarchy without needing to have access to a single ancestor. However, this feature is currently still tightly scoped to the supervisor use case and is probably not flexible enough (in its current form) to be what you need.

Also relevant is the [replication depth](https://docs.communityhealthtoolkit.org/building/guides/performance/replication/#depth) setting. But I think this actually does the opposite of what you are looking for here (blocks a user from seeing data from a certain number of levels _below_ them vs allowing them to see the bottom level patients without the rest of the hierarchy.

* * *

For your use case, are the metro health services and the rural health services serving _different patients_ or do they need to have access to the same patient contacts?

If the rural/metro contacts were separate, you could just configure different hierarchy structures as needed.

If they need access to the _same_ patient contacts, then I agree with your wording that probably what you need is “different “views”” of the data. Instead of getting into the challenges of modifying how the actual contact hierarchy works (which then affects the replication algorithm), it might be enough to just update the webapp to allow hiding contact levels from some users/roles… 🤔
