comorb | R Documentation |
Convert ICD-10 diagnosis codes to a table of indicators for each of the 39 comorbidities using the 2021.1 definitions of the comorbidities.
comorb(
tbl,
diagcol = "diagnosis",
poacol = "poa",
idcol = "id",
dotless = FALSE
)
tbl |
Table of input data |
diagcol |
Column containing the diagnosis codes. Default is 'diagnosis'. |
poacol |
Column containing the present-on-admission flags. Default is 'poa'. |
idcol |
Column containing the id variable (see details). Default is 'id'.
Passing |
dotless |
If |
The input table should have columns for diagnosis code and POA flag. Optionally there can be an ID column, the value of which indicates which diagnoses belong to the same aggregation unit (e.g., claim, or patient). If the ID column is omitted, the entire table is assumed to belong to a single aggregation unit, as might be the case if, for example, a larger table were split on an ID column before being passed in.
The return value will be a table that includes the ID column, if any, and columns for the 39 comorbidities, with a 1 indicating that the comorbidity is present, and a 0 indicating that it is absent. The clinically similar conditions are accounted for, so if multiple levels of severity are indicated by the diagnosis codes, only the most severe will be recorded.
Note that we leave the two subcategories of cerebrovascular disease (CBVD and CBVD_SQLA) separate because they are separated in the reference table supplied by AHRQ.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.