Getting started#
Warning
Please note that this python package is not endorsed or affiliated with the official OHDSI community. It is a project intended for enabling vantage6 to connect to an OMOP CDM database.
This package includes python wrappers for the following OHDSI libraries:
This packages contains, besides the python interfaces for the OHDSI libraries, a small RestAPI to interact with the libraries.
There are three use-cases to use this package:
Use it as a Python interface to interact with an OMOP data source.
Let vantage6 connect with an OMOP data source through an SQL connection
Let vantage6 connect through a HTTP connection with an OMOP data source
Case 1: Python OMOP interface#
You can use the packages to interact with the OMOP data source from your Python environment. Note that all function are formatted in snake case (instead of the camel-case used in the R packages). For example to execute a simple query:
from ohdsi import database_connector
connection_details = database_connector.create_connection_details(
"postgresql",
server="localhost/postgres",
user="postgres",
password="some-password",
port=5432
)
con = database_connector.connect(connection_details)
database_connector.execute_sql(con, "SELECT * FROM omopcdm.person LIMIT 3")
Case 2: vantage6 SQL interface#
The vantage6 algorithm wrapper can directly connect with an OMOP instance through a SQL connection. Important to note that the algorithm container of vantage6 is not able to reach anything outside of its own Docker network. It is required to setup an SSH Tunnel to the machine that hosts the OMOP database. An SSH tunnel brings additional risks, therefore using the API model vantage6-http-interface is preferred.
Case 3: vantage6 HTTP interface#
The vantage6 wrapper can also use the RestAPI (included in this package) to retrieve data from the OMOP source. Important to note that the algorithm container of vantage6 is not able to reach anything outside of its own Docker network. It is required to setup Whitelisting to the IP/hostname and port of the machine that hosts the RestAPI.
Table of Contents#
- Circe
- SQL Render
- Cohort generator
- Database Connector
- Feature Extraction
aggregate_covariates()
compute_standardized_difference()
convert_prespec_settings_to_detailed_settings()
create_analysis_details()
create_covariate_settings()
create_default_covariate_settings()
create_default_temporal_covariate_settings()
create_detailed_covariate_settings()
create_detailed_temporal_covariate_settings()
create_empty_covariate_data()
create_table1()
create_table1_covariate_settings()
create_temporal_covariate_settings()
create_temporal_sequence_covariate_settings()
filter_by_cohort_definition_id()
filter_by_row_id()
get_db_covariate_data()
get_db_default_covariate_data()
get_default_table1_specifications()
is_aggregated_covariate_data()
is_covariate_data()
is_temporal_covariate_data()
load_covariate_data()
save_covariate_data()
tidy_covariate_data()