View source: R/clinical_events_to_phecodes.R
make_phecode_reverse_map | R Documentation |
Requires the output from map_clinical_events_to_phecodes()
, which maps UK
Biobank clinical events from Read 2, Read 3 and ICD-9 to ICD-10, then uses
Phecode Map 1.2 with ICD-10 Codes (beta) to map these ICD-10
equivalents (and any actual ICD-10 records) to Phecodes. This function uses
the output from map_clinical_events_to_phecodes()
to reverse map from
phecodes to Read 2, Read 3, ICD-9 and ICD-10. This is useful for checking
which raw clinical codes have been used in any phecode-defined phenotypes.
make_phecode_reverse_map(clinical_events_phecodes, all_lkps_maps)
clinical_events_phecodes |
A data frame created by
|
all_lkps_maps |
Either a named list of lookup and mapping tables (either
data frames or |
A data frame with columns "phecode", "phecode_description", "data_coding", "code" "description", "icd10_equivalent" and "icd10_description". Column 'code' contains the original 'raw' UK clinical codes, with code type indicated by the 'data_coding' column.
# build dummy all_lkps_maps
all_lkps_maps_dummy <- build_all_lkps_maps_dummy()
# map dummy clinical events df to phecodes
clinical_events_phecodes_dummy <- map_clinical_events_to_phecodes(
clinical_events = dummy_clinical_events_tidy(),
all_lkps_maps = all_lkps_maps_dummy,
min_date_only = FALSE
)
# create reverse map
make_phecode_reverse_map(
clinical_events_phecodes = clinical_events_phecodes_dummy,
all_lkps_maps = all_lkps_maps_dummy
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.