extract_demographics: Extract 1d data from CC-HIC

Description Usage Arguments Value Examples

View source: R/extract_demographics.R

Description

Takes a remote database contection to CC-HIC, a vector of HIC codes (and optionally a vector of labels to rename the codes) and returns a table with 1 row per patient and 1 column per data item.

Usage

1
2
3
4
5
6
extract_demographics(
  connection = NULL,
  episode_ids = NULL,
  code_names = NULL,
  rename = NULL
)

Arguments

connection

a CC-HIC database connection

episode_ids

an integer vector of episode ids from the CC-HIC DB that you want to extact. The default (NULL) is to extract all.

code_names

a character vector of CC-HIC codes

rename

a character vector of names you want to relabel CC-HIC codes as, or NULL (the default) if you do not want to relabel.

Value

A tibble of 1d data

Examples

1
2
3
4
5
6
db_pth <- system.file("testdata/synthetic_db.sqlite3", package = "inspectEHR")
ctn <- connect(sqlite_file = db_pth)
hic_codes <- "NIHR_HIC_ICU_0409"
new_labels <- "apache_score"
extract_demographics(ctn, episode_ids = 13639:13643, hic_codes, new_labels)
DBI::dbDisconnect(ctn)

CC-HIC/inspectEHR documentation built on Jan. 16, 2020, 11:24 p.m.