Learn R Programming

⚠️There's a newer version (1.3.1) of this package.Take me there.

icd9 (version 0.2.1)

tools for working with ICD-9 codes, and finding comorbidities

Description

This package allows accurate manipulation, validation and comparison of ICD-9-CM (clinical modification) codes. Although ICD-9 codes appear numeric, this is not the case, since trailing zeroes, and a mixture of decimal and non-decimal "short" format codes exist. Tools to map ICD-9 codes to co-morbidities are also provided, with mappings from Quan (Deyo and Elixhauser versions), Elixhauser and AHRQ included.

Copy Link

Version

Monthly Downloads

28

Version

0.2.1

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Jack O Wasey

Last Published

July 2nd, 2014

Functions in icd9 (0.2.1)

icd9AddLeadingZeroesShort

add leading zeroes to short-form ICD-9 code
icd9ExpandMinor

expand decimal part of ICD-9 code to cover all possible sub-codes
spawnReferenceChildren

spawn reference codes into all possible lower-level codes (and memoise)
icd9ExpandRangeDecimal

expand range of ICD-9 decimal codes to all possible intermediate and sub-codes
ahrqComorbidAll

AHRQ comorbidities, with HTN, CHF and renal failure subgroups
lookupComorbidities

lookup pre-calculated co-morbidities for given list of visit IDs
icd9ChildrenShort

expand 5 character form 'short' ICD9 to all possible sub codes
icd9ExtractAlphaNumeric

extract alphabetic, and numeric part of icd9 code prefix
icd9ValidMapping

validate an icd9 mapping to comorbidities
parseQuanElixhauser

Generate Quan's revised Elixhauser comorbidities
icd9AddLeadingZeroesMajor

zero-pad major part of ICD9 code
quanElixhauserComorbid

Quan adaptation of Elixhauser comorbidities
parseElixhauser

Generate Elixhauser comorbidities
icd9Explain

explain ICD9 codes
icd9ShortToParts

extract major and minor parts of a decimal ICD-9 code
%nin%

inverse of %in%
icd9ExpandRangeShort

take two ICD-9 codes and expand range to include all child codes
icd9DecimalToShort

convert between icd9 decimal and short formats
icd9ValidNaWarnStop

stop, warn, replace invalid with NA or continue
%i9mj%

create range of icd9 major parts
icd9Valid

check whether any ICD-9 code is syntactically valid
icd9PartsRecompose

recompose major and minor parts into icd9 codes
icd9Comorbidities

merge comorbidities with icd9 codes per visitId (or other identity)
icd9ChildrenDecimal

generate all child codes for given decimal ICD9 codes
getInvalidDecimalIcd9

invalid subset of decimal or short ICD-9 codes
icd9DecimalToParts

icd9DecimalToParts
parseQuanDeyoSas

parse original SAS code defining Quan's update of Deyo comorbidities.
sasExtractLetStrings

extract quoted or unquoted SAS string definitions
ahrqComorbid

AHRQ comorbidities
icd9CondenseShort

condense list of short ICD-9 code into minimal set of parent codes
sasDropOtherAssignment

drop superfluous assignment name when the name is already defined.
icd9-package

tools for working with ICD-9 codes, and finding comorbidities
icd9DropZeroFromDecimal

drop zero padding from decimal ICD-9 code.
elixhauserComorbid

Elixhauser comorbidities
sasParseAssignments

get assignments from a character string strings.
icd9ShortToDecimal

icd9ShortToDecimal
icd9ValidDecimal

check whether decimal icd9 codes are valid
icd9ValidMajor

validate a major part
icd9AddLeadingZeroesDecimal

pad decimal ICD-9 codes with leading zeroes
logicalToBinary

encode TRUE as 1, and FALSE as 0
parseAhrqSas

parse AHRQ data
stopIfInvalidIcd9

warn or stop with invalid ICD-9 codes
strMultiMatch

return the actual matches from a bracketed regex
quanDeyoComorbid

Quan adaptation of Deyo/Charlson comorbidities
trim

strip whitespace from ends of each string in given character vector
icd9CondenseToExplainShort

condense list of short ICD-9 code into minimal set of parent codes which have descriptions.
appendZeroToNine

append zero to nine
icd9SortShort

sort short-form icd9 codes
sasFormatExtract

extract assignments from a SAS FORMAT definition.
saveSourceTreeData

save data in source tree
strip

strip all whitespace
allIsNumeric

check whether character vector represents all numeric values
icd9ValidShort

validate ICD-9 short form code
asNumericNoWarn

convert factor or vector to numeric without warnings
icd9CmDesc

ICD9-CM diagnosis code lookup
icd9InReferenceCode

match ICD9 codes
icd9SubsequentMinors

determine preceding or subsequent post-decimal parts of ICD9 codes
parseIcd9Cm

read the ICD-9-CM description data as provided by the Center for Medicaid Services.
icd9Benchmark

benchmark and profile major functions with larger data sets
icd9WarnStopMessage

warn or stop with message based on switch
asCharacterNoWarn

convert factor or vector to character without warnings