get_metadata {khisr} | R Documentation |
get_metadata
retrieves metadata for a specified endpoint of KHIS
get_metadata(
endpoint,
...,
fields = c("id", "name"),
retry = 2,
verbosity = 0,
timeout = 60
)
endpoint |
The KHIS API endpoint for the metadata of interest (e.g. dataElements, organisationUnits). |
... |
One or more |
fields |
The specific columns to be returned in the tibble. |
retry |
Number of times to retry the API call in case of failure (defaults to 2). |
verbosity |
Level of HTTP information to print during the call:
|
timeout |
Maximum number of seconds to wait for the API response. |
A tibble with the KHIS metadata response.
# Get the categories metadata
get_metadata('categories')
# Get the datasets metadata with fields 'id,name,organisationUnits' and filter
# only the datasets with id 'WWh5hbCmvND'
get_metadata('dataSets',
fields = 'id,name,organisationUnits[id,name,path]',
id %.eq% 'WWh5hbCmvND')
# Get data elements filtered by dataElementgroups id
get_metadata('dataElements',
dataElementGroups.id %.eq% 'IXd7DXxZqzL',
fields = ':all')