asCodelist: Coerce to a codelist

View source: R/asCodelist.R

asCodelistR Documentation

Coerce to a codelist

Description

Coerce to a codelist

Usage

asCodelist(x, ...)

## S3 method for class 'codelist'
asCodelist(x, ...)

## S3 method for class 'codelist_with_details'
asCodelist(x, ...)

## S3 method for class 'concept_set_expression'
asCodelist(x, cdm, ...)

## S3 method for class 'candidate_codes'
asCodelist(x, ...)

Arguments

x

Only codelist_with_details and candidate_codes are currently supported.

...

For extensibility

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).

Value

codelist

Examples


library(omock)
library(CDMConnector)

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

# Create codelist from a codelist_with_details
codelist <- getDrugIngredientCodes(cdm,
                                   name = "acetaminophen",
                                   nameStyle = "{concept_name}",
                                   type = "codelist_with_details")

asCodelist(codelist)

# Create codelist from a candidate_codes
codelist <- getCandidateCodes(cdm,
                              keywords = "arthritis")

asCodelist(codelist)



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