Skip to content

JuliaHealth/OMOPCDMDatabaseConnector.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OMOPCDMDatabaseConnector

Code Style: Blue Zulip

Utility package to connect to databases in the OMOP CDM database

NOTE: WORK IN PROGRESS. API HAS NOT BEEN STABILIZED YET. EXPECT BREAKS UNTIL VERSION 1.0.0

Description

This is a work in progress package that provides utilities to connect to an OMOP CDM database. This package works on version 5.4 of the OMOP CDM. While documentation has not yet been set up, all functions are documented.

For questions, feel free to start a discussion, create an issue, or post on Zulip.

Example Usage

This assumes you have access to an OMOP CDM database set-up with PostgreSQL.

  1. Add needed packages to a Julia environment as follows:
] add https://github.com/JuliaHealth/OMOPCDMCohortCreator.jl
] add https://github.com/JuliaHealth/OMOPCDMDatabaseConnector.jl 
] add DBInterface, LibPQ
  1. Use the packages:
using DBInterface
using LibPQ
using OMOPCDMDatabaseConnector 
using OMOPCDMDatabaseConnector
  1. Create a database connection:
conn = DBInterface.connect(LibPQ.Connection, "host=[your host] port=[your port] user=[your user] password=[your password]")
  1. Generate database details:
GenerateDatabaseDetails(
    :postgresql,
    "synpuf5"
)
  1. Generate Julia representation of database tables:
tables = GenerateTables(conn)
  1. As an example, now run the following to get all person_id's from the database:
GetDatabasePersonIDs(conn)

If everything worked and you got a DataFrame of person_id's at the end of these steps, you are set to continue working with and interfacing with the database to build your own network study.

About

Utility package to connect to databases in the OMOP CDM format

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages