diff --git a/cr_codelist_ED.dta b/cr_codelist_ED.dta new file mode 100644 index 0000000..02732e0 Binary files /dev/null and b/cr_codelist_ED.dta differ diff --git a/cr_codelist_ED_drugs.dta b/cr_codelist_ED_drugs.dta new file mode 100644 index 0000000..44e4d02 Binary files /dev/null and b/cr_codelist_ED_drugs.dta differ diff --git a/cr_codelist_antihypertensives.dta b/cr_codelist_antihypertensives.dta new file mode 100644 index 0000000..9cf4820 Binary files /dev/null and b/cr_codelist_antihypertensives.dta differ diff --git a/cr_codelist_antipsychotics.dta b/cr_codelist_antipsychotics.dta new file mode 100644 index 0000000..2c0f118 Binary files /dev/null and b/cr_codelist_antipsychotics.dta differ diff --git a/cr_codelist_bipolar.dta b/cr_codelist_bipolar.dta new file mode 100644 index 0000000..152ff28 Binary files /dev/null and b/cr_codelist_bipolar.dta differ diff --git a/cr_codelist_corticosteroids.dta b/cr_codelist_corticosteroids.dta new file mode 100644 index 0000000..c7a8f26 Binary files /dev/null and b/cr_codelist_corticosteroids.dta differ diff --git a/cr_codelist_fh_cvd_60.dta b/cr_codelist_fh_cvd_60.dta new file mode 100644 index 0000000..e470b4b Binary files /dev/null and b/cr_codelist_fh_cvd_60.dta differ diff --git a/cr_codelist_hiv.dta b/cr_codelist_hiv.dta new file mode 100644 index 0000000..e673c47 Binary files /dev/null and b/cr_codelist_hiv.dta differ diff --git a/cr_codelist_migraine.dta b/cr_codelist_migraine.dta new file mode 100644 index 0000000..24b96bc Binary files /dev/null and b/cr_codelist_migraine.dta differ diff --git a/cr_codelist_psychosis.dta b/cr_codelist_psychosis.dta new file mode 100644 index 0000000..43ef335 Binary files /dev/null and b/cr_codelist_psychosis.dta differ diff --git a/cr_codelist_qof_cod.dta b/cr_codelist_qof_cod.dta new file mode 100644 index 0000000..2e6a355 Binary files /dev/null and b/cr_codelist_qof_cod.dta differ diff --git a/cr_codelist_qrisk_ethnicity.dta b/cr_codelist_qrisk_ethnicity.dta new file mode 100644 index 0000000..43305dc Binary files /dev/null and b/cr_codelist_qrisk_ethnicity.dta differ diff --git a/cr_codelist_renal_qrisk2.dta b/cr_codelist_renal_qrisk2.dta new file mode 100644 index 0000000..7f05c85 Binary files /dev/null and b/cr_codelist_renal_qrisk2.dta differ diff --git a/cr_codelist_renal_qrisk3.dta b/cr_codelist_renal_qrisk3.dta new file mode 100644 index 0000000..ad77da3 Binary files /dev/null and b/cr_codelist_renal_qrisk3.dta differ diff --git a/cr_codelist_schizophrenia.dta b/cr_codelist_schizophrenia.dta new file mode 100644 index 0000000..cd12f91 Binary files /dev/null and b/cr_codelist_schizophrenia.dta differ diff --git a/cr_codelist_severe_mental_illness.dta b/cr_codelist_severe_mental_illness.dta new file mode 100644 index 0000000..2f6e4d5 Binary files /dev/null and b/cr_codelist_severe_mental_illness.dta differ diff --git a/cr_codelist_sle.dta b/cr_codelist_sle.dta new file mode 100644 index 0000000..cdcc5db Binary files /dev/null and b/cr_codelist_sle.dta differ diff --git a/cr_codelist_smi.dta b/cr_codelist_smi.dta new file mode 100644 index 0000000..ab294f8 Binary files /dev/null and b/cr_codelist_smi.dta differ diff --git a/cr_codelist_statins.dta b/cr_codelist_statins.dta new file mode 100644 index 0000000..ad8f4eb Binary files /dev/null and b/cr_codelist_statins.dta differ diff --git a/globals.do b/globals.do new file mode 100644 index 0000000..5ca07c7 --- /dev/null +++ b/globals.do @@ -0,0 +1,20 @@ +clear +capture set more off + +global database "GOLD" +global version "2018_07" + +if "$database" == "GOLD" { + global Dictionarydir "J:\EHR Share\3 Database guidelines and info\GPRD_Gold\Medical & Product Browsers\\${version}_Browsers" + global Productdic "$Dictionarydir\product" + global Medicaldic "$Dictionarydir\medical" + } + +global Projectdir "J:\EHR-Working\QRISK\qrisk_bundle\codelists\codelist_creation" + +global Dodir "$Projectdir\dofiles" +global Logdir "$Projectdir\logfiles\\${database} ${version}" +global Datadir "$Projectdir\datafiles\\${database} ${version}" +global Textdir "$Projectdir\textfiles\\${database} ${version}" +global Sourcedir "$Projectdir\sourcefiles\\" + diff --git a/inc_importgoldmedicaldictionary.do b/inc_importgoldmedicaldictionary.do new file mode 100644 index 0000000..107df6e --- /dev/null +++ b/inc_importgoldmedicaldictionary.do @@ -0,0 +1,23 @@ +import delimited using "$Medicaldic.txt", clear + +drop in 1 + +rename _05 medcode +rename v2 readcode +rename v3 clinev +rename v4 immunev +rename v5 refev +rename v6 testev +rename v7 readterm +rename v8 build + +sort medcode + + +* Make all descriptions lower case +foreach var of varlist readterm { + generate Z=lower(`var') + drop `var' + rename Z `var' +} + diff --git a/inc_importgoldproddictonary.do b/inc_importgoldproddictonary.do new file mode 100644 index 0000000..c8a9e44 --- /dev/null +++ b/inc_importgoldproddictonary.do @@ -0,0 +1,33 @@ + +clear +set more off +set linesize 100 + + + +*rename variables +import delimited using "$Productdic.txt", clear +drop v2 v12 +rename _05 prodcode +rename v3 therapyev +rename v4 productname +rename v5 drugsubstance +rename v6 strength +rename v7 formulation +rename v8 route +rename v9 bnfcode +rename v10 bnfchapter +rename v11 build + +sort prodcode + + +* Make all descriptions lower case +foreach var of varlist productname drugsubstance formulation route bnfchapter { + generate Z=lower(`var') + drop `var' + rename Z `var' +} + +order prodcode productname drugsubstance strength formulation route bnfcode bnfchapter build + diff --git a/searchProductDict.do b/searchProductDict.do new file mode 100644 index 0000000..4e0c905 --- /dev/null +++ b/searchProductDict.do @@ -0,0 +1,35 @@ + +clear +set more off +set linesize 100 + +/******************************************************************************* +#1. OPEN DATA AND PREP FOR SEARCH +*******************************************************************************/ + +*rename variables +import delimited using "$Productdictionary.txt", clear +drop v2 v12 +rename _08 prodcode +rename v3 therapyev +rename v4 productname +rename v5 drugsubstance +rename v6 strength +rename v7 formulation +rename v8 route +rename v9 bnfcode +rename v10 bnfchapter +rename v11 build + +sort prodcode + + +* Make all descriptions lower case +foreach var of varlist productname drugsubstance formulation route bnfchapter { + generate Z=lower(`var') + drop `var' + rename Z `var' +} + +order prodcode productname drugsubstance strength formulation route bnfcode bnfchapter build +