Title: | Translate ICD-9 into Injury Severity Score |
---|---|
Description: | Calculate the injury severity score (ISS) based on the dictionary in 'ICDPIC' from <https://ideas.repec.org/c/boc/bocode/s457028.html>. The original code was written in 'STATA 11'. The original 'STATA' code was written by David Clark, Turner Osler and David Hahn. I implement the same logic for easier access. Ref: David E. Clark & Turner M. Osler & David R. Hahn, 2009. "ICDPIC: Stata module to provide methods for translating International Classification of Diseases (Ninth Revision) diagnosis codes into standard injury categories and/or scores," Statistical Software Components S457028, Boston College Department of Economics, revised 29 Oct 2010. |
Authors: | Dajun Tian [aut, cre], David E. Clark & Turner M. Osler & David R. Hahn [dtc] (map from ICD-9, cited from 'ICDPIC') |
Maintainer: | Dajun Tian <[email protected]> |
License: | GPL-3 |
Version: | 0.0.0.2 |
Built: | 2025-02-17 04:45:16 UTC |
Source: | https://github.com/dajuntian/injuryseverityscore |
Calculate injury severity score from ICD-9
injury_score(indata, id_var, dx_var, has_dot = TRUE, tall = TRUE)
injury_score(indata, id_var, dx_var, has_dot = TRUE, tall = TRUE)
indata |
A data frame |
id_var |
A variable for patient id |
dx_var |
A character varaible for dx code |
has_dot |
A logical varaible indicates whether ICD code has dot |
tall |
A logical variable incates data is tall (T) or wide (F) |
A data frame contains iss score
https://github.com/dajuntian/InjurySeverityScore/blob/master/README.md
pat_id <- c(2,2,2,2,2,1,2,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1) icd9 <- c('874.2', '874.8', '900.81', '900.82', '900.89', '805.06', 'E966', '805.07', 'V14.0', '807.02', 'V70.4', '821.01', '823.20', '860.0', '861.01', '861.21', '861.22', '863.84', '864.04', '865.04', '865.09', '866.02', '868.04', '958.4') sample_data <- data.frame(subj = pat_id, code = icd9, stringsAsFactors = FALSE) injury_score(sample_data, subj, code) data2 <- data.frame(pid = c(1,2), diag1 = c('900.89', '805.06'), diag2 = c('863.84', '865.04')) injury_score(data2, pid, diag, tall = FALSE)
pat_id <- c(2,2,2,2,2,1,2,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1) icd9 <- c('874.2', '874.8', '900.81', '900.82', '900.89', '805.06', 'E966', '805.07', 'V14.0', '807.02', 'V70.4', '821.01', '823.20', '860.0', '861.01', '861.21', '861.22', '863.84', '864.04', '865.04', '865.09', '866.02', '868.04', '958.4') sample_data <- data.frame(subj = pat_id, code = icd9, stringsAsFactors = FALSE) injury_score(sample_data, subj, code) data2 <- data.frame(pid = c(1,2), diag1 = c('900.89', '805.06'), diag2 = c('863.84', '865.04')) injury_score(data2, pid, diag, tall = FALSE)