Skip to contents

This function start up TrajectoryViz package GUI with the C2T output

Usage

runTrajectoryViz(data)

Arguments

data

Cohort2Trajectory output object

Examples

if (FALSE) { # \dontrun{
  data <- readRDS("./snapshots/CohortContrastDataSnapshot.rds")
  user <- Sys.getenv("DB_USERNAME")
  pw <- Sys.getenv("DB_PASSWORD")
  server <- stringr::str_c(Sys.getenv("DB_HOST"), "/", Sys.getenv("DB_NAME"))
  port <- Sys.getenv("DB_PORT")

  cdmSchema <-
    Sys.getenv("OHDSI_CDM")
  cdmVocabSchema <-
    Sys.getenv("OHDSI_VOCAB")
  cdmResultsSchema <-
    Sys.getenv("OHDSI_RESULTS")
  writeSchema <-
    Sys.getenv("OHDSI_WRITE")
  writePrefix <- "cc_"

  db = DBI::dbConnect(
    RPostgres::Postgres(),
    dbname = Sys.getenv("DB_NAME"),
    host = Sys.getenv("DB_HOST"),
    user = Sys.getenv("DB_USERNAME"),
    password = Sys.getenv("DB_PASSWORD"),
    port = port
  )

  cdm <- CDMConnector::cdmFromCon(
    con = db,
    cdmSchema = cdmSchema,
    achillesSchema = cdmResultsSchema,
    writeSchema = list(schema = writeSchema, prefix = writePrefix)
  )

  data = CohortContrast::createC2TInput(data, cdm)

  trajectories = CohortContrast::C2TCaller <- function(data, pathToResults = getwd())

  CohortContrast::runTrajectoryViz(trajectories)
} # }