Learn R Programming

CodelistGenerator (version 4.0.0)

asCodelist: Coerce to a codelist

Description

Coerce to a codelist

Usage

asCodelist(x, ...)

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

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

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

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

Value

codelist

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

Examples

Run this code
# \donttest{
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)

# }

Run the code above in your browser using DataLab