Below are the database queries which are used to create this measure. These are run against a copy of the BSA prescribing data which we store in Google BigQuery. We're working on making our BigQuery tables publicly available at which point it will be possible to run and modify these queries yourself. But even where code and database queries are not directly useable by others we believe it is always preferable to make them public.
Description | Total quantity of branded desogestrel as a proportion of total quantity of all desogestrel. |
---|---|
Why it matters | Desogestrel is available as both generic tablets and as a number of brands. For a time some of these brands were cheaper than the generic tablets, so CCGs started to use them. However the price of the generic has now fallen and is the cheapest option to prescribe. |
Tags | Standard, Cost Saving, Generic prescribing, Reproductive system |
Implies cost savings | Yes |
History | View change history on GitHub → |
SELECT
CAST(month AS DATE) AS month,
practice AS practice_id,
SUM(quantity) AS numerator
FROM hscic.normalised_prescribing
WHERE bnf_code IN ("0703021Q0BBAAAA", "0703021Q0BCAAAA", "0703021Q0BDAAAA", "0703021Q0BEAAAA", "0703021Q0BFAAAA", "0703021Q0BGAAAA", "0703021Q0BHAAAA", "0703021Q0BIAAAA")
GROUP BY month, practice_id
SELECT
CAST(month AS DATE) AS month,
practice AS practice_id,
SUM(quantity) AS denominator
FROM hscic.normalised_prescribing
WHERE bnf_code IN ("0703021Q0AAAAAA", "0703021Q0BBAAAA", "0703021Q0BCAAAA", "0703021Q0BDAAAA", "0703021Q0BEAAAA", "0703021Q0BFAAAA", "0703021Q0BGAAAA", "0703021Q0BHAAAA", "0703021Q0BIAAAA")
GROUP BY month, practice_id