NHS England Low Priority Treatment - Higher Cost Insulin Pen Needles

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 Cost of higher cost (≥£5/box) insulin pen needles per 1000 patients
Why it matters Insulin pen needles range in price between approximately £3.95 to £30.00 per box. There is no evidence that suggests that there are any significant differences between brands of needles, although there are reommendations about length of needle. NHS England is promoting the use of lower cost needles, i.e. those under £5 per box, which are already in widespread use across the NHS.
Tags Cost Saving, Efficacy, Diabetes, NHS England Investment and Impact Fund, NHS England Low Priority
Implies cost savings Yes
History View change history on GitHub →

Numerator SQL

SELECT
     CAST(month AS DATE) AS month,
     practice AS practice_id,
     SUM(actual_cost) AS numerator
 FROM hscic.normalised_prescribing p LEFT JOIN measures.vw__median_price_per_unit r ON p.month=r.date AND p.bnf_code=r.bnf_code
 WHERE (p.bnf_code LIKE '210109006%' OR p.bnf_code LIKE '210109007%' OR p.bnf_code LIKE '210109008%' OR p.bnf_code LIKE '210109009%') --All needles with these codes 
 AND UPPER(p.bnf_name) LIKE '%NEEDLES%' --Codes contain other products as well, so this selects needles only 
 AND r.median_price_per_unit >= 0.05 --this selects products with median price of >= 5 pound a box
 GROUP BY month, practice_id

Denominator SQL

SELECT
     CAST(month AS DATE) AS month,
     practice AS practice_id,
     SUM(total_list_size / 1000.0) AS denominator
 FROM hscic.practice_statistics
 GROUP BY month, practice_id