select
avg(date_part('day', t.next_era_start) - date_part('day', t.drug_era_end_date))::numeric as num_days
from
(
select
r.drug_era_end_date,
lead(r.drug_era_start_date) over(partition by r.person_id, r.drug_concept_id order by r.drug_era_start_date) as next_era_start
from
@cdm.drug_era r
where r.drug_concept_id = $1
) t
where
t.next_era_start is not null
| Parameter | Example | Mandatory | Notes | | --- | --- | --- | --- | | drug_concept_id | 1304643 | Yes | darbepoetin alfa |
| Field | Description | | --- | --- | | Num_days | Average number of days between drug eras |
| Field | Value | | --- | --- | | Num_days | 82 |
https://github.com/OHDSI/CommonDataModel/wiki/
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.