Drug Exposure‎ > ‎

DEX36: Distribution of drug refills

This query is used to provide summary statistics for drug refills (refills) across all drug exposure records: the mean, the standard deviation, the minimum, the 25th percentile, the median, the 75th percentile, the maximum and the number of missing values. No input is required for this query.

Input:
<None>

Sample query run:
The following is a sample run of the query.

-- Oracle
SELECT min(tt.stat_value) AS min_value
     , max(tt.stat_value) AS max_value
     , avg(tt.stat_value) AS avg_value
     , (round(stdDev(tt.stat_value)) ) AS stdDev_value
     , PERCENTILE_DISC(0.25) WITHIN GROUP( ORDER BY tt.stat_value ) 
                                     AS percentile_25
     , PERCENTILE_DISC(0.5)  WITHIN GROUP (ORDER BY tt.stat_value )
                                     AS median_value
     , PERCENTILE_DISC(0.75) WITHIN GROUP (ORDER BY tt.stat_value )
                                     AS percentile_75
  FROM
    ( SELECT  t.refills AS stat_value
      FROM drug_exposure t 
      where t.refills > 0
    ) tt 
;
Output:
Output field list:
 Field  Description
drug_exposure_id A system-generated unique identifier for each drug utilization event.
refills The number of refills after the initial prescription. The initial prescription is not counted, values start with 0.
percentile_25_date
median_date
percentile_75_date

Sample output record:
 Field  Description
drug_exposure_id
refills
percentile_25_date
median_date
percentile_75_date
Comments