findOrphanCodes: Find orphan codes related to a codelist

View source: R/findOrphanCodes.R

findOrphanCodesR Documentation

Find orphan codes related to a codelist

Description

Find orphan codes related to a codelist

Usage

findOrphanCodes(
  x,
  cdm,
  domains = "Condition",
  standardConcept = "Standard",
  searchInSynonyms = TRUE,
  searchNonStandard = TRUE,
  includeDescendants = TRUE,
  includeAncestor = TRUE,
  minCellCount = 5
)

Arguments

x

Codes for which to find codes related but not included (orphan codes)

cdm

cdm_reference via CDMConnector

domains

Character vector with one or more of the OMOP CDM domain.

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.

includeAncestor

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

minCellCount

The minimum number of counts to reported, below which results will be suppressed. If 0, all results will be reported.

Value

A codelist containing code related to (but not in) the target codelist that are present used in the cdm

Examples

## Not run: 
cdm <- mockVocabRef("database")
codes <- getCandidateCodes(cdm = cdm,
keywords = "Musculoskeletal disorder",
domains = "Condition",
includeDescendants = FALSE)

orphan_codes <- findOrphanCodes(x = list("msk" = codes$concept_id),
cdm = cdm,
domains = "Condition",
standardConcept = "Standard",
searchInSynonyms = FALSE,
searchNonStandard = FALSE,
includeDescendants = TRUE,
includeAncestor = FALSE)

orphan_codes
CDMConnector::cdmDisconnect(cdm)

## End(Not run)

oxford-pharmacoepi/CodelistGenerator documentation built on April 12, 2024, 9:30 a.m.