opensafely-core / cohort-extractor

Cohort extractor tool which can generate dummy data, or real data against OpenSAFELY-compliant research databases
Other
38 stars 13 forks source link

Prioritise Ethnicity Lookups in SUS #498

Open ghickman opened 3 years ago

ghickman commented 3 years ago

We need some form of tie-breaker for the with_ethnicity_from_sus variable in the case where a patient has an equal number of ethnicities records.

It would also be useful to prioritise which datasets we look these up from.

HelenCEBM commented 3 years ago

We should prioritise in the order APC, AE, OP as per NHS Digital - ie. look for most frequent in APCS and use this if present, if not then look in AE and so on. (Though I'm not clear if this matches the full NHSD methodology e.g. do they look for most frequent or latest?)

The logic behind this is that admitted patients are more likely to have an accurate ethnicity recorded than the brief encounters in outpatients or the hectic environment of A&E.

sebbacon commented 3 years ago

Can you dig out a link to that NHSD documentation?

HelenCEBM commented 3 years ago

Can you dig out a link to that NHSD documentation?

Not sure I have it, I got this from what you posted in slack...