-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclickhouse-init.xml
More file actions
870 lines (869 loc) · 52.2 KB
/
Copy pathclickhouse-init.xml
File metadata and controls
870 lines (869 loc) · 52.2 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
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
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
<?xml version="1.0"?>
<clickhouse>
<startup_scripts>
<scripts>
<query>CREATE DATABASE IF NOT EXISTS omop</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.person (
person_id UInt64,
gender_concept_id UInt32,
year_of_birth UInt16,
month_of_birth UInt8,
day_of_birth UInt8,
birth_datetime DateTime64,
race_concept_id UInt32,
ethnicity_concept_id UInt32,
location_id UInt64,
provider_id UInt64,
care_site_id UInt64,
person_source_value String,
gender_source_value String,
gender_source_concept_id UInt32,
race_source_value String,
race_source_concept_id UInt32,
ethnicity_source_value String,
ethnicity_source_concept_id UInt32
) ENGINE = MergeTree()
PRIMARY KEY (person_id)
ORDER BY (person_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.visit_occurrence (
visit_occurrence_id UInt64,
person_id UInt64,
visit_concept_id UInt32,
visit_start_date Date32,
visit_start_datetime DateTime64,
visit_end_date Date32,
visit_end_datetime DateTime64,
visit_type_concept_id UInt32,
provider_id UInt64,
care_site_id UInt64,
visit_source_value String,
visit_source_concept_id UInt32,
admitted_from_concept_id UInt32,
admitted_from_source_value String,
discharged_to_concept_id UInt32,
discharged_to_source_value String,
preceding_visit_occurrence_id UInt64
) ENGINE = MergeTree()
PRIMARY KEY (visit_occurrence_id)
ORDER BY (visit_occurrence_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.condition_occurrence (
condition_occurrence_id UInt64,
person_id UInt64,
condition_concept_id UInt32,
condition_start_date Date32,
condition_start_datetime DateTime64,
condition_end_date Date32,
condition_end_datetime DateTime64,
condition_type_concept_id UInt32,
condition_status_concept_id UInt32,
stop_reason String,
provider_id UInt64,
visit_occurrence_id UInt64,
visit_detail_id UInt64,
condition_source_value String,
condition_source_concept_id UInt32,
condition_status_source_value String
) ENGINE = MergeTree()
PRIMARY KEY (condition_occurrence_id)
ORDER BY (condition_occurrence_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.drug_exposure (
drug_exposure_id UInt64,
person_id UInt64,
drug_concept_id UInt32,
drug_exposure_start_date Date32,
drug_exposure_start_datetime DateTime64,
drug_exposure_end_date Date32,
drug_exposure_end_datetime DateTime64,
verbatim_end_date Date32,
drug_type_concept_id UInt32,
stop_reason String,
refills UInt32,
quantity Float64,
days_supply UInt32,
sig String,
route_concept_id UInt32,
lot_number String,
provider_id UInt64,
visit_occurrence_id UInt64,
visit_detail_id UInt64,
drug_source_value String,
drug_source_concept_id UInt32,
route_source_value String,
dose_unit_source_value String
) ENGINE = MergeTree()
PRIMARY KEY (drug_exposure_id)
ORDER BY (drug_exposure_id)
</query>
</scripts>
<!-- Additional tables -->
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.measurement (
measurement_id UInt64,
person_id UInt64,
measurement_concept_id UInt32,
measurement_date Date32,
measurement_datetime DateTime64,
measurement_time String,
measurement_type_concept_id UInt32,
operator_concept_id UInt32,
value_as_number Float64,
value_as_concept_id UInt32,
unit_concept_id UInt32,
range_low Float64,
range_high Float64,
provider_id UInt64,
visit_occurrence_id UInt64,
visit_detail_id UInt64,
measurement_source_value String,
measurement_source_concept_id UInt32,
unit_source_value String,
value_source_value String
) ENGINE = MergeTree()
PRIMARY KEY (measurement_id)
ORDER BY (measurement_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.observation (
observation_id UInt64,
person_id UInt64,
observation_concept_id UInt32,
observation_date Date32,
observation_datetime DateTime64,
observation_type_concept_id UInt32,
value_as_number Float64,
value_as_string String,
value_as_concept_id UInt32,
qualifier_concept_id UInt32,
unit_concept_id UInt32,
provider_id UInt64,
visit_occurrence_id UInt64,
visit_detail_id UInt64,
observation_source_value String,
observation_source_concept_id UInt32,
unit_source_value String,
qualifier_source_value String
) ENGINE = MergeTree()
PRIMARY KEY (observation_id)
ORDER BY (observation_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.procedure_occurrence (
procedure_occurrence_id UInt64,
person_id UInt64,
procedure_concept_id UInt32,
procedure_date Date32,
procedure_datetime DateTime64,
procedure_type_concept_id UInt32,
modifier_concept_id UInt32,
quantity UInt32,
provider_id UInt64,
visit_occurrence_id UInt64,
visit_detail_id UInt64,
procedure_source_value String,
procedure_source_concept_id UInt32,
modifier_source_value String
) ENGINE = MergeTree()
PRIMARY KEY (procedure_occurrence_id)
ORDER BY (procedure_occurrence_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.device_exposure (
device_exposure_id UInt64,
person_id UInt64,
device_concept_id UInt32,
device_exposure_start_date Date32,
device_exposure_start_datetime DateTime64,
device_exposure_end_date Date32,
device_exposure_end_datetime DateTime64,
device_type_concept_id UInt32,
unique_device_id String,
quantity UInt32,
provider_id UInt64,
visit_occurrence_id UInt64,
visit_detail_id UInt64,
device_source_value String,
device_source_concept_id UInt32
) ENGINE = MergeTree()
PRIMARY KEY (device_exposure_id)
ORDER BY (device_exposure_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.death (
person_id UInt64,
death_date Date32,
death_datetime DateTime64,
death_type_concept_id UInt32,
cause_concept_id UInt32,
cause_source_value String,
cause_source_concept_id UInt32
) ENGINE = MergeTree()
PRIMARY KEY (person_id)
ORDER BY (person_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.note (
note_id UInt64,
person_id UInt64,
note_date Date32,
note_datetime DateTime64,
note_type_concept_id UInt32,
note_class_concept_id UInt32,
note_title String,
note_text String,
encoding_concept_id UInt32,
language_concept_id UInt32,
provider_id UInt64,
visit_occurrence_id UInt64,
visit_detail_id UInt64,
note_source_value String
) ENGINE = MergeTree()
PRIMARY KEY (note_id)
ORDER BY (note_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.note_nlp (
note_nlp_id UInt64,
note_id UInt64,
section_concept_id UInt32,
snippet String,
offset String,
lexical_variant String,
note_nlp_concept_id UInt32,
note_nlp_source_concept_id UInt32,
nlp_system String,
nlp_date Date32,
nlp_datetime DateTime64,
term_exists String,
term_temporal String,
term_modifiers String
) ENGINE = MergeTree()
PRIMARY KEY (note_nlp_id)
ORDER BY (note_nlp_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.observation_period (
observation_period_id UInt64,
person_id UInt64,
observation_period_start_date Date32,
observation_period_end_date Date32,
period_type_concept_id UInt32
) ENGINE = MergeTree()
PRIMARY KEY (observation_period_id)
ORDER BY (observation_period_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.specimen (
specimen_id UInt64,
person_id UInt64,
specimen_concept_id UInt32,
specimen_type_concept_id UInt32,
specimen_date Date32,
specimen_datetime DateTime64,
quantity Float64,
unit_concept_id UInt32,
anatomic_site_concept_id UInt32,
disease_status_concept_id UInt32,
specimen_source_id String,
specimen_source_value String,
unit_source_value String,
anatomic_site_source_value String,
disease_status_source_value String
) ENGINE = MergeTree()
PRIMARY KEY (specimen_id)
ORDER BY (specimen_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.visit_detail (
visit_detail_id UInt64,
person_id UInt64,
visit_detail_concept_id UInt32,
visit_detail_start_date Date32,
visit_detail_start_datetime DateTime64,
visit_detail_end_date Date32,
visit_detail_end_datetime DateTime64,
visit_detail_type_concept_id UInt32,
provider_id UInt64,
care_site_id UInt64,
visit_detail_source_value String,
visit_detail_source_concept_id UInt32,
admitted_from_concept_id UInt32,
admitted_from_source_value String,
discharged_to_source_value String,
discharged_to_concept_id UInt32,
preceding_visit_detail_id UInt64,
visit_detail_parent_id UInt64,
visit_occurrence_id UInt64
) ENGINE = MergeTree()
PRIMARY KEY (visit_detail_id)
ORDER BY (visit_detail_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.cost (
cost_id UInt64,
person_id UInt64,
cost_event_id UInt64,
cost_domain_id String,
cost_type_concept_id UInt32,
currency_concept_id UInt32,
total_charge Float64,
total_cost Float64,
total_paid Float64,
paid_by_payer Float64,
paid_by_patient Float64,
paid_patient_copay Float64,
paid_patient_coinsurance Float64,
paid_patient_deductible Float64,
paid_by_primary Float64,
paid_ingredient_cost Float64,
paid_dispensing_fee Float64,
payer_plan_period_id Int64,
amount_allowed Float64,
revenue_code_concept_id UInt32,
revenue_code_source_value String,
drg_concept_id UInt32,
drg_source_value String
) ENGINE = MergeTree()
PRIMARY KEY (cost_id)
ORDER BY (cost_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.drug_era (
drug_era_id UInt64,
person_id UInt64,
drug_concept_id UInt32,
drug_era_start_date Date32,
drug_era_end_date Date32,
drug_exposure_count UInt32,
gap_days UInt32
) ENGINE = MergeTree()
PRIMARY KEY (drug_era_id)
ORDER BY (drug_era_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.dose_era (
dose_era_id UInt64,
person_id UInt64,
drug_concept_id UInt32,
unit_concept_id UInt32,
dose_value Float64,
dose_era_start_date Date32,
dose_era_end_date Date32
) ENGINE = MergeTree()
PRIMARY KEY (dose_era_id)
ORDER BY (dose_era_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.condition_era (
condition_era_id UInt64,
person_id UInt64,
condition_concept_id UInt32,
condition_era_start_date Date32,
condition_era_end_date Date32,
condition_occurrence_count UInt32
) ENGINE = MergeTree()
PRIMARY KEY (condition_era_id)
ORDER BY (condition_era_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.location (
location_id UInt64,
address_1 String,
address_2 String,
city String,
state String,
zip String,
county String,
location_source_value String,
country_concept_id UInt32,
country_source_value String,
latitude Float64,
longitude Float64
) ENGINE = MergeTree()
PRIMARY KEY (location_id)
ORDER BY (location_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.care_site (
care_site_id UInt64,
care_site_name String,
place_of_service_concept_id UInt32,
location_id UInt64,
care_site_source_value String,
place_of_service_source_value String
) ENGINE = MergeTree()
PRIMARY KEY (care_site_id)
ORDER BY (care_site_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.provider (
provider_id UInt64,
provider_name String,
npi String,
dea String,
specialty_concept_id UInt32,
care_site_id UInt64,
year_of_birth UInt16,
gender_concept_id UInt32,
provider_source_value String,
specialty_source_value String,
specialty_source_concept_id UInt32,
gender_source_value String,
gender_source_concept_id UInt32
) ENGINE = MergeTree()
PRIMARY KEY (provider_id)
ORDER BY (provider_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.payer_plan_period (
payer_plan_period_id UInt64,
person_id UInt64,
payer_plan_period_start_date Date32,
payer_plan_period_end_date Date32,
payer_concept_id UInt32,
payer_source_value String,
payer_source_concept_id UInt32,
plan_concept_id UInt32,
plan_source_value String,
plan_source_concept_id UInt32,
sponsor_concept_id UInt32,
sponsor_source_value String,
sponsor_source_concept_id UInt32,
family_source_value String,
stop_reason_concept_id UInt32,
stop_reason_source_value String,
stop_reason_source_concept_id UInt32
) ENGINE = MergeTree()
PRIMARY KEY (payer_plan_period_id)
ORDER BY (payer_plan_period_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.cdm_source (
cdm_source_name String,
cdm_source_abbreviation String,
cdm_holder String,
source_description String,
source_documentation_reference String,
cdm_etl_reference String,
source_release_date Date32,
cdm_release_date Date32,
cdm_version String,
vocabulary_version String
) ENGINE = MergeTree()
PRIMARY KEY (cdm_source_name)
ORDER BY (cdm_source_name)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.concept (
concept_id UInt32,
concept_name String,
domain_id String,
vocabulary_id String,
concept_class_id String,
standard_concept String,
concept_code String,
valid_start_date Date32,
valid_end_date Date32,
invalid_reason String
) ENGINE = MergeTree()
PRIMARY KEY (concept_id)
ORDER BY (concept_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.concept_relationship (
concept_id_1 UInt32,
concept_id_2 UInt32,
relationship_id String,
valid_start_date Date32,
valid_end_date Date32,
invalid_reason String
) ENGINE = MergeTree()
PRIMARY KEY (concept_id_1, concept_id_2, relationship_id)
ORDER BY (concept_id_1, concept_id_2, relationship_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.concept_ancestor (
ancestor_concept_id UInt32,
descendant_concept_id UInt32,
min_levels_of_separation UInt32,
max_levels_of_separation UInt32
) ENGINE = MergeTree()
PRIMARY KEY (ancestor_concept_id, descendant_concept_id)
ORDER BY (ancestor_concept_id, descendant_concept_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.vocabulary (
vocabulary_id String,
vocabulary_name String,
vocabulary_reference String,
vocabulary_version String,
vocabulary_concept_id UInt32
) ENGINE = MergeTree()
PRIMARY KEY (vocabulary_id)
ORDER BY (vocabulary_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.cohort (
cohort_definition_id Int32,
subject_id UInt64,
cohort_start_date Date32,
cohort_end_date Date32
) ENGINE = MergeTree()
PRIMARY KEY (cohort_definition_id, subject_id)
ORDER BY (cohort_definition_id, subject_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.cohort_definition (
cohort_definition_id Int32,
cohort_definition_name String,
cohort_definition_description String,
definition_type_concept_id UInt32,
cohort_definition_syntax String,
subject_concept_id UInt32,
cohort_initiation_date Date32
) ENGINE = MergeTree()
PRIMARY KEY (cohort_definition_id)
ORDER BY (cohort_definition_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.cohort_attribute (
cohort_definition_id Int32,
subject_id UInt64,
cohort_start_date Date32,
cohort_end_date Date32,
attribute_definition_id Int32,
value_as_number Float64,
value_as_concept_id UInt32
) ENGINE = MergeTree()
PRIMARY KEY (cohort_definition_id, subject_id, attribute_definition_id)
ORDER BY (cohort_definition_id, subject_id, attribute_definition_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.attribute_definition (
attribute_definition_id Int32,
attribute_name String,
attribute_description String,
attribute_type_concept_id UInt32,
attribute_syntax String
) ENGINE = MergeTree()
PRIMARY KEY (attribute_definition_id)
ORDER BY (attribute_definition_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.fact_relationship (
domain_concept_id_1 Int32,
fact_id_1 UInt64,
domain_concept_id_2 Int32,
fact_id_2 UInt64,
relationship_concept_id UInt32
) ENGINE = MergeTree()
PRIMARY KEY (domain_concept_id_1, fact_id_1, domain_concept_id_2, fact_id_2)
ORDER BY (domain_concept_id_1, fact_id_1, domain_concept_id_2, fact_id_2)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.metadata (
metadata_concept_id UInt32,
metadata_type_concept_id UInt32,
name String,
value_as_string String,
value_as_concept_id UInt32,
metadata_date Date32,
metadata_datetime DateTime64
) ENGINE = MergeTree()
PRIMARY KEY (metadata_concept_id)
ORDER BY (metadata_concept_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.relationship (
relationship_id String,
relationship_name String,
is_hierarchical String,
defines_ancestry String,
reverse_relationship_id String,
relationship_concept_id UInt32
) ENGINE = MergeTree()
PRIMARY KEY (relationship_id)
ORDER BY (relationship_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.drug_strength (
drug_concept_id UInt32,
ingredient_concept_id UInt32,
amount_value Float64,
amount_unit_concept_id UInt32,
numerator_value Float64,
numerator_unit_concept_id UInt32,
denominator_value Float64,
denominator_unit_concept_id UInt32,
box_size UInt32,
valid_start_date Date32,
valid_end_date Date32,
invalid_reason String
) ENGINE = MergeTree()
PRIMARY KEY (drug_concept_id, ingredient_concept_id)
ORDER BY (drug_concept_id, ingredient_concept_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.domain (
domain_id String,
domain_name String,
domain_concept_id UInt32
) ENGINE = MergeTree()
PRIMARY KEY (domain_id)
ORDER BY (domain_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.concept_class (
concept_class_id String,
concept_class_name String,
concept_class_concept_id UInt32
) ENGINE = MergeTree()
PRIMARY KEY (concept_class_id)
ORDER BY (concept_class_id)
</query>
</scripts>
<scripts>
<query>
CREATE TABLE IF NOT EXISTS omop.concept_synonym (
concept_id UInt32,
concept_synonym_name String,
language_concept_id UInt32
) ENGINE = MergeTree()
PRIMARY KEY (concept_id, concept_synonym_name)
ORDER BY (concept_id, concept_synonym_name)
</query>
</scripts>
<!-- Data loading scripts -->
<scripts>
<query>INSERT INTO omop.person SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/person.csv.gz', 'CSVWithNames', 'person_id UInt64, gender_concept_id UInt32, year_of_birth UInt16, month_of_birth UInt8, day_of_birth UInt8, birth_datetime DateTime64, race_concept_id UInt32, ethnicity_concept_id UInt32, location_id UInt64, provider_id UInt64, care_site_id UInt64, person_source_value String, gender_source_value String, gender_source_concept_id UInt32, race_source_value String, race_source_concept_id UInt32, ethnicity_source_value String, ethnicity_source_concept_id UInt32', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.person LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.visit_occurrence SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/visit_occurrence.csv.gz', 'CSVWithNames', 'visit_occurrence_id UInt64, person_id UInt64, visit_concept_id UInt32, visit_start_date Date32, visit_start_datetime DateTime64, visit_end_date Date32, visit_end_datetime DateTime64, visit_type_concept_id UInt32, provider_id UInt64, care_site_id UInt64, visit_source_value String, visit_source_concept_id UInt32, admitted_from_concept_id UInt32, admitted_from_source_value String, discharged_to_concept_id UInt32, discharged_to_source_value String, preceding_visit_occurrence_id UInt64', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.visit_occurrence LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.condition_occurrence SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/condition_occurrence.csv.gz', 'CSVWithNames', 'condition_occurrence_id UInt64, person_id UInt64, condition_concept_id UInt32, condition_start_date Date32, condition_start_datetime DateTime64, condition_end_date Date32, condition_end_datetime DateTime64, condition_type_concept_id UInt32, condition_status_concept_id UInt32, stop_reason String, provider_id UInt64, visit_occurrence_id UInt64, visit_detail_id UInt64, condition_source_value String, condition_source_concept_id UInt32, condition_status_source_value String', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.condition_occurrence LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.drug_exposure SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/drug_exposure.csv.gz', 'CSVWithNames', 'drug_exposure_id UInt64, person_id UInt64, drug_concept_id UInt32, drug_exposure_start_date Date32, drug_exposure_start_datetime DateTime64, drug_exposure_end_date Date32, drug_exposure_end_datetime DateTime64, verbatim_end_date Date32, drug_type_concept_id UInt32, stop_reason String, refills UInt32, quantity Float64, days_supply UInt32, sig String, route_concept_id UInt32, lot_number String, provider_id UInt64, visit_occurrence_id UInt64, visit_detail_id UInt64, drug_source_value String, drug_source_concept_id UInt32, route_source_value String, dose_unit_source_value String', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.drug_exposure LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.measurement SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/measurement.csv.gz', 'CSVWithNames', 'measurement_id UInt64, person_id UInt64, measurement_concept_id UInt32, measurement_date Date32, measurement_datetime DateTime64, measurement_time String, measurement_type_concept_id UInt32, operator_concept_id UInt32, value_as_number Float64, value_as_concept_id UInt32, unit_concept_id UInt32, range_low Float64, range_high Float64, provider_id UInt64, visit_occurrence_id UInt64, visit_detail_id UInt64, measurement_source_value String, measurement_source_concept_id UInt32, unit_source_value String, value_source_value String', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.measurement LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.observation SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/observation.csv.gz', 'CSVWithNames', 'observation_id UInt64, person_id UInt64, observation_concept_id UInt32, observation_date Date32, observation_datetime DateTime64, observation_type_concept_id UInt32, value_as_number Float64, value_as_string String, value_as_concept_id UInt32, qualifier_concept_id UInt32, unit_concept_id UInt32, provider_id UInt64, visit_occurrence_id UInt64, visit_detail_id UInt64, observation_source_value String, observation_source_concept_id UInt32, unit_source_value String, qualifier_source_value String', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.observation LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.procedure_occurrence SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/procedure_occurrence.csv.gz', 'CSVWithNames', 'procedure_occurrence_id UInt64, person_id UInt64, procedure_concept_id UInt32, procedure_date Date32, procedure_datetime DateTime64, procedure_type_concept_id UInt32, modifier_concept_id UInt32, quantity UInt32, provider_id UInt64, visit_occurrence_id UInt64, visit_detail_id UInt64, procedure_source_value String, procedure_source_concept_id UInt32, modifier_source_value String', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.procedure_occurrence LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.device_exposure SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/device_exposure.csv.gz', 'CSVWithNames', 'device_exposure_id UInt64, person_id UInt64, device_concept_id UInt32, device_exposure_start_date Date32, device_exposure_start_datetime DateTime64, device_exposure_end_date Date32, device_exposure_end_datetime DateTime64, device_type_concept_id UInt32, unique_device_id String, quantity UInt32, provider_id UInt64, visit_occurrence_id UInt64, visit_detail_id UInt64, device_source_value String, device_source_concept_id UInt32', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.device_exposure LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.death SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/death.csv.gz', 'CSVWithNames', 'person_id UInt64, death_date Date32, death_datetime DateTime64, death_type_concept_id UInt32, cause_concept_id UInt32, cause_source_value String, cause_source_concept_id UInt32', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.death LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.note SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/note.csv.gz', 'CSVWithNames', 'note_id UInt64, person_id UInt64, note_date Date32, note_datetime DateTime64, note_type_concept_id UInt32, note_class_concept_id UInt32, note_title String, note_text String, encoding_concept_id UInt32, language_concept_id UInt32, provider_id UInt64, visit_occurrence_id UInt64, visit_detail_id UInt64, note_source_value String', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.note LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.note_nlp SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/note_nlp.csv.gz', 'CSVWithNames', 'note_nlp_id UInt64, note_id UInt64, section_concept_id UInt32, snippet String, offset String, lexical_variant String, note_nlp_concept_id UInt32, note_nlp_source_concept_id UInt32, nlp_system String, nlp_date Date32, nlp_datetime DateTime64, term_exists String, term_temporal String, term_modifiers String', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.note_nlp LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.observation_period SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/observation_period.csv.gz', 'CSVWithNames', 'observation_period_id UInt64, person_id UInt64, observation_period_start_date Date32, observation_period_end_date Date32, period_type_concept_id UInt32', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.observation_period LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.specimen SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/specimen.csv.gz', 'CSVWithNames', 'specimen_id UInt64, person_id UInt64, specimen_concept_id UInt32, specimen_type_concept_id UInt32, specimen_date Date32, specimen_datetime DateTime64, quantity Float64, unit_concept_id UInt32, anatomic_site_concept_id UInt32, disease_status_concept_id UInt32, specimen_source_id String, specimen_source_value String, unit_source_value String, anatomic_site_source_value String, disease_status_source_value String', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.specimen LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.visit_detail SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/visit_detail.csv.gz', 'CSVWithNames', 'visit_detail_id UInt64, person_id UInt64, visit_detail_concept_id UInt32, visit_detail_start_date Date32, visit_detail_start_datetime DateTime64, visit_detail_end_date Date32, visit_detail_end_datetime DateTime64, visit_detail_type_concept_id UInt32, provider_id UInt64, care_site_id UInt64, visit_detail_source_value String, visit_detail_source_concept_id UInt32, admitted_from_concept_id UInt32, admitted_from_source_value String, discharged_to_source_value String, discharged_to_concept_id UInt32, preceding_visit_detail_id UInt64, visit_detail_parent_id UInt64, visit_occurrence_id UInt64', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.visit_detail LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.cost SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/cost.csv.gz', 'CSVWithNames', 'cost_id UInt64, person_id UInt64, cost_event_id UInt64, cost_domain_id String, cost_type_concept_id UInt32, currency_concept_id UInt32, total_charge Float64, total_cost Float64, total_paid Float64, paid_by_payer Float64, paid_by_patient Float64, paid_patient_copay Float64, paid_patient_coinsurance Float64, paid_patient_deductible Float64, paid_by_primary Float64, paid_ingredient_cost Float64, paid_dispensing_fee Float64, payer_plan_period_id UInt64, amount_allowed Float64, revenue_code_concept_id UInt32, revenue_code_source_value String, drg_concept_id UInt32, drg_source_value String', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.cost LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.drug_era SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/drug_era.csv.gz', 'CSVWithNames', 'drug_era_id UInt64, person_id UInt64, drug_concept_id UInt32, drug_era_start_date Date32, drug_era_end_date Date32, drug_exposure_count UInt32, gap_days UInt32', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.drug_era LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.dose_era SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/dose_era.csv.gz', 'CSVWithNames', 'dose_era_id UInt64, person_id UInt64, drug_concept_id UInt32, unit_concept_id UInt32, dose_value Float64, dose_era_start_date Date32, dose_era_end_date Date32', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.dose_era LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.condition_era SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/condition_era.csv.gz', 'CSVWithNames', 'condition_era_id UInt64, person_id UInt64, condition_concept_id UInt32, condition_era_start_date Date32, condition_era_end_date Date32, condition_occurrence_count UInt32', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.condition_era LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.location SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/location.csv.gz', 'CSVWithNames', 'location_id UInt64, address_1 String, address_2 String, city String, state String, zip String, county String, location_source_value String, country_concept_id UInt32, country_source_value String, latitude Float64, longitude Float64', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.location LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.care_site SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/care_site.csv.gz', 'CSVWithNames', 'care_site_id UInt64, care_site_name String, place_of_service_concept_id UInt32, location_id UInt64, care_site_source_value String, place_of_service_source_value String', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.care_site LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.provider SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/provider.csv.gz', 'CSVWithNames', 'provider_id UInt64, provider_name String, npi String, dea String, specialty_concept_id UInt32, care_site_id UInt64, year_of_birth UInt16, gender_concept_id UInt32, provider_source_value String, specialty_source_value String, specialty_source_concept_id UInt32, gender_source_value String, gender_source_concept_id UInt32', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.provider LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.payer_plan_period SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/payer_plan_period.csv.gz', 'CSVWithNames', 'payer_plan_period_id UInt64, person_id UInt64, payer_plan_period_start_date Date32, payer_plan_period_end_date Date32, payer_concept_id UInt32, payer_source_value String, payer_source_concept_id UInt32, plan_concept_id UInt32, plan_source_value String, plan_source_concept_id UInt32, sponsor_concept_id UInt32, sponsor_source_value String, sponsor_source_concept_id UInt32, family_source_value String, stop_reason_concept_id UInt32, stop_reason_source_value String, stop_reason_source_concept_id UInt32', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.payer_plan_period LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.cdm_source SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/cdm_source.csv.gz', 'CSVWithNames', 'cdm_source_name String, cdm_source_abbreviation String, cdm_holder String, source_description String, source_documentation_reference String, cdm_etl_reference String, source_release_date Date32, cdm_release_date Date32, cdm_version String, vocabulary_version String', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.cdm_source LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.concept SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/concept.csv.gz', 'TabSeparatedWithNames', 'concept_id UInt32, concept_name String, domain_id String, vocabulary_id String, concept_class_id String, standard_concept String, concept_code String, valid_start_date Date32, valid_end_date Date32, invalid_reason String', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.concept LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.concept_relationship SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/concept_relationship.csv.gz', 'TabSeparatedWithNames', 'concept_id_1 Int32, concept_id_2 Int32, relationship_id String, valid_start_date Date32, valid_end_date Date32, invalid_reason String', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.concept_relationship LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.concept_ancestor SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/concept_ancestor.csv.gz', 'CSVWithNames', 'ancestor_concept_id UInt32, descendant_concept_id UInt32, min_levels_of_separation UInt32, max_levels_of_separation UInt32', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.concept_ancestor LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.vocabulary SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/vocabulary.csv.gz', 'TabSeparatedWithNames', 'vocabulary_id String, vocabulary_name String, vocabulary_reference String, vocabulary_version String, vocabulary_concept_id UInt32', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.vocabulary LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.cohort SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/cohort.csv.gz', 'CSVWithNames', 'cohort_definition_id Int32, subject_id UInt64, cohort_start_date Date32, cohort_end_date Date32', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.cohort LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.cohort_definition SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/cohort_definition.csv.gz', 'CSVWithNames', 'cohort_definition_id Int32, cohort_definition_name String, cohort_definition_description String, definition_type_concept_id UInt32, cohort_definition_syntax String, subject_concept_id UInt32, cohort_initiation_date Date32', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.cohort_definition LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.cohort_attribute SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/cohort_attribute.csv.gz', 'CSVWithNames', 'cohort_definition_id Int32, subject_id UInt64, cohort_start_date Date32, cohort_end_date Date32, attribute_definition_id Int32, value_as_number Float64, value_as_concept_id UInt32', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.cohort_attribute LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.attribute_definition SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/attribute_definition.csv.gz', 'CSVWithNames', 'attribute_definition_id Int32, attribute_name String, attribute_description String, attribute_type_concept_id UInt32, attribute_syntax String', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.attribute_definition LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.fact_relationship SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/fact_relationship.csv.gz', 'CSVWithNames', 'domain_concept_id_1 Int32, fact_id_1 UInt64, domain_concept_id_2 Int32, fact_id_2 UInt64, relationship_concept_id UInt32', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.fact_relationship LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.metadata SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/metadata.csv.gz', 'CSVWithNames', 'metadata_concept_id UInt32, metadata_type_concept_id UInt32, name String, value_as_string String, value_as_concept_id UInt32, metadata_date Date32, metadata_datetime DateTime64', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.metadata LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.relationship SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/relationship.csv.gz', 'CSVWithNames', 'relationship_id String, relationship_name String, is_hierarchical String, defines_ancestry String, reverse_relationship_id String, relationship_concept_id UInt32', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.relationship LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.drug_strength SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/drug_strength.csv.gz', 'CSVWithNames', 'drug_concept_id UInt32, ingredient_concept_id UInt32, amount_value Float64, amount_unit_concept_id UInt32, numerator_value Float64, numerator_unit_concept_id UInt32, denominator_value Float64, denominator_unit_concept_id UInt32, box_size UInt32, valid_start_date Date32, valid_end_date Date32, invalid_reason String', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.drug_strength LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.domain SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/domain.csv.gz', 'TabSeparatedWithNames', 'domain_id String, domain_name String, domain_concept_id UInt32', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.domain LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.concept_class SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/concept_class.csv.gz', 'TabSeparatedWithNames', 'concept_class_id String, concept_class_name String, concept_class_concept_id UInt32', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.concept_class LIMIT 1)</condition>
</scripts>
<scripts>
<query>INSERT INTO omop.concept_synonym SELECT * FROM file('/var/lib/clickhouse/user_files/omop_data_csv/concept_synonym.csv.gz', 'TabSeparatedWithNames', 'concept_id UInt32, concept_synonym_name String, language_concept_id UInt32', 'gz') SETTINGS async_insert=1, wait_for_async_insert=1</query>
<condition>SELECT NOT EXISTS(SELECT 1 FROM omop.concept_synonym LIMIT 1)</condition>
</scripts>
</startup_scripts>
</clickhouse>