The goal of patientDesignerExample is to show the test cycle for studies using a graphical interface.
-
Clone this repository.
-
Install the development version of
TestGenerator::patientDesigner().
# install.packages("remotes")
remotes::install_github("darwin-eu/TestGenerator", ref = "develop")- Launch the Shiny app, design a few patient profiles and save the data.
library(TestGenerator)
TestGenerator::patientDesigner()- Use TestGenerator to push the data to a in-memory database.
test_name <- "new_test_set"
cdm <- TestGenerator::patientsCDM(testName = test_name)- Use the CDM reference to write unit tests using your test patients.
library(testthat)
library(dplyr)
test_that("Load patients", {
test_name <- "new_test_set"
cdm <- TestGenerator::patientsCDM(testName = test_name)
cdm[["person"]] |>
collect() |>
pull(person_id) |>
expect_equal(1)
cdm[["drug_exposure"]] |>
collect() |>
pull(drug_exposure_id) |>
length() |>
expect_equal(3)
})