runCodelistBuilder: Create a clinical codelist with R Shiny.

RunCodelistBuilderR Documentation

Create a clinical codelist with R Shiny.

Description

Launches a Shiny app to select clinical codes (see also 'User notes' section below). In general:

  1. Complete details for essential search fields (leaving 'category' box blank and leaving the 'Ignore case' boxes ticked - if un-ticked, this will not be recorded under 'description_search_strategy').

  2. Optionally upload a previous codelist.

  3. Click 'Download selected'.

Usage

RunCodelistBuilder(
  all_lkps_maps = NULL,
  options = list(launch.browser = TRUE),
  ...
)

Arguments

all_lkps_maps

Either a named list of lookup and mapping tables (either data frames or tbl_dbi objects), or the path to a SQLite database containing these tables (see also build_all_lkps_maps() and all_lkps_maps_to_db()). If NULL, will attempt to connect to an SQLite database named 'all_lkps_maps.db' in the current working directory, or to a a SQLite database specified by an environmental variable named 'ALL_LKPS_MAPS_DB' (see here for how to set environment variables using a .Renviron file). The latter method will be used in preference.

options

Named options that should be passed to the runApp call (these can be any of the following: "port", "launch.browser", "host", "quiet", "display.mode" and "test.mode"). You can also specify width and height parameters which provide a hint to the embedding environment about the ideal height/width for the app.

...

Additional args passed on to shinyApp

Value

NULL

User notes

  • Essential fields: 'Disease', either 'Code descriptions like...' or at least one of 'Codes starting with...'.

  • 'Download all': downloads all codes under the 'Matching clinical codes' tab, disregarding any selections (i.e. the 'selected' column will appear blank).

  • 'Download selected': downloads all codes under the 'Preview selected codes only' tab.

  • If uploading a previous codelist selection, this must be formatted as required by validate_clinical_codes (see example_clinical_codes for a valid example).

  • ...this will automatically select any codes matching on 'disease', 'code_type' and 'code' (see update_code_selection function in utils.R), and on clicking 'Download selected', will copy over any values in the 'category' column and set the 'selected' column to 'Yes' only for these rows.

  • ...the full list of uploaded codes can be viewed under the 'Uploaded codelist' tab, which includes a column called 'included_in_matching', indicating whether each uploaded code is present ('Yes') or not present ('No') in the list under 'Matching clinical codes'.

  • Also, click through the tabs after each step before moving on to the next.

  • The final list of matching codes is codes matching 'Code descriptions like...' OR 'Codes starting with...'.

  • CAUTION: make sure there are no inadvertent white spaces (e.g. 'search term', not 'search term ').

Examples

## Not run: 
# build dummy all_lkps_maps
all_lkps_maps_dummy <- build_all_lkps_maps_dummy()

# launch app
RunCodelistBuilder(all_lkps_maps = all_lkps_maps_dummy)

## End(Not run)

rmgpanw/codemapper documentation built on Aug. 30, 2023, 4:07 p.m.