Drug Era‎ > ‎

DER14: Counts of number of distinct drugs persons take

This query is used to count the number of different distinct drugs (drug_concept_id) of all exposed persons. The input to the query is a value (or a comma-separated list of values) for a number of concepts. If the input is ommitted, all possible values are summarized.

 Parameter  Example  Mandatory  Notes
list of drug_type_concept_id 3, 4 Yes


Sample query run:
The following is a sample run of the query. The input parameters are highlighted in blue

SELECT count(distinct t.drug_concept_id)  AS drug_count, t.person_id
FROM drug_era t 
group by t.person_id
having count(distinct t.drug_concept_id) in (3, 4)
Output field list:
 Field  Description
drug_concept_id A foreign key that refers to a standard concept identifier in the vocabulary for the drug concept.
peerson_id A foreign key identifier to the person who is subjected to the drug. The demographic details of that person are stored in the person table.

Sample output record:
 Field  Description