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 | Cost of milk formulas for Cow's Milk Protein Allergy (CMPA) per listed patients aged 0-4 |
---|---|
Why it matters | Prescribing for Cow's Milk Protein Allergy is increasing. Milk formulas are expensive, and should be reviewed regularly to ensure that they are still required, particularly when Amino Acid Formula (AAF) products are used. |
Tags | Nutrition, Standard |
Implies cost savings | No |
Authored by | richard.croker |
Checked by | andrew.brown |
Last reviewed | 2024-02-12 |
Next review due | 2026-02-12 |
Associated notebook | https://github.com/ebmdatalab/jupyter-notebooks/blob/master/new_measures/New%20Measure%20-%20Cow's%20Milk%20Protein%20Allergy.ipynb |
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 ("0913101A0AAACAC", "0913101A0AAAEAE", "0913101A0BBAAAA", "0913101A0BCAAAB", "0913101A0BDAAAC", "0913101A0BEAAAD", "0913101A0BFAAAG", "0913101A0BGAAAE", "0913101A0BHAAAF", "0913107A0AAABAB", "0913107A0BBAAAA", "0913107A0BCAAAE", "0913107A0BDAAAB", "0913107A0BDABAC", "0913107A0BEAAAD", "0913131A0BBAAAA", "0913131A0BBABAA", "0913131B0BBAAAA", "0913132A0BBAAAA", "0913351A0BBAAAA", "0913351A0BBABAB", "0913355A0BBAAAA", "0913361A0BBAAAA", "0913361A0BBABAA", "0913361A0BBACAB", "0913361A0BBADAC", "0913361A0BBAEAC")
GROUP BY month, practice_id
SELECT
CAST(month AS DATE) AS month,
practice AS practice_id,
SUM(male_0_4 + female_0_4) AS denominator
FROM hscic.practice_statistics
GROUP BY month, practice_id