Drug Era‎ > ‎

DER19: Counts of drugs, stratified by drug type

This query is used to count drugs (drug_concept_id) across all drug era records stratified by drug era type (drug_type_concept_id, in CDM V2 drug_exposure_type). The input to the query is a value (or a comma-separated list of values) of a drug_concept_id or a drug_type_concept_id. If the input is omitted, all existing value combinations are summarized.

Input:
 Parameter  Example  Mandatory  Notes
list of concept_id 1300978, 1304643, 1549080 Yes
type_concept_id 38000182 Yes

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

SELECT 
  t.drug_concept_id,
  count(1) as s_count,
  t.drug_TYPE_concept_id
FROM drug_era t
where 
  t.drug_concept_id in (1300978, 1304643, 1549080) 
  and t.drug_TYPE_concept_id = 38000182
group by  t.drug_TYPE_concept_id, t.drug_concept_id
 ;
Output:
Output field list:
 Field  Description
drug_concept_id
drug_TYPE_concept_id A foreign key to the predefined concept identifier in the vocabulary reflecting the type of drug exposure recorded. It indicates how the drug exposure was represented in the source data: as medication history, filled prescriptions, etc.

Sample output record:
 Field  Description
 Field  Description
drug_concept_id
drug_TYPE_concept_id
Comments