cycquery.omop.OMOPQuerier¶
- class OMOPQuerier(database, user, password, dbms='postgresql', host='localhost', port=5432, schema_name='omop')[source]¶
Bases:
DatasetQuerier
OMOP querier.
Methods
Get a table and possibly map columns to have standard names.
List columns in a table.
List custom tables methods provided by the dataset API.
List schemas in the database to query.
List table methods that can be queried using the database.
Map concept IDs in a source table to concept names from concept table.
Query OMOP measurement table.
Query OMOP observation table.
Query OMOP person table.
Query OMOP visit_detail table.
Query OMOP visit_occurrence table.
- get_table(schema_name, table_name, cast_timestamp_cols=True)¶
Get a table and possibly map columns to have standard names.
Standardizing column names allows for columns to be recognized in downstream processing.
- Parameters:
- Returns:
Table with mapped columns.
- Return type:
- list_columns(schema_name, table_name)¶
List columns in a table.
- list_custom_tables()¶
List custom tables methods provided by the dataset API.
- Returns:
List of custom table names.
- Return type:
List[str]
- list_schemas()¶
List schemas in the database to query.
- Returns:
List of schema names.
- Return type:
List[str]
- list_tables(schema_name=None)¶
List table methods that can be queried using the database.
- map_concept_ids_to_name(src_table, src_cols, dst_cols=None)[source]¶
Map concept IDs in a source table to concept names from concept table.
For each concept ID column with a name like somecol_concept_ID, the mapped concept name column will be named somecol_concept_name. If dst_cols is specified, the mapped concept name column will be named according to the corresponding name in dst_cols.
- Parameters:
- Returns:
Query with mapped columns from concept table.
- Return type:
- measurement()[source]¶
Query OMOP measurement table.
- Returns:
Constructed query, wrapped in an interface object.
- Return type:
- observation()[source]¶
Query OMOP observation table.
- Returns:
Constructed query, wrapped in an interface object.
- Return type:
- person()[source]¶
Query OMOP person table.
- Returns:
Constructed query, wrapped in an interface object.
- Return type:
- visit_detail()[source]¶
Query OMOP visit_detail table.
- Returns:
Constructed query, wrapped in an interface object.
- Return type: