get_cases_questionnaire: Download cases from Go.Data and returns questionnaire fields

View source: R/get_cases_questionnaire.R

get_cases_questionnaireR Documentation

Download cases from Go.Data and returns questionnaire fields

Description

A function that retrieves the questionnaire fields from case data for a specific outbreak_id.

Usage

get_cases_questionnaire(url, username, password, outbreak_id, wait = 2)

Arguments

url

Insert the base URL for your instance of Go.Data here. Don't forget the forward slash "/" at end!

username

The email address for your Go.Data login.

password

The password for your Go.Data login

outbreak_id

The id number for the outbreak for which you want to download data.

wait

If method = "export", then wait is the number of seconds to wait in between iterations of checking the status of the export.

Details

Unlike get_cases() this function only uses the export_downloader(), and not the batch_downloader(). Therefore, this function will only work on Go.Data versions 2.38.1 or newer. This method relies on the GET outbreak/id/cases/export API endpoint. An export request is submitted to the server, and then when the export is ready, it will be downloaded.

This function fixes the file return type to "csv".

Value

Returns a tibble.

Examples

## Not run: 
url <- "https://MyGoDataServer.com/"
username <- "myemail@email.com"
password <- "mypassword"
outbreak_id <- "3b5554d7-2c19-41d0-b9af-475ad25a382b"

cases <- get_cases_questionnaire(
  url = url,
  username = username,
  password = password,
  outbreak_id = outbreak_id
)

## End(Not run)

WorldHealthOrganization/godataR documentation built on May 21, 2023, 11:30 a.m.