Skip to contents

Returns data for the SystemLevel Comparison chart for provided metric, area and time period. Data contains the target value as well as an array SystemLevels which contains data grouped by system level.

Usage

cvd_indicator_metric_systemlevel_comparison(
  metric_id = 1,
  time_period_id = 1,
  area_id = 50
)

Arguments

metric_id

integer - the metric to return data for (compulsory)

time_period_id

integer - the time period to return data for (compulsory)

area_id

integer - the area to return data for (compulsory)

Value

Tibble of metric performance for the specified area and all other areas in the same system level in the time period

Details

CVD Prevent API documentation: Indicator metric system level comparison

Examples

# return performance for metric 'AF: DOAC & VitK' in people aged 40-59 years
# (metric ID 1270) in time period 17 for Salford South East PCN (area ID 705)
# and all other PCNs - truncated to a sample of four PCN performances:
cvd_indicator_metric_systemlevel_comparison(metric_id = 1270,
time_period_id = 17, area_id = 705) |>
  dplyr::filter(AreaID %in% c(705:709), !is.na(Value)) |>
  dplyr::select(SystemLevelName, AreaID, AreaName, Value)
#> # A tibble: 4 × 4
#>   SystemLevelName AreaID AreaName                    Value
#>   <chr>            <int> <chr>                       <dbl>
#> 1 PCN                705 Salford South East PCN       80.5
#> 2 PCN                707 Haringey - North East PCN    88  
#> 3 PCN                708 Teesdale PCN                100  
#> 4 PCN                709 Spen Health & Wellbeing PCN  85.7