icd9: Tools for Working with ICD-9 Codes, and Finding Comorbidities

Obsolete: 'icd9' is replaced by CRAN package 'icd'. Calculate comorbidities, Charlson scores, perform fast and accurate validation, conversion, manipulation, filtering and comparison of ICD-9-CM (clinical modification) codes. ICD-9 codes appear numeric but leading and trailing zeroes, and both decimal and non-decimal "short" format codes exist. The package enables a work flow from raw lists of ICD-9 codes from hospital billing databases to comorbidities. ICD-9 to comorbidity mappings from Quan (Deyo and Elixhauser versions), Elixhauser and AHRQ included. Any other mapping of codes, such as ICD-10, to comorbidities can be used.

AuthorJack O. Wasey [aut, cre, cph], William Murphy [ctb], R Core Team [ctb, cph]
Date of publication2016-04-15 08:33:09
MaintainerJack O. Wasey <jack@jackwasey.com>
LicenseGPL-3
Version1.3.1
https://github.com/jackwasey/icd9

View on CRAN

Man pages

ahrqComorbid: AHRQ comorbidities

ahrqComorbidAll: AHRQ comorbidities, with HTN, CHF and renal failure subgroups

convert: Convert ICD9 codes between formats and structures.

elixComorbid: Elixhauser comorbidities

elixComorbidNames: Comorbidity names

expandRangeWorker: expand range worker function

factor_: Fast Factor Generation

fastIntToString: fast convert integer vector to character vector

generateSysData: Generate sysdata.rda

icd9AddLeadingZeroes: Add leading zeroes to incomplete ICD codes

icd9Billable: list of annual versions of billable leaf nodes of ICD-9-CM

icd9Chapters: ICD-9-CM chapters

icd9ChaptersToMap: convert the chapter headings to lists of codes

icd9Charlson: Calculate Charlson Comorbidity Index (Charlson Score)

icd9Children: Expand ICD-9 codes to all possible sub-codes

icd9Comorbid: find comorbidities from ICD-9 codes.

icd9ComorbidDfToMat: convert matrix of comorbidities into data frame, preserving...

icd9ComorbidMatToDf: convert matrix of comorbidities into data frame, preserving...

icd9Condense: Condense ICD-9 code by replacing complete families with...

icd9Count: count ICD codes or comorbidities for each patient

icd9DiffComorbid: show the difference between two comorbidity mappings

icd9DropLeadingZeroes: drop zero padding from decimal ICD-9 code.

icd9ExpandMinor: expand decimal part of ICD-9 code to cover all possible...

icd9ExpandRange: take two ICD-9 codes and expand range to include all child...

icd9Explain: explain ICD9 codes

icd9ExtractAlphaNumeric: extract alphabetic, and numeric part of icd9 code prefix

icd9FilterInvalid: Filter ICD-9 codes by invalidity.

icd9FilterPoa: Filters data frame based on present-on-arrival flag

icd9FilterValid: Filter ICD-9 codes by validity.

icd9GetChapters: get ICD-9 Chapters from vector of ICD-9 codes

icd9GetMajor: Get major (three-digit) part of ICD-9 codes

icd9GetValid: invalid subset of decimal or short ICD-9 codes

icd9GuessIsShort: guess whether short or long

icd9Hierarchy: ICD9-CM diagnosis code lookup

icd9InReferenceCode: match ICD9 codes

icd9IsA: test whether elements of vector begin with V, E (or any other...

icd9IsBillable: Determine whether codes are billable leaf-nodes

icd9IsN: do codes belong to numeric, V or E classes?

icd9IsReal: Check whether ICD-9 codes exist

icd9IsValid: check whether ICD-9 codes are syntactically valid

icd9IsValidMapping: validate an icd9 mapping to comorbidities

icd9LongToWide: convert ICD data from long to wide format

icd9-package: Tools for Working with ICD-9 Codes, and Finding Comorbidities

icd9PoaChoices: present-on-admission flags

icd9RandomShort: generate random short-form icd9 E codes

icd9ShortToDecimal: Convert ICD-9 codes between short and decimal forms

icd9Sort: sort short-form icd9 codes

icd9VanWalraven: Calculate van Walraven Elixhauser Score

icd9WideToLong: convert ICD data from wide to long format

logicalToBinary: encode TRUE as 1, and FALSE as 0 (integers)

parseAhrqSas: parse AHRQ data

parseElix: Generate Elixhauser comorbidities

parseIcd9Chapters: Read higher-level ICD-9 structure from a reliable web site

parseLeafDescriptionsAll: get billable codes from all available years

parseLeafDescriptionsVersion: read the ICD-9-CM description data as provided by the Center...

parseQuanDeyoSas: parse original SAS code defining Quan's update of Deyo...

parseRtfFifthDigitRanges: parse a row of RTF source data for ranges to apply fifth...

parseRtfLines: parse a character vector containing RTF strings

parseRtfYear: parse RTF description of entire ICD-9-CM for a specific year

quanDeyoComorbid: Quan adaptation of Deyo/Charlson comorbidities

quanElixComorbid: Quan adaptation of Elixhauser comorbidities

randomShortIcd9: genereate random short icd9 codes

sasDropOtherAssignment: drop superfluous assignment name when the name is already...

sasExtractLetStrings: extract quoted or unquoted SAS string definitions

sasFormatExtract: extract assignments from a SAS FORMAT definition.

sasParseAssignments: get assignments from a character string strings.

stripRtf: Strip RTF

strMultiMatch: return the actual matches from a bracketed regex

vermont_dx: de-identified data from public Vermont source for 2013

zip_single: unzip a single file

Functions

ahrqComorbid Man page
ahrqComorbidAll Man page
ahrqComorbidNames Man page
ahrqComorbidNamesAbbrev Man page
ahrqComorbidNamesHtn Man page
ahrqComorbidNamesHtnAbbrev Man page
charlsonComorbidNames Man page
charlsonComorbidNamesAbbrev Man page
convert Man page
elixComorbid Man page
elixComorbidNames Man page
elixComorbidNamesAbbrev Man page
elixComorbidNamesHtn Man page
elixComorbidNamesHtnAbbrev Man page
expandRangeWorker Man page
factor_ Man page
factor_nosort Man page
fastIntToStringRcpp Man page
fastIntToStringStd Man page
generateSysData Man page
\%i9d\% Man page
\%i9da\% Man page
\%i9in\% Man page
\%i9mj\% Man page
\%i9s\% Man page
\%i9sa\% Man page
icd9 Man page
icd9AddLeadingZeroes Man page
icd9AddLeadingZeroesDecimal Man page
icd9AddLeadingZeroesShort Man page
icd9Billable Man page
icd9chapters Man page
icd9Chapters Man page
icd9ChaptersMajor Man page
icd9ChaptersSub Man page
icd9ChaptersToMap Man page
icd9Charlson Man page
icd9CharlsonComorbid Man page
icd9Charlson.data.frame Man page
icd9Children Man page
icd9ChildrenDecimal Man page
icd9ChildrenShort Man page
icd9Comorbid Man page
icd9ComorbidAhrq Man page
icd9ComorbidDfToMat Man page
icd9ComorbidElix Man page
icd9Comorbidities Man page
icd9ComorbiditiesAhrq Man page
icd9ComorbiditiesElixHauser Man page
icd9ComorbiditiesQuanDeyo Man page
icd9ComorbiditiesQuanElixhauser Man page
icd9ComorbidMatToDf Man page
icd9ComorbidQuanDeyo Man page
icd9ComorbidQuanElix Man page
icd9ComorbidShort Man page
icd9ComorbidShortCpp Man page
icd9Condense Man page
icd9CondenseDecimal Man page
icd9CondenseShort Man page
icd9Count Man page
icd9CountComorbidBin Man page
icd9CountWide Man page
icd9DecimalToParts Man page
icd9DecimalToPartsCpp Man page
icd9DecimalToShort Man page
icd9DecimalToShortOld Man page
icd9DiffComorbid Man page
icd9DropLeadingZeroes Man page
icd9DropLeadingZeroesDecimal Man page
icd9DropLeadingZeroesMajor Man page
icd9DropLeadingZeroesShort Man page
icd9ExpandMinor Man page
icd9ExpandRange Man page
icd9ExpandRangeDecimal Man page
icd9ExpandRangeMajor Man page
icd9ExpandRangeShort Man page
icd9Explain Man page
icd9Explain.character Man page
icd9ExplainDecimal Man page
icd9Explain.factor Man page
icd9Explain.list Man page
icd9Explain.numeric Man page
icd9ExplainShort Man page
icd9ExtractAlphaNumeric Man page
icd9FilterInvalid Man page
icd9FilterPoa Man page
icd9FilterPoaNo Man page
icd9FilterPoaNotNo Man page
icd9FilterPoaNotYes Man page
icd9FilterPoaYes Man page
icd9FilterValid Man page
icd9GetBillable Man page
icd9GetBillableDecimal Man page
icd9GetBillableShort Man page
icd9GetChapters Man page
icd9GetInvalid Man page
icd9GetInvalidDecimal Man page
icd9GetInvalidMappingDecimal Man page
icd9GetInvalidMappingShort Man page
icd9GetInvalidShort Man page
icd9GetMajor Man page
icd9GetMajorShort Man page
icd9GetNonBillable Man page
icd9GetNonBillableDecimal Man page
icd9GetNonBillableShort Man page
icd9GetReal Man page
icd9GetRealDecimal Man page
icd9GetRealShort Man page
icd9GetValid Man page
icd9GetValidDecimal Man page
icd9GetValidShort Man page
icd9GuessIsShort Man page
icd9Hierarchy Man page
icd9InReferenceCode Man page
icd9IsA Man page
icd9IsBillable Man page
icd9IsBillableDecimal Man page
icd9IsBillableShort Man page
icd9IsE Man page
icd9IsN Man page
icd9IsReal Man page
icd9IsRealDecimal Man page
icd9IsRealShort Man page
icd9IsV Man page
icd9IsValid Man page
icd9IsValidDecimal Man page
icd9IsValidMajor Man page
icd9IsValidMapping Man page
icd9IsValidMappingDecimal Man page
icd9IsValidMappingShort Man page
icd9IsValidShort Man page
icd9IsValidShortE Man page
icd9IsValidShortN Man page
icd9IsValidShortV Man page
icd9LongToWide Man page
icd9-package Man page
icd9PartsToDecimal Man page
icd9PartsToShort Man page
icd9PoaChoices Man page
icd9RandomShort Man page
icd9ShortToDecimal Man page
icd9ShortToParts Man page
icd9ShortToPartsCpp Man page
icd9Sort Man page
icd9SortDecimal Man page
icd9SortShort Man page
icd9Valid Man page
icd9ValidDecimal Man page
icd9ValidShort Man page
icd9VanWalraven Man page
icd9VanWalravenComorbid Man page
icd9VanWalraven.data.frame Man page
icd9WideToLong Man page
logicalToBinary Man page
package-icd9 Man page
parseAhrqSas Man page
parseElix Man page
parseIcd9Chapters Man page
parseLeafDescriptionsAll Man page
parseLeafDescriptionsVersion Man page
parseQuanDeyoSas Man page
parseRtfFifthDigitRanges Man page
parseRtfLines Man page
parseRtfYear Man page
quanDeyoComorbid Man page
quanElixComorbid Man page
quanElixComorbidNames Man page
quanElixComorbidNamesAbbrev Man page
quanElixComorbidNamesHtn Man page
quanElixComorbidNamesHtnAbbrev Man page
randomShortIcd9 Man page
sasDropOtherAssignment Man page
sasExtractLetStrings Man page
sasFormatExtract Man page
sasParseAssignments Man page
stripRtf Man page
strMultiMatch Man page
strPairMatch Man page
.vermont Man page
vermont_dx Man page
zip_single Man page

Files

icd9
icd9/COPYING
icd9/inst
icd9/inst/COPYING
icd9/inst/COPYRIGHTS
icd9/inst/extdata
icd9/inst/extdata/comformat2012-2013.txt
icd9/inst/extdata/ICD9_E_Charlson.sas
icd9/inst/extdata/ICD9_E_Elixhauser.sas
icd9/inst/extdata/all-covariates.xls
icd9/inst/doc
icd9/inst/doc/introduction.R
icd9/inst/doc/introduction.html
icd9/inst/doc/introduction.Rmd
icd9/inst/include
icd9/inst/include/icd9_RcppExports.h
icd9/inst/include/icd9.h
icd9/tests
icd9/tests/testthat
icd9/tests/testthat/test-icd9.R
icd9/tests/testthat/test-LongToWide.R
icd9/tests/testthat/test-is.R
icd9/tests/testthat/test-sas.R
icd9/tests/testthat/test-openmp.R
icd9/tests/testthat/test-hierarchy.R
icd9/tests/testthat/test-filter.R
icd9/tests/testthat/test-convert.R
icd9/tests/testthat/test-parse.R
icd9/tests/testthat/test-ranges.R
icd9/tests/testthat/test-billable.R
icd9/tests/testthat/test-reshape.R
icd9/tests/testthat/test-valid.R
icd9/tests/testthat/test-score.R
icd9/tests/testthat/test-explain.R
icd9/tests/testthat/helper-base.R
icd9/tests/testthat/test-condense.R
icd9/tests/testthat/test-comorbid-calcs.R
icd9/tests/testthat/test-util.R
icd9/tests/testthat/test-comorbid.R
icd9/tests/test-all.R
icd9/src
icd9/src/convert.cpp
icd9/src/ranges.cpp
icd9/src/cutil.c
icd9/src/config.h.win
icd9/src/ranges.h
icd9/src/config.h.in
icd9/src/is.h
icd9/src/comorbidCommon.cpp
icd9/src/longToWide.cpp
icd9/src/manip.h
icd9/src/comorbid.cpp
icd9/src/util.h
icd9/src/Makevars.in
icd9/src/Makevars.win64
icd9/src/convert.h
icd9/src/local.h
icd9/src/util.cpp
icd9/src/cutil.h
icd9/src/Makevars.win
icd9/src/RcppExports.cpp
icd9/src/manip.cpp
icd9/src/comorbidSetup.cpp
icd9/src/is.cpp
icd9/NAMESPACE
icd9/data
icd9/data/mappingNames.rda
icd9/data/icd9Billable.RData
icd9/data/vermont_dx.RData
icd9/data/icd9ChaptersMajor.RData
icd9/data/quanDeyoComorbid.RData
icd9/data/icd9Hierarchy.RData
icd9/data/quanElixComorbid.RData
icd9/data/icd9ChaptersSub.RData
icd9/data/elixComorbid.RData
icd9/data/ahrqComorbid.RData
icd9/data/icd9Chapters.rda
icd9/R
icd9/R/convert.R icd9/R/explain.R icd9/R/parse-rtf.R icd9/R/manip.R
icd9/R/sysdata.rda
icd9/R/score.R icd9/R/filter.R icd9/R/datadocs.R icd9/R/benchmark.R icd9/R/icd9-package.R icd9/R/valid.R icd9/R/parse-comorbid.R icd9/R/RcppExports.R icd9/R/real.R icd9/R/comorbid.R icd9/R/parse.R icd9/R/condense.R icd9/R/util.R icd9/R/ranges.R icd9/R/sas.R icd9/R/zzz.R
icd9/vignettes
icd9/vignettes/introduction.Rmd
icd9/README.md
icd9/MD5
icd9/build
icd9/build/vignette.rds
icd9/DESCRIPTION
icd9/configure
icd9/man
icd9/man/icd9FilterValid.Rd icd9/man/icd9Charlson.Rd icd9/man/icd9GetValid.Rd icd9/man/icd9Condense.Rd icd9/man/ahrqComorbidAll.Rd icd9/man/icd9ExpandMinor.Rd icd9/man/icd9IsBillable.Rd icd9/man/parseRtfYear.Rd icd9/man/icd9InReferenceCode.Rd icd9/man/quanElixComorbid.Rd icd9/man/parseIcd9Chapters.Rd icd9/man/parseElix.Rd icd9/man/stripRtf.Rd icd9/man/expandRangeWorker.Rd icd9/man/elixComorbid.Rd icd9/man/icd9DiffComorbid.Rd icd9/man/icd9FilterInvalid.Rd icd9/man/parseLeafDescriptionsAll.Rd icd9/man/parseAhrqSas.Rd icd9/man/zip_single.Rd icd9/man/parseRtfFifthDigitRanges.Rd icd9/man/icd9RandomShort.Rd icd9/man/icd9ComorbidDfToMat.Rd icd9/man/icd9ExtractAlphaNumeric.Rd icd9/man/vermont_dx.Rd icd9/man/icd9GuessIsShort.Rd icd9/man/convert.Rd icd9/man/sasFormatExtract.Rd icd9/man/icd9-package.Rd icd9/man/icd9Chapters.Rd icd9/man/icd9IsReal.Rd icd9/man/randomShortIcd9.Rd icd9/man/icd9GetChapters.Rd icd9/man/generateSysData.Rd icd9/man/icd9LongToWide.Rd icd9/man/parseQuanDeyoSas.Rd icd9/man/icd9Children.Rd icd9/man/icd9ExpandRange.Rd icd9/man/elixComorbidNames.Rd icd9/man/parseRtfLines.Rd icd9/man/icd9VanWalraven.Rd icd9/man/sasParseAssignments.Rd icd9/man/sasDropOtherAssignment.Rd icd9/man/icd9WideToLong.Rd icd9/man/strMultiMatch.Rd icd9/man/icd9Billable.Rd icd9/man/logicalToBinary.Rd icd9/man/icd9IsValidMapping.Rd icd9/man/icd9ComorbidMatToDf.Rd icd9/man/icd9ShortToDecimal.Rd icd9/man/icd9IsA.Rd icd9/man/icd9Comorbid.Rd icd9/man/icd9Hierarchy.Rd icd9/man/icd9AddLeadingZeroes.Rd icd9/man/icd9GetMajor.Rd icd9/man/quanDeyoComorbid.Rd icd9/man/fastIntToString.Rd icd9/man/icd9PoaChoices.Rd icd9/man/icd9ChaptersToMap.Rd icd9/man/icd9FilterPoa.Rd icd9/man/ahrqComorbid.Rd icd9/man/icd9IsValid.Rd icd9/man/icd9DropLeadingZeroes.Rd icd9/man/sasExtractLetStrings.Rd icd9/man/factor_.Rd icd9/man/icd9Sort.Rd icd9/man/icd9IsN.Rd icd9/man/icd9Explain.Rd icd9/man/parseLeafDescriptionsVersion.Rd icd9/man/icd9Count.Rd
icd9/configure.win
icd9/cleanup
icd9/.Rinstignore

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.