Electronic Health Record (EHR) Data Processing and Analysis Tool
Overview
Process and analyze electronic health record (EHR) data. The 'EHR' package provides modules to perform diverse medication-related studies using data from EHR databases. Especially, the package includes modules to perform pharmacokinetic/pharmacodynamic (PK/PD) analyses using EHRs, as outlined in Choi, Beck, McNeer, Weeks, Williams, James, Niu, Abou-Khalil, Birdwell, Roden, Stein, Bejan, Denny, and Van Driest (2020) doi:10.1002/cpt.1787. Additional modules will be added in future. In addition, this package provides various functions useful to perform Phenome Wide Association Study (PheWAS) to explore associations between drug exposure and phenotypes obtained from EHR data, as outlined in Choi, Carroll, Beck, Mosley, Roden, Denny, and Van Driest (2018) doi:10.1093/bioinformatics/bty306.
Install
Health
NOTERd filesr-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-x86_64, r-oldrel-macos-arm64, r-oldrel-macos-x86_64, r-oldrel-windows-x86_64, r-patched-linux-x86_64, r-release-linux-x86_64, r-release-macos-arm64, r-release-macos-x86_64, r-release-windows-x86_64
checkRd: (-1) build_lastdose.Rd:10: Lost braces
10 | code{build_lastdose}: build PK oral with lastdose information
| ^
checkRd: (-1) mod-internal.Rd:18: Lost braces
18 | code{colflow_mod}: build a comparison of potentially duplicate flow data
| ^
checkRd: (-1) mod-internal.Rd:21: Lost braces
21 | code{findMedFlowRow_mod}: find row numbers for matching ID and time
| ^
checkRd: (-1) mod-internal.Rd:23: Lost braces
23 | code{flowData_mod}: correct flow data
| ^
checkRd: (-1) mod-internal.Rd:25: Lost braces
25 | code{concData_mod}: correct concentration data
| ^
checkRd: (-1) mod-internal.Rd:27: Lost braces
27 | code{infusionData_mod}: combine flow and MAR data; standardize hourly rate,
| ^
checkRd: (-1) mod-internal.Rd:30: Lost braces
30 | code{resolveDoseDups_mod}: correct duplicated infusion and bolus doses
| ^
checkRd: (-1) mod-internal.Rd:32: Lost braces
32 | code{writeCheckDat
...[truncated]...
rence (in minutes) of time vector
| ^
checkRd: (-1) pk-internal.Rd:28: Lost braces
28 | code{fixDates}: add leading zeroes to date
| ^
checkRd: (-1) pk-internal.Rd:30: Lost braces
30 | code{joinFlowMar}: rbind two data sets
| ^
checkRd: (-1) pk-internal.Rd:32: Lost braces
32 | code{updateInterval_mod}: replace maxint with difference between surgery time
| ^
checkRd: (-1) pk-internal.Rd:35: Lost braces
35 | code{fix_serum_time}: create time variable
| ^
checkRd: (-1) pk-internal.Rd:37: Lost braces
37 | code{merge_by_time}: impute in x by closest time in y
| ^
checkRd: (-1) pk-internal.Rd:39: Lost braces
39 | code{merge_inf_bolus}: combine infusion and bolus into one hourly dose file
| ^
checkRd: (-1) pk-internal.Rd:41: Lost braces
41 | code{addZeroDose}: add rows of zero dose, after a gap
| ^
checkRd: (-1) pk-internal.Rd:43: Lost braces
43 | code{pkdata}
| ^- NOTE13 NOTE2026-09-04
- ERROR12 NOTE, 1 ERROR2026-08-31
- NOTE13 NOTE2026-06-09
- ERROR12 NOTE, 1 ERROR2026-06-08
- NOTE12 NOTE2026-04-25
Show 2 earlier changesHide 2 earlier changes
- ERROR13 NOTE, 1 ERROR2026-03-30
- NOTE14 NOTE2026-03-10
Documentation
- Help pages
- 52 (9 internal)includes a package overview page
- Examples that run
- 97%37 run in a plain check · 1 only when donttest examples are enabled (R CMD check --as-cran)
- Exported functions with examples
- 88%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 4%
Downloads
Repository
2 development-tooling and community-health practices detected across 2 families in the upstream repository
Checks run against github.com/choileena/choileena.github.io on 2026-10-21.
GitHub Pages site last deployed 2026-06-09
Dependencies
Installing EHR adds 6 packages (3 with compiled code, 6.6 MB of source tarballs). Heaviest: data.table 5.7 MB, lubridate 420 KB, cpp11 298 KB.
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- 0.4-11Latest
- 0.4-102022-10-11 · diff ↗
- unarchivedReturned to CRAN2022-06-21
- 0.4-82022-06-21 · diff ↗
- RR 4.2.0 released · 2022-04-22
- archivedRemoved from CRAN2022-04-07resubmitted without corrected check error 'coercion to logical' errors
- unarchivedReturned to CRAN2022-04-06
- 0.4-52022-04-06 · diff ↗
- archivedRemoved from CRAN2022-04-04'coercion to logical' errors were not corrected in time See https://www.stats.ox.ac.uk/pub/bdr/LENGTH1/
- 0.4-42021-10-07 · diff ↗
- 0.4-12021-06-09 · diff ↗
- 0.4-02021-06-05 · diff ↗ ·
added 12 exports
idCrosswalk, pullFakeId, pullRealId, run_Build_PK_IV, run_Build_PK_Oral, run_Demo, run_DrugLevel, run_Labs, run_MedStrI, run_MedStrII, stdzDoseChange, stdzDoseSchedule
Show 10 earlier eventsHide 10 earlier events
- RR 4.1.0 released · 2021-05-18
- unarchivedReturned to CRAN2020-10-08
- 0.3-12020-10-08 · diff ↗
- archivedRemoved from CRAN2020-09-20problems were not corrected in time Calls model.frame with 'data = sys.parent()', which has never worked and is now an error
- 0.3-02020-09-12 · diff ↗ ·
added 18 exports
addLastDose, buildDose, collapseDose, dataTransformation, extractMed, freqNum, makeDose, parseCLAMP, parseMedEx, parseMedExtractR, parseMedXN, processLastDose, readTransform, stdzDose, stdzDuration, stdzFreq, stdzRoute, stdzStrength - RR 4.0.0 released · 2020-04-24
- RR 3.6.0 released · 2019-04-26
- RR 3.5.0 released · 2018-04-23
- 0.1-32017-10-20
- RR 3.4.0 released · 2017-04-21
Package metadata
- First published
- 2017-10-20
- Total releases
- 10 / 9 yrs
- License
- GPL (>= 3) OSI
- Minimum R
- ≥ 2.10
- Bundled data
- 231 KB / 7 files
- Download size
- 1.4 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("EHR")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.