WITH parms as (
select cid::integer as cid from unnest(regexp_split_to_array( nullif($1::text, '')::text, '\s*,\s*')) as cid)
SELECT avg(c.paid_by_patient - c.paid_patient_copay)::numeric AS avg_out_pocket_cost, d.drug_concept_id
FROM @cdm.cost c, @cdm.drug_exposure d
WHERE d.drug_exposure_id = c.cost_event_id
AND (c.paid_by_patient - c.paid_patient_copay) > 0
AND d.drug_concept_id
IN (select cid from parms)
GROUP BY d.drug_concept_id;
| Parameter | Example | Mandatory | Notes | | --- | --- | --- | --- | | list of drug_concept_id | 906805, 1517070, 19010522 | Yes | |
| Field | Description | | --- | --- | | drug_concept_id | A foreign key that refers to a standard concept identifier in the vocabulary for the drug concept. | | total_out_of_pocket | The total amount paid by the person as a share of the expenses, excluding the copay. | | avg_out_pocket_cost | The average amount paid by the person as a share of the expenses, excluding the copay. |
| | | --- | | Field | Description | | avg_out_pocket_cost | | | drug_concept_id | | | total_out_of_pocket | |
https://github.com/OHDSI/CommonDataModel/wiki/
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.