### Example Usage of downloadEunomiaData Source: https://ohdsi.github.io/Eunomia/reference/downloadEunomiaData.html An example demonstrating how to call the `downloadEunomiaData` function to download the 'GiBleed' dataset. This example is wrapped in a conditional to prevent accidental execution. ```r if (FALSE) { # \dontrun{ downloadEunomiaData("GiBleed") } # } ``` -------------------------------- ### Example Usage of extractLoadData Source: https://ohdsi.github.io/Eunomia/reference/extractLoadData.html Demonstrates how to call the `extractLoadData` function to extract data from a specified .ZIP file. This example is non-runnable by default and requires the path to the .ZIP file. ```r if (FALSE) { # \dontrun{ extractLoadData("c:/strategusData/GiBleed_5.3.zip") } # } ``` -------------------------------- ### Connect to Eunomia and Query Data Source: https://ohdsi.github.io/Eunomia/index.html Demonstrates how to get Eunomia connection details, establish a connection, query the 'person' table, list table names, and disconnect. Use 'main' as the database schema when required. ```r library(Eunomia) connectionDetails <- getEunomiaConnectionDetails() connection <- connect(connectionDetails) querySql(connection, "SELECT COUNT(*) FROM person;") # COUNT(*) #1 2694 getTableNames(connection,databaseSchema = 'main') disconnect(connection) ``` -------------------------------- ### Connect to Eunomia Dataset using SQLite Source: https://ohdsi.github.io/Eunomia/reference/getDatabaseFile.html Demonstrates how to connect to a Eunomia dataset using SQLite as the database system. The dataset 'GiBleed' is used as an example. ```r conn <- DBI::dbConnect(RSQLite::SQLite(), getDatabaseFile("GiBleed")) DBI::dbDisconnect(conn) ``` -------------------------------- ### Connect to Eunomia Dataset using DuckDB Source: https://ohdsi.github.io/Eunomia/reference/getDatabaseFile.html Demonstrates how to connect to a Eunomia dataset using DuckDB as the database system. The dataset 'GiBleed' is used as an example. ```r conn <- DBI::dbConnect(duckdb::duckdb(), getDatabaseFile("GiBleed", dbms = "duckdb")) DBI::dbDisconnect(conn, shutdown = TRUE) ``` -------------------------------- ### Install Eunomia Package Source: https://ohdsi.github.io/Eunomia/index.html Installs the Eunomia R package from CRAN. Ensure your R environment is configured, including Java, before installation. ```r install.packages("Eunomia") ``` -------------------------------- ### Connect to Eunomia Dataset using DatabaseConnector Source: https://ohdsi.github.io/Eunomia/reference/getDatabaseFile.html Demonstrates how to connect to a Eunomia dataset using the DatabaseConnector package with SQLite. The dataset 'GiBleed' is used as an example. ```r conn <- DatabaseConnector::connect(dbms = "sqlite", server = getDatabaseFile("GiBleed")) DatabaseConnector::disconnect(conn) ``` -------------------------------- ### Get Database File Function Signature Source: https://ohdsi.github.io/Eunomia/reference/getDatabaseFile.html This is the function signature for getDatabaseFile, showing its parameters and default values. ```r getDatabaseFile( datasetName, cdmVersion = "5.3", pathToData = Sys.getenv("EUNOMIA_DATA_FOLDER"), dbms = "sqlite", databaseFile = tempfile(fileext = paste0(".", dbms)), inputFormat = "csv", verbose = FALSE, overwrite = TRUE ) ``` -------------------------------- ### Get Eunomia Connection Details Function Signature Source: https://ohdsi.github.io/Eunomia/reference/getEunomiaConnectionDetails.html This snippet shows the function signature for getEunomiaConnectionDetails, including its parameters and their default values. It is used to create a copy of the default Eunomia database. ```r getEunomiaConnectionDetails( databaseFile = tempfile(fileext = ".sqlite"), dbms = "sqlite", overwrite = FALSE ) ``` -------------------------------- ### getDatabaseFile Source: https://ohdsi.github.io/Eunomia/reference/getDatabaseFile.html Creates a copy of a Eunomia database, and returns the path to the new database file. If the dataset does not yet exist on the user's computer it will attempt to download the source data to the the path defined by the EUNOMIA_DATA_FOLDER environment variable. ```APIDOC ## Function: getDatabaseFile ### Description Creates a copy of a Eunomia database, and returns the path to the new database file. If the dataset does not yet exist on the user's computer it will attempt to download the source data to the the path defined by the EUNOMIA_DATA_FOLDER environment variable. ### Arguments * **datasetName** (string) - Required - The data set name as found on https://github.com/OHDSI/EunomiaDatasets. The data set name corresponds to the folder with the data set ZIP files. * **cdmVersion** (string) - Optional - The OMOP CDM version. This version will appear in the suffix of the data file, for example: _.zip. Default: '5.3'. * **pathToData** (string) - Optional - The path where the Eunomia data is stored on the file system. By default the value of the environment variable "EUNOMIA_DATA_FOLDER" is used. * **dbms** (string) - Optional - The database system to use. "sqlite" (default) or "duckdb". * **databaseFile** (string) - Optional - The path where the database file will be copied to. By default, the database will be copied to a temporary folder, and will be deleted at the end of the R session. * **inputFormat** (string) - Optional - The format of the files expected in the archive. (csv or parquet). * **verbose** (boolean) - Optional - Provide additional logging details during execution. * **overwrite** (boolean) - Optional - Remove and replace an existing data set. ### Value The file path to the new Eunomia dataset copy. ### Examples ```R # Example 1: Using RSQLite if (FALSE) { # \dontrun{ conn <- DBI::dbConnect(RSQLite::SQLite(), getDatabaseFile("GiBleed")) DBI::dbDisconnect(conn) } # Example 2: Using duckdb if (FALSE) { # \dontrun{ conn <- DBI::dbConnect(duckdb::duckdb(), getDatabaseFile("GiBleed", dbms = "duckdb")) DBI::dbDisconnect(conn, shutdown = TRUE) } # Example 3: Using DatabaseConnector if (FALSE) { # \dontrun{ conn <- DatabaseConnector::connect(dbms = "sqlite", server = getDatabaseFile("GiBleed")) DatabaseConnector::disconnect(conn) } ``` ``` -------------------------------- ### downloadEunomiaData() Source: https://ohdsi.github.io/Eunomia/reference/index.html Downloads the necessary data files for the Eunomia package. This is typically the first step before loading data into a database. ```APIDOC ## downloadEunomiaData() ### Description Download Eunomia data files. ### Method Not applicable (R function) ### Endpoint Not applicable (R function) ### Parameters This function does not explicitly list parameters in the provided documentation. ### Request Example ```R downloadEunomiaData() ``` ### Response This function's response is not explicitly detailed in the provided documentation. ``` -------------------------------- ### getDatabaseFile() Source: https://ohdsi.github.io/Eunomia/reference/index.html Creates a copy of a Eunomia dataset. This is useful for creating backups or working copies of the dataset. ```APIDOC ## getDatabaseFile() ### Description Create a copy of a Eunomia dataset. ### Method Not applicable (R function) ### Endpoint Not applicable (R function) ### Parameters This function does not explicitly list parameters in the provided documentation. ### Request Example ```R getDatabaseFile() ``` ### Response This function's response is not explicitly detailed in the provided documentation. ``` -------------------------------- ### getEunomiaConnectionDetails Source: https://ohdsi.github.io/Eunomia/reference/getEunomiaConnectionDetails.html Creates a copy of the default (GiBleed) Eunomia database and provides details for connecting to that copy. This function ensures backwards compatibility with prior releases of the Eunomia default (GiBleed) dataset. ```APIDOC ## getEunomiaConnectionDetails ### Description Creates a copy of the default (GiBleed) Eunomia database and provides details for connecting to that copy. Function provides backwards compatibility to prior releases of Eunomia default (GiBleed) dataset. ### Usage ```R getEunomiaConnectionDetails( databaseFile = tempfile(fileext = ".sqlite"), dbms = "sqlite", overwrite = FALSE ) ``` ### Arguments * **databaseFile** (string) - The path where the database file will be copied to. By default, the database will be copied to a temporary folder, and will be deleted at the end of the R session. * **dbms** (string) - The target dialect, by default "sqlite". * **overwrite** (boolean) - Control whether the existing archive file will be overwritten should it already exist. ### Value A ConnectionDetails object, to be used with the `DatabaseConnector` package. ``` -------------------------------- ### extractLoadData() Source: https://ohdsi.github.io/Eunomia/reference/index.html Extracts Eunomia data files from a ZIP archive and loads them into a new OMOP CDM database. The database is created in the same directory as the ZIP file. ```APIDOC ## extractLoadData() ### Description Extract the Eunomia data files and load into a database. Extract files from a .ZIP file and creates a OMOP CDM database that is then stored in the same directory as the .ZIP file. ### Method Not applicable (R function) ### Endpoint Not applicable (R function) ### Parameters This function does not explicitly list parameters in the provided documentation. ### Request Example ```R extractLoadData() ``` ### Response This function's response is not explicitly detailed in the provided documentation. ``` -------------------------------- ### extractLoadData Source: https://ohdsi.github.io/Eunomia/reference/extractLoadData.html Extracts data from a specified .ZIP file and creates an OMOP CDM database (SQLite or DuckDB) in the same directory. It supports different CDM versions and input file formats. ```APIDOC ## Function: extractLoadData ### Description Extracts files from a .ZIP file and creates an OMOP CDM database that is then stored in the same directory as the .ZIP file. ### Usage ```R extractLoadData( from, to, dbms = "sqlite", cdmVersion = "5.3", inputFormat = "csv", verbose = FALSE ) ``` ### Arguments * **from** (string) - The path to the .ZIP file that contains the csv CDM source files. * **to** (string) - The path to the .sqlite or .duckdb file that will be created. * **dbms** (string) - The file based database system to use: 'sqlite' (default) or 'duckdb'. * **cdmVersion** (string) - The version of the OMOP CDM that are represented in the archive files. * **inputFormat** (string) - The format of the files expected in the archive. (csv or parquet). * **verbose** (boolean) - Provide additional logging details during execution. ### Value No return value, called to load archive into a database file. ### Examples ```R if (FALSE) { # \dontrun{ extractLoadData("c:/strategusData/GiBleed_5.3.zip") } ``` ``` -------------------------------- ### loadDataFiles() Source: https://ohdsi.github.io/Eunomia/reference/index.html Loads data files into a specified database (SQLite or DuckDB). This function is used after data has been prepared or downloaded. ```APIDOC ## loadDataFiles() ### Description Load data files into a database(sqlite or duckdb). ### Method Not applicable (R function) ### Endpoint Not applicable (R function) ### Parameters This function does not explicitly list parameters in the provided documentation. ### Request Example ```R loadDataFiles() ``` ### Response This function's response is not explicitly detailed in the provided documentation. ``` -------------------------------- ### loadDataFiles Source: https://ohdsi.github.io/Eunomia/reference/loadDataFiles.html Loads CDM data from local files (CSV or Parquet) into a specified SQLite or DuckDB database file. This function is useful for setting up a local CDM instance for testing or development. ```APIDOC ## Function: loadDataFiles ### Description Loads data from CSV or Parquet files into a database file (sqlite or duckdb). ### Usage ```R loadDataFiles( dataPath, dbPath, inputFormat = "csv", cdmVersion = "5.3", cdmDatabaseSchema = "main", dbms = "sqlite", verbose = FALSE, overwrite = FALSE ) ``` ### Arguments * **dataPath** (string) - Required - The path to the directory containing CDM source files (csv or parquet). * **dbPath** (string) - Required - The path to the .sqlite or .duckdb file that will be created. * **inputFormat** (string) - Optional - The input format of the files to load. Supported formats include csv, parquet. Default is "csv". * **cdmVersion** (string) - Optional - The CDM version to create in the resulting database. Supported versions are 5.3 and 5.4. Default is "5.3". * **cdmDatabaseSchema** (string) - Optional - The schema in which to create the CDM tables. Default is "main". * **dbms** (string) - Optional - The file-based database system to use: 'sqlite' (default) or 'duckdb'. Default is "sqlite". * **verbose** (boolean) - Optional - Provide additional logging details during execution. Default is FALSE. * **overwrite** (boolean) - Optional - Remove and replace an existing data set. Default is FALSE. ### Value No return value, loads data into database file. ``` -------------------------------- ### Download Eunomia Data Function Signature Source: https://ohdsi.github.io/Eunomia/reference/downloadEunomiaData.html This snippet shows the signature of the `downloadEunomiaData` function, outlining its parameters and their default values. Use this function to download Eunomia datasets. ```r downloadEunomiaData( datasetName, cdmVersion = "5.3", pathToData = Sys.getenv("EUNOMIA_DATA_FOLDER"), overwrite = FALSE, verbose = FALSE ) ``` -------------------------------- ### Function Signature for extractLoadData Source: https://ohdsi.github.io/Eunomia/reference/extractLoadData.html Defines the parameters for extracting and loading Eunomia data. Use this to specify the source archive, destination database path, database management system, CDM version, input file format, and verbosity. ```r extractLoadData( from, to, dbms = "sqlite", cdmVersion = "5.3", inputFormat = "csv", verbose = FALSE ) ``` -------------------------------- ### BibTeX Citation for Eunomia Package Source: https://ohdsi.github.io/Eunomia/authors.html This is the BibTeX entry for citing the Eunomia R package. Use this in LaTeX documents for academic referencing. ```bibtex @Manual{ title = {Eunomia: Standard Dataset Manager for Observational Medical Outcomes Partnership Common Data Model Sample Datasets}, author = {Frank DeFalco and Martijn Schuemie and Anthony Sena and Natthawut Adulyanukosol and Star Liu and Adam Black}, year = {2025}, note = {R package version 2.1.0, https://github.com/OHDSI/Eunomia}, url = {https://ohdsi.github.io/Eunomia/}, } ``` -------------------------------- ### downloadEunomiaData Source: https://ohdsi.github.io/Eunomia/reference/downloadEunomiaData.html Downloads specified Eunomia data files from the OHDSI EunomiaDatasets GitHub repository. Users can control the dataset name, CDM version, download location, and whether to overwrite existing files. ```APIDOC ## Function: downloadEunomiaData ### Description Downloads the Eunomia data files from https://github.com/OHDSI/EunomiaDatasets. Allows specifying the dataset name, OMOP CDM version, local path for storage, and options to overwrite existing files or enable verbose logging. ### Usage ```R downloadEunomiaData( datasetName, cdmVersion = "5.3", pathToData = Sys.getenv("EUNOMIA_DATA_FOLDER"), overwrite = FALSE, verbose = FALSE ) ``` ### Arguments * **datasetName** (string) - Required - The name of the data set as found on https://github.com/OHDSI/EunomiaDatasets. This corresponds to the folder containing the data set ZIP files. * **cdmVersion** (string) - Optional - The OMOP CDM version. This version is appended to the data file name (e.g., `_.zip`). Defaults to '5.3'. * **pathToData** (string) - Optional - The path on the file system where the Eunomia data will be stored. Defaults to the value of the environment variable "EUNOMIA_DATA_FOLDER". * **overwrite** (boolean) - Optional - If TRUE, overwrites the existing archive file if it already exists. Defaults to FALSE. * **verbose** (boolean) - Optional - If TRUE, provides additional logging details during execution. Defaults to FALSE. ### Value Invisibly returns the destination path if the download was successful. ### Examples ```R # Download the GiBleed dataset downloadEunomiaData("GiBleed") ``` ``` -------------------------------- ### getEunomiaConnectionDetails() Source: https://ohdsi.github.io/Eunomia/reference/index.html Retrieves the default connection details for accessing the Eunomia database. This function simplifies the process of connecting to the dataset. ```APIDOC ## getEunomiaConnectionDetails() ### Description Get Default Eunomia Connection Details. ### Method Not applicable (R function) ### Endpoint Not applicable (R function) ### Parameters This function does not explicitly list parameters in the provided documentation. ### Request Example ```R getEunomiaConnectionDetails() ``` ### Response This function's response is not explicitly detailed in the provided documentation. ``` -------------------------------- ### Load Data Files Function Signature Source: https://ohdsi.github.io/Eunomia/reference/loadDataFiles.html This is the function signature for loadDataFiles. It outlines the parameters and their default values for loading data into a database. ```r loadDataFiles( dataPath, dbPath, inputFormat = "csv", cdmVersion = "5.3", cdmDatabaseSchema = "main", dbms = "sqlite", verbose = FALSE, overwrite = FALSE ) ``` -------------------------------- ### R createCohorts Function Source: https://ohdsi.github.io/Eunomia/reference/createCohorts.html Use this function to create predefined cohorts in a specified cohort table. WARNING: this will delete all existing cohorts in the table! ```r createCohorts( connectionDetails, cdmDatabaseSchema = "main", cohortDatabaseSchema = "main", cohortTable = "cohort" ) ``` -------------------------------- ### createCohorts() Source: https://ohdsi.github.io/Eunomia/reference/index.html Constructs cohorts based on specified criteria. This function is a primary tool for defining and generating patient cohorts within the OMOP Common Data Model. ```APIDOC ## createCohorts() ### Description Constructs cohorts. ### Method Not applicable (R function) ### Endpoint Not applicable (R function) ### Parameters This function does not explicitly list parameters in the provided documentation. ### Request Example ```R createCohorts() ``` ### Response This function's response is not explicitly detailed in the provided documentation. ``` -------------------------------- ### exportDataFiles() Source: https://ohdsi.github.io/Eunomia/reference/index.html Exports data files from a specified database (SQLite or DuckDB). This function is useful for extracting processed data for further analysis or sharing. ```APIDOC ## exportDataFiles() ### Description Export data files from a database(sqlite or duckdb). ### Method Not applicable (R function) ### Endpoint Not applicable (R function) ### Parameters This function does not explicitly list parameters in the provided documentation. ### Request Example ```R exportDataFiles() ``` ### Response This function's response is not explicitly detailed in the provided documentation. ``` -------------------------------- ### Export Data Files Function Signature Source: https://ohdsi.github.io/Eunomia/reference/exportDataFiles.html This is the function signature for exporting data files. It specifies the parameters required for the export process, including database path, output folder, format, DBMS, and verbosity. ```R exportDataFiles( dbPath, outputFolder, outputFormat = "csv", dbms = "sqlite", verbose = FALSE ) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.