CohortGenerator
Cohort Generation for the OMOP Common Data Model
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.2%) to scientific vocabulary
Keywords
Repository
Cohort Generation for the OMOP Common Data Model
Basic Info
- Host: GitHub
- Owner: OHDSI
- Language: R
- Default Branch: main
- Homepage: https://ohdsi.github.io/CohortGenerator/
- Size: 10.8 MB
Statistics
- Stars: 14
- Watchers: 9
- Forks: 14
- Open Issues: 36
- Releases: 17
Topics
Metadata Files
README.md
CohortGenerator
CohortGenerator is part of HADES.
Introduction
This R package contains functions for generating cohorts and cohort subsets using data in the CDM.
Features
- Create a cohort table and generate cohorts against an OMOP CDM.
- Get the count of subjects and events in a cohort.
- Define subsets of cohorts using different criteria or other cohorts.
- Provides functions for performing incremental tasks. This is used by CohortGenerator to skip any cohorts that were successfully generated in a previous run. This functionality is generic enough for other packages to use for performing their own incremental tasks.
Example
``` r
First construct a cohort definition set: an empty
data frame with the cohorts to generate
cohortsToCreate <- CohortGenerator::createEmptyCohortDefinitionSet()
Fill the cohort set using cohorts included in this
package as an example
cohortJsonFiles <- list.files(path = system.file("testdata/name/cohorts", package = "CohortGenerator"), full.names = TRUE) for (i in 1:length(cohortJsonFiles)) { cohortJsonFileName <- cohortJsonFiles[i] cohortName <- tools::filepathsans_ext(basename(cohortJsonFileName)) # Here we read in the JSON in order to create the SQL # using CirceR # If you have your JSON and SQL stored differenly, you can # modify this to read your JSON/SQL files however you require cohortJson <- readChar(cohortJsonFileName, file.info(cohortJsonFileName)$size) cohortExpression <- CirceR::cohortExpressionFromJson(cohortJson) cohortSql <- CirceR::buildCohortQuery(cohortExpression, options = CirceR::createGenerateOptions(generateStats = FALSE)) cohortsToCreate <- rbind(cohortsToCreate, data.frame(cohortId = i, cohortName = cohortName, sql = cohortSql, stringsAsFactors = FALSE)) }
Generate the cohort set against Eunomia.
cohortsGenerated contains a list of the cohortIds
successfully generated against the CDM
connectionDetails <- Eunomia::getEunomiaConnectionDetails()
Create the cohort tables to hold the cohort generation results
cohortTableNames <- CohortGenerator::getCohortTableNames(cohortTable = "mycohorttable") CohortGenerator::createCohortTables(connectionDetails = connectionDetails, cohortDatabaseSchema = "main", cohortTableNames = cohortTableNames)
Generate the cohorts
cohortsGenerated <- CohortGenerator::generateCohortSet(connectionDetails = connectionDetails, cdmDatabaseSchema = "main", cohortDatabaseSchema = "main", cohortTableNames = cohortTableNames, cohortDefinitionSet = cohortsToCreate)
Get the cohort counts
cohortCounts <- CohortGenerator::getCohortCounts(connectionDetails = connectionDetails, cohortDatabaseSchema = "main", cohortTable = cohortTableNames$cohortTable) print(cohortCounts) ```
Technology
CohortGenerator is an R package.
System requirements
Requires R (version 3.6.0 or higher).
Getting Started
Make sure your R environment is properly configured. This means that Java must be installed. See these instructions for how to configure your R environment.
In R, use the following commands to download and install CohortGenerator:
r remotes::install_github("OHDSI/CohortGenerator")
User Documentation
Documentation can be found on the package website.
PDF versions of the documentation are also available:
- Vignette: Generating Cohorts
- Package manual: CohortGenerator.pdf
Support
- Developer questions/comments/feedback: OHDSI Forum
- We use the GitHub issue tracker for all bugs/issues/enhancements
Contributing
Read here how you can contribute to this package.
License
CohortGenerator is licensed under Apache License 2.0
Development
This package is being developed in RStudio.
Development status
Beta
Owner
- Name: Observational Health Data Sciences and Informatics
- Login: OHDSI
- Kind: organization
- Website: http://ohdsi.org
- Repositories: 285
- Profile: https://github.com/OHDSI
GitHub Events
Total
- Create event: 16
- Release event: 2
- Issues event: 22
- Watch event: 2
- Delete event: 8
- Member event: 1
- Issue comment event: 23
- Push event: 140
- Pull request review comment event: 15
- Pull request review event: 17
- Pull request event: 27
- Fork event: 5
Last Year
- Create event: 16
- Release event: 2
- Issues event: 22
- Watch event: 2
- Delete event: 8
- Member event: 1
- Issue comment event: 23
- Push event: 140
- Pull request review comment event: 15
- Pull request review event: 17
- Pull request event: 27
- Fork event: 5
Issues and Pull Requests
Last synced: 9 months ago
All Time
- Total issues: 88
- Total pull requests: 122
- Average time to close issues: 3 months
- Average time to close pull requests: 26 days
- Total issue authors: 20
- Total pull request authors: 10
- Average comments per issue: 1.67
- Average comments per pull request: 0.94
- Merged pull requests: 92
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 21
- Pull requests: 33
- Average time to close issues: 8 days
- Average time to close pull requests: 3 days
- Issue authors: 7
- Pull request authors: 5
- Average comments per issue: 0.19
- Average comments per pull request: 0.27
- Merged pull requests: 20
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- anthonysena (28)
- azimov (13)
- schuemie (10)
- gowthamrao (10)
- ablack3 (4)
- chrisknoll (4)
- ericaVoss (2)
- catalamarti (2)
- mdlavallee92 (2)
- ob325 (2)
- jreps (2)
- edward-burn (1)
- FredAC24 (1)
- mgkahn (1)
- jmb01 (1)
Pull Request Authors
- anthonysena (86)
- azimov (24)
- FredAC24 (4)
- gowthamrao (2)
- mdlavallee92 (1)
- javier-gracia-tabuenca-tuni (1)
- mgkahn (1)
- chrisknoll (1)
- schuemie (1)
- ablack3 (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 551 last-month
- Total docker downloads: 245
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 4
- Total maintainers: 1
cran.r-project.org: CohortGenerator
Cohort Generation for the OMOP Common Data Model
- Homepage: https://ohdsi.github.io/CohortGenerator/
- Documentation: http://cran.r-project.org/web/packages/CohortGenerator/CohortGenerator.pdf
- License: Apache License version 1.1 | Apache License version 2.0 [expanded from: Apache License]
-
Latest release: 0.12.1
published 10 months ago
Rankings
Maintainers (1)
Dependencies
- actions/cache v2 composite
- actions/checkout v2 composite
- actions/create-release v1 composite
- actions/download-artifact v2 composite
- actions/upload-artifact v2 composite
- r-lib/actions/setup-pandoc v1 composite
- r-lib/actions/setup-r v1 composite
- r-lib/actions/setup-tinytex v1 composite
- actions/checkout v2 composite
- r-lib/actions/check-r-package v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- r-lib/actions/setup-tinytex v2 composite
- c-hive/gha-remove-artifacts v1 composite
- DatabaseConnector >= 5.0.0 depends
- R >= 3.6.0 depends
- ParallelLogger >= 3.0.0 imports
- RJSONIO * imports
- SqlRender >= 1.7.0 imports
- bit64 * imports
- checkmate * imports
- digest * imports
- dplyr * imports
- lubridate * imports
- readr >= 2.1.0 imports
- rlang * imports
- stringi >= 1.7.6 imports
- CirceR >= 1.1.1 suggests
- Eunomia * suggests
- ROhdsiWebApi * suggests
- knitr * suggests
- rmarkdown * suggests
- testthat * suggests