PREVIEW: Oral Nutritional Supplementation (ONS) prescribed as ready to serve liquid

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 Percentage of standard Oral Nutritional Supplementation (ONS) prescribed as ready to serve liquid
Why it matters
Tags
Implies cost savings No
History View change history on GitHub →

Numerator SQL

SELECT
     CAST(month AS DATE) AS month,
     practice AS practice_id,
     SUM(items) AS numerator
 FROM hscic.normalised_prescribing p LEFT JOIN hscic.bnf r ON p.bnf_code = r.presentation_code
 WHERE p.bnf_code LIKE '091301%' AND --ONS Standard 
 (LOWER(r.chemical) LIKE '%rts%' OR LOWER(r.chemical) LIKE '%ready to serve%')  -- items with ready to serve or rts in chemical substance
 GROUP BY month, practice_id

Denominator SQL

SELECT
     CAST(month AS DATE) AS month,
     practice AS practice_id,
     SUM(items) AS denominator
 FROM hscic.normalised_prescribing p
 WHERE p.bnf_code LIKE '091301%' --ONS Standard
 GROUP BY month, practice_id
Feedback