Antibiotic stewardship: co-amoxiclav, cephalosporins & quinolones (KTT9)

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 prescription items for co-amoxiclav, cephalosporins and quinolones as a percentage of total prescription items for cephalosporins, macrolides, metronidazole tinidazole & ornidazole, penicillins, quinolones, sulphonamides & trimethoprim, tetracyclines and drugs for urinary-tract infections.
Why it matters Co-amoxiclav, cephalosporins and quinolones are broad spectrum antibiotics that can be used when others have failed. It is important that they are used sparingly, to avoid drug-resistant bacteria developing. This measure looks at the quantity of these prescribed, versus the broad class of similar antibiotics.
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(items) AS numerator
 FROM hscic.normalised_prescribing
 WHERE bnf_code IN ("0501013K0AAAAAA", "0501013K0AAABAB", "0501013K0AAADAD", "0501013K0AAAEAE", "0501013K0AAAFAF", "0501013K0AAAGAG", "0501013K0AAAHAH", "0501013K0AAAIAI", "0501013K0AAAJAJ", "0501013K0AAAKAK", "0501013K0AAANAN", "0501013K0BBAAAA", "0501013K0BBACAE", "0501013K0BBAHAF", "0501013K0BBAJAD", "0501013K0BBAKAG", "0501013K0BBALAJ", "0501013K0BBAMAK", "0501021A0AAAAAA", "0501021A0AAABAB", "0501021A0AAACAC", "0501021A0AAAEAE", "0501021A0AAAGAG", "0501021A0AAAJAJ", "0501021A0AAAKAK", "0501021A0BBABAB", "0501021A0BBACAC", "0501021A0BBADAE", "0501021A0BBAEAG", "0501021A0BDAAAA", "0501021A0BDACAJ", "0501021B0AAAAAA", "0501021B0AAADAD", "0501021C0AAAAAA", "0501021C0AAABAB", "0501021C0AAACAC", "0501021C0BBAAAA", "0501021C0BBABAB", "0501021D0AAAAAA", "0501021D0AAABAB", "0501021D0AAACAC", "0501021F0AAAAAA", "0501021F0BBAAAA", "0501021G0AAABAB", "0501021G0AAACAC", "0501021G0AAADAD", "0501021G0BBAAAB", "0501021G0BBABAC", "0501021G0BBACAD", "0501021H0AAAAAA", "0501021H0AAABAB", "0501021H0AAACAC", "0501021H0AAADAD", "0501021H0AAAHAH", "0501021H0BBABAA", "0501021H0BBACAB", "0501021J0AAAAAA", "0501021J0AAABAB", "0501021J0AAACAC", "0501021J0BBABAB", "0501021K0AAAAAA", "0501021K0AAABAB", "0501021K0AAACAC", "0501021K0AAADAD", "0501021K0BBAAAA", "0501021K0BBABAB", "0501021K0BBACAC", "0501021L0AAAAAA", "0501021L0AAABAB", "0501021L0AAACAC", "0501021L0AAADAD", "0501021L0AAAEAE", "0501021L0AAAGAG", "0501021L0AAAHAH", "0501021L0AAANAN", "0501021L0AAAPAP", "0501021L0BBAAAA", "0501021L0BBABAB", "0501021L0BBACAG", "0501021L0BBADAH", "0501021L0BBAHAC", "0501021L0BBAIAD", "0501021L0BBAJAE", "0501021L0BCAAAA", "0501021L0BCABAB", "0501021L0BCACAG", "0501021L0BCADAH", "0501021L0BCAEAC", "0501021L0BCAFAD", "0501021M0AAAAAA", "0501021M0AAABAB", "0501021M0BBABAB", "0501021M0BCAAAA", "0501021M0BCABAB", "0501120L0AAAAAA", "0501120L0AAABAB", "0501120L0AAADAD", "0501120L0AAAFAF", "0501120L0AAAGAG", "0501120L0AAAJAJ", "0501120L0AAAQAQ", "0501120L0AAAYAY", "0501120L0AABEBE", "0501120L0AABFBF", "0501120L0AABGBG", "0501120L0AABQBQ", "0501120L0BBAAAA", "0501120L0BBABAF", "0501120L0BBADAJ", "0501120L0BBAJBG", "0501120N0AAAAAA", "0501120N0BBAAAB", "0501120N0BDAAAC", "0501120P0AAAAAA", "0501120P0AAABAB", "0501120P0AAACAC", "0501120P0BBAAAA", "0501120P0BBACAB", "0501120Q0AAAAAA", "0501120Q0BBAAAA", "0501120X0AAAAAA", "0501120X0AAABAB", "0501120X0AAACAC", "0501120X0AAADAD", "0501120X0AAAFAF", "0501120X0BBAAAA", "0501120X0BBABAB", "0501120X0BCACAA", "0501120Y0AAAAAA", "0501120Y0BBAAAA")
 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 ("0501011J0AAABAB", "0501011J0AAAFAF", "0501011J0BBABAB", "0501011J0BBAFAF", "0501011P0AAADAD", "0501011P0AAAFAF", "0501011P0AAAJAJ", "0501011P0AAARAR", "0501011P0AAASAS", "0501012G0AAAAAA", "0501012G0AAABAB", "0501012G0AAACAC", "0501012G0AAADAD", "0501012G0AAAEAE", "0501012G0AAAFAF", "0501012G0AAAGAG", "0501012G0AAAPAP", "0501012G0AAAQAQ", "0501012G0AAARAR", "0501012G0BBAAAA", "0501012G0BBABAB", "0501012G0BGADAB", "0501012H0AAAAAA", "0501012H0AAABAB", "0501012H0BBAAAA", "0501012H0BBABAB", "0501012U0AAABAB", "0501013B0AAAAAA", "0501013B0AAABAB", "0501013B0AAAHAH", "0501013B0AAAIAI", "0501013B0AAAJAJ", "0501013B0AAAKAK", "0501013B0AAASAS", "0501013B0AAATAT", "0501013B0BCAAAA", "0501013B0BCABAB", "0501013B0BCAEAS", "0501013B0BCAFAT", "0501013B0BCAGAI", "0501013B0BCAIAH", "0501013B0BGAAAA", "0501013B0BGABAB", "0501013B0BGACAS", "0501013B0BGADAT", "0501013B0BHACAS", "0501013C0AAACAC", "0501013C0AAADAD", "0501013C0AAAEAE", "0501013C0BCABAD", "0501013C0BCACAE", "0501013E0AAAAAA", "0501013E0AAABAB", "0501013E0AAADAD", "0501013E0AAAEAE", "0501013E0AAAFAF", "0501013E0BEAAAA", "0501013E0BEABAB", "0501013E0BEAEAF", "0501013K0AAAAAA", "0501013K0AAABAB", "0501013K0AAADAD", "0501013K0AAAEAE", "0501013K0AAAFAF", "0501013K0AAAGAG", "0501013K0AAAHAH", "0501013K0AAAIAI", "0501013K0AAAJAJ", "0501013K0AAAKAK", "0501013K0AAANAN", "0501013K0BBAAAA", "0501013K0BBACAE", "0501013K0BBAHAF", "0501013K0BBAJAD", "0501013K0BBAKAG", "0501013K0BBALAJ", "0501013K0BBAMAK", "0501013L0AAAAAA", "0501013L0AAABAB", "0501013L0AAADAD", "0501013L0BBAAAA", "0501013L0BBABAB", "0501013L0BBADAD", "0501014N0BBACAC", "0501014S0AAAAAA", "0501014S0AAABAB", "0501014S0AAACAC", "0501014S0BBAAAA", "0501014S0BBABAB", "0501014S0BBACAC", "0501015P0AAABAB", "0501015P0AAACAC", "0501015P0BBABAB", "0501021A0AAAAAA", "0501021A0AAABAB", "0501021A0AAACAC", "0501021A0AAAEAE", "0501021A0AAAGAG", "0501021A0AAAJAJ", "0501021A0AAAKAK", "0501021A0BBABAB", "0501021A0BBACAC", "0501021A0BBADAE", "0501021A0BBAEAG", "0501021A0BDAAAA", "0501021A0BDACAJ", "0501021B0AAAAAA", "0501021B0AAADAD", "0501021C0AAAAAA", "0501021C0AAABAB", "0501021C0AAACAC", "0501021C0BBAAAA", "0501021C0BBABAB", "0501021D0AAAAAA", "0501021D0AAABAB", "0501021D0AAACAC", "0501021F0AAAAAA", "0501021F0BBAAAA", "0501021G0AAABAB", "0501021G0AAACAC", "0501021G0AAADAD", "0501021G0BBAAAB", "0501021G0BBABAC", "0501021G0BBACAD", "0501021H0AAAAAA", "0501021H0AAABAB", "0501021H0AAACAC", "0501021H0AAADAD", "0501021H0AAAHAH", "0501021H0BBABAA", "0501021H0BBACAB", "0501021J0AAAAAA", "0501021J0AAABAB", "0501021J0AAACAC", "0501021J0BBABAB", "0501021K0AAAAAA", "0501021K0AAABAB", "0501021K0AAACAC", "0501021K0AAADAD", "0501021K0BBAAAA", "0501021K0BBABAB", "0501021K0BBACAC", "0501021L0AAAAAA", "0501021L0AAABAB", "0501021L0AAACAC", "0501021L0AAADAD", "0501021L0AAAEAE", "0501021L0AAAGAG", "0501021L0AAAHAH", "0501021L0AAANAN", "0501021L0AAAPAP", "0501021L0BBAAAA", "0501021L0BBABAB", "0501021L0BBACAG", "0501021L0BBADAH", "0501021L0BBAHAC", "0501021L0BBAIAD", "0501021L0BBAJAE", "0501021L0BCAAAA", "0501021L0BCABAB", "0501021L0BCACAG", "0501021L0BCADAH", "0501021L0BCAEAC", "0501021L0BCAFAD", "0501021M0AAAAAA", "0501021M0AAABAB", "0501021M0BBABAB", "0501021M0BCAAAA", "0501021M0BCABAB", "0501030F0AAAAAA", "0501030F0AAAGAG", "0501030F0AAAIAI", "0501030I0AAAAAA", "0501030I0AAABAB", "0501030I0AAAEAE", "0501030I0AAAHAH", "0501030I0AAAKAK", "0501030I0AAALAL", "0501030I0BCAAAB", "0501030I0BCABAA", "0501030I0BEAAAA", "0501030I0BEABAB", "0501030I0BEADAE", "0501030I0BLAAAB", "0501030L0AAABAB", "0501030L0BBABAB", "0501030P0AAAAAA", "0501030P0AAABAB", "0501030P0AAACAC", "0501030P0AAADAD", "0501030P0AAAEAE", "0501030P0BBAAAA", "0501030P0BBABAB", "0501030P0BBACAC", "0501030P0BDAAAD", "0501030P0BDABAE", "0501030P0BHAAAC", "0501030P0BHABAC", "0501030T0AAAJAJ", "0501030T0AAAPAP", "0501030T0AAARAR", "0501030T0BIAAAJ", "0501030V0AAAAAA", "0501030V0AAAFAF", "0501030V0AAARAR", "0501030X0BBAAAA", "0501030Y0AAAAAA", "0501030Z0AAAAAA", "0501030Z0BBAAAA", "0501050A0AAAAAA", "0501050A0AAABAB", "0501050A0AAADAD", "0501050A0AAAGAG", "0501050A0AAAHAH", "0501050A0BBAAAA", "0501050A0BBABAB", "0501050A0BBADAD", "0501050A0BCAAAD", "0501050B0AAAAAA", "0501050B0AAABAB", "0501050B0AAACAC", "0501050B0AAADAD", "0501050B0AAAEAE", "0501050B0AAAFAF", "0501050B0AAAHAH", "0501050B0AAAKAK", "0501050B0BBAAAA", "0501050B0BBABAB", "0501050B0BBACAC", "0501050B0BBADAD", "0501050B0BBAEAE", "0501050B0BBAFAF", "0501050B0BBAHAH", "0501050B0BEAAAE", "0501050B0BHAAAE", "0501050C0AAABAB", "0501050C0AAAKAK", "0501050C0BCAAAK", "0501050C0BKAAAK", "0501050H0AAAAAA", "0501050H0AAABAB", "0501050H0AAACAC", "0501050H0AAAEAE", "0501050H0AAALAL", "0501050H0AAAMAM", "0501050H0AAANAN", "0501050H0BDAIAE", "0501050H0BDAMAM", "0501050H0BDANAL", "0501050H0BDAPAN", "0501050K0AAAAAA", "0501050N0AAAAAA", "0501050N0AAABAB", "0501050N0BBAAAA", "0501050N0BBABAB", "0501050N0BCAAAA", "0501050N0BCABAB", "0501080D0AAABAB", "0501080D0AAACAC", "0501080D0AAAEAE", "0501080D0AAAHAH", "0501080D0AAAJAJ", "0501080D0BGAAAH", "0501080D0BGACAJ", "0501080D0BGAEAE", "0501080D0BGAFAC", "0501080D0BGAHAB", "0501080J0AAABAB", "0501080J0AAAHAH", "0501080T0AAAAAA", "0501080V0AAADAD", "0501080V0BDABAD", "0501080W0AAADAD", "0501080W0AAAEAE", "0501080W0AAAIAI", "0501080W0AAAMAM", "0501080W0AAANAN", "0501080W0BCACAI", "0501080W0BGABAE", "0501080W0BHAAAD", "0501080W0BHABAE", "0501110C0AAAEAE", "0501110C0AAAGAG", "0501110C0AAAHAH", "0501110C0AAAIAI", "0501110C0AAAJAJ", "0501110C0AAAKAK", "0501110C0AABABA", "0501110C0AABHBH", "0501110C0AABJBJ", "0501110C0AABLBL", "0501110C0AABQBQ", "0501110C0AABRBR", "0501110C0AABTBT", "0501110C0BCAAAI", "0501110C0BCABAJ", "0501110C0BCADAG", "0501110C0BCAEAH", "0501110C0BCAIAE", "0501110C0BCALA8", "0501110C0BFADAG", "0501110C0BFAEAH", "0501110C0BKAAAE", "0501110G0AAABAB", "0501110G0BBAAAB", "0501120L0AAAAAA", "0501120L0AAABAB", "0501120L0AAADAD", "0501120L0AAAFAF", "0501120L0AAAGAG", "0501120L0AAAJAJ", "0501120L0AAAQAQ", "0501120L0AAAYAY", "0501120L0AABEBE", "0501120L0AABFBF", "0501120L0AABGBG", "0501120L0AABQBQ", "0501120L0BBAAAA", "0501120L0BBABAF", "0501120L0BBADAJ", "0501120L0BBAJBG", "0501120N0AAAAAA", "0501120N0BBAAAB", "0501120N0BDAAAC", "0501120P0AAAAAA", "0501120P0AAABAB", "0501120P0AAACAC", "0501120P0BBAAAA", "0501120P0BBACAB", "0501120Q0AAAAAA", "0501120Q0BBAAAA", "0501120X0AAAAAA", "0501120X0AAABAB", "0501120X0AAACAC", "0501120X0AAADAD", "0501120X0AAAFAF", "0501120X0BBAAAA", "0501120X0BBABAB", "0501120X0BCACAA", "0501120Y0AAAAAA", "0501120Y0BBAAAA", "0501130H0AAAAAA", "0501130H0BBAAAA", "0501130R0AAAAAA", "0501130R0AAABAB", "0501130R0AAACAC", "0501130R0AAADAD", "0501130R0AAAEAE", "0501130R0AAAGAG", "0501130R0AAAJAJ", "0501130R0AAAMAM", "0501130R0AAANAN", "0501130R0AAATAT", "0501130R0AAAUAU", "0501130R0AAAVAV", "0501130R0AABDBD", "0501130R0AABEBE", "0501130R0AABNBN", "0501130R0AABSBS", "0501130R0AABWBW", "0501130R0AACGCG", "0501130R0BBAAAD", "0501130R0BBABAE", "0501130R0BBACAC", "0501130R0BCAAAA", "0501130R0BCABAB", "0501130R0BGAAAG", "0501130R0BHAAAE", "0501130R0BHABAD", "0501130S0AAAAAA", "0501130S0BBAAAA")
 GROUP BY month, practice_id