Skip to content

Commit 1a907f8

Browse files
committed
Updated the locations of GP Practices in Trafford using the latest data. This matches with the patient registrations data updated yesterday.
1 parent 1b9e318 commit 1a907f8

4 files changed

Lines changed: 96 additions & 105 deletions

File tree

general_practice/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@
5353
</tr>
5454
<tr>
5555
<td>Last updated</td>
56-
<td>2022-06-10</td>
56+
<td>2023-06-14</td>
5757
</tr>
5858
<tr>
5959
<td>Notes</td>
60-
<td>The postcodes for GP Practice are matched with centroids derived from the latest release of the <a href="https://geoportal.statistics.gov.uk/datasets/ons-postcode-directory-latest-centroids">ONS Postcode Directory</a></td>
60+
<td>The postcodes for GP Practices are matched with centroids derived from the May 2023 release of the <a href="https://geoportal.statistics.gov.uk/datasets/ons-postcode-directory-may-2023/about">ONS Postcode Directory</a></td>
6161
</tr>
6262
<tr>
6363
<td>Lab visualisation</td>

general_practice/pre-processing.R

Lines changed: 40 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -58,34 +58,53 @@ df <- read_csv("epraccur.csv",
5858
# drop variables starting NULL
5959
select(-starts_with("NULL"))
6060

61-
# optional steps ---------------------------------------------------------------
61+
62+
# Tidy up filesystem
63+
file.remove("epraccur.csv")
64+
file.remove("epraccur.pdf")
65+
66+
67+
# Get just GPs in Trafford ---------------------------------------------------------------
68+
69+
# NOTE Clinical Commissioning Groups (CCG) were abolished in favour of Integrated Care Boards (ICB) in 2022.
70+
# ICB22NM: NHS Greater Manchester Integrated Care Board
71+
# ICB22CD: E54000057
72+
# ICB22CDH: QOP
6273

6374
library(httr) ; library(jsonlite) ; library(sf)
6475

65-
# retrieve postcode centroids for your CCG
66-
ccg = "E38000187"
67-
url <- paste0("https://ons-inspire.esriuk.com/arcgis/rest/services/Postcodes/ONS_Postcode_Directory_Latest_Centroids/MapServer/0/query?where=UPPER(ccg)%20like%20'%25", URLencode(toupper(ccg), reserved = TRUE), "%25'&outFields=pcds,ccg,lat,long&outSR=4326&f=json")
68-
postcodes <- fromJSON(content(GET(url), "text", encoding="UTF-8"))$features$attributes %>%
69-
rename(Postcode = pcds)
76+
# Retrieve postcode centroids for Trafford - https://geoportal.statistics.gov.uk/datasets/ons-postcode-directory-may-2023/about
77+
pcode_file_reference <- "ONSPD_MAY_2023_UK" # makes it easier to change this once here than throughout the code below
78+
79+
tmp <- tempfile(fileext = ".zip")
80+
GET(url = "https://www.arcgis.com/sharing/rest/content/items/bd25c421196b4546a7830e95ecdd70bc/data",
81+
write_disk(tmp))
7082

71-
# filter GP Practices by matching postcodes
72-
geo <- left_join(df, postcodes, by = "Postcode") %>%
73-
filter(!is.na(ccg))
83+
unzip(tmp, exdir = pcode_file_reference) # extract the contents of the zip
7484

75-
# remove inactive GP practices and rename variables
76-
results <- geo %>%
77-
filter(`Status Code` == "Active") %>%
78-
select(Name, Address, Postcode,
79-
telephone = `Contact Telephone Number`, lon = long, lat) %>%
80-
rename_all(tolower)
85+
# delete the downloaded zip
86+
unlink(tmp)
87+
88+
postcodes <- read_csv(paste0(pcode_file_reference, "/Data/", pcode_file_reference, ".csv")) %>%
89+
filter(oslaua == "E08000009") %>%
90+
select(Postcode = pcds,
91+
lon = long,
92+
lat = lat)
93+
94+
# remove the postcodes folder (contents of the zip)
95+
unlink(pcode_file_reference, recursive = TRUE)
96+
97+
# Get just GPs in Trafford by matching to Trafford postcodes and filtering to select only active GP Practices
98+
gp <- inner_join(df, postcodes, by = "Postcode") %>%
99+
filter(`Prescribing Setting` == "GP Practice",
100+
`Status Code` == "Active") %>%
101+
select(Name, Address, Postcode,
102+
telephone = `Contact Telephone Number`, lon, lat) %>%
103+
rename_all(tolower)
81104

82105
# write results as CSV and GeoJSON
83-
write_csv(results, "trafford_general_practices.csv")
106+
write_csv(gp, "trafford_general_practices.csv")
84107

85-
st_as_sf(results, coords = c("lon", "lat")) %>%
108+
st_as_sf(gp, coords = c("lon", "lat")) %>%
86109
st_set_crs(4326) %>%
87110
st_write("trafford_general_practices.geojson")
88-
89-
# Tidy up filesystem
90-
file.remove("epraccur.csv")
91-
file.remove("epraccur.pdf")
Lines changed: 27 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,28 @@
11
name,address,postcode,telephone,lon,lat
2-
Park Medical Practice,"Park Medical Practice, 405 Stockport Road, Altrincham",WA15 7XR,0161 9733485,-2.31569505,53.39855957
3-
Altrincham Medical Practice,"Altrincham Medical Pract, Lloyd House, 7 Lloyd St., Altrincham, Cheshire",WA14 2DD,0161 9282424,-2.351614,53.38451004
4-
Urmston Group Practice,"6 Woodsend Crescent Road, Urmston, Manchester",M41 8AA,0161 7559870,-2.3940661,53.45249176
5-
Timperley Health Centre (Westwood),"Timperley Health Centre, 169 Grove Lane, Timperley, Altrincham, Cheshire",WA15 6PH,0161 9803751,-2.32356596,53.39722824
6-
Shay Lane Medical Centre (Kelman),"Shay Lane Medical Centre, Shay Lane, Hale Barns, Altrincham, Cheshire",WA15 8NZ,0161 9803835,-2.3155601,53.37218857
7-
Davyhulme Medical Centre,"130 Broadway, Davyhulme,Urmston, Manchester",M41 7WJ,0161 7485559,-2.36678195,53.4594841
8-
Shay Lane Medical Centre (Patel),"Shay Lane Medical Centre, Shay Lane, Hale Barns, Altrincham, Cheshire",WA15 8NZ,0161 9802656,-2.3155601,53.37218857
9-
Primrose Surgery,"59 Old Crofts Bank, Urmston, Manchester",M41 7AB,0161 7472424,-2.35731101,53.45615768
10-
Boundary House Medical Centre,"Boundary House, 462 Northenden Road, Sale, Cheshire",M33 2RH,0161 9729999,-2.2889359,53.41563416
11-
Washway Road Medical Centre,"Washway Road Medical Ctr., 67 Washway Road, Sale, Cheshire",M33 7SS,0161 9624354,-2.32828808,53.42251587
12-
West Timperley Medical Centre,"West Timperley Med. Ctr., 21 Dawson Road, West Timperley, Altrincham, Cheshire",WA14 5PF,0161 9291515,-2.35311699,53.40269852
13-
Bodmin Road Health Centre,"Bodmin Road Health Centre, Bodmin Road, Sale, Cheshire",M33 5JH,0161 9624625,-2.35171795,53.42812347
14-
Delamere Medical Practice,"The Delamere Med Pract, Delamere Avenue, Stretford, Manchester",M32 0DF,0161 8640200,-2.30736494,53.45088577
15-
Partington Central Surgery,"Partington Central Surg, Partington Health Centre, Central Road, Partington, Manchester",M31 4FY,0161 7757032,-2.42501593,53.41678238
16-
Limelight Health And Wellbeing Hub,"Limelight, 1 St Brides Way, Old Trafford, Manchester",M16 9NW,0161 2267777,-2.26196909,53.46141052
17-
Firsway Health Centre,"121 Firsway, Sale, Cheshire",M33 4BR,0161 9050310,-2.35546803,53.42128754
18-
Partington Family Practice,"Partington Health Centre, Central Road, Partington, Manchester",M31 4FL,0161 7757033,-2.42617011,53.41778564
19-
Flixton Road Medical Centre,"Flixton Road Medical Ctr, 132 Flixton Road, Urmston, Manchester",M41 5BG,0161 7482021,-2.36266398,53.44826889
20-
Conway Road Medical Practice,"Conway Road Med Practice, 80a Conway Road, Sale, Cheshire",M33 2TB,0161 9731151,-2.30356097,53.41787338
21-
Barrington Medical Centre,"33 Market Street, Altrincham, Cheshire",WA14 1PF,0161 9289621,-2.3526299,53.38743591
22-
St Johns Medical Centre,"Altrincham Health, 31-33 Market Street, Altrincham, Cheshire",WA14 1PF,0161 9285522,-2.3526299,53.38743591
23-
Family Surgery,"The Surgery, 94 Navigation Road, Altrinchan, Cheshire",WA14 1LL,0161 9299300,-2.34605503,53.39619446
24-
Village Surgery,"The Village Surgery, Timperley Health Centre, 169 Grove Lane,Timperley, Cheshire",WA15 6PH,0161 9039010,-2.32356596,53.39722824
25-
Lostock Medical Centre,"431 Barton Road, Stretford, Manchester",M32 9PA,0161 8651100,-2.3281281,53.4545784
26-
North Trafford Group Practice,"North Trafford Group Prac, 864/866 Chester Road, Stretford, Manchester",M32 0PA,0161 8655556,-2.29942107,53.45395279
27-
Riddings Family Health Centre,"Riddings Family Hlth Ctr, 34 Riddings Road, Timperley, Altrincham, Cheshire",WA15 6BP,0161 9629662,-2.33129096,53.40442276
28-
Grove Medical Practice,"Grove Medical Practice, 169 Grove Lane,Timperley, Altrincham, Cheshire",WA15 6PH,0161 9039302,-2.32356596,53.39722824
29-
Trafford Drug Service,"454 Chester Road, Old Trafford, Manchester",M16 9HD,0161 7868250,-2.268471,53.46540451
30-
Trafford Health Centre Wic,"Trafford General Hospital, Moorside Road, Manchester",M41 5SL,0161 7474975,-2.37068105,53.4540596
31-
Nmps Trafford Lco,"Meadway Health Centre, Meadway, Sale, Cheshire",M33 4PS,0161 5496227,-2.34429908,53.41332245
32-
Community Geriatricians,"Ascot House, Ascot Avenue, Sale",M33 4GT,0161 9620996,-2.35516405,53.41724396
33-
Mss Rheumatology,"Mss,Trafford Hospital, Moorside Road,Davyhulme, Manchester",M41 5SL,0161 7462434,-2.37068105,53.4540596
34-
Community Paediatrics Tlco,"1st Floor Waterside House, Waterside Plaza, Sale, Cheshire",M33 7ZF,0161 9125945,-2.31999993,53.42510986
35-
Adult Adhd Cheshire Priory Service,"Priory Hosp Altringham, Rappax Road, Hale, Cheshire",WA15 0NU,0161 9040050,-2.32711792,53.36642838
36-
Pes @ Johnson&Leatherbarrow Trafford Ccg,"28 School Road, Sale",M33 7XF,0161 9051104,-2.32090306,53.42505264
37-
Pes @ David Arnold Trafford Ccg,"17 Green Lane, Ashton On Mersey, Sale",M33 5PN,0161 9733674,-2.3423841,53.4296608
38-
Pes @ Thomas Carter Trafford Ccg,"4 Station Road, Urmston, Manchester",M41 9JN,0161 7475555,-2.35308099,53.44734573
39-
Pes @ Stotts Opticians Urmston Traf Ccg,"Stotts Opticians, 8 Crofts Bank Road, Urmston, Manchester",M41 0TS,0161 7484920,-2.3527329,53.44901657
40-
Pes @ Specsavers Altrincham Trafford Ccg,"95 George Street, Altrincham",WA14 1RN,0161 9295555,-2.3505919,53.38651657
41-
Pes @ Specsavers Sale Trafford Ccg,"Specsavers Opticians, 31-32 Stanley Square, Sale",M33 7ZZ,0161 9692001,-2.32319999,53.42432785
42-
Pes @ Specsavers Urmston Trafford Ccg,"3 Crofts Bank Road, Urmston, Manchester",M41 0TZ,0161 7470425,-2.35341096,53.44903183
2+
Park Medical Practice,"Park Medical Practice, 405 Stockport Road, Altrincham",WA15 7XR,0161 9733485,-2.315695,53.398559
3+
Altrincham Medical Practice,"Altrincham Medical Pract, Lloyd House, 7 Lloyd St., Altrincham, Cheshire",WA14 2DD,0161 9282424,-2.351614,53.38451
4+
Urmston Group Practice,"6 Woodsend Crescent Road, Urmston, Manchester",M41 8AA,0161 7559870,-2.394066,53.452491
5+
Timperley Health Centre (Westwood),"Timperley Health Centre, 169 Grove Lane, Timperley, Altrincham, Cheshire",WA15 6PH,0161 9803751,-2.323566,53.397228
6+
Shay Lane Medical Centre (Kelman),"Shay Lane Medical Centre, Shay Lane, Hale Barns, Altrincham, Cheshire",WA15 8NZ,0161 9803835,-2.31556,53.372189
7+
Davyhulme Medical Centre,"130 Broadway, Davyhulme,Urmston, Manchester",M41 7WJ,0161 7485559,-2.366782,53.459483
8+
Shay Lane Medical Centre (Patel),"Shay Lane Medical Centre, Shay Lane, Hale Barns, Altrincham, Cheshire",WA15 8NZ,0161 9802656,-2.31556,53.372189
9+
Primrose Surgery,"59 Old Crofts Bank, Urmston, Manchester",M41 7AB,0161 7472424,-2.357311,53.456159
10+
Boundary House Medical Centre,"Boundary House, 462 Northenden Road, Sale, Cheshire",M33 2RH,0161 9729999,-2.288936,53.415635
11+
Washway Road Medical Centre,"Washway Road Medical Ctr., 67 Washway Road, Sale, Cheshire",M33 7SS,0161 9624354,-2.328288,53.422516
12+
West Timperley Medical Centre,"West Timperley Med. Ctr., 21 Dawson Road, West Timperley, Altrincham, Cheshire",WA14 5PF,0161 9291515,-2.353117,53.402699
13+
Bodmin Road Health Centre,"Bodmin Road Health Centre, Bodmin Road, Sale, Cheshire",M33 5JH,0161 9624625,-2.351718,53.428123
14+
Delamere Medical Practice,"The Delamere Med Pract, Delamere Avenue, Stretford, Manchester",M32 0DF,0161 8640200,-2.307365,53.450887
15+
Partington Central Surgery,"Partington Central Surg, Partington Health Centre, Central Road, Partington, Manchester",M31 4FY,0161 7757032,-2.425016,53.416781
16+
Limelight Health And Wellbeing Hub,"Limelight, 1 St Brides Way, Old Trafford, Manchester",M16 9NW,0161 2267777,-2.261969,53.461412
17+
Firsway Health Centre,"121 Firsway, Sale, Cheshire",M33 4BR,0161 9050310,-2.355468,53.421289
18+
Partington Family Practice,"Partington Health Centre, Central Road, Partington, Manchester",M31 4FL,0161 7757033,-2.42617,53.417784
19+
Flixton Road Medical Centre,"Flixton Road Medical Ctr, 132 Flixton Road, Urmston, Manchester",M41 5BG,0161 7482021,-2.362664,53.448267
20+
Conway Road Medical Practice,"Conway Road Med Practice, 80a Conway Road, Sale, Cheshire",M33 2TB,0161 9731151,-2.303561,53.417873
21+
Barrington Medical Centre,"33 Market Street, Altrincham, Cheshire",WA14 1PF,0161 9289621,-2.35263,53.387437
22+
St Johns Medical Centre,"Altrincham Health, 31-33 Market Street, Altrincham, Cheshire",WA14 1PF,0161 9285522,-2.35263,53.387437
23+
Family Surgery,"The Surgery, 94 Navigation Road, Altrinchan, Cheshire",WA14 1LL,0161 9299300,-2.346055,53.396194
24+
Village Surgery,"The Village Surgery, Timperley Health Centre, 169 Grove Lane,Timperley, Cheshire",WA15 6PH,0161 9039010,-2.323566,53.397228
25+
Lostock Medical Centre,"431 Barton Road, Stretford, Manchester",M32 9PA,0161 8651100,-2.328128,53.45458
26+
North Trafford Group Practice,"North Trafford Group Prac, 864/866 Chester Road, Stretford, Manchester",M32 0PA,0161 8655556,-2.299421,53.453953
27+
Riddings Family Health Centre,"Riddings Family Hlth Ctr, 34 Riddings Road, Timperley, Altrincham, Cheshire",WA15 6BP,0161 9629662,-2.331291,53.404424
28+
Grove Medical Practice,"Grove Medical Practice, 169 Grove Lane,Timperley, Altrincham, Cheshire",WA15 6PH,0161 9039302,-2.323566,53.397228

0 commit comments

Comments
 (0)