dxCustom: Code classification for customized group

dxCustomR Documentation

Code classification for customized group

Description

Researches can define the grouping categories and therefore have more flexible for grouping ICD diagnostic codes.

Usage

icdDxToCustom(
  dxDataFile,
  idColName,
  icdColName,
  dateColName,
  customGroupingTable
)

icdDxToCustomGrep(
  dxDataFile,
  idColName,
  icdColName,
  dateColName,
  customGroupingTable
)

Arguments

dxDataFile

A data frame object of clinical diagnostic data with at least 3 columns: ID, ICD, and Date. As for date column, the data format should be YYYY/MM/DD or YYYY-MM-DD.

idColName

Column name of ID column in dxDataFile. Data type of this argumant should be string without quotation marks.

icdColName

Column name of ICD column in dxDataFile. Data type of this argumant should be string without quotation marks.

dateColName

Column name of date column in dxDataFile, and the type of date column should be a date format in R or a string format with date information in YYYY/MM/DD or YYYY-MM-DD. Data type of this argumant should be string without quotation marks.

customGroupingTable

Used-defined grouping categories. icdDxToCustom needs a dataset with two columns called "Group" and "ICD", respectively; User can define one or more disease categories in "Group" column, and define a list of corresponding category-related ICD codes in "ICD" column. icdDxToCustomGrep needs a dataset with two columns: "Group", "grepIcd"; "Group" defines one or more disease categories and "grepICD" defines disease-related ICD code character strings containing regular expressions.

Details

There are two functions for customized defined grouping method, the customized category grouping is based on precise ('icdDxToCustom') and fuzzy ('icdDxToCustomGrep') grouping method, respectively.

Value

Two new data.tables. 1) groupedDT: Based on dxDataFile with two new columns for uniform format diagnostic codes and classified standard categories. 2) summarised_groupedDT: Summarized the dataset groupedDT and sorted by memberID.

See Also

Other code classification functions: dxPheWAS, dxComorbid, DxCCS

Examples

# sample file for example

head(sampleDxFile)

# Group diagnostic codes into "Chronic kidney disease" with precise grouping method

groupingTable <- data.frame(Group = rep("Chronic kidney disease",6),
                            ICD = c("N181","5853","5854","5855","5856","5859"),
                            stringsAsFactors = FALSE)

icdDxToCustom(sampleDxFile, ID, ICD, Date, customGroupingTable = groupingTable)

# Group diagnostic codes into "Chronic kidney disease" with fuzzy grouping method

grepTable <- data.frame(Group = "Chronic kidney disease",
                        grepIcd = "^585|^N18",
                        stringsAsFactors = FALSE)

icdDxToCustomGrep(sampleDxFile, ID, ICD, Date, customGroupingTable = grepTable)


DHLab-CGU/emr documentation built on Sept. 2, 2023, 9:16 p.m.