-
Notifications
You must be signed in to change notification settings - Fork 0
/
Script_SQLite.txt
302 lines (271 loc) · 5.21 KB
/
Script_SQLite.txt
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
SET ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep=',';
SET MoneyDecimalSep='.';
SET MoneyFormat='$#,##0.00;($#,##0.00)';
SET TimeFormat='h:mm:ss TT';
SET DateFormat='M/D/YYYY';
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';
SET LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December';
SET LongDayNames='Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday';
SET FirstWeekDay=0;
SET BrokenWeeks=1;
SET ReferenceDay=0;
SET FirstMonthOfYear=1;
SET CollationLocale='en-US';
//Facts
//1
'Death Records':
LOAD Id ,
ResidentStatus,
Education1989Revision as Educ1989,
Education2003Revision as Educ2003,
EducationReportingFlag as EduFlag,
MonthOfDeath,
Sex,
AgeType,
Age,
AgeSubstitutionFlag,
AgeRecode52,
AgeRecode27,
AgeRecode12,
InfantAgeRecode22,
PlaceOfDeathAndDecedentsStatus,
MaritalStatus,
DayOfWeekOfDeath,
CurrentDataYear,
InjuryAtWork, //No Dimension
MannerOfDeath,
MethodOfDisposition,
Autopsy,
ActivityCode,
PlaceOfInjury,
Icd10Code,
CauseRecode358, //No Dimension
CauseRecode113, //No Dimension
InfantCauseRecode130,
CauseRecode39,
NumberOfEntityAxisConditions,
NumberOfRecordAxisConditions,
Race,
BridgedRaceFlag,
RaceImputationFlag,
RaceRecode3,
RaceRecode5,
HispanicOrigin,
HispanicOriginRaceRecode
SQL SELECT *
FROM DeathRecords;
Concatenate
//EntityAxisConditions
LOAD //Id,
DeathRecordId,
Part,
Line,
Sequence
//Icd10Code
SQL SELECT *
FROM EntityAxisConditions;
Concatenate
LOAD
//Id,
DeathRecordId ;
//Icd10Code;
SQL SELECT *
FROM RecordAxisConditions;
//Dimensions
//1
'Hispanic Origin Race Recode':
QUALIFY *;
UNQUALIFY HispanicOriginRaceRecode;
LOAD Code as HispanicOriginRaceRecode,
Description;
SQL SELECT *
FROM HispanicOriginRaceRecode;
//2
'Resident Status':
QUALIFY *;
UNQUALIFY ResidentStatus;
LOAD Code as ResidentStatus,
Description;
SQL SELECT *
FROM ResidentStatus;
//3
'Education 1989':
QUALIFY *;
UNQUALIFY Educ1989;
LOAD Code as Educ1989,
Description;
SQL SELECT *
FROM Education1989Revision;
//4
'Education 2003':
QUALIFY *;
UNQUALIFY Educ2003;
LOAD Code as Educ2003,
Description;
SQL SELECT *
FROM Education2003Revision;
//5
'Education Report':
QUALIFY *;
UNQUALIFY EduFlag;
LOAD Code as EduFlag,
Description;
SQL SELECT *
FROM EducationReportingFlag;
//6
'Age Type':
QUALIFY *;
UNQUALIFY AgeType;
LOAD Code as AgeType,
Description;
SQL SELECT *
FROM AgeType;
//7
'Age Recode 52':
QUALIFY *;
UNQUALIFY AgeRecode52;
LOAD Code as AgeRecode52,
Description;
SQL SELECT *
FROM AgeRecode52;
//8
'Age Recode 27':
QUALIFY *;
UNQUALIFY AgeRecode27;
LOAD Code as AgeRecode27,
Description;
SQL SELECT *
FROM AgeRecode27;
//9
'Age Recode 12':
QUALIFY *;
UNQUALIFY AgeRecode12;
LOAD Code as AgeRecode12,
Description;
SQL SELECT *
FROM AgeRecode12;
//10
'Infant Age 22':
QUALIFY *;
UNQUALIFY InfantAgeRecode22;
LOAD Code as InfantAgeRecode22,
Description;
SQL SELECT *
FROM InfantAgeRecode22;
//11
'Death Place':
QUALIFY *;
UNQUALIFY PlaceOfDeathAndDecedentsStatus;
LOAD Code as PlaceOfDeathAndDecedentsStatus,
Description;
SQL SELECT *
FROM PlaceOfDeathAndDecedentsStatus;
//12
'Marital Status':
QUALIFY *;
UNQUALIFY MaritalStatus;
LOAD Code as MaritalStatus,
Description;
SQL SELECT *
FROM MaritalStatus;
//13
'Death Day':
QUALIFY *;
UNQUALIFY DayOfWeekOfDeath;
LOAD Code as DayOfWeekOfDeath,
Description;
SQL SELECT *
FROM DayOfWeekOfDeath;
//14
//'Injury At Work':
'Manner of Death':
QUALIFY *;
UNQUALIFY MannerOfDeath;
LOAD Code as MannerOfDeath,
Description;
SQL SELECT *
FROM MannerOfDeath;
//15
'Method Of Disposition':
QUALIFY *;
UNQUALIFY MethodOfDisposition;
LOAD Code as MethodOfDisposition,
Description;
SQL SELECT *
FROM MethodOfDisposition;
//16
'Activity Code':
QUALIFY *;
UNQUALIFY ActivityCode;
LOAD Code as ActivityCode,
Description;
SQL SELECT *
FROM ActivityCode;
//17
'Place Of Injury':
QUALIFY *;
UNQUALIFY PlaceOfInjury;
LOAD Code as PlaceOfInjury,
Description;
SQL SELECT *
FROM PlaceOfInjury;
//18
'Icd 10 Code':
QUALIFY *;
UNQUALIFY Icd10Code;
LOAD Code as Icd10Code,
Description;
SQL SELECT *
FROM Icd10Code;
//19
'Race':
QUALIFY *;
UNQUALIFY Race;
LOAD Code as Race,
Description;
SQL SELECT *
FROM Race;
//20
'Bridged Race Flag':
QUALIFY *;
UNQUALIFY BridgedRaceFlag;
LOAD Code as BridgedRaceFlag,
Description;
SQL SELECT *
FROM BridgedRaceFlag;
//21
'RaceImputationFlag':
QUALIFY *;
UNQUALIFY RaceImputationFlag;
LOAD Code as RaceImputationFlag,
Description;
SQL SELECT *
FROM RaceImputationFlag;
//22
'Race Recode 3':
QUALIFY *;
UNQUALIFY RaceRecode3;
LOAD Code as RaceRecode3,
Description;
SQL SELECT *
FROM RaceRecode3;
//23
'Race Recode 5':
QUALIFY *;
UNQUALIFY RaceRecode5;
LOAD Code as RaceRecode5,
Description;
SQL SELECT *
FROM RaceRecode5;
//24
'Hispanic Origin':
QUALIFY *;
UNQUALIFY HispanicOrigin;
LOAD Code as HispanicOrigin,
Description;
SQL SELECT *
FROM HispanicOrigin;