subsetToCodesInUse {CodelistGenerator}R Documentation

Use achilles counts to filter a codelist to keep only the codes used in the database

Description

Use achilles counts to filter a codelist to keep only the codes used in the database

Usage

subsetToCodesInUse(
  x,
  cdm,
  minimumCount = 0L,
  table = c("condition_occurrence", "device_exposure", "drug_exposure", "measurement",
    "observation", "procedure_occurrence", "visit_occurrence")
)

Arguments

x

A codelist

cdm

cdm_reference via CDMConnector

minimumCount

Any codes with a frequency under this will be removed.

table

cdm table

Value

Use achilles counts to filter codelist to only the codes used in the database

Examples

## Not run: 
cdm <- mockVocabRef("database")
codes <- getCandidateCodes(cdm = cdm,
                           keywords = "arthritis",
                           domains = "Condition",
                           includeDescendants = FALSE)
x <- subsetToCodesInUse(list("cs1" = codes$concept_id,
                               "cs2" = 999),
                                cdm = cdm)

x
CDMConnector::cdmDisconnect(cdm)

## End(Not run)

[Package CodelistGenerator version 3.1.0 Index]