General Queries‎ > ‎

G15: Statistic about Concepts, Vocabularies, Classes and Levels

This query generates the list of all vocabularies in the CONCEPT table (Standard and non-standard), their class, level and frequency.

Input:
<None>

Sample query run:
The following query returns list of statistics.

SELECT voc.vocabulary_id, 
       r.vocabulary_name, 
       voc.concept_class, 
       voc.concept_level, 
       voc.cnt 
FROM (
  SELECT vocabulary_id, concept_class, concept_level, COUNT(concept_id) cnt 
  FROM vocabulary.concept
  GROUP BY vocabulary_id, concept_class, concept_level 
) voc
JOIN vocabulary.vocabulary r ON voc.vocabulary_id=r.vocabulary_ID
ORDER BY 1,2,4,3
Output:
Output field list:
 Field  Description
 vocabulary_id  OMOP Vocabulary ID
 vocabulary_name  Vocabulary name
 concept_class Concept Class
 concept_level Concept Level Number
 cnt Number of concepts

Sample output record:
 Field  Value
 vocabulary_id  1
 vocabulary_name  SNOMED-CT
 concept_class Procedure
 concept_level 2
 cnt 20286
Comments