Drug Era‎ > ‎

DER01: Which drug_exposure records belong to a drug_era?

This query is used to count all gender values (gender_concept_id) for all exposed persons stratified by drug (drug_concept_id). The input to the query is a value (or a comma-separated list of values) of a gender_concept_id and drug_concept_id. If the input is omitted, all existing value combinations are summarized.

 Parameter  Example  Mandatory  Notes
drug_era_id 20 Yes

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

select *
from drug_exposure e
where exists (select 1 
              from drug_era r ,
                   vocabulary.ERA_VOCAB_MAP4DRUGS m
              where r.drug_era_id = 20--&era_id
                and r.person_id = e.person_id
                and r.drug_concept_id = m.gen_voc_ancestor_concept_id
                and e.drug_concept_id = m.gen_voc_descendant_concept_id
                and e.drug_exposure_start_date BETWEEN r.drug_era_start_date AND r.drug_era_end_date 
Output field list:
 Field  Description
drug_era_id A system-generated unique identifier for each drug era.
person_id A foreign key identifier to the person who is subjected to the drug during the drug era. The demographic details of that person are stored in the person table.
drug_exposure_start_date The start date for the current instance of drug utilization. Valid entries include a start date of a prescription, the date a prescription was filled, or the date on which a drug administration procedure was recorded.
drug_era_start_date The start date for the drug era constructed from the individual instances of drug exposures. It is the start date of the very first chronologically recorded instance of utilization of a drug.
drug_era_end_date The end date for the drug era constructed from the individual instance of drug exposures. It is the end date of the final continuously recorded instance of utilization of a drug.

Sample output record:
 Field  Description