icd_intent_mech: Add intent and mechanism combined fields for injury...

Description Usage Arguments Value See Also Examples

View source: R/icd10cm_injury.R

Description

, reference

Usage

1
icd_intent_mech(data, inj_col, reference = c("both", "intent", "mechanism"))

Arguments

data

input data

inj_col

ecode and diagnosis column indices

reference

injury matrix reference with three possible choices: "both"(the default) adding intent and mechanism combined variables "intent" adding intent only "mechanism" adding mechanism only

Value

return the input with additional variables (93 intent_mechanism combinations, five intent variables, or 32 mechanism variable depending on the reference choice

See Also

icd_matched_intent_mech for a more efficient approach

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(dplyr)
library(purrr)
dat <- data.frame(
  d1 = c("T63023", "X92821", "X99100", "T360x"),
  d2 = c("T65823", "Y030x0", "T17200", "V0100x")
)

dat %>% icd_intent_mech(inj_col = c(1, 2), reference = "both")
dat %>% icd_intent_mech(inj_col = c(1, 2), reference = "intent")
dat %>% icd_intent_mech(inj_col = c(1, 2), reference = "mechanism")

epinotes/useicd10cm documentation built on Oct. 18, 2021, 2:33 a.m.