View source: R/clinical_codes.R
map_codes | R Documentation |
Uses the code mapping file provided by UK Biobank (resource 592).
map_codes(
codes,
from,
to,
all_lkps_maps = NULL,
codes_only = FALSE,
standardise_output = TRUE,
unrecognised_codes = "error",
preferred_description_only = NULL,
reverse_mapping = "error",
col_filters = default_col_filters()
)
codes |
A character vector of codes to be mapped. |
from |
Coding system that |
to |
Coding system to map |
all_lkps_maps |
Either a named list of lookup and mapping tables (either
data frames or |
codes_only |
bool. If |
standardise_output |
bool. If |
unrecognised_codes |
Either 'error' (default) or 'warning'. If any input
|
preferred_description_only |
If |
reverse_mapping |
If 'error' (default), an error raised if attempting to map between coding systems for which a mapping table does not exist. If 'warning', will raise a warning and attempt to use an existing mapping table in the opposite direction (for example, a mapping from ICD10 to Read 3 would be attempted using the Read 3-to-ICD10 mapping table). |
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, |
The values for arguments from
and to
must be one of
read2
, read3
, icd9
, icd10
, bnf
,
dmd
, read2_drugs
or opcs4
.
Other Clinical code lookups and mappings:
codes_starting_with()
,
default_col_filters()
,
get_mapping_df()
,
lookup_codes()
,
reformat_icd10_codes()
# build dummy all_lkps_maps
all_lkps_maps_dummy <- build_all_lkps_maps_dummy()
# map codes from Read 2 to ICD10
map_codes(
codes = "G20..",
from = "read2",
to = "icd10",
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.