Is it possible to aggregate data if I set my organization hierarchy structure like in this post?

I am planning to have an organization hierarchy structure like below.
My question is can I aggregate data long the following organisation unit hierarchy:

  1. Country → State → LGA → Location
  2. Country → State → LGA → Ward → Facility
  3. Country → State → LGA → Ward → Community

If possible, is there a documentation I can look at for guidance?

                                             Country
                                                .
                                                .
                                              State
                                                .
                                                .
                                               LGA
                                                .
                            ............................................
                            .                                          .
                            .                                          .
                           Ward                                   Location
                             .
                  ..............................
                  .                            .
               Facility                     Community

Hi @jetisco4u

Based on the structure you put out there, in DHIS2 it’d be:

But in reality, the levels need to be in order as we can’t have two at the same level as you can see here when retrieving level and offlineLevels from the API:

If it could be (Country - State - LGA) and then whatever comes after LGA will depend on the OU code or another thing to distinguish it from (Location, Ward, Facility, or Community) then it might work better. From my perspective I haven’t seen parallel OU levels.

Thanks for the reply, based on my picture, Location will be level 4 not 3 same with Ward.

What is the use case of the offlineLevels in the organisationUnitLevels api? Because in my case Ward and Location will have the same offlineLevel 4 while Facility and Community have the same offlineLevel 5.

I don’t understand this suggestion especially the part ’ or another thing to distinguish it from (Location, Ward, Facility, or Community)'.

I tried to import into the organisationUnitLevels API and it’s throwing an error suggesting that the level field is unique. In order word, I cant set level 4 for both Ward and Location as well as level 5 for both Community and Facility.

I am thinking as alternative to set it as below with Entity as level 5. Entity in this instance can be Community, Facility, Location or other defined entity. All these OU still fall under Ward except that Location data may not need to be aggregated at Ward level. Under Ward, I can now use organizationUnitGroup and organisationUnitGroupSet to disaggregate the Entities. Can it work like this?
Also lets say we define OUG for facilities, does it matter if we do not assign some Entities like the communities to this facility OUG?

                                             Country
                                                .
                                                .
                                              State
                                                .
                                                .
                                               LGA
                                                .
                                                .                          
                                              Ward           
                                                .
                                                .
                                              Entity

Hi @jetisco4u
The key concept with the organisation unit hierarchy dimension is that it should represent a geographical hierarchy. When you start trying to mix administrative hierarchies inside, problems arise. I think your last suggestion, to use a shared level for facilities/communities makes a lot of sense. Using orgunit group sets, you can then determine which type of “entity” is a facility or community organisation unit.

Its very important that all organisation units at level 5 (Entity) be a member of exactly one organisation unit group within the group set for Facility/Community. Organisation unit group sets should generally be compulsory (all organisation units should belong to the group set) and exclusive (organisation unit should only belong to one group within a group set).

Best regards,
Jason

2 Likes

Thanks for the clarification. I intend to have all OU defined by the Entity. But there will be different OUGS and different OUG that each entity is assigned to.

So I think you only need one orgunit group set called “Type” or something like that, and then orgunit groups like “Facility”, “Community”, etc. I do not see why you would need multiple orgunit group sets for this particular case. There could of course be other group sets like “Ownership” or “Urban/Rural” but for the use case which you have described here, I think only one group set is required to achieve the desired aggregation which you describe in your initial post.

2 Likes

Thanks for the insight to use Entity Type for OUGS and the type for OUG. You just saved me days of brainstorming.

1 Like

That’s great to hear! @jetisco4u would you please mark the post that solve the issue? Thanks!