-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
64 lines (45 loc) · 2.15 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
---
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%"
)
```
# polyester2 <img src="man/figures/logo.png" align="right" alt="" width="120" />
<!-- badges: start -->
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
[![CRAN status](https://www.r-pkg.org/badges/version/polyester2)](https://CRAN.R-project.org/package=polyester2)
<!-- badges: end -->
This package creates a simulated patient population using Synthea and ETL it into the OMOP Common Data Model. It is centered around 2 major operations: 1. Creating a synthetic database using Synthea and 2. the ETL to OMOP, governed by function `etl_to_omop` that is a convenience wrapper function around the suite of ETL functions in [OHDI's ETL-Synthea package](https://github.com/OHDSI/ETL-Synthea)
## Installation
You can install polyester2 with:
``` r
devtools::install_github("meerapatelmd/polyester2")
```
## Example
Artificial data is first generated using Synthea by:
```{r example,echo=TRUE,eval=FALSE}
library(polyester2)
run_synthea(populationSize = 1000,
state = "California",
city = "Los Angeles")
```
The output data is located in a subdirectory `synthea_output` folder in the working directory named by timestamp. This way, multiple rounds of Synthea can be executed and saved without being overwritten.
The native Synthea output can be ETL'd into the OMOP CDM:
```{r example2,echo=TRUE,eval=FALSE}
library(polyester2)
etl_to_omop(user = "root",
password = "candycane",
server = "localhost/taffeta",
port = 5432,
omop_cdm_schema = "omop",
synthea_schema = "synthea",
path_to_synthea_csvs = "synthea_output/2020-11-14 11:00:00:00/csv",
path_to_omop_vocab_csvs = "~/athena_vocabulary")
```
The function will fail to execute if a connection cannot be made using the credentials provided or if the schemas do not exist.