The goal of ccdm
is to facilitate the use of the Core Clinical Data
Model (Core CDM) and other data sources in the Cloud Data Warehouse
(CDW).
To install ccdm
, the package remotes
is required, and can be
installed with install.packages("remotes")
.
If you are able to access GitHub.com, you can then install cddm
on
RStudio from GitHub with:
remotes::install_github("RollieParrish/ccdm")
Network security settings may prevent remotes::install_github()
from
accessing GitHub.com. If this is the case, ccdm
can be installed by
downloading the Package
Archive and running
the following code (replacing the section marked <>
, including the
arrows themselves):
remotes::install_local("<FILEPATH OF ccdm.*.tar.gz FILE>")
This package assumes that:
First, set up the connection to the CDW.
library(dplyr, warn.conflicts = FALSE)
library(ccdm)
conn <- connect_cdw()
The ccdm_tbl()
function is use to create pointers to Core CDM
tables. The conn
connection defined above must be passed as the first
parameter, followed by the name of a table. If a name is not specified,
then a list of available tables will be displayed.
ccdm_tbl(conn)
#> TABLE_NAME TABLE_TYPE ROW_COUNT SIZE LAST_ALTERED
#> 1 ADT_EVENTS BASE TABLE 21429490 248.77 MB 2020-11-22 07:13:29
#> 2 ED_ENCOUNTERS BASE TABLE 3583088 201.07 MB 2020-11-22 07:11:38
#> 3 FLOWSHEET BASE TABLE 14625241312 314.42 GB 2020-11-22 07:19:40
#> 4 HOSPITAL_ENCOUNTERS BASE TABLE 12612180 1.86 GB 2020-11-22 07:10:17
#> 5 ICD_DIAG BASE TABLE 42371459 360.11 MB 2020-11-22 07:11:57
#> 6 ICD_PROC BASE TABLE 3126754 40.76 MB 2020-11-22 07:12:13
#> 7 LABS BASE TABLE 31406895 1.01 GB 2020-11-22 07:24:13
#> 8 MEDICATIONS BASE TABLE 1128618051 20.39 GB 2020-11-22 07:26:46
#> 9 ORDERS BASE TABLE 362633816 12.45 GB 2020-11-22 07:15:32
#> 10 OR_CASE_LOGS BASE TABLE 3859873 329.84 MB 2020-11-22 07:17:58
#> 11 PROBLEMS BASE TABLE 7223627 96.29 MB 2020-11-22 07:27:07
#> 12 PROVIDERS BASE TABLE 36041 3.33 MB 2020-11-22 07:10:33
#> 13 TRANSFUSIONS BASE TABLE 219759 9.90 MB 2020-11-22 07:24:56
#> COMMENT
#> 1 Admission, Discharge and Transfer Events
#> 2 ED encounters
#> 3 Flowsheet data
#> 4 Inpatients, EHOP, ED, Newborn, and Ambulatory Surgery
#> 5 ICD10 Diagnosis code details
#> 6 ICD prodecure information
#> 7 Lab results
#> 8 Med administrations
#> 9 Orders
#> 10 Procedure & Surgery information
#> 11 Problem list
#> 12 Provider and group info
#> 13 RBC Transfusions
Next we need to set up a pointer to a remote tables in Core CDM.
HOSPITAL_ENCOUNTERS
is the primary table and will probably used for
most analytics projects.
Note: data has been de-identified and truncated to just a few columns in the examples below
hosp_enc <- ccdm_tbl(conn, "HOSPITAL_ENCOUNTERS")
hosp_enc
| PAT_ENC_CSN_ID | AGE | SEX | FACILITY_CD | ACCOUNT_CLASS | ARRIVAL_DTS | | :---------------- | --: | :-- | :----------- | :--------------------------- | :------------------ | | 150xxx014 | 32 | F | PSHMC | Extended Hospital Outpatient | yyyy-mm-dd 11:32:00 | | 150xxx104 | 67 | F | PSHMC | Emergency | yyyy-mm-dd 03:15:00 | | 150xxx124 | 79 | M | PSHMC | Inpatient | yyyy-mm-dd 11:10:00 | | 150xxx180 | 61 | M | PSHMC | Inpatient | yyyy-mm-dd 20:51:00 | | 150xxx617 | 26 | M | PSHMC | Inpatient | yyyy-mm-dd 17:43:00 | | 150xxx893 | 52 | F | PSHMC | Emergency | yyyy-mm-dd 17:31:00 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.