View source: R/subsetOnDoseForm.R
| subsetOnDoseForm | R Documentation |
Subset a codelist to only those codes from a particular domain.
subsetOnDoseForm(x, cdm, doseForm, negate = FALSE)
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). |
doseForm |
Dose form/s. See |
negate |
If FALSE, only concepts with the dose form specified will be returned. If TRUE, concepts with the dose form specified will be excluded. |
The codelist with only those concepts associated with the dose form (if negate = FALSE) or the codelist without those concepts associated with the dose form (if negate = TRUE).
library(CodelistGenerator)
library(omopgenerics)
cdm <- mockVocabRef()
codelist <- newCodelist(list("codes" = c(10L,20L,21L)))
# Dose forms present in our codelist:
codelist |> associatedDoseForms(cdm)
codes <- subsetOnDoseForm(
x = codelist,
cdm = cdm,
doseForm = "Injection")
codes
codes |> associatedDoseForms(cdm)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.