Learn R Programming

hybridEHR (version 0.1.0)

generate_hybrid_ehr: High-level wrapper to generate and export a hybrid EHR dataset

Description

High-level wrapper to generate and export a hybrid EHR dataset

Usage

generate_hybrid_ehr(
  n_patients = 500,
  n_sites = 3,
  covid_focused = TRUE,
  include_ct_links = FALSE,
  output_dir,
  seed = NULL,
  verbose = TRUE
)

Value

A list with:

dataset

The in-memory dataset list (as from generate_hybrid_ehr_dataset).

output_dir

The output directory path where files were written.

A list containing:

dataset

Generated dataset object

output_dir

Path to exported files

Arguments

n_patients

Number of unique patients.

n_sites

Number of sites/hospitals to simulate.

covid_focused

Logical; if TRUE, use COVID-era encounter and lab patterns.

include_ct_links

Logical; if TRUE, add CT timing variables and a CT severity score in the CT research view.

output_dir

Directory for exported files.

seed

Optional integer used to set the random seed for reproducibility.

verbose

Logical; if TRUE, print progress messages to the console.

Examples

Run this code
# \donttest{
ehr <- generate_hybrid_ehr_dataset(
  n_patients = 10,
  seed = 123,
  verbose = FALSE
)

export_hybrid_ehr_dataset(
  ehr,
  output_dir = tempdir(),
  verbose = FALSE
)
# }

Run the code above in your browser using DataLab