This study package demonstrates how to currently use CohortDiagnostics in a package. The package only contains code to run StudyDiagnostics.
To modify the package to include the cohorts of interest, take these steps:
Copy/download the examplePackage folder. For example, download the Zip file here, open it, and locate the examplePackage folder and extract it.
Change the package name as needed. Most importantly:
Package:
field in the DESCRIPTION file, packageName
argument in the R/CohortDiagnostics file, andlibrary()
call at the top of extras/CodeToRun.ROpen the R project in R studio (e.g. by double-clicking on the .Rproj file).
Modify inst/settings/CohortsToCreate.csv to include only those cohorts you are interested in. Fill in each of the four columns:
Run this code (note, this can also be found in extras/PackageMaintenance.R):
```r
install.packages("devtools") devtools::install_github("ROhdsiWebApi")
ROhdsiWebApi::insertCohortDefinitionSetInPackage(fileName = "inst/settings/CohortsToCreate.csv", baseUrl = , insertTableSql = TRUE, insertCohortCreationR = TRUE, generateStats = TRUE, packageName = ) ```
Where <baseUrl>
is the base URL for the WebApi instance, for example: "http://server.org:80/WebAPI", and <package name>
is the name of your new package.
You can now build your package. See extras/CodeToRun.R on how to run the package.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.