cat_trauma.Rd
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)
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.
Prefix for diagnosis code column names (example: dx1, dx2, etc.)
Should ICD-10 codes be included? Must be one of: TRUE, FALSE, "cm", or "base".
TRUE - ICD-10 codes will be processed by the program
FALSE - Any ICD-10 codes in the data will be ignored.
"cm" - ICD-10-CM codes will be processed by the program
"base" - Basic ICD-10 (international) codes will be processed by the program
Method for calculating ISS from ICD-10 codes. Ignored if icd10 = FALSE. Must be one of:
"roc_max_NIS" Table derived empirically from National Inpatient Sample (NIS) maximizing area under an ROC curve. For ICD10 codes not in NIS the mapping based on TQIP data will be used as a backup. This option is recommended if the user's data are similar to NIS data.
"roc_max_TQIP" Table derived empirically from the Trauma Quality Improvement Program (TQIP) data maximizing area under an ROC curve. For ICD-10 codes not in TQIP the mapping based on NIS data will be used as a backup. This option is recommended if the user's data are similar to TQIP data.
"roc_max_NIS_only" Table derived as for "roc_max_NIS", but injury ICD-10 codes not in the NIS dataset will be ignored
"roc_max_TQIP_only" Table derived as for "roc_max_TQIP", but injury ICD-10 codes not in the TQIP dataset will be ignored.
"gem_max" Table derived by mapping ICD-10-CM to ICD-9-CM using the CMS general equivalence mapping tables and then to AIS and ISS using the ICDPIC table inherited from the Stata version. Mapping conflicts handled by taking the max AIS.
"gem_min" Same as "gem_max" except that mapping conflicts are handled by taking the min AIS.
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.
Should updates be printed to the console? TRUE or FALSE (default). This can be helpful for long running computations.
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)
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
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)