Learn R Programming

LABTNSCPSS (version 1.0.2)

comorbidity: Comorbidity mapping

Description

Maps ICD diagnostic codes to comorbidity categories using supported algorithms.

Usage

comorbidity(x, id, code, map, assign0, labelled = TRUE, tidy.codes = TRUE)

Value

A data.frame with comorbidity indicator columns and class `"comorbidity"`.

Arguments

x

A data.frame (or data.table/tibble) containing at least an ID column and a code column.

id

Name of the patient identifier column in `x`.

code

Name of the diagnostic code column in `x`.

map

Name of the mapping algorithm to use.

assign0

Logical; if TRUE, applies hierarchy rules to avoid double-counting.

labelled

Logical; if TRUE, adds labels for easier viewing.

tidy.codes

Logical; if TRUE, cleans codes before mapping.

Examples

Run this code
x <- data.frame(
  id = c(1, 1, 2, 2),
  code = c("I10", "E119", "F200", "E110"),
  stringsAsFactors = FALSE
)

comorbidity(x = x, id = "id", code = "code",
            map = "charlson_icd10_quan", assign0 = FALSE)

comorbidity(x = x, id = "id", code = "code",
            map = "elixhauser_icd10_quan", assign0 = FALSE)

Run the code above in your browser using DataLab