# Packages
library(dplyr)
library(traumar)
# Simulated data for SEQIC Indicator 10
test_data <- tibble::tibble(
id = as.character(1:12),
trauma_level = c("I", "II", "III", "IV", "II", "I", "IV", "III", "II", "I",
"III", "IV"),
activation = c("Level 1", "Level 2", "None", "Consultation", "Level 1",
"Level 1", "None", "Level 3", "Level 1", "Consultation", "None", "Level
2"),
acute_transfer = rep("No", 12),
iss = c(25, 10, 16, 8, 30, 45, 12, 9, 28, 6, 17, 14),
nfti = c(TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE,
TRUE, TRUE),
region = rep(c("East", "West"), each = 6)
)
# Run the function, this will succeed
traumar::seqic_indicator_10(
data = test_data,
level = trauma_level,
included_levels = c("I", "II", "III", "IV"),
unique_incident_id = id,
transfer_out_indicator = acute_transfer,
trauma_team_activation_level = activation,
iss = iss,
nfti = NULL,
groups = "region",
calculate_ci = "wilson"
)
# Run the function, this will fail
try(
traumar::seqic_indicator_10(
data = test_data,
level = trauma_level,
included_levels = c("I", "II", "III", "IV"),
unique_incident_id = id,
transfer_out_indicator = acute_transfer,
trauma_team_activation_level = activation,
iss = iss,
nfti = nfti,
groups = "region",
calculate_ci = "wilson"
))
Run the code above in your browser using DataLab