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 | Total DDD of pregabalin + gabapentin per 1000 patients |
---|---|
Why it matters | Gabapentin and pregabalin are increasingly used in neuropathic and other types of pain, and use is rising rapidly in the NHS. There are also concerns about the potential for abuse and consequently both medicines have been reclassified legally (more information here). There appears to be no robust evidence for dose conversion between gabapentin and pregabalin. We have therefore chosen to use the Defined Daily Dose (DDD) for this measure. This is a similar dose ratio that Toth described in his paper on the substitution of gabapentin with pregabalin. Please note that this is an experimental measure. We would be grateful for any feedback at [email protected]. |
Tags | Standard, Pain, Safety |
Implies cost savings | No |
Authored by | richard.croker |
Checked by | andrew.brown |
Last reviewed | 2024-02-12 |
Next review due | 2025-02-12 |
History | View change history on GitHub → |
SELECT
CAST(month AS DATE) AS month,
practice AS practice_id,
SUM((p.quantity * i.strnt_nmrtr_val * COALESCE(n.nmtr_unit_conversion,1) / -- calculate the total unit of drug, and convert if neccesary to miligrams). Uses COALESCE to default to 1 if conversion not available
COALESCE(d.nmtr_unit_conversion * i.strnt_dnmtr_val,1) / --divides unit dose if multiple, and converts to mililitre if necessary. Uses COALESCE to default to 1 if conversion or denominator strength not available
CASE WHEN p.bnf_code LIKE '0408010AE%' THEN 300 ELSE 1800 END)) AS numerator -- divide number of miligram by 300 (pregabalin) or 1800 (gabapentin) to get DDD
FROM hscic.normalised_prescribing p INNER JOIN dmd.vmp v --this joins data table to dm+d vmp table
ON CONCAT(SUBSTR(p.bnf_code,0,9),SUBSTR(p.bnf_code,-2)) = CONCAT(SUBSTR(v.bnf_code,0,9),SUBSTR(v.bnf_code,-2)) --joins both brand and generics to vmp table
INNER JOIN dmd.vpi i -- joins vmp to vpi table to get ingredient strengths
ON v.id = i.vmp
INNER JOIN measures.vw__measure_conversion n -- joins unit conversion view to numerator unit of measure
ON i.strnt_nmrtr_uom = n.cd
LEFT JOIN measures.vw__measure_conversion d -- joins unit conversion view to denominator unit of measure (LEFT join as not all products have a denominator UOM)
ON i.strnt_dnmtr_uom = d.cd
WHERE (p.bnf_code LIKE '0408010AE%' --Pregabalin
OR p.bnf_code LIKE '0408010G0%') --Gabapentin
AND i.ing IN (
415160008, --Pregabalin ing_code
386845007) --Gabapentin ing_code
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