Skip to contents

Clinical codes

Functions for looking up clinical codes and mapping between different coding systems.

DESCRIPTION()
Search for codes that match a description
CODES() CODES_LIKE()
Look up descriptions for clinical codes
CHILDREN() PARENTS() N_CHILDREN() N_PARENTS()
Retrieve parent or child codes
ATTRIBUTES_FOR() HAS_ATTRIBUTES()
Get attributes or codes with attributes
RELATIONSHIP_TYPES_FROM() RELATIONSHIP_TYPES_TO()
Get relationship types for codes
MAP()
Map clinical codes from one coding system to another
get_lookup_table()
Get the full lookup table for a code type
get_mapping_table()
Get the full mapping table for a pair of code types
get_relationship_table()
Get the full relationship table for a code type
default_col_filters()
Default column filters
get_col_filters()
Extract column filters from database metadata

Workbench management

Connect to and manage the codeminer workbench (persistent DuckDB connection).

codeminer_connect()
Connect to the codeminer workbench
codeminer_disconnect()
Disconnect the codeminer workbench
codeminer_status()
Show workbench status
codeminer_refresh_cache()
Refresh the metadata cache
codeminer_set_version()
Pin table versions for the session
codeminer_clear_versions()
Clear active version selections
codeminer_set_col_filters()
Pin column filters for the session
codeminer_clear_col_filters()
Clear all pinned column filters
with_col_filters()
Temporarily override column filters
codeminer_snapshot_extra()
Create a snapshot of the extra database

Database management

Build a local database with lookup and mapping tables for various clinical coding systems.

get_ukb_resource_592()
Get UK Biobank resource 592 directly from UK Biobank website
read_ukb_resource_592()
Read UK Biobank Resource 592 clinical code mappings
add_ukb_resource_592()
Add UK Biobank Resource 592 tables to CodeMiner database
get_snomed_ct_uk_monolith()
Get SNOMED CT UK Monolith Edition from NHS TRUD
read_snomed_ct_uk_monolith()
Read the SNOMED CT UK Monolith Edition into R
add_snomed_ct_uk_monolith()
Add SNOMED CT UK Monolith tables to CodeMiner database
read_all_lkps_maps()
Read UK Biobank resource 592 into a named list
build_all_lkps_maps()
Build named list of clinical code look up and mapping tables
all_lkps_maps_to_db()
Build a Duckdb database of clinical code look up and mapping tables
build_database()
Build the Codeminer database
dummy_ukb_resource_592_path()
Get path to dummy UK Biobank Resource 592 file
create_dummy_database()
Create a dummy database
add_lookup_table()
Add a lookup table to the database
remove_lookup_table()
Remove a lookup table from the database
lookup_metadata()
Create lookup metadata
update_lookup_metadata()
Update lookup table metadata
add_mapping_table()
Add a mapping table to the database
remove_mapping_table()
Remove a mapping table from the database
mapping_metadata()
Create mapping metadata
update_mapping_metadata()
Update mapping table metadata
add_relationship_table()
Add a relationship table to the database
remove_relationship_table()
Remove a relationship table from the database
relationship_metadata()
Create relationship metadata
update_relationship_metadata()
Update relationship table metadata
get_codeminer_metadata()
Get codeminer metadata

Dummy data

Dummy data for tests.

build_all_lkps_maps_dummy()
Create a dummy all_lkps_maps
read_all_lkps_maps_dummy()
Read dummy UK Biobank resource 592 into R
read_icd10_phecode_map_dummy()
Read dummy Phecode Map 1.2 with ICD-10 codes (beta) file into R
read_phecode_lkp_dummy()
Read dummy Phecode definitions file into R
read_ukb_codings_dummy()
Read dummy UK Biobank codings into R
dummy_all_lkps_maps_db()
Set up a dummy all_lkps_maps database
dummy_clinical_events_tidy()
Dummy UK Biobank clinical events, tidied
dummy_icd10_phecode_map_path()
Dummy Phecode Map 1.2 with ICD-10 codes (beta) file path
dummy_phecode_lkp_path()
Dummy Phecode definitions file path
dummy_snomed_ct_uk_monolith_path()
Get full path to the dummy SNOMED CT GPS RF2 files
dummy_ukb_codings_path()
Dummy UK Biobank codings file path
dummy_ukb_resource_592_path()
Get path to dummy UK Biobank Resource 592 file
example_ontology
Example ontology data

Utilities

Miscellaneous utility functions.

`%AND%` `%OR%` `%NOT%`
Infix set operations
codeminer_metadata()
Metadata
get_bnf_from_open_prescribing()
Get the BNF terminology from OpenPrescribing
get_nhsbsa_snomed_bnf()
Download and read the NHSBSA BNF_SNOMED mapping file
get_ukb_self_report_med_to_atc_map()
Download and read a UKB welf-reported medication code to ATC mapping file
get_phecode_definitions()
Download the Phecode 1.2 definitions file
get_phecode_icd9_map()
Download the Phecode 1.2 to ICD9 mapping file
get_phecode_icd10_map()
Download the Phecode 1.2 to ICD10 (beta) mapping file
icd10() icd9() read3() read2() sct() opcs4() phecode() read2_drugs() bnf() dmd() data_coding_3() data_coding_4() data_coding_5() data_coding_6() medcode_aurum() prodcode_aurum()
With Code Type Functions
start_api()
Start Plumber API