forked from IHTSDO/snomed-database-loader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenvironment-postgresql.sql
More file actions
165 lines (153 loc) · 4.7 KB
/
environment-postgresql.sql
File metadata and controls
165 lines (153 loc) · 4.7 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
/* create the Full S-CT data tables */
/* Change the table suffix for different release type. _f stands for full, _d stands for delta, _s stands for snapshot */
set schema 'snomedct';
drop table if exists concept_f cascade;
create table concept_f(
id varchar(18) not null,
effectivetime char(8) not null,
active char(1) not null,
moduleid varchar(18) not null,
definitionstatusid varchar(18) not null,
PRIMARY KEY(id, effectivetime)
);
drop table if exists description_f cascade;
create table description_f(
id varchar(18) not null,
effectivetime char(8) not null,
active char(1) not null,
moduleid varchar(18) not null,
conceptid varchar(18) not null,
languagecode varchar(2) not null,
typeid varchar(18) not null,
term text not null,
casesignificanceid varchar(18) not null,
PRIMARY KEY(id, effectivetime)
);
drop table if exists textdefinition_f cascade;
create table textdefinition_f(
id varchar(18) not null,
effectivetime char(8) not null,
active char(1) not null,
moduleid varchar(18) not null,
conceptid varchar(18) not null,
languagecode varchar(2) not null,
typeid varchar(18) not null,
term text not null,
casesignificanceid varchar(18) not null,
PRIMARY KEY(id, effectivetime)
);
drop table if exists relationship_f cascade;
create table relationship_f(
id varchar(18) not null,
effectivetime char(8) not null,
active char(1) not null,
moduleid varchar(18) not null,
sourceid varchar(18) not null,
destinationid varchar(18) not null,
relationshipgroup varchar(18) not null,
typeid varchar(18) not null,
characteristictypeid varchar(18) not null,
modifierid varchar(18) not null,
PRIMARY KEY(id, effectivetime)
);
drop table if exists stated_relationship_f cascade;
create table stated_relationship_f(
id varchar(18) not null,
effectivetime char(8) not null,
active char(1) not null,
moduleid varchar(18) not null,
sourceid varchar(18) not null,
destinationid varchar(18) not null,
relationshipgroup varchar(18) not null,
typeid varchar(18) not null,
characteristictypeid varchar(18) not null,
modifierid varchar(18) not null,
PRIMARY KEY(id, effectivetime)
);
drop table if exists langrefset_f cascade;
create table langrefset_f(
id uuid not null,
effectivetime char(8) not null,
active char(1) not null,
moduleid varchar(18) not null,
refsetid varchar(18) not null,
referencedcomponentid varchar(18) not null,
acceptabilityid varchar(18) not null,
PRIMARY KEY(id, effectivetime)
);
drop table if exists associationrefset_f cascade;
create table associationrefset_f(
id uuid not null,
effectivetime char(8) not null,
active char(1) not null,
moduleid varchar(18) not null,
refsetid varchar(18) not null,
referencedcomponentid varchar(18) not null,
targetcomponentid varchar(18) not null,
PRIMARY KEY(id, effectivetime)
);
drop table if exists attributevaluerefset_f cascade;
create table attributevaluerefset_f(
id uuid not null,
effectivetime char(8) not null,
active char(1) not null,
moduleid varchar(18) not null,
refsetid varchar(18) not null,
referencedcomponentid varchar(18) not null,
valueid varchar(18) not null,
PRIMARY KEY(id, effectivetime)
);
drop table if exists simplerefset_f cascade;
create table simplerefset_f(
id uuid not null,
effectivetime char(8) not null,
active char(1) not null,
moduleid varchar(18) not null,
refsetid varchar(18) not null,
referencedcomponentid varchar(18) not null,
PRIMARY KEY(id, effectivetime)
);
drop table if exists simplemaprefset_f cascade;
create table simplemaprefset_f(
id uuid not null,
effectivetime char(8) not null,
active char(1) not null,
moduleid varchar(18) not null,
refsetid varchar(18) not null,
referencedcomponentid varchar(18) not null,
maptarget text not null,
PRIMARY KEY(id, effectivetime)
);
drop table if exists complexmaprefset_f cascade;
create table complexmaprefset_f(
id uuid not null,
effectivetime char(8) not null,
active char(1) not null,
moduleid varchar(18) not null,
refsetid varchar(18) not null,
referencedcomponentid varchar(18) not null,
mapGroup smallint not null,
mapPriority smallint not null,
mapRule text,
mapAdvice text,
mapTarget text,
correlationId varchar(18) not null,
PRIMARY KEY(id, effectivetime)
);
drop table if exists extendedmaprefset_f cascade;
create table extendedmaprefset_f(
id uuid not null,
effectivetime char(8) not null,
active char(1) not null,
moduleid varchar(18) not null,
refsetid varchar(18) not null,
referencedcomponentid varchar(18) not null,
mapGroup smallint not null,
mapPriority smallint not null,
mapRule text,
mapAdvice text,
mapTarget text,
correlationId varchar(18),
mapCategoryId varchar(18),
PRIMARY KEY(id, effectivetime)
)