Learn R Programming

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

icd9 (version 0.5)

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

Description

This package allows accurate manipulation, conversion, 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.5

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Jack O Wasey

Last Published

July 21st, 2014

Functions in icd9 (0.5)

icd9SortShort

sort short-form icd9 codes
icd9GuessIsShort

guess whether short or long
parseAhrqSas

parse AHRQ data
icd9PartsRecompose

recompose major and minor parts into icd9 codes
icd9DecimalToShort

convert between icd9 decimal and short formats
icd9Comorbidities

find comorbidities from ICD-9 codes.
icd9ChildrenDecimal

generate all child codes for given decimal ICD9 codes
icd9ValidMajor

validate a major part
icd9InvalidDecimal

invalid subset of decimal or short ICD-9 codes
icd9Chapters

ICD-9-CM chapters
icd9Hierarchy

ICD9-CM diagnosis code lookup
icd9WarnStopMessage

warn or stop with message based on switch
icd9Real

Does ICD-9 code exist
icd9-package

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

convert the chapter headings to lists of codes
strMultiMatch

return the actual matches from a bracketed regex
ahrqComorbid

AHRQ comorbidities
logicalToBinary

encode TRUE as 1, and FALSE as 0
icd9ParentMinor

get parent of an ICD-9 code
icd9CondenseToMajor

condense list of short ICD-9 code into minimal set of major-part-only codes
trim

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

parse list of top-level ICD-9 codes from canonical data from CDC. #
saveSourceTreeData

save data in source tree
sasFormatExtract

extract assignments from a SAS FORMAT definition.
asNumericNoWarn

convert factor or vector to numeric without warnings
icd9GetChapters

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

check whether character vector represents all numeric values
asCharacterNoWarn

convert factor or vector to character without warnings
quanElixhauserComorbid

Quan adaptation of Elixhauser comorbidities
quanDeyoComorbid

Quan adaptation of Deyo/Charlson comorbidities
icd9ValidDecimal

check whether decimal icd9 codes are valid
icd9Benchmark

benchmark and profile major functions with larger data sets
icd9SubsequentMinors

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

create range of icd9 major parts
elixhauserComorbid

Elixhauser comorbidities
icd9FilterPoa

filters data frame based on present-on-arrival flag
icd9ExpandRangeShort

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

drop zero padding from decimal ICD-9 code.
icd9ParseAndSaveMappings

parse all known mappings and save to development tree
%nin%

inverse of %in%
icd9DecimalToParts

convert decimal-form ICD-9 code to major and minor parts
icd9AddLeadingZeroes

pad decimal ICD-9 codes with leading zeroes
icd9ShortToDecimal

convert short-form ICD-9 code to decimal form
appendZeroToNine

append zero to nine
icd9Valid

check whether any ICD-9 code is syntactically valid
icd9GetMajor

extract major part from short or decimal ICD-9 code
stopIfInvalidIcd9

warn or stop with invalid ICD-9 codes
elixhauserComorbidNames

Comorbidity names
ahrqComorbidAll

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

get assignments from a character string strings.
icd9ExpandMinor

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

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

validate an icd9 mapping to comorbidities
icd9CondenseToExplain

condense list of short ICD-9 code into minimal set of parent descriptions
spawnReferenceChildren

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

explain ICD9 codes
icd9ExtractAlphaNumeric

extract alphabetic, and numeric part of icd9 code prefix
strip

strip all whitespace
sasDropOtherAssignment

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

Generate Elixhauser comorbidities
parseQuanElixhauser

Generate Quan's revised Elixhauser comorbidities
parseIcd9Descriptions

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

present-on-admission flags
icd9ValidShort

validate ICD-9 short form code
read.zip.url

read file from zip at URL
icd9InvalidActions

invalid actions, default is first item
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
icd9ValidNaWarnStop

stop, warn, replace invalid with NA or continue
parseQuanDeyoSas

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

match ICD9 codes
icd9ChildrenShort

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