Get program stages for one or more DHSI2 programs
Source:R/read_dhis2-helpers.R
get_program_stages.Rd
Retrieves the stages associated with specified DHIS2 program IDs, or all programs if none are specified. If any of the supplied program names or IDs are not found, the function displays a message and proceeds with the valid ones.
Arguments
- login
A httr2_response object returned by the
dhis2_login()
function- programs
A data frame with the program IDs and names obtained from the
get_programs()
function- program
A character with the program ID or name
Value
A data frame with the following columns:
program_id
: the unique ID of the programprogram_name
: the displayed name of the programprogram_stage_name
: the name of each stage associate with the programprogram_stage_id
: the ID of each program stage
Examples
# establish the connection to the DHIS2 instance
dhis2_login <- login(
type = "dhis2",
from = "https://smc.moh.gm/dhis",
user_name = "test",
password = "Gambia@123"
)
#> ✔ Logged in successfully!
# get the list of all program stages from the DHIS2 instance
all_program_stages <- get_program_stages(
login = dhis2_login,
program = "E5IUQuHg3Mg",
programs = NULL
)