Ghost-branded generic excess spend

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 Excess spend on ghost-branded generics (more info) as a percentage of all spending on generics
Why it matters When an item is prescribed generically, the dispenser is reimbursed at the price in the Drug Tariff; but when a manufacturer is stated, the reimbursement price is usually more expensive. A list of products which have been prescribed as ghost-generics is available on every CCG and Practice dashboard page. Read more in our FAQ and our blog.
Tags Cost Saving, Standard, Generic prescribing
Implies cost savings No
History View change history on GitHub →

Numerator SQL

SELECT
     CAST(month AS DATE) AS month,
     practice AS practice_id,
     SUM(possible_savings) AS numerator
 FROM measures.vw__ghost_generic_measure p
 WHERE (possible_savings >= 2 OR possible_savings <=-2)
 GROUP BY month, practice_id

Denominator SQL

SELECT
     CAST(month AS DATE) AS month,
     practice AS practice_id,
     SUM(net_cost) AS denominator
 FROM measures.vw__ghost_generic_measure p
 GROUP BY month, practice_id