Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ablack3/syntheacdmfactory
https://github.com/ablack3/syntheacdmfactory
Last synced: 29 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ablack3/syntheacdmfactory
- Owner: ablack3
- License: apache-2.0
- Created: 2023-06-16T09:07:05.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-23T09:52:28.000Z (12 months ago)
- Last Synced: 2024-01-23T10:58:25.876Z (12 months ago)
- Language: R
- Size: 1 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE.md
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.