opensafely-core / ehrql

ehrQL: the electronic health record query language for OpenSAFELY
https://docs.opensafely.org/ehrql/
Other
7 stars 3 forks source link

Decide how to handle non-patient tables in Comparative Booster study #544

Closed evansd closed 2 years ago

evansd commented 2 years ago

This is the immediate practical compliment to the more abstract question raised in:

The current comparative booster study involves a few cases of non-patient data, specifically data associated with patients' registered addresses and registered practices: https://github.com/opensafely/comparative-booster/blob/48dd15683e0d0c75e048c7b429e0372373a86145/analysis/study_definition.py#L250-L326

msoa=patients.address_as_of(
  returning="msoa",
),    

stp=patients.registered_practice_as_of(
  returning="stp_code",
),

region=patients.registered_practice_as_of(
  returning="nuts1_region_name",
),

imd=patients.address_as_of(
  returning="index_of_multiple_deprivation",
),

rural_urban=patients.address_as_of(
  returning="rural_urban_classification",
),

As regards

I think we have three options:

  1. Wait until we solve #543 properly before we can call the translation done.

  2. Decide that we don't really need the above variables for at least the initial run of the study.

  3. Use the "denormalised view" trick for these tables with a view to doing it properly later (possibly giving some suitably off-putting name to these views to make it clear they are only temporary).

evansd commented 2 years ago

As mentioned here we're going for option 3 but without the off-putting name because, although we'll probably revisit this, this is going to be longer lived than just a quick temporary workaround.