inspectomop.inspector.Inspector

class inspectomop.inspector.Inspector(connection_url)

Creates an Inspector object which can be used to run OMOP data queries

Parameters:connection_url (string) – A connection url of form ‘dialect+driver://username:password@host:port/database’. The driver can be any currently supported by sqlalchemy (sqlite, mysql, postgresql, etc.).
connection_url
Type:str

Notes

SQLite DBs require an additional ‘/’ as in ‘sqlite:///foo.db’ for a relative path and ‘sqlite:////abs/path/to/foo.db’ for an absolute path.

See http://docs.sqlalchemy.org/en/latest/core/engines.html for more information about connection URLs and supported dialects.

Examples

>>> import inspectomop as iomop
>>> connection_url = 'sqlite:///:memory:'
>>> iomop.Inspector(connection_url)
__init__(connection_url)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(connection_url) Initialize self.
attach_sqlite_db(db_file, schema_name) For SQLite backends, attaches an additional sqlite database file.
execute(statement) Executes an SQL query on the OMOP CDM.
table_info(table_name) Return a Pandas DataFrame describing the fields and properties of a table.

Attributes

clinical_tables A dictionary containing all of the Clinical OMOP CDM tables in the connected database.
connection_url password@host:port/database’ used to specify the dialect, location, etc.
derived_elements_tables A dictionary containing all of the Derived Elements OMOP CDM tables in the connected database.
engine A convenience hook to the underlying sqlalchemy engine.
health_economics_tables A dictionary containing all of the Health Economics OMOP CDM tables in the connected database.
health_system_tables A dictionary containing all of the Health System OMOP CDM tables in the connected database.
metadata_tables A dictionary containing all of the MetaData OMOP CDM tables in the connected database.
tables A dictionary containing all OMOP CDM tables in the connected database.
vocabularies_tables A dictionary containing all of the Vocabularies OMOP CDM tables in the connected database.