Loads or creates a concept set manifest from CIRCE JSON files located in the inputs/conceptSets/json folder. The manifest is stored in an SQLite database for efficient querying and metadata persistence. ExecutionSettings are optional and only required if you plan to extract source codes or access vocabularies.
Usage
loadConceptSetManifest(
conceptSetsFolderPath = here::here("inputs/conceptSets"),
executionSettings = NULL
)Arguments
- conceptSetsFolderPath
Character. Path to the conceptSets folder containing the manifest database. Defaults to "inputs/conceptSets".
- executionSettings
ExecutionSettings object. Optional. Defaults to NULL. Only required for operations like extractSourceCodes(). You can add settings later using setExecutionSettings() on the returned ConceptSetManifest object.
Details
Workflow:
Checks if conceptSetManifest.sqlite database exists
If it exists, loads concept set entries from the json/ directory using cached metadata
If not, scans the json/ directory for CIRCE JSON files
Creates ConceptSetDef objects for each JSON file
Enriches metadata from conceptSetsLoad.csv if available
Returns a ConceptSetManifest object
Metadata CSV Format: The conceptSetsLoad.csv file (optional) should contain:
file_name: Relative path to JSON file (e.g., "conceptSet1.json")label: Display name for the concept setatlasId: ATLAS concept set IDdomain: OMOP domain classificationsourceCode: Whether the concept set represents source codes
Post-Load: After loading, use manifest methods to query concept sets:
getConceptSetById(id)- Get by database IDgetConceptSetsByTag(key, value)- Get by metadata taggrabConceptSetById(id)- Get ConceptSetDef object
Examples
if (FALSE) {
# Load concept set manifest (no settings required for metadata review)
manifest <- loadConceptSetManifest()
# Or load from custom path
manifest <- loadConceptSetManifest(conceptSetsFolderPath = "path/to/conceptsets")
# Add execution settings later if needed for source code extraction
settings <- createExecutionSettings(
connectionString = "Server=localhost;Database=mydb"
)
manifest$setExecutionSettings(settings)
manifest$extractSourceCodes(sourceVocabs = c("ICD10CM"))
}