This is a convenience function that calls the LLM to determine the domain of the concept set target, and then either calls createNonDrugConceptSet() or createDrugConceptSet(), depending on the domain.

createConceptSet(
  name,
  seedConceptIds = NULL,
  clinicalDefinition = NULL,
  llmClient,
  connectionDetails,
  vocabDatabaseSchema,
  tempEmulationSchema = getOption("sqlRenderTempEmulationSchema"),
  cacheFolder = NULL,
  excludedVocabularyIds = c("ICDO3"),
  seedConceptFinder = DefaultSeedConceptFinder$new(),
  conceptRecommender = HecateConceptRecommender$new(),
  maxNforAdjudication = 5000,
  conceptAdjudicator = DefaultConceptAdjudicator$new(),
  condenseConceptSet = TRUE,
  fuzzyVocabSearchType = "HECATE",
  batchSize = 20
)

Arguments

name

The name of the concept set to create. This should be an informative name reflecting the concept set target (the idea expressed by the concept set).

seedConceptIds

Optional: a set of one or more concept IDs that resemble the concept set target.

clinicalDefinition

Optional: a clinical definition of the concept set target.

llmClient

An ellmer chat object to connect to a large language model, as created for example using ellmer::chat_ollama().

connectionDetails

An object with details for connecting to a database server, as created using DatabaseConnector::createConnectionDetails().

vocabDatabaseSchema

The database and or schema where the OHDSI Vocabulary tables are loaded.

tempEmulationSchema

For database platforms that do not natively support temp tables, a database schema where the user has write access.

cacheFolder

Optional: Folder where intermediary results can be stored.

excludedVocabularyIds

Character vector of OHDSI Vocabulary names to exclude.

seedConceptFinder

An object of class SeedConceptFinder for finding seed concepts when not provided.

conceptRecommender

An object of class ConceptRecommender for recommending additional concepts.

maxNforAdjudication

If the number of concepts to adjudicate is greater than this number, a warning of class TooManyConceptsWarning is thrown, and the concept set will be simplified to the first seed concept plus descendants.

conceptAdjudicator

An object of class ConceptAdjudicator for adjudicating recommended concepts.

condenseConceptSet

Condense the resulting concept set?

fuzzyVocabSearchType

For drugs: type of fuzzy vocabulary search. Currently only 'HECATE' is supported.

batchSize

For drugs: The size of the batches fed to the LLM for adjudication.

Value

A concept set expression