rcpch / national-paediatric-diabetes-audit

A django application to audit the care of children and young people with diabetes in England and Wales.
0 stars 1 forks source link

Can only look up GP in new patient form if postcode has a space #164

Closed mbarton closed 2 weeks ago

mbarton commented 3 months ago

The NHS spine API is fussy and requires the postcode to have a space in it otherwise the lookup fails and you get a full screen error

mbarton commented 3 months ago

Fixing https://github.com/rcpch/national-paediatric-diabetes-audit/issues/163 first would at least reduce it down to a validation error.

I'm not sure there's a sensible way we can add a space to the postcode automatically but we can at least prompt the user to do it in the error message.

eatyourpeas commented 3 months ago

If we go back to postcodes io which is maybe a good idea, we could fix the postcode using that: [here] (https://api.postcodes.io/) for example you get data back against a postcode which would buy validate it and give a cleaned version

mbarton commented 3 months ago

Moving back to postcodes.io would help with https://github.com/rcpch/national-paediatric-diabetes-audit/issues/147 too.

According to their docs at least they are up to date with the May 2024 ONS data so hopefully the issues we had in E12 with missing postcodes are fixed?

I'd also be keen to explore running it ourselves which is easy given they publish docker containers. That way we don't send postcodes outside of our own systems.

mbarton commented 1 month ago

I've managed to set up a self hosted instance of postcodes.io this morning, they've made it so easy!

https://postcodes-io.greenrock-df7c746b.uksouth.azurecontainerapps.io

Response time of around 50ms

eatyourpeas commented 1 month ago

Amazing! Thank you Michael feel much happier about that When new postcodes are published, how does it update”? S

mbarton commented 1 month ago

We'd have to keep it up to date as they publish new versions of the Docker images. Being open source though perhaps there's a way to collaborate with updates or at worst do a full new build ourselves