Drug Cost‎ > ‎

DCR02: What is a cost of a treatment over a time period?


Input:
 Parameter  Example  Mandatory  Notes
list of condition_concept_id 192279, 200687, 194405, 376065, 4096038, 443767, 373999, 4044391, 377821, 376065, 434633,375806, 380419, 4110655, 78236 Yes Diabetes

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

-- diabetes for a period of one year (365 days)
SELECT min(t.tot_cost4era) min_cost, max(t.tot_cost4era) max_cost, avg(t.tot_cost4era) avg_cost 
from (
    select 365.0*sum(dc.total_paid)/(c.condition_era_end_date - c.condition_era_start_date) as tot_cost4era

    from  condition_era c,

          drug_exposure de,

          drug_cost dc

    where c.condition_concept_id in (
                                     192279, 200687, 194405, 376065, 
                    4096038, 443767, 373999, 4044391, 
                    377821, 376065, 434633, 375806, 
                    380419, 4110655, 78236)

    and c.person_id = de.person_id
-- choose minimal length of condition eras to take into account

    and (c.condition_era_end_date - c.condition_era_start_date) > 365
 
    and de.drug_exposure_id = dc.drug_exposure_id

    and de.drug_exposure_start_date between c.condition_era_start_date and c.condition_era_end_date

    group by c.condition_era_id, c.condition_era_end_date , c.condition_era_start_date
) t
;
Output:
Output field list:
 Field  Description
condition_concept_id A foreign key that refers to a standard condition concept identifier in the vocabulary.
min_cost
max_cost
avg_cost
total_paid The total amount paid for the expenses of drug exposure.
person_id A foreign key identifier to the person covered by the payer. The demographic details of that person are stored in the person table.
drug_exposure_id A foreign key identifier to the drug record for which cost data are recorded.
condition_era_start_date The start date for the condition era constructed from the individual instances of condition occurrences. It is the start date of the very first chronologically recorded instance of the condition.
condition_era_end_date The end date for the condition era constructed from the individual instances of condition occurrences. It is the end date of the final continuously recorded instance of the condition.

Sample output record:
 Field  Description
condition_concept_id
min_cost
max_cost
avg_cost
total_paid
person_id
drug_exposure_id
condition_era_start_date
condition_era_end_date
Comments