plotICDError: Plot for error ICD list

View source: R/plotICDError.R

plotICDErrorR Documentation

Plot for error ICD list

Description

Pareto chart of error ICD list

Usage

plotICDError(
  errorFile,
  icdVersion = all,
  wrongICDType = all,
  groupICD = FALSE,
  others = TRUE,
  topN = 10
)

Arguments

errorFile

Error file (a data frame) from ICD uniform functions dxUniform (icdDxDecimalToShort or icdDxShortToDecimal)

wrongICDType

Certain wrong type that interested. The value can either version, format, or all, and this argument is the also string data type without quotation mark.

groupICD

Binary data type. Only ICD-9 codes can group because ICD 10 already has unique alphanumeric codes to identify known diseases. Default is FALSE.

others

Default is TRUE

topN

Numeric argument. Default is 10 (Top 10; 10 most common wrong ICD).

ICDVersion

Certain version that interested. The argument should be string data type: 9, 10 or all (without quotation mark).

Details

Through first phase function, code standardization, it detects diagnosis codes with potential error. The Pareto chart includes bar plot and line chart to visualize individual possible error ICD codes represented in descending order and cumulative total.

Value

A Pareto plot and a data.table of statistical information about error codes.

See Also

other plot function: plotDiagCat

Examples

# sample file for example
head(sampleDxFile)

# Data of diagnosis codes with potential error

error <- icdDxDecimalToShort(sampleDxFile, ICD, Date, icdVerColName = NULL, "2015/10/01")

# Plot of top 3 common error ICD-9 codes and a list of the detail of error ICD codes

plotICDError(errorFile = error$Error,
              icdVersion = 9,
              wrongICDType = all,
              groupICD = TRUE,
              others = TRUE,
              topN = 3)

# Plot of top 10 common error ICD codes and a list of the detail of error ICD codes

plotICDError(errorFile = error$Error,
              icdVersion = all,
              wrongICDType = all,
              groupICD = FALSE,
              others = TRUE)


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