This query is used to count drugs (drug_concept_id) across all drug exposure records stratified by drug exposure 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.
The following is a sample run of the query. The input parameters are highlighted in blue
SELECT
drug_concept_id,
COUNT(1) AS drugs_count,
drug_type_concept_id
FROM @cdm.drug_exposure
-- Filter by input list of drug_concept_id
WHERE drug_concept_id IN (906805, 1517070, 19010522)
-- Filter ny input list of drug_type_concept_id
AND drug_type_concept_id IN (38000175,38000179)
GROUP BY drug_type_concept_id, drug_concept_id;
| Parameter | Example | Mandatory | Notes | | --- | --- | --- | --- | | list of drug_concept_id | 906805, 1517070, 19010522 | Yes | | list of drug_type_concept_id | 38000175,38000179 | Yes |
| Field | Description | | --- | --- | | drug_concept_id | A foreign key that refers to a standard concept identifier in the vocabulary for the drug concept. | | drug_type_concept_id | A foreign key to the predefined concept identifier in the vocabulary reflecting the parameters used to construct the drug era. | | count | A foreign key to the predefined concept identifier in the vocabulary reflecting the parameters used to construct the drug era. |
| Field | Description | | --- | --- | | drug_concept_id | 906805 | | drug_type_concept_id | 38000175 | | count | 45 |
https://github.com/OHDSI/CommonDataModel/wiki/
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.