I have a pretty complicated question, and if I need to move it/ change the category please let me know.
I am currently building a shiny dashboard to return results from a survey designed using REDCap. I have built the dashboard, and it communicates (when I run it locally) with the database using the REDCap API and the R package redcapAPI. I am moving towards trying to host this application somewhere (shinyapps.io?) and have a part that I cannot figure out.
Currently, my shiny application connects to the database (successfully!) using the following code snippet
library(redcapAPI) #establish connection to the API project <- redcapConnection(url, token)
I then pull the information I want using this function:
#extract only the records from the appropriate subject by variable subject_id into a data frame data <- exportRecords(project,records = c(subject_id))
Currently, I have to hard code the variable subject_id so that I can change which set of records I am pulling in.
The REDCap program, allows me to redirect a user to a custom URL upon completion of the survey, and I can pipe a variable (subject_id) into the URL. So I could have something like this:
My question is if it is possible to have all of the information needed to launch my application with the appropriate subject ID stored inside of the URL? Are there any tips or resources you can think of that would make this work? Or am I attempting the impossible?
Any input is much appreciated.