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 | Prescribing of amino acid formula (AAF) products as proportion of AAF and extensively hydrolysed formula (EHF) |
---|---|
Why it matters | These products are prescribed for a number of allergy indications, and are most commonly prescribed for Cow's Milk Protein Allergy (CMPA). Amino acid formula (AAF) products are almost three times more expensive than EHF and it is believed that only a small proportion of infants (thought to be around 10%) need to be started on AAF for CMPA in primary care. |
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(quantity) AS numerator
FROM hscic.normalised_prescribing
WHERE bnf_code IN ("0913107A0AAABAB", "0913107A0BBAAAA", "0913107A0BCAAAE", "0913107A0BDAAAB", "0913107A0BDABAC", "0913107A0BEAAAD", "0913131A0BBAAAA", "0913131A0BBABAA", "0913131B0BBAAAA", "0913355A0BBAAAA", "0913361A0BBAAAA", "0913361A0BBABAA", "0913361A0BBACAB", "0913361A0BBADAC", "0913361A0BBAEAC")
GROUP BY month, practice_id
SELECT
CAST(month AS DATE) AS month,
practice AS practice_id,
SUM(quantity) AS denominator
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