epiforecasts / covid19.nhs.data

Trust-level COVID-19 hospitalisations in England
https://epiforecasts.io/covid19.nhs.data
Other
8 stars 3 forks source link

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

Closed hadjipantelis closed 1 year ago

hadjipantelis commented 2 years ago

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 https://github.com/epiforecasts/covid19.nhs.data/issues/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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

sophiemeakin commented 2 years ago

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.

tjmckinley commented 2 years ago

Awesome - many thanks Sophie!