This function adds cohort jsons from ATLAS to a subfolder in input/cohortsToCreate. The subfolder is specified by the type.

addCohortsWebApi(
  folderName,
  cohortIds,
  webApiBaseUrl = Sys.getenv("WEBAPI_URL"),
  webApiAuthMethod = Sys.getenv("WEBAPI_AUTHMETHOD"),
  webApiUser = Sys.getenv("WEBAPI_USERNAME"),
  webApiPassword = Sys.getenv("WEBAPI_PASSWORD"),
  cohortFolder = here::here("input/cohortsToCreate")
)

Arguments

folderName

the name of the folder to add the cohorts

cohortIds

a vector of cohorts ids used to identify the cohorts to upload from webapi into the input/cohortsToCreate folder of the project

webApiBaseUrl

the base URL to access webapi, defaults to a system envrionment variable

webApiAuthMethod

the webApi Authentication method, defaults to a system envrionment variable

webApiUser

the user name used to access WebApi, defaults to a system envrionment variable

webApiPassword

the password used to access webApi, defaults to a system envrionment variable

cohortFolder

the input/cohortsToCreate folder to save the cohorts, defaults to the folder within the active project binding