An open API service indexing awesome lists of open source software.

https://github.com/rmgpanw/codemapper

R package for working with clinical codes
https://github.com/rmgpanw/codemapper

rpackage ukbiobank

Last synced: 8 months ago
JSON representation

R package for working with clinical codes

Awesome Lists containing this project

README

          

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

# codemapper

[![R-CMD-check](https://github.com/rmgpanw/codemapper/workflows/R-CMD-check/badge.svg)](https://github.com/rmgpanw/codemapper/actions) [![Codecov test coverage](https://codecov.io/gh/rmgpanw/codemapper/branch/master/graph/badge.svg)](https://codecov.io/gh/rmgpanw/codemapper?branch=master) [![pkgdown](https://github.com/rmgpanw/codemapper/workflows/pkgdown/badge.svg)](https://github.com/rmgpanw/codemapper/actions) [![Launch RStudio Cloud](https://img.shields.io/badge/RStudio-Cloud-blue)](https://rstudio.cloud/project/4007004) [![DOI](https://zenodo.org/badge/485945478.svg)](https://zenodo.org/badge/latestdoi/485945478) [![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)

The goal of codemapper is to facilitate working with clinical codes used in electronic health records.

This package relies primarily on UK Biobank resource 592 ([Clinical coding classification systems and maps](https://biobank.ndph.ox.ac.uk/ukb/refer.cgi?id=592)) and the UK Biobank [data codings file](https://biobank.ctsu.ox.ac.uk/crystal/exinfo.cgi?src=accessing_data_guide), both of which are publicly available.

## Installation

You can install the development version from [GitHub](https://github.com/) with:

```{r eval=FALSE}
# install.packages("devtools")
devtools::install_github("rmgpanw/codemapper")
```

## Basic example

A data analyst using electronic health records for research into hypertension may wish to build a list of clinical codes that capture this condition.

First, build a local resource containing lookup and mapping tables for various clinical codings systems. A dummy dataset is used here:

```{r example}
library(codemapper)

all_lkps_maps_dummy <- build_all_lkps_maps_dummy()
```

Look up Read 2 codes for hypertension:

```{r}
htn_read2 <- code_descriptions_like("Hypertension",
code_type = "read2",
all_lkps_maps = all_lkps_maps_dummy)

htn_read2
```

Map these to ICD10:

```{r}
htn_icd10 <- map_codes(
codes = htn_read2$code,
from = "read2",
to = "icd10",
all_lkps_maps = all_lkps_maps_dummy
)

htn_icd10
```

See `vignette('codemapper')` for further details, including how to build a clinical codelist with R Shiny using `RunCodelistBuilder()`.

## UK Biobank

Also included are functions for using CALIBER code lists (`vignette('caliber')`) and Phecodes (`vignette('phecodes')`) with UK Biobank data.