seqic_indicator_5 {traumar}R Documentation

SEQIC Indicator 5 - Alcohol and Drug Screening

Description

[Experimental]

Computes SEQIC Indicator 5a–5d for trauma system quality monitoring. These indicators measure alcohol and drug screening rates among trauma patients at trauma level I–IV facilities.

Usage

seqic_indicator_5(
  data,
  level,
  included_levels = c("I", "II", "III", "IV"),
  unique_incident_id,
  blood_alcohol_content,
  drug_screen,
  groups = NULL,
  calculate_ci = NULL,
  ...
)

Arguments

data

A data frame containing trauma incident records.

level

Column indicating the trauma center designation level (e.g., I, II, III, IV).

included_levels

Character vector indicating what facility levels to include in the analysis. Defaults to c("I", "II", "III", "IV").

unique_incident_id

Unique identifier for each record.

blood_alcohol_content

Unquoted column name for blood alcohol concentration. Numeric. A non-missing value indicates a test was performed. Values greater than zero are considered positive results.

drug_screen

Unquoted column name for the drug screen result. Character or factor. May contain keywords (e.g., "opioid", "cocaine", "none"). The keywords used in this function correspond to the National Trauma Data Bank (NTDB) field values for the corresponding data element.

groups

Additional columns passed as a vector of strings to dplyr::summarize() via the .by argument for grouped summaries. Defaults to NULL.

calculate_ci

If NULL, 95% confidence intervals will not be calculated for the performance estimates. Otherwise, options of "wilson" or "clopper-pearson" can be supplied to utilize the corresponding methods to calculate the confidence intervals for the proportions. Defaults to NULL.

...

Arguments passed on to nemsqar::nemsqa_binomial_confint

conf.level

Numeric value between 0 and 1 indicating the confidence level. Defaults to 0.95 (95% confidence interval).

correct

Logical, indicating whether to apply continuity correction for Wilson intervals. Defaults to TRUE.

Details

This function:

Value

A tibble summarizing SEQIC Indicator 5a–5d results. Includes numerator, denominator, and calculated proportion for each measure. Optionally includes 95% confidence intervals.

Note

Users must ensure input columns are correctly named and contain standardized values where applicable. Drug screen values should ideally use consistent naming or be mapped to recognizable substance terms prior to function use.

Author(s)

Nicolas Foss, Ed.D., MS

Examples

# Packages
library(dplyr)
library(traumar)

# Create synthetic test data for Indicators 5a–5d
test_data <- tibble::tibble(
  id = as.character(1:10),
  trauma_level = rep(c("I", "II", "III", "IV", "V"), each = 2),
  bac = c(0.08, NA, 0, 0.02, NA, 0.15, NA, NA, 0, 0),
  drug = c(
    "opioid", "none", "cocaine", "none", NA,
    "benzodiazepine", "alcohol", "thc", "none", NA
  )
)

# Run the indicator function
traumar::seqic_indicator_5(
  data = test_data,
  level = trauma_level,
  unique_incident_id = id,
  blood_alcohol_content = bac,
  drug_screen = drug
) |>
  tidyr::pivot_longer(cols = -1, names_to = "Indicator", values_to =
  "Values")


[Package traumar version 1.2.1 Index]