-
Notifications
You must be signed in to change notification settings - Fork 1
/
CodeToRun.R
59 lines (36 loc) · 2.25 KB
/
CodeToRun.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
#' @file CodeToRun.R
#DQD section-----------------------------------------------
#----------------------------------------------------------
#----------------------------------------------------------
#---LOAD THE R PACKAGE
#install the latest version of the DataQuality package
#it requires devtools library installed - install it first if you don't have it
devtools::install_github("vojtechhuser/DataQuality")
#load the package
library(DataQuality)
#---SPECIFY YOUR LOCAL PARAMTERS BELOW-----
#replace with your local parameters using the same variable names
#note: it will run some achilles measures (so it may overwrite your current achilles results table)
# Specify details for connecting to the server:
# See ?DatabaseConnector::createConnectionDetails for help
connectionDetails <- DatabaseConnector::createConnectionDetails(dbms = "postgresql",
server = "some.server.com/ohdsi",
user = "",
password = "")
cdmDatabaseSchema <-'main'
resultsDatabaseSchema <-'main' #at most sites this likely will not be the same as cdmDatabaseSchema
workFolder <- 'c:/temp/dqd' #this folder must exist (use forward slashes)
#just a helper construct to package all study details into one object (similar as done with database connection details)
connectionDetails2<-DataQuality:::.createConnectionDetails2(cdmDatabaseSchema = cdmDatabaseSchema
,resultsDatabaseSchema = resultsDatabaseSchema
,workFolder = workFolder
)
#----EXECUTE THE DQD THRESHOLD STUDY
#execute the core of the DQD helper analysis, outptu will be writen as CSV file into an export folder
DataQuality::dashboardLabThresholds(connectionDetails = connectionDetails,connectionDetails2 = connectionDetails2)
#second component added in May 2020
DataQuality::dashboardLabValueAsConceptID(connectionDetails = connectionDetails,connectionDetails2 = connectionDetails2)
#results are in workfolder, subfolder export, inspect it and
#email the CSV files called Thresholds and LabCodedValueResults to the study PI
#for simplicity, the package is not using submission of the results via OHDSI AWS infrustructure
#(if requested by site, the code can be provided, though)