IMPORTANT NOTES

Always remember to access and analyze data on the CAMH server (eg in SCC)
Never save data on your personal computer
Data can be accessed/shared via the Y Drive (see instructions in the Powerpoint below) or via postgres (instructions below)

For more information and best practices, see:

Accessing data via a data mart in postgres

The following datasets are available via postgres:

DATA (POSTGRES)
1                    <Id> schema = fml01_cmh, table = DCRestraint_20220826     FALSE
2                       <Id> schema = fml01_cmh, table = DCDASAIV_20220519     FALSE
3                     <Id> schema = fml01_cmh, table = medication_20220610     FALSE
4                  <Id> schema = fml01_cmh, table = DCED_WaitTime_20220505     FALSE
5 <Id> schema = fml01_cmh, table = DCIncidentBehaviorsAndAssaults_20220531     FALSE
6                      <Id> schema = fml01_cmh, table = encounter_20220516     FALSE
7                   <Id> schema = fml01_cmh, table = HealthEquity_20220516     FALSE
8                  <Id> schema = fml01_cmh, table = DCOrders_PICU_20220512     FALSE
9                  <Id> schema = fml01_cmh, table = encounter_20220516_bkp     FALSE

To access this data, you must have been provided access by IMG staff (to request access, please let Marta or Laura know). You will also need to install the DBI package in R (https://dbi.r-dbi.org/). Once access is granted and the package is installed, you can use the following code to access these data:

R code

# import library
library(DBI)

# Connect to a specific postgres database
con <- dbConnect(RPostgres::Postgres(),
                 dbname = 'nip',
                 host = 'rprshpostgresv02.camhres.ca',
                 port = 5432,
                 user = 'FIRSTNAME_LASTNAME', #replace with CAMH account credentials
                 password = 'PASSWORD') #replace with CAMH account password

DBI::dbListObjects(con, DBI::Id(schema = 'fml01_cmh')) #gives you a list of available databases

# as an example, we will query all data from the restraints dataset: 
data <- dbSendQuery(con, "SELECT * FROM fml01_cmh.\"DCRestraint_20220826\"")
restraint = dbFetch(data) #this should now be available as a dataset in your environment
(restraint) #check dimensions


Data analysis plan

Predictors
We will train models on patient demographics (HealthEquity), diagnosis (encounter), admission information (encounter), structured risk assessments (DCDASAIV) and unstructured risk assessments (eg clinical notes/FMTs, when available). We will use these predictors recorded on each day a DASA was administered to predict our composite outcome (occurring between one DASA score and the next DASA score).

Outcomes
Our models will predict a composite outcome made up of the occurrence of a violent/aggressive incident (recorded in SCORES/STRIDES, DCIncidentBehaviorsAndAssaults), a restraint event (differentiating between mechanical or chemical only), and/or a seclusion event (restraints/seclusions are from the structured portions of the powerforms, DCRestraint).

Our data log which documents initial processing tasks, assigned team members, and completion dates can be found here:

https://docs.google.com/spreadsheets/d/1iJEZDwrSe15fB6SpicQcXIn4EblTCRUivdXQJdMuPEE/edit#gid=722089260



  • No labels