dataHelperServer: Shiny module server for simple traversal of relational tables...

View source: R/dataHelper.R

dataHelperServerR Documentation

Shiny module server for simple traversal of relational tables in a database

Description

Traverse data in "right-hand" and "left-hand" tables

Usage

dataHelperServer(
  id,
  dbcon = NULL,
  lhdata,
  lhdatakey,
  rhdata,
  rhdatakey,
  handler,
  functionality = "filter"
)

Arguments

id

Character ID for specifying namespace, see shiny::NS.

dbcon

A database connection object to the database containing the required tables.

lhdata

Name of the table on the left-hand side.

lhdatakey

Name of key column in lhdata table, which should also be a key in handler.

rhdata

Name of the table on the right-hand side.

rhdatakey

Name of key column in rhdata table, which should also be a key in handler.

handler

Name of table used for translating between lhdata and rhdata.

functionality

Either "filter" or "select" for the intended behavior of module, defaulting to the first. See details.

Details

Implements simple interface allowing constrained browsing, filtering, subsetting of traditional tabular data. The module requires these tables:

lhdata

"Left-hand" table of data. Conceptually, also known as a "dimension table". For example, a table of unique patients and attributes such as age, sex, race, etc.

rhdata

"Right-hand" table of data. Conceptually, also known as a "dimension table". For example, a table of unique diagnoses and attributes such as description, insurance code, etc.

handler

Lookup table to translate relations between the left-hand and right-hand tables. Using current example, a table linking patient IDs to diagnosis IDs (which can be many-to-many). See helpful reference for bridge table

.

There can be some nuance to the intended functionality: one table acts as a constraint filter to limit the results in the second table, or one table acts as an entryway to show linked results in the second table. The difference boils down to whether the second table shows all possible results if nothing is selected in the first ("filter" functionality type) or the second table shows nothing if nothing is selected in the first ("select" functionality type).

See Also

Other dataHelper: dataHelperUI()


avucoh/DIVE documentation built on Aug. 29, 2023, 6:02 p.m.