Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not all NHS trusts from the NHS API are included in trust_ltla_mapping #20

Closed
hadjipantelis opened this issue Jan 8, 2022 · 7 comments · Fixed by #28
Closed

Not all NHS trusts from the NHS API are included in trust_ltla_mapping #20

hadjipantelis opened this issue Jan 8, 2022 · 7 comments · Fixed by #28

Comments

@hadjipantelis
Copy link

Hello,

Thank you for your work on this package, it is great!

I was looking to link the data available from the NHS API on NHS Trusts to the LTLAs mapping in trust_ltla_mapping; unfortunately, the NHS API catalogue includes numerous trusts that are not available in trust_ltla_mapping. For example, the Herefordshire and Worcestershire Health and Care NHS Trust (code: R1A) seems to be gobbled in the Worcestershire Acute Hospitals NHS Trust (RWP) despite having a separate entry in the NHS API. I would maybe expect this to happen with the Nightgale hospitals (codes: 'NR0A', 'NR1H', etc. - which are missing too) but the LTLA mapping is also missing existing NHS Trusts in major cities (e.g. in Liverpool, both the Liverpool Heart and Chest Hospital NHS Foundation Trust (code: RBQ) and the Liverpool Women's NHS Foundation Trust (code: REP) are missing while available to download from the NHS API).

I understand this mapping is a probabilistic estimate based on the Secondary Uses Service (SUS) healthcare data for England that uses the counts of COVID-19 hospital discharges between 01 January 2020 and 30 September 2020. That said, all the NHS trusts mentioned above have counts during this period. (In total I think they are about ~82 NHS Trust names in the NHS API that are not in the trust_ltla_mapping)
Am I misunderstanding something or is there some limitation on the SUS dataset that makes this linkage infeasible? Is it that the mapping includes only acute NHS Trusts? (in a way my question is the opposite of #16 - I suspect @sophiemeakin's comment: "we exclude Trust-LTLA pairs with fewer than 10" is a partial answer but I try to confirm I don't misunderstand something cause they are not just a handful of trusts missing)

Thanks again for your work on this, it is really helpful!

@sophiemeakin
Copy link
Collaborator

You're correct that I believe that only acute NHS Trusts are included in the mapping, and that Trust-LTLA pairs with fewer than 10 admissions are dropped. I would expect this to account for the majority of, if not all, missing Trusts in the mapping. If this is not the case, then it would be that they were not present in the raw data that we used to make the mapping.
We are now working on updating the mapping with a new and more recent data source. This will still focus on acute NHS Trusts, but should hopefully include more pairs that were initially excluded due to low (<10) counts as we will be using a longer time window (compared to January - September 2020).

@hadjipantelis
Copy link
Author

Thank you for the clarification and the quick response.

I think that the "only acute NHS Trusts" complicates things indeed. If there is a way to include more Trusts that would be very helpful because as mentioned it is a substantial discrepancy (80+ Trusts) between the NHS API (live data) and this.

@tjmckinley
Copy link

Hi all, many thanks for this package, it is great! I was wondering if there were any updates regarding the updated mapping discussed in the reply above? I would really like to use the package to map LTLAs to trusts, but there are many missing trusts that have large numbers of admissions (at least according to the latest PHE admissions data). If there was an updated mapping that dealt with these cases, then that would be really useful. Many thanks, TJ

@sophiemeakin
Copy link
Collaborator

Hi everyone! Good news - update coming soon! I'm going to be updating the mapping with some more recent COVID-19 admissions data. I expect that this more recent version of the mapping will address the missing Trusts and a few other outstanding issues (#8 #26), too.
This data comes from a different source to the current data, so I'm going to include both versions of the mapping and use a function to access the data, rather than accessing it directly as it is currently. Hopefully it should be very easy to update any code that uses the mapping to use the function instead.
Any thoughts or suggestions welcome!

@hadjipantelis
Copy link
Author

hadjipantelis commented Aug 22, 2022

Awesome. Maybe there is a legacy argument (or a year) so the previous mapping(s) are available from a unified API?

@sophiemeakin
Copy link
Collaborator

Both the mappings (and any future versions, if necessary) will be accessed through one function with an argument source (or similar), so you will still be able to access the current version of the mapping, if needed.

@sophiemeakin sophiemeakin linked a pull request Aug 23, 2022 that will close this issue
@tjmckinley
Copy link

Awesome - many thanks Sophie!

sophiemeakin pushed a commit that referenced this issue Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants