Method new()
Create a connection to a DHIS2 instance using basic authentication
Usage
Dhis2r$new(
base_url,
username = NULL,
password = NULL,
api_token = NULL,
api_version = NULL,
api_version_position = c("after", "before")
)
Arguments
base_url
Base url e.g https://play.dhis2.org/
username
Registered username e.g "admin"
password
Registered password e.g "district"
api_token
Personal Access Token (PAT) to use instead of username and password
api_version
The api version e.g "33"
api_version_position
position where the api_version is after or before in web API url i.e /api/
Returns
A new `Dhis2r` object
Method get_user_info()
Get information of the logged in user
Usage
Dhis2r$get_user_info()
Arguments
endpoint
a resource, get the available resources using `get_metadata()` without any arguments
fields
The specific columns to be return in the dataframe e.g c("name","id")
Arguments
endpoint
a resource, get the available resources using `get_metadata()` without any arguments
Returns
A vector of all possible fields for a specific metadata
Method get_analytics()
Get all possible analytics resources from a DHIS2 instance i.e
Usage
Dhis2r$get_analytics(
analytic,
org_unit,
period,
output_scheme = c("UID", "NAME")
)
Arguments
analytic
vector of ID of specific analytic(s) from a DHIS2 instance
org_unit
vector of ID of specific organisation unit(s) from a DHIS2 instance
period
vector of relative or fixed periods from a DHIS2 instance
output_scheme
Output type ID or Names of fields
Returns
A data frame of the analytics resource
Method get_any_analytic()
Get all any analytics resource from a DHIS2 instance to cater for long DHIS2 favorites
Usage
Dhis2r$get_any_analytic(endpoint_url)
Arguments
endpoint_url
string part of Analytic(s) from a DHIS2 instance api endpoint starting from 'analytics.json?dimension='
Returns
A data frame of the analytics resource
Method clone()
The objects of this class are cloneable with this method.
Usage
Dhis2r$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.