excludeConcepts: Exclude concepts from a codelist

View source: R/excludeConcepts.R

excludeConceptsR Documentation

Exclude concepts from a codelist

Description

Exclude concepts from a codelist

Usage

excludeConcepts(x, cdm, concepts, codelistName = NULL)

Arguments

x

A codelist.

cdm

A cdm reference to an OMOP CDM dataset. If data is held within a database, the vocabulary tables should be in the same schema as the clinical tables (person, observation period, and so on).

concepts

Concepts_id to exclude

codelistName

Name or names of codelist in x. If NULL, all codelist present in x will be considered.

Value

A codelist

Examples


library(omock)
library(CDMConnector)

# Creating CDM object
# downloadMockDataset(datasetName = "GiBleed")
cdm <- mockCdmFromDataset(datasetName = "GiBleed")

# Creating codelist
codelist <- getDrugIngredientCodes(cdm,
                                   nameStyle = "{concept_name}")

# Exclude concept to all the codelists:
codelist$acetaminophen
codelist <- codelist |>
  excludeConcepts(cdm, concepts = c(1125315L))
codelist$acetaminophen
# Add a concept to a specific codelist
codelist$amiodarone
codelist <- codelist |>
  excludeConcepts(cdm, concepts = c(1310034L), codelistName = "amiodarone")
codelist$amiodarone

# See function: `addConcepts()` for details on how to add specific concepts
# to a codelist


CodelistGenerator documentation built on Dec. 17, 2025, 5:06 p.m.