opensafely-core / cohort-extractor

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

Naming the system for medicines in codelists.py #839

Closed brianmackenna closed 2 years ago

brianmackenna commented 2 years ago

This may be more hassle than its worth but wanted to document it as it has caused a little confusion from time to time. It may be covered when we address #496

In codelists.py users are asked to specificy what type of terminology/system the codelist coming from OpenCodelists is (example)

To identify prescriptions to specify snomed however with_these_medications needs a dm+d codelist (example linked codelist from above)

I have written about the differences in medicines terminologies here in this draft blog

At the moment its just annoying and a bit confusing and most users sort it out. However the risk is that someone feeds in a true snomed list to with_these_medications or with_these_clinical_events thinking they are identifying prescriptions but are actually only identifying snomed entries which will be much lower than dm+d prescriptions

evansd commented 2 years ago

I'm hoping all of this will be addressed in Data Builder.

For one thing, Data Builder is strict about coding systems so it's an immediate error to try to use a SNOMEDCT codelist to query a DM+D field.

And for another, we'd like to move away from users having to specify the system associated with a codelist when they load it. OpenCodelists already knows the system, so it just introduces needless work and potential for error to have the user specify it again. There's a rough outline of a proposal for how it could all work here.

So hopefully those two thing together should solve the problem.

brianmackenna commented 2 years ago

Looks like it will from reading the linked issue. Closing the issue unless you think it should stay open @evansd