OpenSRP web 2.0 and FHIR tooling can define Administration levels for locations. This helps us easily query locations at specific levels in the hierarchy.
The LocationHierarchy endpoint doesn’t take this into account while searching and building the hierarchy.
Updating the LocationHierarchy to use this would give OpenSRP the ability to get locations at a specific level for a specific hierarchy.
The implementation idea is to have an adminstrativeLevelMin and adminstrativeLevelMax search parameter.
The parameters would affect the search results in the following ways:
If none of the 2 are defined, the LocationHierarchy works as is right now.
If just the administrativeLevelMin is defined then the LocationHierarchy endpoint response will return all the locations in the hierarchy down to the specified min administrative level.
Anything below that level will not be returned.
The search result will include all the locations with the Administration level defined on the administrativeLevelMin parameter.
If just the adminstrativeLevelMax is defined then the LocationHierarchy endpoint will return all the locations in the hierarchy up to the specified max administrative level.
Anything above that level will not be returned.
The search result will include all the locations with the Administration level defined on the adminstrativeLevelMax parameter.
If both the adminstrativeLevelMin and adminstrativeLevelMax are defined, then the LocationHierarchy endpoint results will only have the locations within the specified levels.
This includes the locations with the adminstrativeLevelMin and adminstrativeLevelMax levels.
Acceptance Criteria
[ ] The LocationHierarchy endpoint should accept the Location Levels as search parameters
[ ] The LocationHierachy endpoint should filter the response based on all the search parameters provided
Content
administrativeLevelMin
is defined then the LocationHierarchy endpoint response will return all the locations in the hierarchy down to the specified min administrative level.dministrativeLevelMin
parameter.adminstrativeLevelMax
is defined then the LocationHierarchy endpoint will return all the locations in the hierarchy up to the specified max administrative level.adminstrativeLevelMax
parameter.adminstrativeLevelMin
andadminstrativeLevelMax
are defined, then the LocationHierarchy endpoint results will only have the locations within the specified levels.adminstrativeLevelMin
andadminstrativeLevelMax
levels.Acceptance Criteria
References