m4_patient_admissions: Access combined patient and admissions data.

Description Usage Arguments Value Examples

View source: R/m4_patterns.R

Description

This function combines data from the patients with matching data from the admissions table. The function calculates additional common pattern data like length of stay in the hospital in days (los_hospital) and age at admission in years (admission_age). Patients who are older than 89 years old at any time in the database have had their date of birth shifted to obscure their age and comply with HIPAA. These ages appear in the data as = 91. As such, an additional field is added to categorize age into decades (admission_decade). Patients older than 89 show up in the 90 and older age decade bucket.

Usage

1
m4_patient_admissions(con, cohort = NULL, ...)

Arguments

con

A bigrquery::bigquery() DBIConnection object, as returned by DBI::dbConnect() with an appropriate bigrquery::bigquery() DBI driver specified in the call.

cohort

an optional vector of patient IDs defining the cohort of interest

...

additional optional passed along parameters.

Value

a tibble with the results.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
con <- bigrquery::dbConnect(
  bigrquery::bigquery(),
  project = bigrquery::bq_test_project(),
  quiet = TRUE
)

patadm <- m4_patient_admissions(con, cohort = 16904137)
dim(patadm)

bigrquery::dbDisconnect(con)

hdshea/MIMIC4db documentation built on Dec. 20, 2021, 3:45 p.m.