View source: R/clinical_codes.R
reformat_icd10_codes | R Documentation |
The lookup sheet in
UKB resource 592
for ICD-10 ("icd10_lkp") has a column called ALT_CODE
, which is an
alternative format for ICD-10 codes. This is the format used in the mapping
sheets for this resource, as well as in
Field ID 41270.
Note however that in contrast to the ICD10 lookup and mapping sheets,
undivided 3 character codes do not have an 'X' appended in the UK Biobank
dataset. This function converts from one format to the other, with the
option to strip the final 'X' from undivided 3 character codes if converting
to ALT_CODE
format.
reformat_icd10_codes(
icd10_codes,
all_lkps_maps = NULL,
input_icd10_format = "ICD10_CODE",
output_icd10_format = "ALT_CODE",
unrecognised_codes = "error",
strip_x = FALSE
)
icd10_codes |
character vector of ICD-10 codes |
all_lkps_maps |
Either a named list of lookup and mapping tables (either
data frames or |
input_icd10_format |
character. Must be either "ICD10_CODE" or "ALT_CODE". |
output_icd10_format |
character. Must be either "ICD10_CODE" or "ALT_CODE". |
unrecognised_codes |
Either 'error' (default) or 'warning'. If any input
|
strip_x |
If |
character vector of ICD-10 codes, reformatted as specified by
output_icd10_format
.
Other Clinical code lookups and mappings:
codes_starting_with()
,
default_col_filters()
,
get_mapping_df()
,
lookup_codes()
,
map_codes()
# build dummy all_lkps_maps
all_lkps_maps_dummy <- build_all_lkps_maps_dummy()
# reformat from ICD10_CODE to ALT_CODE
reformat_icd10_codes(
icd10_codes = c("E10.9"),
all_lkps_maps = all_lkps_maps_dummy,
input_icd10_format = "ICD10_CODE",
output_icd10_format = "ALT_CODE"
)
# reformat from ALT_CODE to ICD10_CODE
reformat_icd10_codes(
icd10_codes = c("E109"),
all_lkps_maps = all_lkps_maps_dummy,
input_icd10_format = "ALT_CODE",
output_icd10_format = "ICD10_CODE"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.