write_crosswalk_table: Write a Crosswalk Table

View source: R/crosswalk.R

write_crosswalk_tableR Documentation

Write a Crosswalk Table

Description

Subset the MRCONSO table by vocabulary and reduce the rows to 1 str per code. All original fields from the MRCONSO table are preserved. Crosswalks can then be performed by cui between vocabularies. This function assumes that the core metathesaurus tables are within a umls schema. Note that any source sab value that contains punctuation other than an underscore is replaced with an underscore to write tables with names that Postgres can accept.

Usage

write_crosswalk_table(
  sab,
  crosswalk_schema = "umls_crosswalk",
  conn_fun = "pg13::local_connect(verbose = FALSE)",
  tty_ranking,
  log_schema = "public",
  log_table_name = "setup_umls_log",
  crosswalk_log_table_name = "setup_umls_crosswalk_log",
  verbose = TRUE,
  render_sql = TRUE
)

Arguments

sab

Vocabulary.

crosswalk_schema

Schema to which these extension tables are to be written.

tty_rank

(Optional). Vector of case insensitive tty values for the given sab in the order of rank. Any invalid tty values are skipped and those not included in the tty_rank vector are subranked after. If not provided, the function defaults to the rank given to the sab in the MRRANK table in descending order.

Value

A table named by sab is written to the crosswalk_schema. If sab value contained any punctuation, it is replaced with an underscore.


meerapatelmd/metathesaurus documentation built on May 23, 2022, 7:41 a.m.