Antibiotic stewardship: three-day courses for uncomplicated UTIs

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 Number of average daily quantities (ADQs) per item for trimethoprim 200mg tablets, nitrofurantoin 50mg tablets and capsules, nitrofurantoin 100mg m/r capsules and pivmecillinam 200mg tablets.
Why it matters NICE KTT on antimicrobial stewardship states that for most women (who are not pregnant) with no fever or flank pain, a three-day course of antibiotics for an uncomplicated urinary tract infection (UTI) will treat it effectively. This also reduces the amount of unnecessary antibiotics being prescribed.
Tags Antimicrobial Stewardship, Standard, Infections, NICE
Implies cost savings No
History View change history on GitHub →

Numerator SQL

SELECT
     CAST(month AS DATE) AS month,
     practice AS practice_id,
     SUM(p.quantity * r.adq_per_quantity) AS numerator
 FROM hscic.normalised_prescribing p  LEFT JOIN hscic.presentation r  ON p.bnf_code = r.bnf_code
 WHERE p.bnf_code LIKE '0501015P0%AB' OR --Pivmecillinam HCl_Tab 200mg (brands and generic) 
 p.bnf_code LIKE '0501080W0%AE' OR --Trimethoprim_Tab 200mg (brands and generic) 
 p.bnf_code LIKE '0501130R0%AA' OR --Nitrofurantoin_Cap 50mg (brands and generic) 
 p.bnf_code LIKE '0501130R0%AD' OR --Nitrofurantoin_Tab 50mg (brands and generic) 
 p.bnf_code LIKE '0501130R0%AG%' --Nitrofurantoin_Cap 100mg M/R (brands and generic)
 GROUP BY month, practice_id

Denominator SQL

SELECT
     CAST(month AS DATE) AS month,
     practice AS practice_id,
     SUM(items) AS denominator
 FROM hscic.normalised_prescribing
 WHERE bnf_code IN ("0501015P0AAABAB", "0501015P0BBABAB", "0501080W0AAAEAE", "0501080W0BGABAE", "0501080W0BHABAE", "0501130R0AAAAAA", "0501130R0AAADAD", "0501130R0AAAGAG", "0501130R0BBAAAD", "0501130R0BCAAAA", "0501130R0BGAAAG", "0501130R0BHABAD")
 GROUP BY month, practice_id