build_all_lkps_maps: Build named list of clinical code look up and mapping tables

View source: R/lookups_and_mappings.R

build_all_lkps_mapsR Documentation

Build named list of clinical code look up and mapping tables

Description

Downloads the lookup and mapping tables from UK Biobank resource 592 as well as the NHSBSA BNF-SNOMED mapping table (available here) and OPCS4, self-reported medical conditions/medications/operations from the UK Biobank codings file (available here).

Usage

build_all_lkps_maps(
  all_lkps_maps = read_all_lkps_maps(),
  ukb_codings = ukbwranglr::get_ukb_codings(),
  bnf_dmd = get_nhsbsa_snomed_bnf(),
  self_report_med_to_atc_map = get_ukb_self_report_med_to_atc_map(),
  ctv3sctmap2 = NULL,
  phecode_1_2_lkp = get_phecode_definitions(),
  icd10_phecode_1_2 = get_phecode_icd10_map(),
  icd9_phecode_1_2 = get_phecode_icd9_map()
)

Arguments

all_lkps_maps

UK Biobank resource 592, as returned by get_ukb_all_lkps_maps.

ukb_codings

The UK Biobank codings file, as returned by get_ukb_codings.

bnf_dmd

Optional: path to the NHSBSA BNF-SNOMED mapping table (see get_nhsbsa_snomed_bnf()).

self_report_med_to_atc_map

Optional: path to a UK Biobank self-reported medication to ATC map (see get_ukb_self_report_med_to_atc_map()).

ctv3sctmap2

Optional: path to the NHS TRUD mapping file for Read 3 to SNOMEDCT ("ctv3sctmap2_uk_20200401000001.txt").

phecode_1_2_lkp

Optional: path to the phecode v1.2 lookup file (see get_phecode_definitions()).

icd10_phecode_1_2

Optional: path to the phecode v1.2 to ICD10 mapping file (see get_phecode_icd10_map()).

icd9_phecode_1_2

Optional: path to the phecode v1.2 to ICD10 mapping file (see get_phecode_icd9_map()).

Value

Returns a named list of data frames.

See Also

all_lkps_maps_to_db()

Examples

# build dummy all_lkps_maps using just UKB resource 592 and UKB codings file
build_all_lkps_maps(
  all_lkps_maps = read_all_lkps_maps_dummy(),
  ukb_codings = read_ukb_codings_dummy(),
  bnf_dmd = NULL,
  self_report_med_to_atc_map = NULL,
  ctv3sctmap2 = NULL,
  phecode_1_2_lkp = NULL,
  icd10_phecode_1_2 = NULL,
  icd9_phecode_1_2 = NULL
)

rmgpanw/codemapper documentation built on Aug. 30, 2023, 4:07 p.m.