-
Notifications
You must be signed in to change notification settings - Fork 181
Expand file tree
/
Copy pathB2.99.0006__api_keys.sql
More file actions
2070 lines (1667 loc) · 77.7 KB
/
Copy pathB2.99.0006__api_keys.sql
File metadata and controls
2070 lines (1667 loc) · 77.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
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
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-- WebAPI 3.0.0 Baseline: Complete schema for fresh installations
CREATE SCHEMA IF NOT EXISTS ${ohdsiSchema};
CREATE SEQUENCE ${ohdsiSchema}.achilles_cache_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.achilles_cache (
id bigint DEFAULT nextval('${ohdsiSchema}.achilles_cache_seq'::regclass) NOT NULL,
source_id integer NOT NULL,
cache_name character varying NOT NULL,
cache text
);
CREATE SEQUENCE ${ohdsiSchema}.analysis_execution_sequence
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.analysis_generation_info (
job_execution_id integer NOT NULL,
design character varying NOT NULL,
hash_code character varying NOT NULL,
created_by_id integer
);
CREATE TABLE ${ohdsiSchema}.batch_job_execution (
job_execution_id bigint NOT NULL,
version bigint,
job_instance_id bigint NOT NULL,
create_time timestamp without time zone NOT NULL,
start_time timestamp without time zone,
end_time timestamp without time zone,
status character varying(10),
exit_code character varying(2500),
exit_message character varying(2500),
last_updated timestamp without time zone,
job_configuration_location character varying(2500)
);
CREATE TABLE ${ohdsiSchema}.batch_job_execution_context (
job_execution_id bigint NOT NULL,
short_context character varying(2500) NOT NULL,
serialized_context text
);
CREATE TABLE ${ohdsiSchema}.batch_job_execution_params (
job_execution_id bigint NOT NULL,
parameter_name character varying(100) NOT NULL,
parameter_type character varying(100) NOT NULL,
parameter_value character varying(2500),
identifying character(1) NOT NULL
);
CREATE SEQUENCE ${ohdsiSchema}.batch_job_execution_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.batch_job_instance (
job_instance_id bigint NOT NULL,
version bigint,
job_name character varying(100) NOT NULL,
job_key character varying(32) NOT NULL
);
CREATE SEQUENCE ${ohdsiSchema}.batch_job_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.batch_step_execution (
step_execution_id bigint NOT NULL,
version bigint NOT NULL,
step_name character varying(100) NOT NULL,
job_execution_id bigint NOT NULL,
start_time timestamp without time zone,
end_time timestamp without time zone,
status character varying(10),
commit_count bigint,
read_count bigint,
filter_count bigint,
write_count bigint,
read_skip_count bigint,
write_skip_count bigint,
process_skip_count bigint,
rollback_count bigint,
exit_code character varying(2500),
exit_message character varying(2500),
last_updated timestamp without time zone,
create_time timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
);
CREATE TABLE ${ohdsiSchema}.batch_step_execution_context (
step_execution_id bigint NOT NULL,
short_context character varying(2500) NOT NULL,
serialized_context text
);
CREATE SEQUENCE ${ohdsiSchema}.batch_step_execution_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE SEQUENCE ${ohdsiSchema}.cohort_characterization_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.cohort_characterization
(
id bigint NOT NULL DEFAULT nextval('${ohdsiSchema}.cohort_characterization_seq'::regclass),
name character varying(255) NOT NULL,
created_by_id integer,
created_date timestamp NOT NULL DEFAULT now(),
modified_by_id integer,
modified_date timestamp,
hash_code integer,
stratified_by character varying(255),
strata_only boolean DEFAULT false,
description character varying(1000),
CONSTRAINT cohort_characterization_pkey PRIMARY KEY (id),
CONSTRAINT uq_cc_name UNIQUE (name)
);
CREATE TABLE ${ohdsiSchema}.cohort_characterization_tag
(
asset_id integer NOT NULL,
tag_id integer NOT NULL,
CONSTRAINT pk_cc_tags_id PRIMARY KEY (asset_id, tag_id)
);
CREATE SEQUENCE ${ohdsiSchema}.cc_analysis_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.cc_analysis
(
cohort_characterization_id bigint NOT NULL,
fe_analysis_id bigint NOT NULL,
id bigint NOT NULL DEFAULT nextval('${ohdsiSchema}.cc_analysis_seq'::regclass),
include_annual boolean DEFAULT false,
include_temporal boolean DEFAULT false,
CONSTRAINT cc_analysis_pkey PRIMARY KEY (id)
);
CREATE TABLE ${ohdsiSchema}.cc_cohort
(
cohort_characterization_id bigint NOT NULL,
cohort_id integer NOT NULL,
CONSTRAINT cc_cohort_pkey PRIMARY KEY (cohort_characterization_id, cohort_id)
);
CREATE SEQUENCE ${ohdsiSchema}.cc_param_sequence
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.cc_param
(
id bigint NOT NULL DEFAULT nextval('${ohdsiSchema}.cc_param_sequence'::regclass),
cohort_characterization_id bigint NOT NULL,
name character varying(255),
value character varying(255),
CONSTRAINT cc_param_pkey PRIMARY KEY (id)
);
CREATE SEQUENCE ${ohdsiSchema}.cc_strata_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.cc_strata
(
id bigint NOT NULL DEFAULT nextval('${ohdsiSchema}.cc_strata_seq'::regclass),
cohort_characterization_id bigint NOT NULL,
name character varying(255) NOT NULL,
expression character varying,
CONSTRAINT pk_cc_strata_id PRIMARY KEY (id),
CONSTRAINT cc_strata_name_uq UNIQUE (cohort_characterization_id, name)
);
CREATE SEQUENCE ${ohdsiSchema}.cc_strata_conceptset_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.cc_strata_conceptset
(
id bigint NOT NULL DEFAULT nextval('${ohdsiSchema}.cc_strata_conceptset_seq'::regclass),
cohort_characterization_id bigint NOT NULL,
expression character varying,
CONSTRAINT pk_cc_strata_conceptset_id PRIMARY KEY (id)
);
CREATE SEQUENCE ${ohdsiSchema}.cdm_cache_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.cdm_cache (
id bigint DEFAULT nextval('${ohdsiSchema}.cdm_cache_seq'::regclass) NOT NULL,
concept_id integer NOT NULL,
source_id integer NOT NULL,
record_count bigint,
descendant_record_count bigint,
person_count bigint,
descendant_person_count bigint
);
CREATE TABLE ${ohdsiSchema}.cohort_concept_map (
cohort_definition_id integer NOT NULL,
cohort_definition_name character varying(255),
concept_id integer
);
CREATE TABLE ${ohdsiSchema}.cohort_definition (
id integer NOT NULL,
name character varying(255) NOT NULL,
description character varying(1000),
expression_type character varying(50),
created_date timestamp(3) without time zone,
modified_date timestamp(3) without time zone,
created_by_id integer,
modified_by_id integer
);
CREATE TABLE ${ohdsiSchema}.cohort_definition_details (
id integer NOT NULL,
expression text NOT NULL,
hash_code integer
);
CREATE SEQUENCE ${ohdsiSchema}.cohort_definition_sequence
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.cohort_generation_info (
id integer NOT NULL,
source_id integer NOT NULL,
start_time timestamp(3) without time zone,
execution_duration integer,
status integer NOT NULL,
is_valid boolean NOT NULL,
fail_message character varying(2000),
person_count bigint,
record_count bigint,
is_canceled boolean DEFAULT false NOT NULL,
created_by_id integer,
is_demographic boolean DEFAULT false NOT NULL,
cc_generate_id integer
);
CREATE TABLE ${ohdsiSchema}.cohort_sample (
id integer NOT NULL,
name character varying(255) NOT NULL,
cohort_definition_id integer NOT NULL,
source_id integer NOT NULL,
size integer NOT NULL,
age_min smallint,
age_max smallint,
age_mode character varying(24),
gender_concept_ids character varying(255),
created_by_id integer,
created_date timestamp with time zone DEFAULT now() NOT NULL,
modified_by_id integer,
modified_date timestamp with time zone
);
CREATE SEQUENCE ${ohdsiSchema}.cohort_sample_sequence
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.cohort_study (
cohort_study_id integer NOT NULL,
cohort_definition_id integer,
study_type integer,
study_name character varying(1000),
study_url character varying(1000)
);
CREATE SEQUENCE ${ohdsiSchema}.cohort_study_cohort_study_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE ${ohdsiSchema}.cohort_study_cohort_study_id_seq OWNED BY ${ohdsiSchema}.cohort_study.cohort_study_id;
CREATE TABLE ${ohdsiSchema}.cohort_tag (
asset_id integer NOT NULL,
tag_id integer NOT NULL
);
CREATE TABLE ${ohdsiSchema}.cohort_version (
asset_id bigint NOT NULL,
comment character varying,
description character varying,
version integer DEFAULT 1 NOT NULL,
asset_json character varying NOT NULL,
archived boolean DEFAULT false NOT NULL,
created_by_id integer,
created_date timestamp with time zone DEFAULT now() NOT NULL
);
CREATE TABLE ${ohdsiSchema}.concept_of_interest (
id integer NOT NULL,
concept_id integer,
concept_of_interest_id integer
);
CREATE SEQUENCE ${ohdsiSchema}.concept_of_interest_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE ${ohdsiSchema}.concept_of_interest_id_seq OWNED BY ${ohdsiSchema}.concept_of_interest.id;
CREATE SEQUENCE ${ohdsiSchema}.concept_set_sequence
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.concept_set (
concept_set_id integer DEFAULT nextval('${ohdsiSchema}.concept_set_sequence'::regclass) NOT NULL,
concept_set_name character varying(255) NOT NULL,
created_date timestamp with time zone,
modified_date timestamp with time zone,
created_by_id integer,
modified_by_id integer,
description character varying(1000)
);
CREATE SEQUENCE ${ohdsiSchema}.concept_set_annotation_sequence
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.concept_set_annotation (
concept_set_annotation_id integer DEFAULT nextval('${ohdsiSchema}.concept_set_annotation_sequence'::regclass) NOT NULL,
concept_set_id integer NOT NULL,
concept_id integer,
annotation_details character varying,
vocabulary_version character varying,
created_by_id integer,
created_date timestamp with time zone DEFAULT now() NOT NULL,
modified_by_id integer,
modified_date timestamp with time zone,
concept_set_version integer,
copied_from_concept_set_ids character varying(1000)
);
CREATE TABLE ${ohdsiSchema}.concept_set_generation_info (
concept_set_id integer NOT NULL,
source_id integer NOT NULL,
generation_type integer NOT NULL,
start_time timestamp without time zone NOT NULL,
execution_duration integer,
status integer NOT NULL,
is_valid boolean NOT NULL,
params text NOT NULL,
is_canceled boolean DEFAULT false NOT NULL
);
CREATE SEQUENCE ${ohdsiSchema}.concept_set_item_sequence
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.concept_set_item (
concept_set_item_id integer DEFAULT nextval('${ohdsiSchema}.concept_set_item_sequence'::regclass) NOT NULL,
concept_set_id integer NOT NULL,
concept_id integer NOT NULL,
is_excluded integer NOT NULL,
include_descendants integer NOT NULL,
include_mapped integer NOT NULL
);
CREATE SEQUENCE ${ohdsiSchema}.negative_controls_sequence
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.concept_set_negative_controls (
id integer DEFAULT nextval('${ohdsiSchema}.negative_controls_sequence'::regclass) NOT NULL,
evidence_job_id bigint NOT NULL,
source_id integer NOT NULL,
concept_set_id integer NOT NULL
);
CREATE TABLE ${ohdsiSchema}.concept_set_tag (
asset_id integer NOT NULL,
tag_id integer NOT NULL
);
CREATE TABLE ${ohdsiSchema}.concept_set_version (
asset_id bigint NOT NULL,
comment character varying,
version integer DEFAULT 1 NOT NULL,
asset_json character varying NOT NULL,
archived boolean DEFAULT false NOT NULL,
created_by_id integer,
created_date timestamp with time zone DEFAULT now() NOT NULL
);
CREATE SEQUENCE ${ohdsiSchema}.drug_hoi_evidence_sequence
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.drug_hoi_evidence (
id integer DEFAULT nextval('${ohdsiSchema}.drug_hoi_evidence_sequence'::regclass) NOT NULL,
drug_hoi_relationship character varying(50),
evidence_type character varying(4000),
supports character varying(1),
evidence_source_code_id integer,
statistic_value numeric,
evidence_linkout character varying(4000),
statistic_type character varying(4000)
);
COMMENT ON COLUMN ${ohdsiSchema}.drug_hoi_evidence.id IS 'primary key';
COMMENT ON COLUMN ${ohdsiSchema}.drug_hoi_evidence.drug_hoi_relationship IS 'foreign key to the drug_HOI_relationship id';
COMMENT ON COLUMN ${ohdsiSchema}.drug_hoi_evidence.evidence_type IS 'the type of evidence (literature, product label, pharmacovigilance, EHR)';
COMMENT ON COLUMN ${ohdsiSchema}.drug_hoi_evidence.supports IS 'Whether or not the relationship of evidence is to refute the assertion';
COMMENT ON COLUMN ${ohdsiSchema}.drug_hoi_evidence.evidence_source_code_id IS 'a code indicating the actual source of evidence (e.g., PubMed, US SPLs, EU SPC, VigiBase, etc)';
COMMENT ON COLUMN ${ohdsiSchema}.drug_hoi_evidence.statistic_value IS 'For literature-like (e.g., PubMed abstracts, product labeling) sources this holds the count of the number of items of the evidence type present in the evidence base from that source (several rules are used to derive the counts, see documentation on the knowledge-base wiki). From signal detection sources, the result of applying the algorithm indicated in the evidence_type column is shown.';
COMMENT ON COLUMN ${ohdsiSchema}.drug_hoi_evidence.evidence_linkout IS 'For literature-like (e.g., PubMed abstracts, product labeling), this holds a URL that will resolve to a query against the RDF endpoint for all resources used to generate the evidence_count. For signal detection sources, this holds a link to metadata on the algorithm and how it was applied to arrive at the statistical value.';
COMMENT ON COLUMN ${ohdsiSchema}.drug_hoi_evidence.statistic_type IS 'For literature-like (e.g., PubMed abstracts, product labeling), and other count based methods this holds COUNT. For signal detection sources, this holds a string indicating the type of the result value (e.g., AERS_EBGM, AERS_EB05)';
CREATE TABLE ${ohdsiSchema}.drug_hoi_relationship (
id character varying(50) NOT NULL,
drug integer,
rxnorm_drug character varying(4000),
hoi integer,
snomed_hoi character varying(4000)
);
COMMENT ON COLUMN ${ohdsiSchema}.drug_hoi_relationship.drug IS 'OMOP/IMEDS Concept ID for the drug';
COMMENT ON COLUMN ${ohdsiSchema}.drug_hoi_relationship.rxnorm_drug IS 'RxNorm Preferred Term of the Drug';
COMMENT ON COLUMN ${ohdsiSchema}.drug_hoi_relationship.hoi IS 'OMOP/IMEDS Concept ID for the Health Outcome of Interest';
COMMENT ON COLUMN ${ohdsiSchema}.drug_hoi_relationship.snomed_hoi IS 'SNOMED preferred term of the Health Outcome of Interest';
CREATE TABLE ${ohdsiSchema}.drug_labels (
drug_label_id bigint NOT NULL,
search_name character varying(255),
ingredient_concept_id bigint,
ingredient_concept_name character varying(255),
setid character varying(255),
date timestamp(3) without time zone,
cohort_id integer,
image_url character varying(255)
);
CREATE TABLE ${ohdsiSchema}.ee_analysis_status (
id integer DEFAULT nextval('${ohdsiSchema}.analysis_execution_sequence'::regclass) NOT NULL,
executionstatus character varying,
job_execution_id bigint
);
CREATE SEQUENCE ${ohdsiSchema}.evidence_sources_sequence
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.evidence_sources (
id integer DEFAULT nextval('${ohdsiSchema}.evidence_sources_sequence'::regclass) NOT NULL,
title character varying(4000),
description character varying(4000),
contributer character varying(4000),
creator character varying(4000),
creation_date date NOT NULL,
rights character varying(4000),
source character varying(4000),
coverage_start_date date,
coverage_end_date date
);
COMMENT ON COLUMN ${ohdsiSchema}.evidence_sources.title IS 'a short name for the evidence source. Same as http://purl.org/dc/elements/1.1/title';
COMMENT ON COLUMN ${ohdsiSchema}.evidence_sources.description IS 'Description of the evidence source. Same as http://purl.org/dc/elements/1.1/description';
COMMENT ON COLUMN ${ohdsiSchema}.evidence_sources.contributer IS 'Same as http://purl.org/dc/elements/1.1/contributor';
COMMENT ON COLUMN ${ohdsiSchema}.evidence_sources.creator IS 'Same as http://purl.org/dc/elements/1.1/creator';
COMMENT ON COLUMN ${ohdsiSchema}.evidence_sources.creation_date IS 'Date that the source was created. For example, if the source was created in 2010 but added to the knowledge base in 2014, the creation date would be 2010';
COMMENT ON COLUMN ${ohdsiSchema}.evidence_sources.rights IS 'Same as http://purl.org/dc/elements/1.1/rights';
COMMENT ON COLUMN ${ohdsiSchema}.evidence_sources.source IS 'The source from which this data was derived. Same as http://purl.org/dc/elements/1.1/source';
COMMENT ON COLUMN ${ohdsiSchema}.evidence_sources.coverage_start_date IS 'The start date of coverage for the resource. Data can be trusted on or after this date and up to and including the coverage_end_date';
COMMENT ON COLUMN ${ohdsiSchema}.evidence_sources.coverage_end_date IS 'The date of coverage for the resource. Data can be trusted on or after the coverage_start_date date and up to and including this date';
CREATE SEQUENCE ${ohdsiSchema}.fe_analysis_sequence
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE IF NOT EXISTS ${ohdsiSchema}.fe_analysis
(
id integer NOT NULL DEFAULT nextval('${ohdsiSchema}.fe_analysis_sequence'::regclass),
type character varying(255) COLLATE pg_catalog."default",
name character varying(255) COLLATE pg_catalog."default",
domain character varying(255) COLLATE pg_catalog."default",
descr character varying(1000) COLLATE pg_catalog."default",
value character varying(255) COLLATE pg_catalog."default",
design text COLLATE pg_catalog."default",
is_locked boolean,
stat_type character varying(255) COLLATE pg_catalog."default" NOT NULL DEFAULT 'PREVALENCE'::character varying,
created_by_id integer,
created_date timestamp without time zone,
modified_by_id integer,
modified_date timestamp without time zone,
supports_annual boolean DEFAULT false,
supports_temporal boolean DEFAULT false,
CONSTRAINT fe_analysis_pkey PRIMARY KEY (id),
CONSTRAINT uq_fe_name UNIQUE (name)
);
CREATE SEQUENCE ${ohdsiSchema}.fe_aggregate_sequence
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE IF NOT EXISTS ${ohdsiSchema}.fe_analysis_aggregate
(
id integer NOT NULL DEFAULT nextval('${ohdsiSchema}.fe_aggregate_sequence'::regclass),
name character varying(255) NOT NULL,
domain character varying(50),
agg_function character varying(50),
criteria_columns character varying(255),
expression character varying,
join_table character varying(50) ,
join_type character varying(50),
join_condition character varying(50),
is_default boolean DEFAULT false,
missing_means_zero boolean DEFAULT false,
CONSTRAINT pk_fe_aggregate PRIMARY KEY (id)
);
CREATE SEQUENCE ${ohdsiSchema}.fe_conceptset_sequence
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.fe_analysis_conceptset (
id bigint DEFAULT nextval('${ohdsiSchema}.fe_conceptset_sequence'::regclass) NOT NULL,
fe_analysis_id integer NOT NULL,
expression character varying
);
CREATE SEQUENCE ${ohdsiSchema}.fe_analysis_criteria_sequence
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE IF NOT EXISTS ${ohdsiSchema}.fe_analysis_criteria
(
id bigint NOT NULL DEFAULT nextval('${ohdsiSchema}.fe_analysis_criteria_sequence'::regclass),
name character varying(255) COLLATE pg_catalog."default",
expression text COLLATE pg_catalog."default",
fe_analysis_id bigint,
criteria_type character varying COLLATE pg_catalog."default",
fe_aggregate_id integer,
CONSTRAINT fe_analysis_criteria_pkey PRIMARY KEY (id)
);
CREATE SEQUENCE ${ohdsiSchema}.generation_cache_sequence
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.generation_cache (
id integer DEFAULT nextval('${ohdsiSchema}.generation_cache_sequence'::regclass) NOT NULL,
type character varying NOT NULL,
design_hash integer NOT NULL,
source_id integer NOT NULL,
result_checksum character varying,
created_date date DEFAULT now() NOT NULL
);
CREATE SEQUENCE ${ohdsiSchema}.ir_analysis_sequence
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.ir_analysis
(
id integer DEFAULT nextval('${ohdsiSchema}.ir_analysis_sequence'::regclass) NOT NULL,
name character varying(255) COLLATE pg_catalog."default" NOT NULL,
description character varying(1000) COLLATE pg_catalog."default",
created_date timestamp(3) without time zone,
modified_date timestamp(3) without time zone,
created_by_id integer,
modified_by_id integer,
CONSTRAINT pk_ir_analysis PRIMARY KEY (id),
CONSTRAINT uq_ir_name UNIQUE (name)
);
CREATE TABLE ${ohdsiSchema}.ir_analysis_details
(
id integer NOT NULL,
expression text,
CONSTRAINT pk_ir_analysis_details PRIMARY KEY (id)
);
CREATE TABLE ${ohdsiSchema}.ir_execution
(
analysis_id integer NOT NULL,
source_id integer NOT NULL,
start_time timestamp(3) without time zone,
execution_duration integer,
is_valid boolean NOT NULL,
message character varying(2000),
is_canceled boolean NOT NULL DEFAULT false,
status character varying(128),
CONSTRAINT pk_ir_execution PRIMARY KEY (analysis_id, source_id)
);
CREATE TABLE ${ohdsiSchema}.ir_tag
(
asset_id integer NOT NULL,
tag_id integer NOT NULL,
CONSTRAINT pk_ir_tags_id PRIMARY KEY (asset_id, tag_id)
);
CREATE TABLE ${ohdsiSchema}.ir_version (
asset_id bigint NOT NULL,
comment character varying,
description character varying,
version integer DEFAULT 1 NOT NULL,
asset_json character varying NOT NULL,
archived boolean DEFAULT false NOT NULL,
created_by_id integer,
created_date timestamp with time zone DEFAULT now() NOT NULL
);
CREATE SEQUENCE ${ohdsiSchema}.laertes_summary_sequence
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.laertes_summary (
id integer DEFAULT nextval('${ohdsiSchema}.laertes_summary_sequence'::regclass) NOT NULL,
report_order integer,
report_name character varying(4000),
ingredient_id integer,
ingredient character varying(4000),
clinical_drug_id integer,
clinical_drug character varying(4000),
hoi_id integer,
hoi character varying(4000),
medline_ct_count integer,
medline_case_count integer,
medline_other_count integer,
splicer_count integer,
eu_spc_count integer,
semmeddb_ct_count integer,
semmeddb_case_count integer,
semmeddb_neg_ct_count integer,
semmeddb_neg_case_count integer,
aers_report_count integer,
prr numeric,
ctd_chemical_disease_count integer,
semmeddb_other_count integer,
semmeddb_neg_other_count integer
);
COMMENT ON COLUMN ${ohdsiSchema}.laertes_summary.id IS 'primary key';
COMMENT ON COLUMN ${ohdsiSchema}.laertes_summary.report_order IS 'there are several reports in this summary, this is an identifier for each report';
COMMENT ON COLUMN ${ohdsiSchema}.laertes_summary.report_name IS 'there are several reports in this summary, this is a name of the report';
COMMENT ON COLUMN ${ohdsiSchema}.laertes_summary.ingredient_id IS 'a drug ingredient CONCEPT_ID';
COMMENT ON COLUMN ${ohdsiSchema}.laertes_summary.ingredient IS 'a drug ingredient name';
COMMENT ON COLUMN ${ohdsiSchema}.laertes_summary.clinical_drug_id IS 'if a clinical drug exists, the clinical drug CONCEPT_ID';
COMMENT ON COLUMN ${ohdsiSchema}.laertes_summary.clinical_drug IS 'if a clinical drug exists, the clinical drug name';
COMMENT ON COLUMN ${ohdsiSchema}.laertes_summary.hoi_id IS 'the HOI CONCEPT_ID, this is at the SNOMED level';
COMMENT ON COLUMN ${ohdsiSchema}.laertes_summary.hoi IS 'the HOI name, this is at the SNOMED level';
COMMENT ON COLUMN ${ohdsiSchema}.laertes_summary.splicer_count IS 'counts of SPLs that mention specific drugs and hois';
COMMENT ON COLUMN ${ohdsiSchema}.laertes_summary.eu_spc_count IS 'counts of SPCs that mention specific drugs and hois';
CREATE SEQUENCE ${ohdsiSchema}.pathway_analysis_sequence
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.pathway_analysis
(
id integer NOT NULL DEFAULT nextval('${ohdsiSchema}.pathway_analysis_sequence'::regclass),
name character varying(255) NOT NULL,
combination_window integer,
min_cell_count integer,
max_depth integer,
allow_repeats boolean DEFAULT false,
created_by_id integer,
created_date timestamp without time zone,
modified_by_id integer,
modified_date timestamp without time zone,
hash_code integer,
min_segment_length integer,
description character varying(1000),
CONSTRAINT pk_pathway_analysis PRIMARY KEY (id),
CONSTRAINT uq_pw_name UNIQUE (name)
);
CREATE SEQUENCE ${ohdsiSchema}.pathway_cohort_sequence
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.pathway_event_cohort
(
id integer NOT NULL DEFAULT nextval('${ohdsiSchema}.pathway_cohort_sequence'::regclass),
name character varying(255) NOT NULL,
cohort_definition_id integer NOT NULL,
pathway_analysis_id integer NOT NULL,
CONSTRAINT pk_pathway_event_cohort PRIMARY KEY (id)
);
CREATE TABLE ${ohdsiSchema}.pathway_tag
(
asset_id integer NOT NULL,
tag_id integer NOT NULL,
CONSTRAINT pk_pathway_tags_id PRIMARY KEY (asset_id, tag_id)
);
CREATE TABLE ${ohdsiSchema}.pathway_target_cohort
(
id integer NOT NULL DEFAULT nextval('${ohdsiSchema}.pathway_cohort_sequence'::regclass),
name character varying(255) NOT NULL,
cohort_definition_id integer NOT NULL,
pathway_analysis_id integer NOT NULL,
CONSTRAINT pk_pathway_target_cohort PRIMARY KEY (id)
);
CREATE TABLE ${ohdsiSchema}.pathway_version (
asset_id bigint NOT NULL,
comment character varying,
version integer DEFAULT 1 NOT NULL,
asset_json character varying NOT NULL,
archived boolean DEFAULT false NOT NULL,
created_by_id integer,
created_date timestamp with time zone DEFAULT now() NOT NULL
);
CREATE TABLE ${ohdsiSchema}.penelope_laertes_uni_pivot (
condition_concept_id integer,
condition_concept_name character varying(255),
ingredient_concept_id integer,
ingredient_concept_name character varying(255),
medline_ct integer,
medline_case integer,
medline_other integer,
semmeddb_ct_t integer,
semmeddb_case_t integer,
semmeddb_other_t integer,
semmeddb_ct_f integer,
semmeddb_case_f integer,
semmeddb_other_f integer,
eu_spc integer,
spl_adr integer,
aers integer,
aers_prr numeric,
aers_prr_original numeric,
id integer NOT NULL
);
CREATE SEQUENCE ${ohdsiSchema}.penelope_laertes_uni_pivot_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE ${ohdsiSchema}.penelope_laertes_uni_pivot_id_seq OWNED BY ${ohdsiSchema}.penelope_laertes_uni_pivot.id;
CREATE TABLE ${ohdsiSchema}.penelope_laertes_universe (
id bigint NOT NULL,
condition_concept_id integer,
condition_concept_name character varying(255),
ingredient_concept_id integer,
ingredient_concept_name character varying(255),
evidence_type character varying(255),
supports character(1),
statistic_value numeric,
evidence_linkouts text
);
CREATE SEQUENCE ${ohdsiSchema}.reusable_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.reusable (
id integer DEFAULT nextval('${ohdsiSchema}.reusable_seq'::regclass) NOT NULL,
name character varying NOT NULL,
description character varying,
data text NOT NULL,
created_by_id integer,
created_date timestamp with time zone DEFAULT now() NOT NULL,
modified_by_id integer,
modified_date timestamp with time zone
);
CREATE TABLE ${ohdsiSchema}.reusable_tag (
asset_id integer NOT NULL,
tag_id integer NOT NULL
);
CREATE TABLE ${ohdsiSchema}.reusable_version (
asset_id bigint NOT NULL,
comment character varying,
description character varying,
version integer DEFAULT 1 NOT NULL,
asset_json character varying NOT NULL,
archived boolean DEFAULT false NOT NULL,
created_by_id integer,
created_date timestamp with time zone DEFAULT now() NOT NULL
);
-- NOTE: schema_version table removed - Flyway manages this table automatically
CREATE SEQUENCE ${ohdsiSchema}.sec_permission_sequence
START WITH 1000
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.sec_permission (
id integer DEFAULT nextval('${ohdsiSchema}.sec_permission_sequence'::regclass) NOT NULL,
value character varying(255) NOT NULL,
description character varying(255)
);
COMMENT ON COLUMN ${ohdsiSchema}.sec_permission.id IS 'Primary key';
COMMENT ON COLUMN ${ohdsiSchema}.sec_permission.value IS 'Permission';
COMMENT ON COLUMN ${ohdsiSchema}.sec_permission.description IS 'Desctiption of permission';
CREATE SEQUENCE ${ohdsiSchema}.sec_role_sequence
START WITH 1000
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.sec_role (
id integer DEFAULT nextval('${ohdsiSchema}.sec_role_sequence'::regclass) NOT NULL,
name character varying(255),
system_role boolean DEFAULT false NOT NULL
);
COMMENT ON COLUMN ${ohdsiSchema}.sec_role.id IS 'primary key';
COMMENT ON COLUMN ${ohdsiSchema}.sec_role.name IS 'Role name';
CREATE SEQUENCE ${ohdsiSchema}.sec_role_group_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.sec_role_group (
id integer DEFAULT nextval('${ohdsiSchema}.sec_role_group_seq'::regclass) NOT NULL,
provider character varying NOT NULL,
group_dn character varying NOT NULL,
group_name character varying,
role_id integer NOT NULL,
job_id bigint
);
CREATE SEQUENCE ${ohdsiSchema}.sec_role_permission_sequence
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.sec_role_permission (
id integer DEFAULT nextval('${ohdsiSchema}.sec_role_permission_sequence'::regclass) NOT NULL,
role_id integer NOT NULL,
permission_id integer NOT NULL,
status character varying(255)
);
COMMENT ON COLUMN ${ohdsiSchema}.sec_role_permission.id IS 'Primary key';
COMMENT ON COLUMN ${ohdsiSchema}.sec_role_permission.role_id IS 'Foreign key to SEC_ROLE';
COMMENT ON COLUMN ${ohdsiSchema}.sec_role_permission.permission_id IS 'Foreign key to SEC_PERMISSION';
COMMENT ON COLUMN ${ohdsiSchema}.sec_role_permission.status IS 'Status of relation between role and permission';
CREATE SEQUENCE ${ohdsiSchema}.sec_user_sequence
START WITH 1000
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
CREATE TABLE ${ohdsiSchema}.sec_user (
id integer DEFAULT nextval('${ohdsiSchema}.sec_user_sequence'::regclass) NOT NULL,