R/mod_querywidget.R

Defines functions mod_querywidget_server mod_querywidget_ui

#' querywidget UI Function
#'
#' @description A shiny Module.
#'
#' @param id,input,output,session Internal parameters for {shiny}.
#'
#' @noRd 
#'
#' @importFrom shiny NS tagList 
mod_querywidget_ui <- function(id){
  ns <- NS(id)
  tagList(
    queryBuilder::queryBuilderOutput(ns('querybuilder'),height = 'auto')
  )
}
    
#' querywidget Server Functions
#'
#' @noRd 
mod_querywidget_server <- function(id){
  moduleServer( id, function(input, output, session){
    ns <- session$ns
    # 
    # filters = list(list(name = 'AGE', type = 'integer'),
    #                list(name = 'RACE', type = 'character'),
    #                list(name = "TYPE OF NEEDLE", type = 'character'),
    #                list(name = 'GAUGE', type = 'character'),
    #                list(name = 'ATTEMPT', type = 'integer'),
    #                list(name = 'PROVIDER', type = 'character'),
    #                list(name =  "HEADACHE ONSET", type = 'character'),
    #                list(name = "FRONTO-OCCIPITAL", type = 'character'),
    #                list(name = "POSITIONAL", type = 'character'),
    #                list(name = "NECK PAIN", type = 'character'),
    #                list(name = "FLUIDS", type = 'character'),
    #                list(name = "NSAID", type = 'character'),
    #                list(name = "CAFFIENE", type = 'character'),
    #                list(name = "OPIOID", type = 'character'),
    #                list(name = "RESOLUTION", type = 'character'),
    #                list(name = "BLOOD PATCH", type = 'character'),
    #                list(name = "DISCHARGE SUMMARY", type = 'integer')
    # )    
    
    
    output$querybuilder <- queryBuilder::renderQueryBuilder({
      queryBuilder::queryBuilder(#filters = filters, 
                   data = dataset,
                   autoassign = TRUE
      )
    })
    
    
    
    
  })
}
    
## To be copied in the UI
# 
    
## To be copied in the server
# 
gavandrewj/pdphApp documentation built on Dec. 20, 2021, 9:48 a.m.