opensafely / immunosuppressant-meds-research

This repo is to support investigations into immunosuppressant medications and COVID-19 outcomes
1 stars 0 forks source link

Drug names cleaning dofile (STATA) #29

Closed myatesrheum closed 3 years ago

myatesrheum commented 3 years ago

*capture log close clear capture log close set more off set type double set scheme plotplainblind /** File : csv high cost drugs data Date created : 14/Dec/2020 Last modified: 17/Dec/2020 Input file : drug_name_unique.csv Output file : cleaned_drugs.dta **/

noi display "DATE: c(current_date)', TIME:c(current_time)'" local date = c(current_date) display "`date'"

*import delimited csv file

/* Drugs list

TNFi adalimumab humira amgevita hyrimoz idacio imraldi certolizumab cimzia etanercept enbrel benepali erelzi golimumab simponi infliximab remicade remsima flixabi inflecta zessli IL5 mepolizumab nucala IL6 tocilizumab roactemra sarilumab kevzara IL12/23 ustekinumab stelara IL23 guselkumab tremfya risankizumab skyrizi tildrakizumab ilumetri IL1 anakinra kineret IL4 dupilumab dupixent IL17 secukinumab cosentyx ixekizumab taltz brodalumab kyntheum B cell rituximab mabthera rixathon ruxience truxima ocrelizumab ocrevus CD52 alemtuzumab lemtrada CTLA4 abatacept orencia JAK tofacitinib xeljanz baricitinib olumiant upadacitinib rinvoq filgotinib jyseleca INTEGRINS vedolizumab entyvio natalizumab tysabri IGE omalizumab xolair EOSINOPHILS reslizumab cinqaero benralizumab fasenra

belimumab benlysta Anti-VEGF ranibizumab lucentis aflibercept eylea zaltrap

*/

*confirm variable with drug name in csv = drugname and convert to all lower case gen olddrugname = lower(v2)

*create drug names that all align to above lists gen cleandrugname = 1 if regexm(olddrugname, "adalimumab") recode cleandrugname .=1 if regexm(olddrugname, "amgevita") recode cleandrugname .=1 if regexm(olddrugname, "hyrimoz") recode cleandrugname .=1 if regexm(olddrugname, "humira") recode cleandrugname .=1 if regexm(olddrugname, "idacio") recode cleandrugname .=1 if regexm(olddrugname, "imraldi") gen vtm =398728003 if cleandrugname ==1

recode cleandrugname .=2 if regexm(olddrugname, "certolizumab") recode cleandrugname .=2 if regexm(olddrugname, "cimzia") recode vtm .=430307008 if cleandrugname ==2

recode cleandrugname .=3 if regexm(olddrugname, "etanercept") recode cleandrugname .=3 if regexm(olddrugname, "enbrel") recode cleandrugname .=3 if regexm(olddrugname, "benepali") recode cleandrugname .=3 if regexm(olddrugname, "erelzi") recode vtm .=118259007 if cleandrugname ==3

recode cleandrugname .=4 if regexm(olddrugname, "golimumab") recode cleandrugname .=4 if regexm(olddrugname, "simponi") recode vtm .=442318002 if cleandrugname ==4

recode cleandrugname .=5 if regexm(olddrugname, "infliximab") recode cleandrugname .=5 if regexm(olddrugname, "remsima") recode cleandrugname .=5 if regexm(olddrugname, "inflectra") recode cleandrugname .=5 if regexm(olddrugname, "zessli") recode cleandrugname .=5 if regexm(olddrugname, "remicade") recode cleandrugname .=5 if regexm(olddrugname, "flixabi") recode vtm .=108675009 if cleandrugname ==5

recode cleandrugname .=6 if regexm(olddrugname, "mepolizumab") recode cleandrugname .=6 if regexm(olddrugname, "nucala") recode vtm .=31201911000001100 if cleandrugname ==6

recode cleandrugname .=7 if regexm(olddrugname, "tocilizumab") recode cleandrugname .=7 if regexm(olddrugname, "tocilizuma") recode cleandrugname .=7 if regexm(olddrugname, "actemra") recode vtm .=444649004 if cleandrugname ==7

recode cleandrugname .=7 if regexm(olddrugname, "sarilumab") recode cleandrugname .=7 if regexm(olddrugname, "kevzara") recode vtm .=34743211000001100 if cleandrugname ==7

recode cleandrugname .=8 if regexm(olddrugname, "ustekinumab") recode cleandrugname .=8 if regexm(olddrugname, "ustekinimab") recode cleandrugname .=8 if regexm(olddrugname, "ustekinimb") recode cleandrugname .=8 if regexm(olddrugname, "stelara") recode cleandrugname .=8 if regexm(olddrugname, "stelera") recode vtm .=443644001 if cleandrugname ==8

recode cleandrugname .=9 if regexm(olddrugname, "guselkumab") recode cleandrugname .=9 if regexm(olddrugname, "tremfya") recode vtm .=35015511000001100 if cleandrugname ==9

recode cleandrugname .=9 if regexm(olddrugname, "risankizumab") recode cleandrugname .=9 if regexm(olddrugname, "skyrizi") recode vtm .=37138511000001100 if cleandrugname ==9

recode cleandrugname .=9 if regexm(olddrugname, "tildrakizumab") recode cleandrugname .=9 if regexm(olddrugname, "ilumetri") recode vtm .=36440811000001100 if cleandrugname ==9

recode cleandrugname .=10 if regexm(olddrugname, "anakinra") recode cleandrugname .=10 if regexm(olddrugname, "kineret") recode vtm .=395279009 if cleandrugname ==10

recode cleandrugname .=11 if regexm(olddrugname, "dupilumab") recode cleandrugname .=11 if regexm(olddrugname, "dupixent") recode vtm .=395279009 if cleandrugname ==11

recode cleandrugname .=12 if regexm(olddrugname, "secukinumab") recode cleandrugname .=12 if regexm(olddrugname, "secukinimab") recode cleandrugname .=12 if regexm(olddrugname, "cosentyx") recode vtm .=714689007 if cleandrugname ==12

recode cleandrugname .=12 if regexm(olddrugname, "ixekizumab") recode cleandrugname .=12 if regexm(olddrugname, "taltz") recode vtm .=32819111000001100 if cleandrugname ==12

recode cleandrugname .=12 if regexm(olddrugname, "brodalumab") recode cleandrugname .=12 if regexm(olddrugname, "brodalimumab") recode cleandrugname .=12 if regexm(olddrugname, "kyntheum") recode vtm .=34673011000001100 if cleandrugname ==12

recode cleandrugname .=13 if regexm(olddrugname, "rituximab") recode cleandrugname .=13 if regexm(olddrugname, "rituxmab") recode cleandrugname .=13 if regexm(olddrugname, "mabthera") recode cleandrugname .=13 if regexm(olddrugname, "rixathon") recode cleandrugname .=13 if regexm(olddrugname, "ruxience") recode cleandrugname .=13 if regexm(olddrugname, "truxima") recode vtm .=108809004 if cleandrugname ==13

recode cleandrugname .=13 if regexm(olddrugname, "ocrelizumab") recode cleandrugname .=13 if regexm(olddrugname, "ocrevus") recode vtm .=35058611000001100 if cleandrugname ==13

recode cleandrugname .=14 if regexm(olddrugname, "alemtuzumab") recode cleandrugname .=14 if regexm(olddrugname, "lemtrada") recode vtm .=391632007 if cleandrugname ==14

recode cleandrugname .=15 if regexm(olddrugname, "abatacept") recode cleandrugname .=15 if regexm(olddrugname, "orencia") recode vtm .=21412005 if cleandrugname ==15

recode cleandrugname .=16 if regexm(olddrugname, "tofacitinib") recode cleandrugname .=16 if regexm(olddrugname, "tofacitinab") recode cleandrugname .=16 if regexm(olddrugname, "xeljanz") recode vtm .=704316006 if cleandrugname ==16

recode cleandrugname .=16 if regexm(olddrugname, "baricitinib") recode cleandrugname .=16 if regexm(olddrugname, "baricitnib") recode cleandrugname .=16 if regexm(olddrugname, "olumiant") recode vtm .=34345911000001100 if cleandrugname ==16

recode cleandrugname .=16 if regexm(olddrugname, "upadacitinib") recode cleandrugname .=16 if regexm(olddrugname, "rinvoq") recode vtm .=38030311000001100 if cleandrugname ==16

recode cleandrugname .=16 if regexm(olddrugname, "filgotinib") recode cleandrugname .=16 if regexm(olddrugname, "jyseleca") recode vtm .=39046711000001100 if cleandrugname ==16

recode cleandrugname .=17 if regexm(olddrugname, "vedolizumab") recode cleandrugname .=17 if regexm(olddrugname, "entyvio") recode vtm .=704257002 if cleandrugname ==17

recode cleandrugname .=17 if regexm(olddrugname, "natalizumab") recode cleandrugname .=17 if regexm(olddrugname, "tysabri") recode vtm .=414804006 if cleandrugname ==17

recode cleandrugname .=18 if regexm(olddrugname, "omalizumab") recode cleandrugname .=18 if regexm(olddrugname, "xolair") recode vtm .=406442003 if cleandrugname ==18

recode cleandrugname .=19 if regexm(olddrugname, "reslizumab") recode cleandrugname .=19 if regexm(olddrugname, "cinqaero") recode vtm .=33999711000001100 if cleandrugname ==19

recode cleandrugname .=19 if regexm(olddrugname, "benralizumab") recode cleandrugname .=19 if regexm(olddrugname, "fasenra") recode vtm .=35299711000001100 if cleandrugname ==19

recode cleandrugname .=20 if regexm(olddrugname, "belimumab") recode cleandrugname .=20 if regexm(olddrugname, "benlysta") recode vtm .=704193005 if cleandrugname ==20

recode cleandrugname .=21 if regexm(olddrugname, "ranibizumab") recode cleandrugname .=21 if regexm(olddrugname, "lucentis") recode vtm .=425256004 if cleandrugname ==21

recode cleandrugname .=21 if regexm(olddrugname, "aflibercept") recode cleandrugname .=21 if regexm(olddrugname, "eylea") recode cleandrugname .=21 if regexm(olddrugname, "zaltrap") recode vtm .=21674911000001100 if cleandrugname ==21

label define drugname 1"adalimumab" 2"certolizumab" 3"etanercept" 4"golimumab" 5"infliximab" 6"mepolizumab" 7"IL6" 8"ustekinumab" 9"IL23" 10"anakinra" 11"dupilumab" 12"IL17" 13"B cell" 14"alemtuzumab" 15"abatacept" 16"JAKi" 17"integrins" 18"omalizumab" 19"anti-eosinophils" 20"belimumab" 21"VEGF"

label values cleandrugname drugname

myatesrheum commented 3 years ago

Output of above dofile

druglistoutput.xlsx

myatesrheum commented 3 years ago

@AnnaB45

myatesrheum commented 3 years ago

Outputs as seperate CSV files for each drug @NikNakk csv files.zip