Skip to content

Commit

Permalink
Add codelist and codelist creation do files
Browse files Browse the repository at this point in the history
  • Loading branch information
emilyherrett authored Jun 15, 2022
1 parent b7e4921 commit 9757a25
Show file tree
Hide file tree
Showing 23 changed files with 111 additions and 0 deletions.
Binary file added cr_codelist_ED.dta
Binary file not shown.
Binary file added cr_codelist_ED_drugs.dta
Binary file not shown.
Binary file added cr_codelist_antihypertensives.dta
Binary file not shown.
Binary file added cr_codelist_antipsychotics.dta
Binary file not shown.
Binary file added cr_codelist_bipolar.dta
Binary file not shown.
Binary file added cr_codelist_corticosteroids.dta
Binary file not shown.
Binary file added cr_codelist_fh_cvd_60.dta
Binary file not shown.
Binary file added cr_codelist_hiv.dta
Binary file not shown.
Binary file added cr_codelist_migraine.dta
Binary file not shown.
Binary file added cr_codelist_psychosis.dta
Binary file not shown.
Binary file added cr_codelist_qof_cod.dta
Binary file not shown.
Binary file added cr_codelist_qrisk_ethnicity.dta
Binary file not shown.
Binary file added cr_codelist_renal_qrisk2.dta
Binary file not shown.
Binary file added cr_codelist_renal_qrisk3.dta
Binary file not shown.
Binary file added cr_codelist_schizophrenia.dta
Binary file not shown.
Binary file added cr_codelist_severe_mental_illness.dta
Binary file not shown.
Binary file added cr_codelist_sle.dta
Binary file not shown.
Binary file added cr_codelist_smi.dta
Binary file not shown.
Binary file added cr_codelist_statins.dta
Binary file not shown.
20 changes: 20 additions & 0 deletions globals.do
Original file line number Diff line number Diff line change
@@ -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\\"

23 changes: 23 additions & 0 deletions inc_importgoldmedicaldictionary.do
Original file line number Diff line number Diff line change
@@ -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'
}

33 changes: 33 additions & 0 deletions inc_importgoldproddictonary.do
Original file line number Diff line number Diff line change
@@ -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

35 changes: 35 additions & 0 deletions searchProductDict.do
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9757a25

Please sign in to comment.