loginToDATIM: loginToDATIMfunction(config_path=NULL, config_path_level =...

View source: R/loginToDATIM.R

loginToDATIMR Documentation

loginToDATIMfunction(config_path=NULL, config_path_level = "dhis" )

Description

logins into a datim or dhis2 api using either default keyring and a config file. This function creates a d2Session login object in the environment calling the login function. E.g. global environment or R-shiny session. Thus you do not need to assign the output of this function to a variable as it creates the variable/object as a side effect.

Usage

loginToDATIM(
  config_path = NULL,
  config_path_level = "dhis",
  username = NULL,
  password = NULL,
  base_url = NULL,
  d2_session_name = "d2_default_session",
  d2_session_envir = parent.frame()
)

Arguments

config_path

path to a dhis config file. If provided, username and password should not be provided.

config_path_level

if there a multiple json entries in the config file, it will default to dhis

username

DHIS 2 username. If provided must provide password and config_path must be NULL

password

DHIS 2 password for the username. If provided must provide password and config_path must be NULL

base_url

if providing password and username directly this must be non null

d2_session_name

the variable name for the d2Session object. The default name is d2_default_session and will be used by other datimutils functions by default when connecting to datim. Generally a custom name should only be needed if you need to log into two seperate DHIS2 instances at the same time. If you create a d2Session object with a custom name then this object must be passed to other datimutils functions explicitly

d2_session_envir

the environment in which to place the R6 login object, default is the immediate calling environment


pepfar-datim/datimutils documentation built on Nov. 20, 2023, 7:58 a.m.