Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
R
 
 
 
 
 
 
man
 
 
 
 
 
 
 
 
 
 
 
 

treatmentCycleExtraction

Introduction

Tool for extracting treatment cycle from single medication records in CDM database

Technology

treatmentCycleExtraction is an R package.

Dependencies

install.packages("listviewer")

install.packages("jsonlite")

install.packages("collapsibleTree")

install.packages("rjson")

install.packages("data.table")

install.packages("dplyr")

install.packages("tidyr")

install.packages("DatabaseConnector")

install.packages("ParallelLogger")

install.packages("SqlRender")

Getting started

In R, use the following commands to download and install:

install.packages("devtools")

devtools::install_github("ABMI/treatmentCycleExtraction")

library('treatmentCycleExtraction')

How to run

Parameter setting for algorithm :

Database parameters :

# Details for connecting to the server:
connectionDetails <- DatabaseConnector::createConnectionDetails(dbms='pdw',
                                                                server=Sys.getenv("PDW_SERVER"),
                                                                schema='cdmDatabaseSchema',
                                                                user=NULL,
                                                                password=NULL,
                                                                port='port')

oracleTempSchema <- NULL
cdmDatabaseSchema <- "cdm_database_schema.dbo"
cohortDatabaseSchema <- "cohort_database_schema.dbo"
vocaDatabaseSchema <- "voca_database_schema.dbo"
oncologyDatabaseSchema <- "oncology_database_schema.dbo" # Schema for Episode table and Episode_eventtable, default = cdmDatabaseSchema

cohortTableCreation = FALSE # Create cohort table for your cohort table
episodeTableCreation = FALSE  # warning: existing table might be erased
generateTargetCohort = FALSE  # Create target cohort ,i.e., 'colorectal cancer'

episodeTable <- "episode_table"
episodeEventTable <- "episode_event_table"
cohortTable <- "cohort"

maxCores <- 4

Then run the following :

Generate episode and episode event table :

executeExtraction(connectionDetails,
                  oracleTempSchema = NULL,
                  cdmDatabaseSchema,
                  vocaDatabaseSchema,
                  cohortDatabaseSchema,
                  oncologyDatabaseSchema,
                  cohortTable,
                  episodeTable,
                  episodeEventTable,
                  includeConceptIdSetDescendant = TRUE,
                  maxCores,
                  cohortTableCreation = FALSE,
                  episodeTableCreation = FALSE,
                  generateTargetCohort = FALSE)

Rule Editor

If you need a modification in the rule for algorithm :

targetRegimenIds <- c(35806596,35804761)
newJson <- ruleEditor(targetRegimenIds) # Edit your rule
newJson <- ruleEditor(new= TRUE) # Add a new rule
ruleSave(newJson,targetRegimenIds) # Save your rule

License

treatmentCycleExtraction is licensed under Apache License 2.0

Development

treatmentCycleExtraction is being developed in R Studio.

About

Tool for extracting treatment cycle from single medication records in CDM database

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published