API Reference¶
Inspector¶
inspectomop.Inspector
Constructor¶
|
Creates an Inspector object which can be used to run OMOP data queries |
Attributes¶
password@host:port/database' used to specify the dialect, location, etc. |
|
A convenience hook to the underlying sqlalchemy engine. |
|
A dictionary containing all OMOP CDM tables in the connected database. |
|
A dictionary containing all of the |
|
A dictionary containing all of the |
|
A dictionary containing all of the |
|
A dictionary containing all of the |
|
A dictionary containing all of the |
|
A dictionary containing all of the |
Methods¶
|
For SQLite backends, attaches an additional sqlite database file. |
Provides a Connection to the underlying database from the connection pool. |
|
|
Return a Pandas DataFrame describing the fields and properties of a table. |
Connection¶
inspectomop.Connection
Constructor¶
|
A subclass of sqlalchemy.engine.Connection. |
Warning
Although a public constructor exists, Connection objects are meant to be instantiated indirectly from calls to Inspector.connect()
Methods¶
|
Executes an SQL query on the OMOP CDM. |
Results¶
inspectomop.Results
Constructor¶
|
A cursor-like object with methods such as fetchone, fetchmany etc. |
Warning
Although a public constructor exists, Results objects are meant to be instantiated indirectly from calls to Connection.execute()
Methods¶
Return all rows from a results object as a pandas DataFrame |
|
|
Yields a pandas DataFrame with n_rows = chunksize |
Queries¶
inspectomop.queries
Care Site¶
inspectomop.queries.care_site
|
Returns facility counts by type in the OMOP CDM i.e. # Inpatient Hospitals, Offices, etc. |
|
Returns patients counts by facility type. |
Condition¶
inspectomop.queries.condition
|
Retrieves anatomical site concepts given a keyword. |
|
Retrieves the condition concept for a condition_concept_id. |
|
Retrieves standard concepts for a condition/keyword. |
|
Retrieves standard condition concepts for source codes. |
|
Retrieves condition concepts that occur at a given anatomical site. |
|
Retreives all conditions caused by a pathogen or other causative agent concept_id. |
|
Retrieves disease causing agents by keyword. |
|
Retreives source condition concepts for OMOP concept_ids. |
|
Retrieves pathogen concepts based on a keyword with 'Organsim' as the concept_class_id. |
Provides counts of conditions stratified by place_of_service (Office, Inpatient Hospital, etc.) |
Drug¶
inspectomop.queries.drug
|
Returns drug classes for drug or ingredient concept_ids. |
Get all drugs that contain a given ingredient. |
|
|
Find all indications for a drug given a concept_id. |
|
Get ingredients for brand or generic drug concept_ids. |
Get concept_ids for a list of ingredients. |
General¶
inspectomop.queries.general
|
Find all ancestor concepts for a concept_id. |
|
Find all child concepts for a concept_id. |
|
Returns concept information for a list of concept_ids |
|
Find all descendant concepts for a concept_id. |
|
Find all parent concepts for a concept_id. |
|
Find all concepts related to a concept_id. |
|
Find all sibling concepts for a concept_id i.e.(concepts that share common parents). |
|
Returns concept information for a list of concept_ids |
|
Convert source code to all mapped standard vocabulary concepts. |
Observation¶
inspectomop.queries.observation
|
Search for LOINC and UCUM concepts by keyword. |
Payer Plan¶
inspectomop.queries.payer_plan
|
Returns counts of payer coverage based on continuous coverage (payer_plan_period_start_date - payer_plan_period_end_date)365.25. |
|
Returns counts of payer coverage by plan type. |
Person¶
inspectomop.queries.person
|
Returns patient counts grouped by gender for the database or alternativily, for a supplied list of person_ids. |
|
Returns patient counts grouped by year of birth for the database or alternativily, for a supplied list of person_ids. |
|
Returns patient counts grouped by state for the database or alternativily, for a supplied list of person_ids. |
|
Returns patient counts grouped by zip code for the database or alternativily, for a supplied list of person_ids. |
Returns patient counts stratified by year of birth and gender for the database or alternativily, for a supplied list of person_ids. |