Learn R Programming

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

icd9 (version 0.3)

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.3

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Jack O Wasey

Last Published

July 7th, 2014

Functions in icd9 (0.3)

icd9AddLeadingZeroes

pad decimal ICD-9 codes with leading zeroes
icd9ValidDecimal

check whether decimal icd9 codes are valid
allIsNumeric

check whether character vector represents all numeric values
icd9-package

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

convert factor or vector to character without warnings
icd9ExpandRangeDecimal

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

validate a major part
icd9ExtractAlphaNumeric

extract alphabetic, and numeric part of icd9 code prefix
appendZeroToNine

append zero to nine
ahrqComorbidAll

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

create range of icd9 major parts
icd9ValidMapping

validate an icd9 mapping to comorbidities
spawnReferenceChildren

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

extract major part from decimal ICD-9 code
icd9DecimalToParts

icd9DecimalToParts
icd9InvalidDecimal

invalid subset of decimal or short ICD-9 codes
parseQuanElixhauser

Generate Quan's revised Elixhauser comorbidities
icd9ChapterShort

get ICD-9 Chapters from vector of ICD-9 codes
icd9DropLeadingZeroes

drop zero padding from decimal ICD-9 code.
icd9ChildrenShort

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

match ICD9 codes
icd9CmChapters

ICD-9-CM chapters
sasFormatExtract

extract assignments from a SAS FORMAT definition.
read.zip.url

read file from zip at URL
quanElixhauserComorbid

Quan adaptation of Elixhauser comorbidities
icd9ParentMinor

get parent of an ICD-9 code
icd9ValidNaWarnStop

stop, warn, replace invalid with NA or continue
stopIfInvalidIcd9

warn or stop with invalid ICD-9 codes
%nin%

inverse of %in%
icd9ChildrenDecimal

generate all child codes for given decimal ICD9 codes
ahrqComorbid

AHRQ comorbidities
icd9ExpandMinor

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

drop superfluous assignment name when the name is already defined.
icd9PartsRecompose

recompose major and minor parts into icd9 codes
icd9ExpandRangeShort

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

Generate Elixhauser comorbidities
icd9ShortToDecimal

icd9ShortToDecimal
parseAhrqSas

parse AHRQ data
icd9Benchmark

benchmark and profile major functions with larger data sets
icd9WarnStopMessage

warn or stop with message based on switch
icd9DecimalToShort

convert between icd9 decimal and short formats
strip

strip all whitespace
icd9Comorbidities

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

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

convert factor or vector to numeric without warnings
saveSourceTreeData

save data in source tree
trim

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

is the given code V or E type?
icd9ShortToParts

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

extract quoted or unquoted SAS string definitions
elixhauserComorbid

Elixhauser comorbidities
logicalToBinary

encode TRUE as 1, and FALSE as 0
icd9CondenseToExplainShort

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

sort short-form icd9 codes
icd9Tell

describe ICD-9 codes, guess whether short or long
icd9SubsequentMinors

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

validate ICD-9 short form code
lookupComorbidities

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

explain ICD9 codes
strMultiMatch

return the actual matches from a bracketed regex
parseIcd9Chapters

parse list of top-level ICD-9 chapters from canonical data from CDC.
sasParseAssignments

get assignments from a character string strings.
parseQuanDeyoSas

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

invalid actions, default is first item
icd9ShortToMajor

extract major part from short ICD-9 code
icd9Valid

check whether any ICD-9 code is syntactically valid
icd9CondenseShort

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

Quan adaptation of Deyo/Charlson comorbidities
icd9CmDesc

ICD9-CM diagnosis code lookup