Input:
Parameter |
Example |
Mandatory |
Notes |
concept_id |
1549080 |
Yes |
Estrogens, Conjugated (USP) |
Sample query run:
The following is a sample run of the query. The input parameters are highlighted in blue
SELECT decode(o.totalObs, 0, 0, 100*(e.totExposure*1.0/o.totalObs*1.0)) as proportion
FROM
(
SELECT SUM(r.drug_era_end_date - r.drug_era_start_date) AS totExposure, r.person_id
FROM drug_era r
WHERE r.person_id = 101--&pers_id
AND r.drug_concept_id = 1549080--&ingr_id
group by r.person_id
) e,
(
SELECT sum(p.observation_period_end_date - p.observation_period_start_date) AS totalObs, p.person_id
FROM observation_period p
--WHERE p.person_id = 101--&pers_id
group by p.person_id
) o
where o.person_id = e.person_id
Output:
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_concept_id |
A foreign key that refers to a standard concept identifier in the vocabulary for the drug concept. |
count |
The number of individual drug exposure occurrences used to construct the drug era. |
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. |
observation_period_end_date |
The end date of the observation period for which data are available from the data source. |
observation_period_start_date |
The start date of the observation period for which data are available from the data source. |
Sample output record:
Field |
Description |
drug_era_id |
|
person_id |
drug_concept_id |
|
count |
|
drug_era_start_date |
|
observation_period_end_date |
|
observation_period_start_date |
|
|
|