addCodelistAttribute {PhenotypeR} | R Documentation |
'addCodelistAttribute()' allows the users to add a codelist to a cohort in OMOP CDM.
This is particularly important for the use of 'codelistDiagnostics()', as the underlying assumption is that the cohort that is fed into 'codelistDiagnostics()' has a cohort_codelist attribute attached to it.
addCodelistAttribute(cohort, codelist, cohortName = names(codelist))
cohort |
Cohort table in a cdm reference |
codelist |
Named list of concepts |
cohortName |
For each element of the codelist, the name of the cohort in 'cohort' to which the codelist refers |
A cohort
library(IncidencePrevalence)
cdm <- mockIncidencePrevalenceRef(sampleSize = 1000)
cohort <- addCodelistAttribute(cohort = cdm$outcome, codelist = list("cohort_1" = 1L))
CDMConnector::cdm_disconnect(cdm)