Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/ablack3/syntheacdmfactory


https://github.com/ablack3/syntheacdmfactory

Last synced: 29 days ago
JSON representation

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%"
)
```

# SyntheaCdmFactory

The goal of SyntheaCdmFactory is to create synthetic OMOP CDMs

## Installation

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

``` r
# install.packages("devtools")
devtools::install_github("OdyOSG/SyntheaCdmFactory")
```

## Example

This is a basic example which shows you how to solve a common problem:

```{r example, eval=FALSE}
library(SyntheaCdmFactory)

# install the synthea java library. Only do this once.
install_synthea()

# manually download vcoab bundle from https://drive.google.com/file/d/1by7G4pLvUeepOpRqzl3ItO1WDZv_xYoK/view?usp=sharing

# point R to the location

# this step might be automated in the future.
vocab_path <- "~/Downloads/vocabulary_bundle_v5_0-22-JUN-22.zip"

# may take a few minuetes to run
debugonce(synthesize_cdm)
synthesize_cdm(path = here::here("hiv_cdm.duckdb"),
vocab_path = "~/Downloads/vocabulary_bundle_v5_0-22-JUN-22.zip",
n_persons = 100,
modules = "hiv",
age = c(0, 100),
format = "duckdb",
overwrite = TRUE,
seed = 1)
```

Now we have a new cdm with 100 HIV patients

```{r, eval=FALSE}
con <- DBI::dbConnect(duckdb::duckdb(), here::here("hiv_cdm.duckdb"))

DBI::dbListTables(con)

DBI::dbGetQuery(con, "select count(*) as n_persons from main.person;")
```

# Attribution

This package relies heavily on code copied from [ETLSyntheaBuilder](https://github.com/OHDSI/ETL-Synthea) by Anthony Molinaro, Clair Blacketer, and Frank DeFalco and would not be possible without their work.