mapICD9ToPhecodes: Map ICD9 codes to phecodes

View source: R/mapICD9ToPhecodes.R

mapICD9ToPhecodesR Documentation

Map ICD9 codes to phecodes

Description

This function takes a vector of International Classification of Disease 9th Edition Clinical Modification codes and returns the phecodes represented. This is a many to many mapping.

Usage

mapICD9ToPhecodes(..., icd9s, add.info=F, keep.icd9=F)

Arguments

...

a data frame or arguments of either the form value or tag = value.

icd9s

a character vector of ICD9 billing codes, including trailing '0's.

add.info

a boolean informing if the returned data frame should include phecode descriptions and groups.

keep.icd9

a boolean requesting to keep the original ICD9 code column in the returned data frame.

Details

By supplying ids and counts, one can convert data for multiple records at once, preserving count information. Note that this function does not collapse duplicate mappings; id-phecode pairs will not necessarily be unique.

Value

A data frame containing the input columns in ... and the phecodes. The origial ICD9s and description are included if requested.

...

Other rows supplied e.g., ids or counts

icd9

Input ICD9

phecode

phecodes

phecode_description

The description of the phecode.

phecode_group

The name of the phecode group.

phecode_groupnum

The assigned number of the phecode group.

Author(s)

Robert Carroll Laura Wiley

Examples

icd9codes=c("008","714.1","250.00")
phecodes=mapICD9ToPhecodes(icd9s=icd9codes)$phecode
head(phecodes)

PheWAS/PheWAS documentation built on July 3, 2023, 3:40 p.m.