Skip to content

Measure definitions

Chris Wood edited this page Feb 6, 2024 · 10 revisions

A Measure object describes how a measure is calculated, and how the calculation is displayed to users on the website. Each measure definition is stored in a JSON object in a file in the openprescribing/measure_definitions directory. This page describes the expected attributes of a Measure object -- if in doubt, ask a coder!

id

Used in URLs for pages about measures, eg https://openprescribing.net/measure/keppra/.

name

Used in page headings.

title

Unused, as far as I can tell.

description

Describes briefly how the meaure is calculated. Used on the main measure pages and in certain graph titles.

why_it_matters

Explains why the measure matters! Used on the main measure pages.

tags

A list of tags for this measure. Available tags are listed in openprescribing/common/measure_tags.json.

tags_focus

Used for omnibus measures, of which lpzomnibus is the only example we have at the moment.

include_in_alerts

true/false (default: true), indicating whether measure should be included in alerts.

url

Not set for any current measure, but would be used for a "read more..." link on the main measure pages.

is_percentage

true/false, indicating whether measure ratio is a percentage (which would be the case if the numerator and denominator were both sums of items/quantities/costs, with the numerator summing over a subset of the things the denominator sums over). This is used for certain calculations related to cost savings for cost-based measures.

is_cost_based

true/false, indicating whether it is meaningful to calculate cost savings.

low_is_good

true/false/null, indicating whether a low ratio is good, bad, or neither.

(num_or_denom)_short

Used in chart tool-tips.

(num_or_denom)_type

One of:

  • custom (eg aafpercent, bdzadq, lpherbal`)
  • bnf_items (eg dipyridamole, ciclosporin)
  • bnf_quantity (eg desogestrel, keppra)
  • bnf_cost (eg all the lp* measures)
  • list_size, denominator_type only (eg all the lp* measures, coproxamol)
  • star_pu_antibiotics, denominator_type only (ktt9_antibiotics, ktt9_cephalosporins_star)

(num_or_denom)_columns

Only required if (num_or_denom)_type is custom.

(num_or_denom)_from

Only required if (num_or_denom)_type is custom.

(num_or_denom)_where

Only required if (num_or_denom)_type is custom or bnf_*.

(num_or_denom)_is_list_of_bnf_codes

true/false. Only required if (num_or_denom)_type is custom. Indicates whether numerator/denominator is computed from a list of BNF codes.

numerator_bnf_codes_query

Only required for custom numerators/denominators if (num_or_denom)_is_list_of_bnf_codes is not set to False. Used to populate numerator_bnf_codes.

numerator_bnf_codes

This is computed, and should not be set manually. This is a list of BNF codes of presentations that have appeared in the measure's denominator in the last three months. Used for the "presentations contributing to variation" page, and for the link from the measure to the analyse page.

analyse_url

This is computed, and should not be set manually.

radar_exclude

Default should be false. Should be set to true if measure should be excluded from prescribing radar e.g. measures where low isn't necessarily better - e.g. uptake of continuous glucose monitors.

no_analyse_url

Default should be false. If set to true, stops the measure having a "look at this on the analyse page" link

Clone this wiki locally