CO24: Counts of genders, stratified by condition

Returns the distrubition of the physican's speciality who diagnosed a certian condition.

Input:
 Parameter  Example  Mandatory  Notes
condition_concept_id  31967 Yes Nausea

Sample query run:
The following is a sample run of the query to run a search for specific gender concept ID. The input parameters are highlighted in blue.

select concept_name as speciality, speciality_freq
from (
    select specialty_concept_id, count(*) as speciality_freq
    from (select *
        from (select associated_provider_id from mslr_cdm4.condition_occurrence where condition_concept_id in (31967) and  associated_provider_id is not null) as from_cond
    left join (select provider_id, specialty_concept_id from mslr_cdm4.provider) as from_prov
    on from_cond.associated_provider_id=from_prov.provider_id
    )
    group by specialty_concept_id
    order by speciality_freq
    ) as spec_id_count
left join (select concept_id, concept_name from vocabulary.concept) as spec_concept
on spec_id_count.specialty_concept_id=spec_concept.concept_id
order by speciality_freq desc;

Output:
Output field list:
 Field  Description
speciality Physican's speciality
speciality_freqFrequancy of the speciality

Sample output record:
 Field  Value
speciality Internal Medicine
speciality_freq10324
Comments