Drug Era‎ > ‎

DER16: Counts of drug era records per person

This query is used to count the number of drug era records (drug_era_id) for all persons. The input to the query is a value (or a comma-separated list of values) for a number of records per person. If the input is ommitted, all possible values are summarized.

Input:
 Parameter  Example  Mandatory  Notes
list of drug_type_concept_id 3, 4 Yes

<None>

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

SELECT count(1)  AS s_count, t.person_id
FROM drug_era t 
group by t.person_id
having count(1) in (3, 4)
;
Output:
Output field list:
 Field  Description
drug_era_id A system-generated unique identifier for each drug era.
person_id
count

Sample output record:
 Field  Description
drug_era_id
person_id
count
Comments