View source: R/get_candidate_codes.R
get_candidate_codes | R Documentation |
This function generates a set of codes that can be considered for creating a phenotype using the OMOP CDM.
get_candidate_codes( keywords, domains = c("Condition", "Drug", "Device", "Observation", "Procedure"), search.synonyms = FALSE, fuzzy.match = FALSE, fuzzy.match.max.distance = 0.1, exclude = NULL, include.descendants = TRUE, include.ancestor = FALSE, db, vocabulary_database_schema )
keywords |
Character vector of words to search for. Where more than one word is given (e.g. "knee osteoarthritis"), all words will be identified but can be in different positions (e.g. "osteoarthritis of knee") should be identified. |
domains |
Character vector with one or more of the OMOP CDM domain (e.g. "Condition"). |
search.synonyms |
Either TRUE or FALSE. If TRUE the code will also search via the concept synonym table. |
fuzzy.match |
Either TRUE or FALSE. If TRUE the fuzzy matches will be used, with approximate matches identified. |
fuzzy.match.max.distance |
The max.distance parmeter for fuzzy matching (see ??base::agrep for further details). |
exclude |
Character vector of words to search for to identify concepts to exclude. |
include.descendants |
Either TRUE or FALSE. If TRUE descendant concepts of identified concepts will be included in the candidate codelist. |
include.ancestor |
Either TRUE or FALSE. If TRUE the direct ancestor concepts of identified concepts will be included in the candidate codelist. |
db |
Database connection via DBI::dbConnect() |
vocabulary_schema |
Name of database schema with vocab tables |
Dataframe
untar(xzfile(system.file("sqlite", "cdm.tar.xz", package = "Eunomia"), open = "rb"), exdir = tempdir()) db <- dbConnect(RSQLite::SQLite(), paste0(tempdir(),"\\cdm.sqlite")) vocabulary_database_schema<-"main" get_candidate_codes(keywords="asthma", db=db, vocabulary_schema = "main") get_candidate_codes(keywords="asthma", search.synonyms=TRUE, fuzzy.match=TRUE, exclude=NULL, include.descendants=TRUE, include.ancestor=FALSE, db=db, vocabulary_database_schema = "main")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.