convertICD: Convert ICD code(s)

Description Usage Arguments Value Author(s) Examples

Description

Converting ICD codes between the ICD-9 and ICD-10 classifications is not entirely trivial. There are about twice as many codes in ICD-10 compared to ICD-9. In addition, several countries have constructed their own variants of the classification systems. This function will try to convert ICD codes between the two definitions, with a possibility to specify how flexible the translation should be. If a code is translated and yields multiple ICD codes in the target definition, only the first code will be returned. The function also has multicore support, to reduce computing time when analyzing large datasets. Also, if an ICD code is not found in the database on its 4-digit representation, the function will also try to find a 3-digit code by keeping only the first three characters in the code. It will work only with the 'clean' original versions of ICD, i.e. country-specific codes have to be converted into a style that the function understands; e.g. "I259" for ICD10, "4149" for ICD9. This function is in early development, and should be tested more before put to use.

Usage

1
2
convertICD(ICDcode, from = "icd10", to = "icd9", flexibility = 1,
  cores = 1)

Arguments

ICDcode

a vector containing the ICD codes that should be converted. The code must not contain dots (which are common in some countries representation of the ICD10 system).

from

What is the source classification: "icd10" or "icd9"? Defaults to "icd10".

to

What is the destination classification: "icd10" or "icd9"? Defaults to "icd9".

flexibility

Takes either of the following values: 0, 1, 2:

  • 0 means no flexibility at all, i.e. the content in ICD9 and ICD10 codes must match perfectly; this will probably induce quite many NAs.

  • 1 means that the function accepts that either the ICD10 or the ICD9 code more precisely describes the diagnosis.

  • 2 corresponds to the most flexible conversion, where the function accepts that e.g. an ICD10 code is most properly described by several ICD9 codes, or vice versa.

Defaults to 1.

cores

The number of processor cores to use. Multicore functionality is available on all unix platforms (e.g. MacOSX, Linux), but not on Windows. Defaults to 1.

Value

Outputs a character vector containing the converted ICD codes.

Author(s)

Daniel Lindholm

Examples

1
2
3
4
5
6
# Simple example of converting from ICD10 to ICD9:
convertICD("I259")

# Run on several processor cores:
test_codes <- c("I10", "I259", "C820", "E669")
convertICD(test_codes, cores = 4)

dlindholm/convertICD documentation built on May 15, 2019, 9:18 a.m.