Skip to content

ohdsi-studies/OsteoporosisTreatmentPathways

Repository files navigation

Osteoporosis Treatment Pathways Analysis

Study Status: Started

As a chronic degenerative disease, osteoporosis requires a long-term treatment strategy. Recent guidelines emphasize that a sequential treatment strategy tailored to individual risk is a core component to effectively prevent fracture events. To provide further evidence to support the scheme in clinical practice, it is crucial to identify patterns of sequential therapy for osteoporosis in the real world. We aim to evaluate treatment patterns of osteoporosis medication in postmenopausal women using a common data model.

How to run

  1. Follow these instructions for seting up your R environment, including RTools and Java.

    R version 4.1.3 is required to run this package.

  2. Open your study package in RStudio. Use the following code to install all the dependencies:

    renv::restore()

    Please deactivate renv package if you use Docker containers.

    renv::deactivate()
  3. In RStudio, select 'Build' then 'Install and Restart' to build the package.

  4. Once installed, you can execute the study by modifying and using the code below. For your convenience, this code is also provided under extras/CodeToRun.R:

    library(ODTP)
    
    
    # Maximum number of cores to be used:
    maxCores <- parallel::detectCores()
     
    # The folder where the study intermediate and result files will be written:
     outputFolder <- "s:/ODTP"
     
    # Optional: specify where the temporary files (used by the Andromeda package) will be created:
    options(andromedaTempFolder = "s:/andromeda")
     
    # Details for connecting to the server:
     connectionDetails <- DatabaseConnector::createConnectionDetails(dbms = "pdw",
    																 server = Sys.getenv("PDW_SERVER"),
    																 user = NULL,
    																 password = NULL,
    																 port = Sys.getenv("PDW_PORT"))
     
    # The name of the database schema where the CDM data can be found:
    cdmDatabaseSchema <- "CDM_IBM_MDCD_V1153.dbo"
     
    # The name of the database schema and table where the study-specific cohorts will be instantiated:
    cohortDatabaseSchema <- "scratch.dbo"
    cohortTable <- "ODTP"
    
    # # Some meta-information that will be used by the export function:
    databaseId <- ""
    StartDate <- "" # The start date of CDM-transformation (ex. 2006-01-01, The day of the date must be set to '01')
    EndDate <- "" # The end date of CDM-transformation (ex. 2021-12-31)
    # # For Oracle: define a schema that can be used to emulate temp tables:
    oracleTempSchema <- NULL
    
    execute(connectionDetails = connectionDetails,
    		cdmDatabaseSchema = cdmDatabaseSchema,
    		cohortDatabaseSchema = cohortDatabaseSchema,
    		cohortTable = cohortTable,
    		oracleTempSchema = oracleTempSchema,
    		outputFolder = outputFolder,
    		databaseId = databaseId,
    		databaseName = databaseId,
    		databaseDescription = databaseId,
    		startDate = StartDate,
    		endDate = EndDate,
    		createCohorts = TRUE,
    		synthesizePositiveControls = FALSE,
    		runAnalyses = TRUE,
    		packageResults = TRUE,
    		maxCores = maxCores)
    
    
    zip::zip(zipfile = paste0(databaseId, "_results.zip"), files = "results", root = outputFolder)
    
    
  5. Send the zip file <DatabaseId>_results.zip in the output folder to the study coordinator.

About

In this study,we evaluate the changes in osteoporosis medication treatment patterns in postmenopausal women.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published