Skip to contents

Returns details of a specific area at a given time period, including details about any parent and child areas.

Usage

cvd_area_details(time_period_id = 1, area_id = 1)

Arguments

time_period_id

integer - specified time period for which to return details for, i.e. population and participation rate (compulsory)

area_id

integer - specified area id for which to return details for.

Value

Named list of tibbles containing area 'area_details', child 'area_child_details' (where appropriate) and parent 'area_parent_details' (where appropriate)

Details

CVD Prevent API documentation: Area details

Examples

# to see details for '3 Centres PCN' (area_id = 1103) use the following:
# get the list of tibbles from the function
returned_list <- cvd_area_details(time_period_id = 17, area_id = 1103)

# view area details
returned_list$area_details |>
  dplyr::select(AreaCode, AreaName)
#> # A tibble: 1 × 2
#>   AreaCode AreaName     
#>   <chr>    <chr>        
#> 1 U60176   3 Centres PCN

# view details for the parent of this area
returned_list$area_parent_details |>
  dplyr::select(AreaID, AreaName, SystemLevelID)
#> # A tibble: 1 × 3
#>   AreaID AreaName                       SystemLevelID
#>    <int> <chr>                                  <int>
#> 1   7959 NHS West Yorkshire ICB - X2C4Y             8

# view details for the children of this area
returned_list$area_child_details |>
  dplyr::select(AreaID, AreaName, SystemLevelID)
#> # A tibble: 5 × 3
#>   AreaID AreaName                                 SystemLevelID
#>    <int> <chr>                                            <int>
#> 1   1929 Calder View Surgery                                  5
#> 2   1932 North Road Suite,Ravensthorpe Health Ctr             5
#> 3   1938 Mirfield Health Centre                               5
#> 4   1939 Eightlands Surgery                                   5
#> 5   1978 Dr Mahmood & Partners                                5