Add CPRD Aurum code browser tables to CodeMiner database
Source:R/add_cprd_aurum.R
add_cprd_aurum.RdReads a CPRD Aurum code browser release and adds the medcode and prodcode
lookup tables, and their mappings to SNOMED CT and Read v2, to the active
CodeMiner database. This is a convenience wrapper around
read_cprd_aurum() that calls add_lookup_table() and
add_mapping_table(). Tables that already exist for the version are
skipped.
Usage
add_cprd_aurum(
path,
tables = cprd_aurum_tables(),
version = NULL,
source = "CPRD Aurum code browser"
)Arguments
- path
Path to the CPRD Aurum code browser release directory, containing
CPRDAurumMedical.txtandCPRDAurumProduct.txt. Only the files needed fortablesmust be present.- tables
Character vector of tables to read. Any of
"cprd_aurum_medcode_lkp","cprd_aurum_prodcode_lkp","cprd_aurum_medcode_snomed","cprd_aurum_medcode_read2"and"cprd_aurum_prodcode_snomed". Defaults to all of them. Themedcodetables come fromCPRDAurumMedical.txtand theprodcodetables fromCPRDAurumProduct.txt.- version
Character string for the version label. If
NULL(default), the release date (yyyymm) is taken from a directory name likeCPRD_CodeBrowser_YYYYMM_Aurum, with a message saying which version is used. If the name doesn't include a release date, an error asks forversionto be supplied.- source
Character string for the data source.
Value
Invisibly returns the result from read_cprd_aurum() for the
tables that were added (a named list of tables with metadata), or NULL
if they all existed already.
Details
CPRD supplies the code browser to researchers with access to its data, so
path is required. Check your CPRD data access agreement before sharing a
database that contains these tables.
Examples
if (FALSE) { # \dontrun{
build_database()
add_cprd_aurum("path/to/CPRD_CodeBrowser_YYYYMM_Aurum")
} # }