opensafely-core / ehrql

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

Expose `MedicationStatus` column in `medications` raw tables #1994

Closed milanwiedemann closed 4 months ago

milanwiedemann commented 4 months ago

This adds raw medications tables for all backends and exposes the MedicationStatus field. I decided not to map the values to the descriptions from the data dictionary (see https://github.com/opensafely-core/ehrql/issues/1991#issuecomment-2076828972) yet as I think we should explore this more thoroughly first, but have added this to the description of the column.

Initially, I think we only need this in TPP and I'm not even sure if EMIS provides identical information. However, because this is a core table I just added this this to EMIS schema and pretend it exises. I assume this is not the best approach but couldn't find a better way to stop the tests failing. Also, I dont know what our current approach is for updating EMIS when we make changes to core tables?

Closes #1991

cloudflare-pages[bot] commented 4 months ago

Deploying databuilder-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: daf05d0
Status: ✅  Deploy successful!
Preview URL: https://41558d72.databuilder.pages.dev
Branch Preview URL: https://milanwiedemann-expose-medica.databuilder.pages.dev

View logs

evansd commented 4 months ago

Thanks Milan. We're only just starting to establish the process for adding additional provider-specific fields to core tables. In fact, I've just done the first such PR here:

But I think this case is slightly different because there isn't currently a medications table in raw.core that we need to extend. So I think we should just be able to add it to the raw.tpp schema. Or am I missing something?

milanwiedemann commented 4 months ago

I think my problem was that I started by changing ehrql/tables/raw/core.py and subsequently the integration tests wouldnt pass without adding the same to emis

milanwiedemann commented 4 months ago

closing as this is now covered in #2002