This report demonstrates the structure of the Clinical Context Coding Scheme (CCCS) with respect to the target cohort.
This section will introduce you to the linguistic environment of the report. Use this section for reference as you interpret the code and its output in the present document.
# Attach these packages so their functions don't need to be qualified
library(magrittr) # pipes
library(readxl) # excel input
library(ggplot2) # graphing
library(dplyr) # data wrangling
# Call in functions defined on other scripts
base::source("./scripts/common-functions.R") # personal utilities
# where we stored an analytic product containing computed measures of service engagement
path_input <- "./data-public/raw/addiction-cohort-summative-2019-04-05.xlsx"
# SERVICE CLASS - a group of programs, homogenous with respect to services they provide
# the fundamental unit of analysis
service_class <- c(
"service_class_code" # numeric id
,"service_class_description" # label
)
# Available quantifications for service engagements registered by VIHA
# computed for each of service class in CCCS(6)
measures <- c( # over "Addiction" cohort, for Jan 1, 2007 - Sep 1, 2017
"n_people" # n of unique patients that engaged this service class at least once
,"n_encounters" # n of times the service was engaged by this cohort
)
# Dimensions of the Clinical Context Coding Scheme (CCCS)
cccs_dimensions <- c(
"intensity_type" # intensity level-1
,"intensity_severity_risk" # intensity level-2
,"population_age" # age of people targeted by this health service
,"service_location" # where service takes place
,"clinical_focus" # the nature of health conditions
,"service_type" # type of service provided
)
variables_selected_for_analysis <- c(
service_class # a group of programs, homogeneous with respect to services they provide
,"beyond_ed_acute" # T/FALSE - service is in (ED + Acute) set, typically captured by an EHR
,measures # quantifications of service engagement (n_people, n_encounters)
,cccs_dimensions # Clinical Context Coding Scheme (6)
)
The cohort of 4,067
persons was selected on the basis of transactional data. Specifically, persons were included if they had at least one encounter with any of the following VIHA programs*:
*Please note that these programs (~1,700
) are what CCCS(6) groups into ~150
“service classes” using (6) dimensions of service description.
These criteria are ‘biased’ in favour of ensuring inclusion of persons who have serious/chronic problems with abuse of alcohol. However, by including the Sobering and Assessment Centre in the inclusion criteria for defining the cohort, there will be some cases where the person uses drugs other than alcohol. In future analyses, we can refine the inclusion/exclusion criteria on the basis of the Substance Use Profile from the Minimum Reporting Requirements (MRR).
For each individual in the cohort, we have extracted the complete record of engagement with VIHA services for the period between January 1, 2007 and September 1, 2017. We call these records transactional data(1), because they keep track of patients’ encounters with the healthcare system. Encounter data for the Addiction cohort ( N = 4,067
) were mapped onto 6 categories of CCCS(6) classification system (./manipulation/1-greeter-transactions.R
), producing 124
distinct service classes, unique on the features of each CCCS(6) dimension.
extracted from VIHA’s CERNER-Millenium EHR system
Observations: 125
Variables: 11
$ service_class_code <dbl> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13...
$ service_class_description <chr> "Dedicated Psychiatric Emergency Settings...
$ beyond_ed_acute <lgl> FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FA...
$ n_people <dbl> 564, 838, 165, 66, 447, 8, 1, 79, 2, 29, ...
$ n_encounters <dbl> 940, 2085, 1103, 109, 754, 8, 1, 129, 2, ...
$ intensity_type <chr> "ED, Urgent Care, Acute", "ED, Urgent Car...
$ intensity_severity_risk <chr> "Emergent-Hospital", "Emergent-Community"...
$ population_age <chr> "Mixed Ages", "Mixed Ages", "Adults, some...
$ service_location <chr> "Hospital-ED", "Community", "Community", ...
$ clinical_focus <chr> "MHSU", "MHSU", "MHSU", "Frailty, Non-Spe...
$ service_type <chr> "ED-PES or Psychiatric Bed", "Crisis Resp...
In this data frame (ds
):
service_class_code
and/or service_class_description
n_people
or a number of unique transactions n_encounters
Let us ask this dataframe a few questions to better understand its structure and contents.
# How many different service classes have been engaged by this cohort of 4,067?
ds %>% dplyr::distinct(service_class_code) %>% dplyr::count()
# A tibble: 1 x 1
n
<int>
1 124
# How many categories are there in each dimension of CCCS(6)?
ds %>%
tidyr::gather(
key = "cccs_dimension"
,value = "possible_categories"
,c(
"intensity_type" # intensity level-1
,"intensity_severity_risk" # intensity level-2
,"population_age" # age of people targeted by this health service
,"service_location" # where service takes place
,"clinical_focus" # the nature of health conditions
,"service_type" #
)
) %>%
dplyr::group_by(cccs_dimension) %>%
dplyr::summarize(
n_categories = length(unique(possible_categories)) # N categories in this dimension
,n_encounters = sum(n_encounters) # N of unique transactions by the cohort
) %>%
dplyr::ungroup() %>%
neat() # custom table formatting, from `./scripts/common-functions.R`
cccs_dimension | n_categories | n_encounters |
---|---|---|
clinical_focus | 43 | 160318 |
intensity_severity_risk | 36 | 160318 |
intensity_type | 14 | 160318 |
population_age | 8 | 160318 |
service_location | 14 | 160318 |
service_type | 53 | 160318 |
Each dimension of CCCS(6) groups the same set of encounters into different number of categories.
Intensity_Type - this is a set of categories that are used to classify the 1700 service locations into groups that are relatively homogeneous with respect to the manner in which service intensity would be coded. (e.g. “Ambulatory_Chronic” would refer to ambulatory services provided over an extended period of time)
Intensity_Severity_Risk - this set of categories is nested within Intensity_Type and is used to characterize the intensity of services provided within an Intensity_Type class. (e.g. three levels of intensity within the “Ambulatory_Chronic” class)
Population_Age - this set of categories refers to the age range of the patients/clients who access a particular service. (e.g. “Infants” or “Older Adults Exclusively” or “Mixed”)
Service_Location - this set of categories refers to the physical location where a given service is provided. (e.g. “Ambulatory Clinic” or “Hospital” or “Home”)
Clinical_Focus - this set of categories refers to the predominant clinical focus of a service associated with a location in the Cerner location build. (e.g. “Diabetes” or “Frailty/Neurocognitive, Psychiatric”)
Service_Type - this set of categories refers to the type of service provided. (e.g. “Assertive Community Treatment” or “Acute Care - Tertiary”)
t1 <- ds %>%
dplyr::filter(clinical_focus == "Med-Surg") %>%
dplyr::group_by(beyond_ed_acute, service_class_description, service_location) %>%
dplyr::summarize(
n_encounters = sum(n_encounters)
)
t1 %>%
neat() # custom table formatting, from `./scripts/common-functions.R`
beyond_ed_acute | service_class_description | service_location | n_encounters |
---|---|---|---|
FALSE | Acute Care - Children, Adolescents | Hospital | 46 |
FALSE | Acute Care - Infants | Hospital | 1 |
FALSE | Acute Care - Med-Surg - Mixed Ages | Hospital | 3320 |
FALSE | Acute Care - Med-Surg ED - Mixed Ages | Hospital-ED | 89 |
TRUE | Ambulatory Episodic - Treatment - Medical Day Care | Ambulatory Clinic | 103 |
TRUE | Ambulatory Episodic - Urgent Assessment | Ambulatory Clinic | 184 |
TRUE | Med-Surg - Ambulatory Episodic - Mixed Ages | Ambulatory Clinic | 371 |
TRUE | Med-Surg - Ambulatory Mixed Episodic - Chronic - Child & Youth | Ambulatory Clinic | 24 |
TRUE | Med-Surg - Ambulatory Mixed Episodic - Chronic - Mixed Ages | Ambulatory Clinic | 611 |
service_class_description | service_location | FALSE | TRUE |
---|---|---|---|
Acute Care - Children, Adolescents | Hospital | 46 | NA |
Acute Care - Infants | Hospital | 1 | NA |
Acute Care - Med-Surg - Mixed Ages | Hospital | 3320 | NA |
Acute Care - Med-Surg ED - Mixed Ages | Hospital-ED | 89 | NA |
Ambulatory Episodic - Treatment - Medical Day Care | Ambulatory Clinic | NA | 103 |
Ambulatory Episodic - Urgent Assessment | Ambulatory Clinic | NA | 184 |
Med-Surg - Ambulatory Episodic - Mixed Ages | Ambulatory Clinic | NA | 371 |
Med-Surg - Ambulatory Mixed Episodic - Chronic - Child & Youth | Ambulatory Clinic | NA | 24 |
Med-Surg - Ambulatory Mixed Episodic - Chronic - Mixed Ages | Ambulatory Clinic | NA | 611 |