-
Notifications
You must be signed in to change notification settings - Fork 3
/
dev.R
executable file
·50 lines (41 loc) · 2.31 KB
/
dev.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
require(devtools)
load_all()
medical_table <- read.delim("~/hspc//CPRD2014//Lookups//medical.txt", fileEncoding="latin1", stringsAsFactors = FALSE)
drug_table <- read.delim("~/hspc//CPRD2014/Lookups/product.txt", fileEncoding="latin1", stringsAsFactors = FALSE)
def <- MedicalDefinition(terms = list("peripheral vascular disease", "peripheral gangrene", "-wrong answer",
"intermittent claudication", "thromboangiitis obliterans",
"thromboangiitis obliterans", "diabetic peripheral angiopathy",
c("diabetes", "peripheral angiopathy"),
c("diabetes", "peripheral angiopathy"),
c("buerger", "disease presenile_gangrene"),
"thromboangiitis obliterans",
"-rubbish",
c("percutaneous_transluminal_angioplasty", "artery"),
c("bypass", "iliac_artery"),
c("bypass", "femoral_artery"),
c("femoral_artery" , "occlusion"),
c("popliteal_artery", "occlusion"),
"dissecting_aortic_aneurysm", "peripheral_angiopathic_disease",
"acrocyanosis", "acroparaesthesia", "erythrocyanosis",
"erythromelalgia", "ABPI",
c("ankle", "brachial"),
c("ankle", "pressure"),
c("left", "brachial"),
c("left", "pressure"),
c("right", "brachial"),
c("right", "pressure")),
codes = list("G73"),
tests = NULL,
drugs = list("insulin", "diabet", "aspirin"))
def2 <- import_definition_lists("example_search.csv")
def <- match_list$PAD
def_name <- "terms"
input <- def$terms
a <- build_definition_lists(def, medical_table,drug_table = drug_table)
b <- build_definition_lists(def2, medical_table,drug_table = drug_table)
medical <- read.delim("~/hspc//Main//Original_data/Data/Lookups/medical.txt")
### smi
medical_table <- read.delim("~/hspc//Main//Original_data/Data/Lookups/medical.txt", fileEncoding="latin1", stringsAsFactors = FALSE)
input_file <- "inst/extdata/SMI_search.csv"
def <- import_definitions("inst//extdata//SMI_search.csv")
b <- definition_search(def, medical_table,drug_table = drug_table)