-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtestthis.R
74 lines (62 loc) · 2.75 KB
/
testthis.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
rm(list=ls()); gc()
setwd("C:/repo/utils")
# install.packages("jsonlite")
# install.packages("stringdist")
library(jsonlite)
library(DBI)
library(magrittr)
library(tidyverse)
library(stringdist)
source("extract_util.R")
load_valueset(vs_template = "rxnav",
vs_url="https://raw.githubusercontent.com/sxinger/PheCDM/main/valuesets/valueset_autogen/als-rx-output.json",
vs_name_str="riluzole")
load_valueset(vs_template = "ncbo",
vs_url="https://raw.githubusercontent.com/sxinger/PheCDM/main/valuesets/valueset_autogen/als-tx_output.json",
vs_name_str="mechanical ventilation")
load_valueset(vs_template = "curated",
vs_url = "https://raw.githubusercontent.com/sxinger/PheCDM/main/valusets/valueset_curated/vs-osa-comorb.json",
vs_name_str = "myocardial infarction")
# load_valueset(vs_template = "curated",
# vs_url = "https://raw.githubusercontent.com/sxinger/PheCDM/main/valusets/valueset_curated/vs-osa-comorb.json",
# vs_name_str = "myocardial infarction",
# dry_run = FALSE,
# conn=myconn,
# write_to_schema = "PUBLIC",
# write_to_tbl = "TEMP")
source("extract_util.R")
collect_cdm(conn=NULL,
patset = "PAT_ELIG",
key_col_pat = c("PATID"),
idx_dt_col = "INDEX_DATE",
cdm_schema = "CMS_PCORNET_CDM",
key_col_schema=c("PATID"),
cdm_tbl = "DIAGNOSIS",
ep_dt_col = "EVENT_DATE",
vs_template = "curated",
vs_url = "https://raw.githubusercontent.com/sxinger/PheCDM/main/valusets/valueset_curated/vs-osa-comorb.json",
vs_name_str = "myocardial infarction",
col_out = c("DX","DX_DATE"),
write_back = FALSE,
write_to_schema = "OBESITY",
write_to_tbl = "TEMP",
dry_run = TRUE)
source("extract_util.R")
load_valueset.curated(vs_url = "https://raw.githubusercontent.com/sxinger/PheCDM/main/valusets/valueset_curated/vs-osa-comorb.json",
vs_name_str = "bariatric surgery")
collect_cdm(conn=NULL,
patset = "PAT_ELIG",
key_col_pat = c("PATID"),
idx_dt_col = "INDEX_DATE",
cdm_schema = "CMS_PCORNET_CDM",
key_col_schema=c("PATID"),
cdm_tbl = "PROCEDURES",
ep_dt_col = "EVENT_DATE",
vs_template = "curated",
vs_url = "https://raw.githubusercontent.com/sxinger/PheCDM/main/valusets/valueset_curated/vs-osa-comorb.json",
vs_name_str = "bariatric surgery",
col_out = c("PX","PX_DATE"),
write_back = FALSE,
write_to_schema = "OBESITY",
write_to_tbl = "TEMP",
dry_run = TRUE)