Get tracked entity attributes, their corresponding IDs and event IDs
Source:R/read_dhis2-helpers.R
get_tracked_entities.Rd
Get tracked entity attributes, their corresponding IDs and event IDs
Arguments
- login
A httr2_response object returned by the
dhis2_login()
function- api_version
A numeric with the API version obtained from the
get_api_version()
function- org_unit
A character with the organisation unit ID or name
- program
A character with the program ID or name
- org_units
A data frame with all organisation units from target DHIS2 instance. This is the output from the
get_organisation_units()
function
Examples
# login to the DHIS2 instance
dhis2_login <- login(
type = "dhis2",
from = "https://smc.moh.gm/dhis",
user_name = "test",
password = "Gambia@123"
)
#> ✔ Logged in successfully!
# set the program and org unit IDs
program <- "E5IUQuHg3Mg"
org_unit <- "GcLhRNAFppR"
# get the api version
api_version <- get_api_version(login = dhis2_login)
# get all the organisation units from the DHIS2 instance
org_units <- get_organisation_units(login = dhis2_login)
# get the tracked entity attributes
tracked_entity_attributes <- get_tracked_entities(
login = dhis2_login,
api_version = api_version,
org_unit = org_unit,
program = program,
org_units = org_units
)