cat_trauma | R Documentation |
This function adds Abbreviated Injury Scores (AIS), Injury Severity Scores (ISS), and other descriptors of injury to a dataframe. For each observation this function will
assign a severity (AIS) and ISS body region values to each valid ICD-9 or ICD-10 injury diagnosis code,
add variables for maximum severity of each body region,
calculate ISS, "New ISS", maximum AIS, and a regression-based mortality prediction,
select first 4 e-codes/mechanism codes and categorize major mechanism, minor mechanism, and intent
cat_trauma(df, dx_pre, icd10, i10_iss_method, calc_method = 1, verbose = FALSE)
df |
A dataframe in wide format containing ICD-9 and/or ICD-10 diagnosis codes with a common column name prefix. Diagnosis codes should be character strings and may have a decimal or not. |
dx_pre |
Prefix for diagnosis code column names (example: dx1, dx2, etc.) |
icd10 |
Should ICD-10 codes be included? Must be one of: TRUE, FALSE, "cm", or "base".
|
i10_iss_method |
Method for calculating ISS from ICD-10 codes. Ignored if icd10 = FALSE. Must be one of:
|
calc_method |
ISS calculation method: Method 1 (default) will assign an ISS of 75 if any AIS is 6. Method 2 will change any AIS = 6 to 5 and then calculate ISS normally. |
verbose |
Should updates be printed to the console? TRUE or FALSE (default). This can be helpful for long running computations. |
Data should be in wide format:
ID | dx1 | dx2 | dx3 | etc. |
31416 | 800.1 | 959.9 | E910.9 | |
31417 | 800.24 | 410.0 |
Codes for AIS severity:
1 = Minor
2 = Moderate
3 = Serious
4 = Severe
5 = Critical
6 = Unsurvivable
9 = Unknown
A dataframe identical to the dataframe passed to the function with the following additional variables added:
sev_1-sev_n: AIS severity for diagnosis codes 1..n
issbr_1-issbr_n: ISS body region for diagnosis codes 1..n
mxaisbr1-mxaisbr6: maximum AIS severity for each of the 6 ISS body regions
maxais: maximum AIS severity over all ISS body regions
riss: computed injury severity score
niss: new injury severity score
ecode_1-ecode_4: first 4 mechanism/E-Codes (including ICD-10 if requested) found in each row of data
mechmaj1-mechmaj4: CDC external cause of injury major mechanism for each E-Code captured
mechmin1-mechmin4: CDC external cause of injury minor mechanism for each E-Code captured
intent1-intent4: intent for each E-Code captured
lowmech: lowest CDC external cause of injury major mechanism for all E-Codes captured
Pmort: The model predicted probability of mortality (only added if using ICD-10 codes with one of the roc_max methods)
df_in <- read.table(header = TRUE, text = " ident dx1 dx2 dx3 31416 800.1 959.9 E910.9 31417 800.24 410.0 NA ") df_out <- cat_trauma(df_in, "dx", icd10 = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.