Skip to content

mi-erasmusmc/patientDesignerExample

Repository files navigation

patientDesignerExample

The goal of patientDesignerExample is to show the test cycle for studies using a graphical interface.

Installation

  1. Clone this repository.

  2. Install the development version of TestGenerator::patientDesigner().

# install.packages("remotes")
remotes::install_github("darwin-eu/TestGenerator", ref = "develop")

Example

  1. Launch the Shiny app, design a few patient profiles and save the data.
library(TestGenerator)

TestGenerator::patientDesigner()
  1. Use TestGenerator to push the data to a in-memory database.
  test_name <- "new_test_set"

  cdm <- TestGenerator::patientsCDM(testName = test_name)
  1. 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)

})

About

Test Patient Interface for TestGenerator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages