OHDSI Home | Forums | Wiki | Github

Queries on PostgreSQL

(Micheal ) #1

Hello all
I’m trying to use [http://cdmqueries.omop.org/home](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.
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

(Eduard Korchmar) #2

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.

(Lee Evans) #3

@MichealJeong there are some OMOP SQL queries here that you may find useful: