-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
76 lines (51 loc) · 2.79 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# codemapper
<!-- badges: start -->
[![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)
<!-- badges: end -->
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.