This query is used to count the persons with any number of eras with exposure to a certain drug (drug_concept_id) . The input to the query is a value (or a comma-separated list of values) of a drug_concept_id. If the input is omitted, all possible values are summarized.
WITH parms as (select cid as cid from unnest(regexp_split_to_array( nullif($1::text, '')::text, '\s*,\s*')) as cid)
select count(distinct r.person_id)::integer as persons_count
from @cdm.drug_era r
where r.drug_concept_id in (select cid::integer from parms);
| Parameter | Example | Mandatory | Notes | | --- | --- | --- | --- | | list of drug_concept_id | 1304643, 1549080 | Yes | |
| Field | Description | | --- | --- | | persons_count | Count of persons with any number of eras with exposure to certain drug |
| Field | Value | | --- | --- | | persons_count | 1658496 |
https://github.com/OHDSI/CommonDataModel/wiki/
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.