Learn R Programming

hybridEHR (version 0.1.0)

generate_hybrid_ehr_dataset: Generate synthetic hybrid EHR tables

Description

Generate synthetic hybrid EHR tables

Usage

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

Value

A list with elements:

tables

Named list of core EHR tables (patients, encounters, vitals, labs, medications, procedures, allergies).

research

Named list with ct_research_view (if covid_focused) and ml_flat_view (aggregated ML-ready table).

metadata

List of high-level generation settings and table metadata.

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.

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
ehr <- generate_hybrid_ehr_dataset(
  n_patients = 10,
  n_sites = 2,
  covid_focused = TRUE,
  include_ct_links = FALSE,
  seed = 123,
  verbose = FALSE
)

names(ehr$tables)
head(ehr$tables$patients)

Run the code above in your browser using DataLab