build_final_time_map: Builds a time map containing visit specific information for a...

build_final_time_mapR Documentation

Builds a time map containing visit specific information for a specific condition and cohort.

Description

Builds a time map containing visit specific information for a specific condition and cohort.

Usage

build_final_time_map(
  time_map = NULL,
  condition_short_name,
  duration_prior_to_index = 365L,
  collect_tab = smallDB::collect_table(),
  cohort_path,
  ssd_list
)

Arguments

time_map

A time map that is already created. If NULL then it will create a time map. Default is NULL.

condition_short_name

The condition of interest. Specifically the short_name version of the condition

duration_prior_to_index

How far from the index should the time map extend back (e.g. 90, 180, 365)

collect_tab

a collection table to build time_map from. By default all years will be used

cohort_path

Path to the specific cohort for the condition of interest#'

ssd_list

A list of diagnosis codes of interest. The diagnosis codes need to be separated into diagnosis categories (e.g. cough, fever, etc.). Additionally, within the categories, diagnosis codes should be seperated into ICD 9 and ICD 10 specific codes, with list elements labeled as icd9_codes and icd10_codes

Value

A tibble with all the specified diagnosis codes and the corresponding visit key where the diagnosis codes appeared

Examples

ssds <- read_rds("/Shared/Statepi_Diagnosis/params/ssd_codes/ssd_hsv_enceph.RDS")

final_time_map <- build_final_time_map(condition_short_name = "hsv_enceph",
                                       duration_prior_to_index = 365L,
                                       cohort_path = "/Shared/Statepi_Diagnosis/grant_projects/hsv_enceph/scripts/validation/enrolled_ge_365/updated_index_cohort.RDS",
                                       ssd_list = ssds)

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