View source: R/clinical_events_to_phecodes.R
map_clinical_events_to_phecodes | R Documentation |
UK Biobank clinical events sources that are recorded in ICD10 are mapped directly to phecodes, while non-ICD10 sources are mapped to phecodes via ICD10.
map_clinical_events_to_phecodes(
clinical_events,
all_lkps_maps = NULL,
min_date_only = FALSE,
col_filters = default_col_filters()
)
clinical_events |
A long format data frame created by
|
all_lkps_maps |
Either a named list of lookup and mapping tables (either
data frames or |
min_date_only |
If |
col_filters |
A named list where each name in the list refers to the
name of a lookup or mapping table. Each item is also a named list, where
the names refer to column names in the corresponding table, and the items
are vectors of values to filter for. For example, |
Maps the following UK Biobank clinical events sources to phecodes: f40001, f40002, f20002_icd10, f40006, f41270, f40013, f41271, gpc1_r3, gpc2_r3, gpc3_r3, gpc4_r3, gpc1_r2, gpc2_r2, gpc3_r2, gpc4_r2.
A data frame with column names 'eid', 'source', 'index', 'code', 'icd10', 'phecode' and 'date'.
# build dummy all_lkps_maps
all_lkps_maps_dummy <- build_all_lkps_maps_dummy()
# dummy clinical events data frame
dummy_clinical_events_tidy()
# map to phecodes
map_clinical_events_to_phecodes(
clinical_events = dummy_clinical_events_tidy(),
all_lkps_maps = all_lkps_maps_dummy,
min_date_only = FALSE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.