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 | Spend on drugs for erectile dysfunction which are not low-cost generic PD5E-inhibitor tablets per 1000 patients |
---|---|
Why it matters | Phosphodiesterase-5 (PDE-5) inhibitors are the recommended as the first line treatment for erectile dysfunction. Most of these are now generic and inexpensive, and should ideally be considered before more expensive treatments. Other treatments are also available, usually following specialist referral. |
Tags | Standard, Cost Saving, Erectile Dysfunction, Reproductive system |
Implies cost savings | Yes |
Authored by | richard.croker |
Checked by | andrew.brown |
Last reviewed | 2024-08-05 |
Next review due | 2026-08-05 |
History | View change history on GitHub → |
SELECT
CAST(month AS DATE) AS month,
practice AS practice_id,
SUM(actual_cost) AS numerator
FROM hscic.normalised_prescribing
WHERE bnf_code IN ("0704050AAAAADAD", "0704050AABBAAAA", "0704050AABBABAB", "0704050AABBACAC", "0704050AABBADAD", "0704050ACAAAAAA", "0704050ACAAABAB", "0704050ACAAACAC", "0704050ACBBAAAA", "0704050ACBBABAB", "0704050ACBBACAC", "0704050ADAAAAAA", "0704050ADBBAAAA", "0704050B0AAAAAA", "0704050B0AAAIAI", "0704050B0AAAVAV", "0704050B0AAAWAW", "0704050B0AAAZAZ", "0704050B0AABABA", "0704050B0AABBBB", "0704050B0AABDBD", "0704050B0AABFBF", "0704050B0AABJBJ", "0704050B0AABKBK", "0704050B0AABLBL", "0704050B0AABMBM", "0704050B0AABNBN", "0704050B0AABPBP", "0704050B0BBAAAA", "0704050B0BBABAI", "0704050B0BBADBD", "0704050B0BBAEBJ", "0704050B0BBAFBK", "0704050B0BCADAV", "0704050B0BCAEAW", "0704050B0BCAFBF", "0704050B0BCAGBL", "0704050B0BCAHBM", "0704050B0BCAIBN", "0704050B0BDACAZ", "0704050B0BDADBA", "0704050B0BDAEBB", "0704050B0BEAABP", "0704050J0AAAHAH", "0704050R0AAACAC", "0704050R0BBAAAA", "0704050R0BBABAB", "0704050R0BBACAC", "0704050R0BBADAD", "0704050R0BDAAAB", "0704050R0BEAAAA", "0704050Y0AAAVAV", "0704050Y0BCAAAV", "0704050Z0AAAEAE", "0704050Z0AAAFAF", "0704050Z0AAAGAG", "0704050Z0AAAIAI", "0704050Z0AAAKAK", "0704050Z0AAALAL", "0704050Z0AAAMAM", "0704050Z0AAANAN", "0704050Z0AAAPAP", "0704050Z0BBAAAA", "0704050Z0BBABAB", "0704050Z0BBACAC", "0704050Z0BDABAN", "0704050Z0BDACAP", "0704050Z0BEAAAB", "0704050Z0BEABAA", "0704050Z0BFAAAA", "0704050Z0BGAAAA", "0704050Z0BHAAAA", "0704050Z0BIAAAA")
GROUP BY month, practice_id
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