Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
Optimizing Subject Management of a Large Multi-site Randomized Controlled Trial: Implementation of R Shiny Dashboard with Real-time Data
Yongqi Zhong [email protected]
Feb 21, 2018 Washington University Department of Psychiatry | healthymind.wustl.edu
Overview
▪ Introduction of R Shiny ▪ Redcap Reports & API ▪ Optimum Dashboard ▪ Demonstration of Sample Shiny App ▪ Implications
2
Introduction of R Shiny Shiny & Shiny Dashboard
“ Shiny is an R package that makes it easy to build interactive web apps straight from R.
- R Studio
4
Basic Structure of Shiny
▪ library(Shiny) ▪ ui <- fluidPage() ▪ server <- function (input, output){} ▪ shinyApp(ui = ui, server = server)
5
Server
▪ Input (defined in either server or UI) ▫ Dropdown Menu ▫ Radio Button ▫ Text, Slider, etc.
▪ Output ▫ Data Table ▫ Plot ▫ Text, Image, etc.
6
Server Cont.
▪ server <- function (input, output){ ▫ output$plot <- renderPlot({
▫ hist(iris$Petal.Length) ▫ })
}
7
UI
▪ HTML ▪ CSS ▪ JS ▪ Layouts ▪ Shiny Dashboard
8 *Extracted from Shiny Cheat Sheet
Shiny Dashboard ▪ ui <- dashboardPage(
▫ dashboardHeader(title="test"), ▫ dashboardSidebar(sidebarMenu(
▫ menuItem( ▫ "Welcome", ▫ tabName = "welcome", ▫ icon = icon("gift")))),
▫ dashboardBody( ▫ tabItems(
▫ tabItem( ▫ tabName = "welcome", ▫ h3("Welcome"), ▫ box("Iris Petal Length Histogram",
▫ plotOutput("plot")) ▪ ))))
9
Other Dashboard Layout Option ▪ flexdashboard (R Markdown)
▫ https://rmarkdown.rstudio.com/flexdashboard/
10 Source: https://beta.rstudioconnect.com/jjallaire/shiny-eruptions/
Redcap Reports & API Viewing Data from Redcap
Traditional Redcap Reports
▪ Pros ▫ Easy to use
▪ Cons ▫ Limited options
12
Place your screenshot here
Redcap API ▪ library(RCurl) ▪ result <- postForm(
▫ uri=‘XXXXXXX’, ▫ token=‘XXXXXXXXXXX', ▫ content='report', ▫ format=‘csv', ▫ report_id='‘XXXX”, ▫ rawOrLabel='raw', ▫ rawOrLabelHeaders='raw', ▫ exportCheckboxLabel='false', ▫ returnFormat=‘csv'
▪ ) ▪ result_df <-read.csv(textConnection(result), sep = ",", fill = T, stringsAsFactors = F, na.strings =
"", header = T) 13
Place your screenshot here
Redcap API Cont.
Export Options ▪ Record ID ▪ Reports ▪ Instruments
Other Packages ▪ redcapAPI
▫ https://github.com/nutterb/redcapAPI
▪ REDCapR ▫ https://github.com/OuhscBbmc/RE
DCapR
14
Optimum Dashboard WashU’s first Shiny web application using Shiny Server Pro.
Optimizing Outcomes of Treatment-Resistant Depression in Older Adults
▪ Principal Investigator: Dr. Eric Lenze
16
Washington University Department of Psychiatry
https://www.optimumstudy.org/
Step 1 (for 10 weeks): Patient is prescribed augmentation with aripiprazole or bupropion, or switched to bupropion
OPTIMUM study design
What are we measuring?
We look at symptomatic remission, well-being, safety, falls, cognitive function,
& mobility.
4-month acute phase(above)
• Age 60+
• Major depression
• Non-responder to two or more antidepressant trials
N=500
N=500
N=500
N=1,500
STUDY POPULATION
N=400
Augmentationwith aripiprazole
Augmentationwith bupropion
Switch tobupropion
Remission
Switch to nortriptyline
Augmentationwith lithium
N=400
(N estimated)
Those who complete acute phase will be followed in a one-year continuation.
1 Step 2 (for 10 weeks): Those who do not improve in Step 1 receive lithium augmentation or switched to nortriptyline
2
Community clinicians are at the center
The OPTIMUM study team partners with community clinicians to treat older adults with depression. •Patients stay with their own provider. •Provider prescribes medication. • Study team guides treatment steps.
Enrollment at 5 sites
▪ Washington University serves as the Central Coordinating Site
ColumbiaUniversity
New
York
WashingtonHeights
Harlem
NEW
YORK
Toronto
ONTARIO
CANADA
U.S.
Buffalo
Algonquin
Provincial
Park
Universityof Toronto
WestHollywood
HolmbyHills
LaderaHeights
ElSegundo
SantaMonica
Los Angeles
UCLA
Pittsburgh
AlleghenyCounty
University ofPittsburgh
St.Louis
Ferguson
Wellston
Pine Lawn
Soulard
MISSOURIILLINOIS
WashingtonUniversity
$ 13,500,000 Grant awarded from PCORI
50+ staff for 5 years Need reports
1,500 subjects at 5 sites We aimed to enroll
20
What we need? ▪ Tables for weekly internal subject review ▪ Study participant’s characteristics & enrollment ▪ Data & safety monitoring ▪ Real-time report ▪ Easy to access and use ▪ …
21
Optimum Dashboard
22
Dashboard Structure ▪ Welcome (Landing Page) ▪ Patient Tracking ▪ Patient Information ▪ Aggregated Charts ▪ To-do List
23
24
Welcome (Landing Page)
Better user experience
25
Patient Tracking
Date: PHQ9: Continue/Increase/Decrease Med X mg (multiple rows of data in one cell)
26
Patient Information
27
Patient Information Cont.
Active Medications
28
Aggregated Charts
29
Aggregated Charts Cont.
Place your screenshot here
30
To-do List
User Authentication & Privileges Dashboard Deployment on Shiny Server Pro 🔑 ▪ User authentication is only available when the app is deployed on
the server (https://www.rstudio.com/products/shiny-server-pro/) ▫ Protected Health Information (PHI) ▫ Access outside WashU ▫ Version control using Git on GitLab
▪ Collaboration with the Institute for Informatics (I2) (http://informatics.wustl.edu/)
31
Data Flow & User Privileges
Redcap
All Sites’ Data
Eligibility Database
(Cross-sectional)
32
Main Database (Longitudinal)
Site Subsetted
Data
All Data
Individual-level Data
Aggregated Data
Tables & Charts
Admin
Site Users
No Individual
Data Shown
All Users
Demonstration of Sample Shiny App • https://shiny.rstudio.com/gallery/personalized-ui.html • https://yqzhong7.shinyapps.io/Multiple-selectors/
Implications Explore new possibilities
Implications Needs and workflow of the study Thinking like a product manager as well as data analyst
Real-time data management Consider the efficiency of the codes for data wrangling & cleaning
Opportunities Publishing Shiny apps in academic journals (e.g. Bowman RL, Wang Q, Carro A, Verhaak RG, Squatrito M. GlioVis data portal for visualization and analysis of brain tumor expression datasets. Neuro-oncology. 2016 Nov 9;19(1):139-41.) 35
References ▪ Optimum Study:
▫ https://www.optimumstudy.org/ ▪ Shiny Cheat Sheet:
▫ https://github.com/rstudio/cheatsheets/raw/master/shiny.pdf ▪ http://shiny.rstudio.com/ ▪ https://rstudio.github.io/shinydashboard/index.html ▪ https://rstudio.github.io/DT/
36
THANKS! Any questions? You can find me at: [email protected]
37
Washington University Department of Psychiatry | healthymind.wustl.edu