build_dx_indicators: Build diagnosis indicators corresponding to a list of...

View source: R/add_time_map_objects.R

build_dx_indicatorsR Documentation

Build diagnosis indicators corresponding to a list of diagnoses

Description

This function makes indicators corresponding to a list of diagnosis codes, for visits identifiedby timemap keys. IF keys are not found in the database, optional arguments allow keys to be generated temporarily (NOTE: this function cannot be used to permanently add keys to the database, to permanently add keys use, 'add_time_map_keys()').

Usage

build_dx_indicators(
  condition_dx_list,
  db_con,
  collect_tab = collect_table(),
  return_keys_only = FALSE
)

Arguments

condition_dx_list

a named list of icd9 and icd10 codes. Each condition should be named and icd9_codes and icd10_codes should be stored as a named sub-list for each condition

db_con

connection to the small database

collect_tab

(optional) a collection table. This argument is only used to make temporary, visit keys if no keys are found in the database

return_keys_only

Logical to return only the visit keys containing specific diagnosis codes

Value

a tibble containing keys and indicators for each condition


aarmiller/smallDB documentation built on March 29, 2024, 9:37 a.m.