Skip to contents

Map ICD diagnosis or procedure codes to and from either ICD9 or ICD10.

Usage

map_code(
  codes,
  icdVer_dest,
  code_type = c("dg", "pc"),
  method = c("gem", "reverse-gem", "both", "multi-stage"),
  match_method = c("exact", "prefix")
)

Arguments

codes

A vector of ICD diagnosis or procedure codes.

icdVer_dest

A number, either 9 or 10, indicating the destination ICD version.

code_type

A string, either "dg" or "pc," indicating the codes are diagnosis or procedure, respectively.

method

A string specifying the method for mapping the codes. The same methods as implemented by the icd_convert function in the touch package.

  • "gem" performs a single forward mapping.

  • "reverse-gem" performs a single backward mapping.

  • "both" performs a single forward and backward mapping, combining the results.

  • "multi-stage" performs the multiple-stage mapping, as described in the touch package.

match_method

A string, specifying the method for matching the codes

  • "exact" matches the provided code exactly.

  • "prefix" treats the provided code as a prefix for matching.

Value

A dataframe with the source code, the matching destination code, and additional columns for cases where multiple codes represent a single source code.