CO14: Counts of condition types

This query is used to count the condition type concepts (condition_type_concept_id, in the CDM V2 condition_occurrence_type) across all condition occurrence records. The input to the query is a value of a condition_type_concept_id.

 Parameter  Example  Mandatory  Notes
condition_concept_id 31967 Yes Condition concept identifier for 'Nausea'

Sample query run:
The following is a sample run of the query. The input parameters are highlighted in blue
SELECT    condition_type_freq, 
FROM      (SELECT condition_type_concept_id, count(*) as condition_type_freq
FROM      (SELECT * from condition_occurrence)
WHERE     condition_concept_id = 31967
GROUP BY  condition_type_concept_id) 
          AS condition_type_count
LEFT JOIN (SELECT concept_id, concept_name FROM vocabulary.concept) AS type_concept
          ON condition_type_count.condition_type_concept_id=type_concept.concept_id
ORDER BY  condition_type_freq

Output field list:
 Field  Description
condition_type_freq Frequency of a specific condition_type
condition_type_concept_id Unique ID for condition_type
concept_name  Description of the condition's data source

Sample output record:
 Field  Description
condition_type_freq 4735
condition_type_concept_id 38000235
concept_name Outpatient header - 6th position