getCases: Execute a SOQL query against the Case object

Description Usage Arguments Value Examples

View source: R/getCases.R

Description

getCases() returns a tibble of data from the CCM Case object. The Case object maps to Investigations on the client-side.

Usage

1
2
3
4
5
6
7
getCases(
  confirmedOnly = FALSE,
  from = "1990-01-01",
  to = as.character(Sys.time()),
  columns = "Id",
  healthUnit = NULL
)

Arguments

confirmedOnly

Logical scalar. Should the query limit results to confirmed cases? Returns confirmed and probable cases by default.

from

Character scalar. Identifies the start of the date range to include in the query. Defaults to the origin date of CCM.

to

Character scalar. Identifies the end of the date range to include in the query. Defaults to Sys.time() (i.e. today's date and time).

columns

Character scalar or character vector. Names the columns to return from the Case object. Defaults to Id

healthUnit

Character vector or scalar. Names the Public Health Unit used to filter the query. getCases() filters on Permanent PHU. Defaults to NULL (i.e. no health unit filter).

Value

If the query succeeds, a tibble containing columns.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
Get all confirmed cases for Durham Region
cases <- getCases(
  confirmedOnly = TRUE,
  healthUnit = 'Durham Region Health Department'
)
Specify the data to return. This can be field names or labels
N.B. Names are case sensitive!
cases <- getCases(
  columns = c("Id", "Reported Date", "Episode Date", "CCM_Episode_Date_Type__c")
)
Limit the data to a specific time period.
cases <- getCases(
  from = "2020-10-12",
  to = "2020-10-17"
)

## End(Not run)

ccmReportR documentation built on Feb. 12, 2021, 1:06 a.m.