Learn R Programming

CodelistGenerator (version 3.5.0)

getCandidateCodes: Generate a candidate codelist

Description

This function generates a set of codes that can be considered for creating a phenotype using the OMOP CDM.

Usage

getCandidateCodes(
  cdm,
  keywords,
  exclude = NULL,
  domains = "Condition",
  standardConcept = "Standard",
  searchInSynonyms = FALSE,
  searchNonStandard = FALSE,
  includeDescendants = TRUE,
  includeAncestor = FALSE
)

Value

A tibble with the information on the potential codes of interest.

Arguments

cdm

A cdm reference via CDMConnector.

keywords

Character vector of words to search for. Where more than one word is given (e.g. "knee osteoarthritis"), all combinations of those words should be identified positions (e.g. "osteoarthritis of knee") should be identified.

exclude

Character vector of words to identify concepts to exclude.

domains

Character vector with one or more of the OMOP CDM domain. If NULL, all supported domains are included: Condition, Drug, Procedure, Device, Observation, and Measurement.

standardConcept

Character vector with one or more of "Standard", "Classification", and "Non-standard". These correspond to the flags used for the standard_concept field in the concept table of the cdm.

searchInSynonyms

Either TRUE or FALSE. If TRUE the code will also search using both the primary name in the concept table and synonyms from the concept synonym table.

searchNonStandard

Either TRUE or FALSE. If TRUE the code will also search via non-standard concepts.

includeDescendants

Either TRUE or FALSE. If TRUE descendant concepts of identified concepts will be included in the candidate codelist. If FALSE only direct mappings from ICD-10 codes to standard codes will be returned.

includeAncestor

Either TRUE or FALSE. If TRUE the direct ancestor concepts of identified concepts will be included in the candidate codelist.

Examples

Run this code
# \donttest{
cdm <- CodelistGenerator::mockVocabRef()
CodelistGenerator::getCandidateCodes(
  cdm = cdm,
  keywords = "osteoarthritis"
 )
# }

Run the code above in your browser using DataLab