Makes the reference table used my many functions in this package. This is part of the basic setup.

make_reference(connection)

Arguments

connection

a database connection

Value

a tibble with episode level data with site

Examples

db_pth <- system.file("testdata/synthetic_db.sqlite3", package = "inspectEHR") ctn <- connect(sqlite_file = db_pth) ref <- make_reference(ctn) head(ref)
#> # A tibble: 6 x 4 #> episode_id nhs_number start_date site #> <int> <chr> <dttm> <chr> #> 1 13626 8674351972 2016-02-19 01:28:00 B #> 2 13639 4295442348 2016-02-18 17:36:04 B #> 3 13640 3369135825 2016-02-18 20:21:47 B #> 4 13641 5222379698 2016-02-18 18:23:56 B #> 5 13642 4463215420 2016-02-18 09:19:18 B #> 6 13643 7366572217 2016-02-18 21:07:40 B
DBI::dbDisconnect(ctn)