-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript_inserting_data.R
More file actions
100 lines (82 loc) · 3.55 KB
/
script_inserting_data.R
File metadata and controls
100 lines (82 loc) · 3.55 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# inserting previously mapped data into the OMOP tables -- SINASC --
# getting mapped tables
care_site <- read.csv('MOCK_DATA/care_site.csv')
condition_occurrence <- read.csv('MOCK_DATA/condition_occurrence.csv')
location <- read.csv('MOCK_DATA/location.csv')
measurement <- read.csv('MOCK_DATA/measurement.csv')
observation_period <- read.csv('MOCK_DATA/observation_period.csv')
observation <- read.csv('MOCK_DATA/observation.csv')
person <- read.csv('MOCK_DATA/person.csv')
procedure_occurrence <- read.csv('MOCK_DATA/procedure_occurrence.csv')
visit_occurrence <- read.csv('MOCK_DATA/visit_occurrence.csv')
insertTable(connection = connection,
databaseSchema = 'main',
tableName = 'care_site',
data = care_site,
dropTableIfExists = TRUE,
createTable = TRUE,
tempTable = FALSE)
insertTable(connection = connection,
databaseSchema = 'main',
tableName = 'condition_occurrence',
data = condition_occurrence,
dropTableIfExists = TRUE,
createTable = TRUE,
tempTable = FALSE)
insertTable(connection = connection,
databaseSchema = 'main',
tableName = 'location',
data = location,
dropTableIfExists = TRUE,
createTable = TRUE,
tempTable = FALSE)
insertTable(connection = connection,
databaseSchema = 'main',
tableName = 'measurement',
data = measurement,
dropTableIfExists = TRUE,
createTable = TRUE,
tempTable = FALSE)
insertTable(connection = connection,
databaseSchema = 'main',
tableName = 'observation_period',
data = observation_period,
dropTableIfExists = TRUE,
createTable = TRUE,
tempTable = FALSE)
insertTable(connection = connection,
databaseSchema = 'main',
tableName = 'observation',
data = observation,
dropTableIfExists = TRUE,
createTable = TRUE,
tempTable = FALSE)
insertTable(connection = connection,
databaseSchema = 'main',
tableName = 'person',
data = person,
dropTableIfExists = TRUE,
createTable = TRUE,
tempTable = FALSE)
insertTable(connection = connection,
databaseSchema = 'main',
tableName = 'procedure_occurrence',
data = procedure_occurrence,
dropTableIfExists = TRUE,
createTable = TRUE,
tempTable = FALSE)
insertTable(connection = connection,
databaseSchema = 'main',
tableName = 'visit_occurrence',
data = visit_occurrence,
dropTableIfExists = TRUE,
createTable = TRUE,
tempTable = FALSE)
write.csv(care_site, 'EUNOMIA_CSV_TABLES/care_site.csv', row.names=FALSE)
write.csv(condition_occurrence, 'EUNOMIA_CSV_TABLES/condition_occurrence.csv', row.names=FALSE)
write.csv(location, 'EUNOMIA_CSV_TABLES/location.csv', row.names=FALSE)
write.csv(measurement, 'EUNOMIA_CSV_TABLES/measurement.csv', row.names=FALSE)
write.csv(observation_period, 'EUNOMIA_CSV_TABLES/observation_period.csv', row.names=FALSE)
write.csv(observation, 'EUNOMIA_CSV_TABLES/observation.csv', row.names=FALSE)
write.csv(procedure_occurrence, 'EUNOMIA_CSV_TABLES/procedure_occurence.csv', row.names =FALSE)
write.csv(visit_occurrence,'EUNOMIA_CSV_TABLES/visit_occurrence.csv', row.names=FALSE)