Skip to contents

Returns given area and children areas in a nested structure

Usage

cvd_area_nested_subsystems(area_id)

Arguments

area_id

integer - the area to return data for (compulsory)

Value

List of named tibbles containing details for the area and each sub-level areas

Details

CVD Prevent API documentation: Area nested subsystems

Examples

# View details for for Somerset STP
returned_list <- cvd_area_nested_subsystems(area_id = 5)
returned_list |> summary()
#>         Length Class  Mode
#> level_1 7      tbl_df list
#> level_2 7      tbl_df list
#> level_3 7      tbl_df list

# see details for five of the immediate children of Somerset STP
returned_list$level_2 |>
  dplyr::slice_head(n = 5)
#> # A tibble: 1 × 7
#>   AreaCode  AreaID AreaName         AreaOdsCode ParentAreaID SystemLevelID
#>   <chr>      <int> <chr>            <chr>              <int>         <int>
#> 1 E38000150    105 NHS Somerset CCG 11X                    5             3
#> # ℹ 1 more variable: SystemLevelName <chr>

# View details for Leicester Central PCN
returned_list <- cvd_area_nested_subsystems(area_id = 701)
returned_list |> summary()
#>         Length Class  Mode
#> level_1 6      tbl_df list

# see details for the GP practice children of the PCN
returned_list$level_2
#> NULL