opensafely / codelist-development

Repository for discussion of OpenSAFELY codelists
7 stars 3 forks source link

Importing NHSD medication codelists from SNOMED refsets #233

Open chrisjwood16 opened 1 year ago

chrisjwood16 commented 1 year ago

Impact and Investment Fund business rules specify a number of medication codelists within SNOMED refsets.

The medication lists can be viewed by searching corresponding SNOMED code in SNOMED browser, (example) then selecting members tab. The list defaults to displaying only the first 100 items, an extra 100 items can be added at a time with further clicking but some items contain a few thousand items making this time consuming.

I'm not sure if there is already a way to import these into OpenCodelists? If not I'm wondering how much effort would be needed to setup a way to do this. I can do manually if complex/time consuming to implement. But there are likely to more of these requiring import in future:

Cluster name Description SNOMED CT Type
ANTIMICROBIALDRUG_COD Systemic antimicrobials ^154091000001103 DM+D
BENZODRUG_COD Benzodiazepine and benzodiazepine related medication including z-drugs ^226291000001104 DM+D
DIRECTORANTICOAGDRUG_COD Direct Oral anticoagulant drug codes ^92161000001100 DM+D
GABADRUG_COD Gabapentinoid drugs ^154481000001106 DM+D
NONASPANTIPLTDRUG_COD Non aspirin antiplatelet drug codes ^154491000001108 DM+D
NONSELBBDRUG_COD Non-selective betablocker medication codes ^94871000001106 DM+D
OPIOIDDRUG_COD All opioids except heroin substitutes ^154171000001103 DM+D
ORALNSAIDDRUG_COD Oral non-steroidal anti-inflammatory drugs (NSAIDs) ^154181000001101 DM+D
ORANTICOAGDRUG_COD Oral anticoagulant drug codes ^12463501000001109 DM+D
SAL_COD Salicylate prescription codes ^12463701000001103 DM+D
STRONGOPIOIDDRUG_COD Strong opioid drugs ^153791000001103 DM+D
ULCERHEALDRUG_COD Gastroprotective drugs ^153991000001100 DM+D
VSTRONGOPIOIDDRUG_COD Morphine 120mg or greater equivalence opioid drugs ^154131000001100 DM+D

See also issue 232 for clinical code clusters.

brianmackenna commented 1 year ago

My recollection is that there is another NHSD website that has .txt files that we imported

chrisjwood16 commented 1 year ago

Ah great thanks Brian, Done some more digging - seems the following contains the info needed: https://isd.digital.nhs.uk/trud/users/authenticated/group/0/pack/26/subpack/105/releases

Full drug ref sets are contained in the file: der2_Refset_SimpleUKDGFull_GB1000001_20220706.txt

Relevant fields: refsetId contains SNOMED parent code as in table above. referencedComponentId contains SNOMED code for each drug within ref set. One row per component. active - needed to anything filter out anything marked as inactive

If there is a process in place to extra and import into OpenCodelist that would be great. Otherwise I can work with these files.