Skip to contents

This function adds dot to diagnosis codes of the given ICD version.

Usage

insert_dot(dx, version = c(10, 9))

Arguments

dx

A character vector for the diagnosis codes

version

The version of the diagnosis codes. Two available options are 10 and 9. The default version is 10 for ICD-10. This argument can be either a numerical value (nummerical vector of length one) or a character string (character vector of length one).

Value

A character vector representing the diagnosis codes in decimal format.

Examples

library(touch)

## for ICD-9 codes
icd9codes <- c("0011", "001.1", "316", "E950", "E9808", "V90", "v100")
insert_dot(icd9codes, 9)
#> [1] "001.1"  "001.1"  "316"    "E950"   "E980.8" "V90"    "V10.0" 

## for ICD-10 codes
icd10codes <- c("A010", "M61019", "p52", "p528")
insert_dot(icd10codes)
#> [1] "A01.0"   "M61.019" "P52"     "P52.8"