Extract CC-HIC Data

extract(core_table = NULL, code_name = NULL, translate_site = NULL)

Arguments

core_table

core table returned from make_core()

code_name

a string vector of length 1 with the CC-HIC data item to be extracted.

translate_site

a lookup table to translate site names on export in a consistent way. The table requires two columns: site and translation. The site column should be a character vector with names of the existing sites as they are stored in the database (e.g. c("GSTT", "RGT") etc). The translation column should be a character vector with new names to obfuscate the real names (e.g. c("Site A", "Site B") etc). This is a 1:1 mapping so doesn't confer any real privacy advantage, but is useful as a means to casually obscure data origins.

Value

A tibble with 1 row per event

Details

Extracts CC-HIC data from the database events tables and appends them with the correct class for further processing.

Examples

if (FALSE) { # ctn <- DBI::dbConnect() create database connection core <- make_core(ctn) df <- extract(core, "NIHR_HIC_ICU_0108") }