Drug Cost‎ > ‎

DRC01: What is the average/max/min cost per pill (total cost / quantity) per drug concept?


Input:
 Parameter  Example  Mandatory  Notes
list of drug_concept_id 906805, 1517070, 19010522 Yes

Sample query run:
The following is a sample run of the query. The input parameters are highlighted in blue

SELECT avg(t.cost_per_pill) avg_val_num,

       max(t.cost_per_pill) max_val_num,

       min(t.cost_per_pill) min_val_num,

       t.drug_concept_id

from (
  select dc.total_paid/d.quantity as cost_per_pill,

         d.drug_concept_id

  from drug_cost dc,

       drug_exposure d
  
where d.drug_exposure_id = dc.drug_exposure_id
     
    AND d.quantity > 0

    and d.drug_concept_id in (906805, 1517070, 19010522)
) t

GROUP BY t.drug_concept_id

ORDER BY t.drug_concept_id
;

Output:
Output field list:
 Field  Description
drug_concept_id A foreign key that refers to a standard concept identifier in the vocabulary for the drug concept.
cost_per_pill 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_exposure_id A system-generated unique identifier for each drug utilization event.

Sample output record:
 Field  Description
drug_concept_id
cost_per_pill
drug_exposure_id
Comments