read_caliber_raw: Import CALIBER code lists

View source: R/caliber.R

read_caliber_rawR Documentation

Import CALIBER code lists

Description

Reads a local copy of the CALIBER repository into R. All CALIBER codes are read into a named list containing 3 data frames: primary care Read 2, secondary care ICD10 and secondary care OPCS4 codes.

Usage

read_caliber_raw(caliber_dir_path, overlapping_disease_categories = "error")

Arguments

caliber_dir_path

Path to a locally downloaded copy of the CALIBER github repository.

overlapping_disease_categories

If 'error' (default), raises an error if any overlapping disease categories are present after mapping. Specify 'warning' to raise a warning instead.

Details

The directory supplied to caliber_dir_path is expected to contain subdirectories primary_care and secondary_care, each of which contains csv files with clinical code lists.

Note also that:

  1. Medcodes are dropped

  2. Minimal reformatting is performed so that primary and secondary care codes may be combined into a single data frame

Value

A named list of data frames.

See Also

Other CALIBER: default_overlapping_disease_categories_csv(), download_caliber_repo(), get_caliber_categories_mapping(), reformat_caliber_for_ukb()

Examples

# read local copy of CALIBER repository into a named list. Note that
# (i) Medcodes are dropped and (ii) minimal reformatting is performed so that
# primary and secondary care codes may be combined into a single data frame
caliber_raw <- read_caliber_raw(dummy_caliber_dir_path())
caliber_raw

# combine into a single data frame using dplyr
dplyr::bind_rows(caliber_raw)

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