2024-03-14 09:26:22 +01:00
ui <- shiny :: shinyUI (
shiny :: fluidPage (
2024-06-07 10:35:16 +02:00
theme = shinythemes :: shinytheme ( " flatly" ) ,
2024-02-26 20:32:26 +01:00
2024-03-14 09:26:22 +01:00
## -----------------------------------------------------------------------------
## Application title
## -----------------------------------------------------------------------------
2024-02-26 20:32:26 +01:00
2024-03-14 09:26:22 +01:00
# customHeaderPanel(title = "REDCapCAST: data base creation and data upload from data set file",
# windowTitle = "REDCap database creator"
# ),
2024-06-07 10:35:16 +02:00
shiny :: titlePanel (
title = shiny :: div (
shiny :: a ( shiny :: img ( src = " logo.png" ) , href = " https://agdamsbo.github.io/REDCapCAST" ) ,
" Easy REDCap database creation"
) ,
2024-03-14 09:26:22 +01:00
windowTitle = " REDCap database creator"
2024-02-26 20:32:26 +01:00
) ,
2024-06-07 10:35:16 +02:00
shiny :: h4 (
2024-10-24 11:37:40 +02:00
" THese are the functionalities to create and migrate data from a spreadsheet to a REDCap database:" ,
2024-06-07 10:35:16 +02:00
shiny :: br ( ) ,
2024-10-24 11:37:40 +02:00
" 1) create a REDCap data dictionary or instrument based on a spreadsheet (.csv/.xls(x)/.dta/.ods) and" ,
2024-06-07 10:35:16 +02:00
shiny :: br ( ) ,
2024-10-24 11:37:40 +02:00
" 2) upload said database file on a given REDCap server and upload the dataset via API access or download for all manual upload."
2024-06-07 10:35:16 +02:00
) ,
2024-02-26 20:32:26 +01:00
2024-03-14 09:26:22 +01:00
## -----------------------------------------------------------------------------
## Side panel
## -----------------------------------------------------------------------------
2024-02-26 20:32:26 +01:00
2024-03-14 09:26:22 +01:00
shiny :: sidebarPanel (
shiny :: h4 ( " 1) REDCap datadictionary and compatible dataset" ) ,
shiny :: fileInput ( " ds" , " Choose data file" ,
multiple = FALSE ,
accept = c (
" .csv" ,
" .xls" ,
" .xlsx" ,
2024-06-07 12:01:09 +02:00
" .dta" ,
" .ods"
2024-03-14 09:26:22 +01:00
)
) ,
shiny :: h6 ( " B e l o w y o u c a n d o w n l o a d t h e d a t a s e t f o r m a t t e d f o r u p l o a d a n d t h e
corresponding data dictionary for a new data base , if you want to upload manually. " ) ,
# Button
shiny :: downloadButton ( " downloadData" , " Download data" ) ,
# Button
2024-10-24 11:37:40 +02:00
shiny :: downloadButton ( " downloadMeta" , " Download data dictionary" ) ,
# Button
shiny :: downloadButton ( " downloadInstrument" , " Download as instrument" ) ,
2024-02-26 20:32:26 +01:00
2024-03-14 09:26:22 +01:00
# Horizontal line ----
shiny :: tags $ hr ( ) ,
shiny :: h4 ( " 2) REDCap upload" ) ,
shiny :: h6 ( " This tool is usable for now. Detailed instructions are coming." ) ,
shiny :: textInput (
inputId = " uri" ,
label = " URI" ,
value = " https://redcap.your.institution/api/"
) ,
shiny :: textInput (
inputId = " api" ,
label = " API key" ,
value = " "
) ,
2024-06-07 10:35:16 +02:00
shiny :: h6 ( " An API key is an access key to the REDCap database. Please" , shiny :: a ( " see here for directions" , href = " https://www.iths.org/news/redcap-tip/redcap-api-101/" ) , " to obtain an API key for your project." ) ,
2024-03-14 09:26:22 +01:00
shiny :: actionButton (
inputId = " upload.meta" ,
label = " Upload datadictionary" , icon = shiny :: icon ( " book-bookmark" )
2024-02-26 20:32:26 +01:00
) ,
2024-03-14 09:26:22 +01:00
shiny :: h6 ( " P l e a s e n o t e , t h a t b e f o r e u p l o a d i n g a n y r e a l d a t a , p u t y o u r p r o j e c t
into production mode. " ) ,
shiny :: actionButton (
inputId = " upload.data" ,
label = " Upload data" , icon = shiny :: icon ( " upload" )
) ,
# Horizontal line ----
shiny :: tags $ hr ( )
) ,
shiny :: mainPanel (
shiny :: tabsetPanel (
## -----------------------------------------------------------------------------
## Summary tab
## -----------------------------------------------------------------------------
shiny :: tabPanel (
" Summary" ,
shiny :: h3 ( " Data overview (first 20)" ) ,
shiny :: htmlOutput ( " data.tbl" , container = shiny :: span ) ,
shiny :: h3 ( " Dictionary overview" ) ,
shiny :: htmlOutput ( " meta.tbl" , container = shiny :: span )
) ,
## -----------------------------------------------------------------------------
## Upload tab
## -----------------------------------------------------------------------------
shiny :: tabPanel (
" Upload" ,
shiny :: h3 ( " Meta upload overview" ) ,
shiny :: htmlOutput ( " upload.meta.print" , container = shiny :: span ) ,
shiny :: h3 ( " Data upload overview" ) ,
shiny :: htmlOutput ( " upload.data.print" , container = shiny :: span )
)
2024-02-26 20:32:26 +01:00
)
2024-03-14 09:26:22 +01:00
) ,
# close sidebarLayout
2024-04-04 09:50:04 +02:00
shiny :: br ( ) ,
shiny :: br ( ) ,
shiny :: br ( ) ,
shiny :: br ( ) ,
shiny :: hr ( ) ,
2024-03-14 09:26:22 +01:00
shiny :: tags $ footer ( shiny :: strong ( " Disclaimer: " ) ,
2024-06-07 12:01:09 +02:00
" This tool is aimed at demonstrating use of REDCapCAST. The app can be run locally or on a hosted server (will save no data anywhere). No responsibility for data loss or any other problems will be taken. Please contact me for support." ,
2024-06-07 10:35:16 +02:00
shiny :: br ( ) ,
shiny :: a ( " License: GPL-3+" , href = " https://agdamsbo.github.io/REDCapCAST/LICENSE.html" ) ,
" |" ,
shiny :: a ( " agdamsbo/REDCapCAST" , href = " https://agdamsbo.github.io/REDCapCAST" ) ,
" |" ,
shiny :: a ( " Source" , href = " https://github.com/agdamsbo/REDCapCAST" ) ,
" |" ,
shiny :: a ( " Contact" , href = " https://andreas.gdamsbo.dk" ) ,
align = " center" ,
style = "
2024-03-14 09:26:22 +01:00
position : fixed ;
bottom : 40 px ;
width : 100 %;
height : 20 px ;
color : black ;
padding : 0 px ;
background - color : White ;
z - index : 100 ;
2024-06-07 10:35:16 +02:00
"
)
2024-02-26 20:32:26 +01:00
)
)