observeEvent(input$select_yes, {
data$raw$screened_abstracts[progress$row] <- "DONE"
data$raw$time_screened[progress$row] <- Sys.time()
filename <- paste(paste0(data$raw$recordid.[progress$row],"_", data$raw$id[progress$row],
"_",Sys.time()),"csv", sep = ".")
filePath <- file.path("~/Downloads", filename)
write.csv(data$raw[progress$row,], filePath, row.names = FALSE, quote = TRUE)
if(input$hide_screened){ # progress$current remains the same and progress$available changes
progress$available <- which(is.na(data$raw$screened_abstracts))
progress$max_n <- length(progress$available)
if(progress$current > progress$max_n){
progress$current <- progress$max_n
}
}else{ # i.e. if screened elements are visible, then current is used for navigation
if(progress$current < progress$max_n){
progress$current <- progress$current + 1
}
}
})