OHDSI Home | Forums | Wiki | Github

Queries on PostgreSQL

Hello all
I’m trying to use [OMOP CDM Queries](http://omop queries.org) with PostgreSQL. I know it’s for Oracle and Redshift, so it’s different with others.
Some queries work, some queries don’t work.
image
For example, like above figure
what is source_vocabulary_id, and target_vocabulary_id and where are those from?
Does this query even work on Oracle?
‘Source_vocabulary_id = 2 / Target_vocabulary_id = 1’?? I don’t understand it.
How could I execute this query? I should know it

It seems like the original link was http://cdmqueries.omop.org/condition-era/ce07 ?
Querry in question appears to be written for CDM v4. That would explain integer values for source_vocabulary_id and target_vocabulary_id and fields. CDM v5 uses varchar for all vocabulary_id keys across all tables.

Currently vocabulary_id value for ICD9 (american clinical modification) is ‘ICD9CM’, and ‘SNOMED’ for SNOMED CT.

@MichealJeong there are some OMOP SQL queries here that you may find useful:
https://github.com/OHDSI/OMOP-Queries/tree/master/md

t