From 8f0dbbab4f56d2e7926f8fd4f75c3b4e01287a45 Mon Sep 17 00:00:00 2001 From: Richard Croker Date: Tue, 8 Aug 2023 10:00:27 +0100 Subject: [PATCH 1/3] Create insulin_disposable.json create prototype measure --- .../insulin_disposable.json | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 openprescribing/measure_definitions/insulin_disposable.json diff --git a/openprescribing/measure_definitions/insulin_disposable.json b/openprescribing/measure_definitions/insulin_disposable.json new file mode 100644 index 0000000000..2e750edc24 --- /dev/null +++ b/openprescribing/measure_definitions/insulin_disposable.json @@ -0,0 +1,54 @@ +{ + "name": "Prescribing of disposable insulin devices", + "title": "Prescribing of disposable insulin devices", + "description": "Prescribing of disposable insulin devices as percentage of all insulin prescribing", + "why_it_matters": [ + "" + ], + "numerator_short": "Items of disposable insulin devices", + "denominator_short": "Items for all insulin devices", + "url": null, + "is_percentage": true, + "is_cost_based": false, + "low_is_good": yes, + "tags": [ + "core", + "diabetes", + "greenernhs" + ], + "numerator_type": "bnf_items", + "numerator_from": [ + "{hscic}.normalised_prescribing p", + "INNER JOIN {dmd}.vmp v --this joins data table to dm+d vmp table \n", + "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 \n", + "INNER JOIN {dmd}.vtm t --this joins VMP table to VTM table \n", + "ON v.vtm = t.id", + "INNER JOIN {dmd}.unitofmeasure u --this joins to unit of measure table to get device details \n", + "ON v.unit_dose_uom = u.cd" + ], + "numerator_where": [ + "lOWER(t.nm) LIKE '%insulin%' -- filters to any insulin \n", + "and LOWER(u.descr) = 'pre-filled disposable injection' -- filters to disposable pens" + ], + "denominator_type": "bnf_items", + "denominator_from": [ + "{hscic}.normalised_prescribing p", + "INNER JOIN {dmd}.vmp v --this joins data table to dm+d vmp table \n", + "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 \n", + "INNER JOIN {dmd}.vtm t --this joins VMP table to VTM table \n", + "ON v.vtm = t.id", + "INNER JOIN {dmd}.unitofmeasure u --this joins to unit of measure table to get device details \n", + "ON v.unit_dose_uom = u.cd" + ], + "denominator_where": [ + "lOWER(t.nm) LIKE '%insulin%' -- filters to any insulin \n", + "and LOWER(u.descr) IN('pre-filled disposable injection', 'cartridge') -- filters to disposable pens and catridges" + ], + "date_reviewed":"", + "next_review": "1", + "authored_by": "richard.croker@phc.ox.ac.uk", + "checked_by":"", + "measure_complexity":"medium", + "measure_type": "dmd", + "radar_exclude": false +} From 1dd400725eaf1aa8d4ae09717563b9c1e727691c Mon Sep 17 00:00:00 2001 From: Richard Croker Date: Tue, 8 Aug 2023 10:01:43 +0100 Subject: [PATCH 2/3] Update insulin_disposable.json --- openprescribing/measure_definitions/insulin_disposable.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openprescribing/measure_definitions/insulin_disposable.json b/openprescribing/measure_definitions/insulin_disposable.json index 2e750edc24..50a4672b69 100644 --- a/openprescribing/measure_definitions/insulin_disposable.json +++ b/openprescribing/measure_definitions/insulin_disposable.json @@ -10,7 +10,7 @@ "url": null, "is_percentage": true, "is_cost_based": false, - "low_is_good": yes, + "low_is_good": true, "tags": [ "core", "diabetes", From 71e2149f767fe8020e90dbc2e2d936f1b30a9e81 Mon Sep 17 00:00:00 2001 From: Richard Croker Date: Tue, 8 Aug 2023 10:12:02 +0100 Subject: [PATCH 3/3] Update insulin_disposable.json amend denominator and numerator columns --- openprescribing/measure_definitions/insulin_disposable.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openprescribing/measure_definitions/insulin_disposable.json b/openprescribing/measure_definitions/insulin_disposable.json index 50a4672b69..666fd0a802 100644 --- a/openprescribing/measure_definitions/insulin_disposable.json +++ b/openprescribing/measure_definitions/insulin_disposable.json @@ -16,7 +16,8 @@ "diabetes", "greenernhs" ], - "numerator_type": "bnf_items", + "numerator_type": "custom", + "numerator_columns": "SUM(items) AS numerator", "numerator_from": [ "{hscic}.normalised_prescribing p", "INNER JOIN {dmd}.vmp v --this joins data table to dm+d vmp table \n", @@ -30,7 +31,8 @@ "lOWER(t.nm) LIKE '%insulin%' -- filters to any insulin \n", "and LOWER(u.descr) = 'pre-filled disposable injection' -- filters to disposable pens" ], - "denominator_type": "bnf_items", + "denominator_type": "custom", + "denominator_columns": "SUM(items) AS denominator", "denominator_from": [ "{hscic}.normalised_prescribing p", "INNER JOIN {dmd}.vmp v --this joins data table to dm+d vmp table \n",